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 | update the release date | 5224feded47c5f85514ac89c79e3de49060b0d99 | <ide><path>docs/topics/release-notes.md
<ide> You can determine your currently installed version using `pip freeze`:
<ide>
<ide> ### 3.3.2
<ide>
<del>**Date**: [16th December 2015][3.3.2-milestone].
<add>**Date**: [14th December 2015][3.3.2-milestone].
<ide>
<ide> * `ListField` enforces input is a list. ([#3513][gh3513])
<ide> * Fix regression hiding raw data form. ([#3600][gh3600], [#3578][gh3578]) | 1 |
Javascript | Javascript | remove picker from xhr example | 65740723d9842bbd13e8d201848a7572bdbb0b1f | <ide><path>packages/rn-tester/js/examples/XHR/XHRExampleBinaryUpload.js
<ide> const React = require('react');
<ide> const {
<ide> Alert,
<ide> Linking,
<del> Picker,
<ide> StyleSheet,
<ide> Text,
<ide> TouchableHighlight,
<ide> View,
<ide> } = require('react-native');
<add>import RNTOption from '../../components/RNTOption';
<ide>
<ide> const BINARY_TYPES = {
<ide> String,
<ide> class XHRExampleBinaryUpload extends React.Component<{...}, $FlowFixMeState> {
<ide> render(): React.Node {
<ide> return (
<ide> <View>
<del> <Text>Upload 255 bytes as...</Text>
<del> <Picker
<del> selectedValue={this.state.type}
<del> onValueChange={type => this.setState({type})}>
<del> {Object.keys(BINARY_TYPES).map(type => (
<del> <Picker.Item key={type} label={type} value={type} />
<del> ))}
<del> </Picker>
<add> <View style={styles.block}>
<add> <Text style={styles.title}>Upload 255 bytes as ...</Text>
<add> <View style={styles.row}>
<add> {Object.keys(BINARY_TYPES).map(type => (
<add> <RNTOption
<add> selected={this.state.type === type}
<add> key={type}
<add> label={type}
<add> onPress={() => this.setState({type})}
<add> style={styles.option}
<add> />
<add> ))}
<add> </View>
<add> </View>
<ide> <View style={styles.uploadButton}>
<ide> <TouchableHighlight onPress={this._upload}>
<ide> <View style={styles.uploadButtonBox}>
<ide> class XHRExampleBinaryUpload extends React.Component<{...}, $FlowFixMeState> {
<ide> }
<ide>
<ide> const styles = StyleSheet.create({
<add> block: {
<add> borderColor: 'rgba(0,0,0, 0.1)',
<add> borderBottomWidth: 1,
<add> padding: 6,
<add> },
<add> row: {
<add> flexDirection: 'row',
<add> flexWrap: 'wrap',
<add> },
<add> title: {
<add> fontWeight: 'bold',
<add> },
<add> option: {margin: 6},
<ide> uploadButton: {
<ide> marginTop: 16,
<ide> }, | 1 |
Javascript | Javascript | avoid allocations in bidi() | 2e93a0cc9878c8493b146e76a08365e9afa3b505 | <ide><path>src/core/bidi.js
<ide> var bidi = PDFJS.bidi = (function bidiClosure() {
<ide> this.dir = (vertical ? 'ttb' : (isLTR ? 'ltr' : 'rtl'));
<ide> }
<ide>
<add> // These are used in bidi(), which is called frequently. We re-use them on
<add> // each call to avoid unnecessary allocations.
<add> var chars = [];
<add> var types = [];
<add>
<ide> function bidi(str, startLevel, vertical) {
<ide> var isLTR = true;
<ide> var strLength = str.length;
<ide> var bidi = PDFJS.bidi = (function bidiClosure() {
<ide> }
<ide>
<ide> // Get types and fill arrays
<del> var chars = [];
<del> var types = [];
<add> chars.length = 0;
<add> types.length = 0;
<ide> var numBidi = 0;
<ide>
<ide> for (var i = 0; i < strLength; ++i) { | 1 |
Javascript | Javascript | update meta.js (new buffer when init) | 8b931ae09f96e16f04e866c8a03d4dba5b7a2f67 | <ide><path>local-cli/bundle/output/meta.js
<ide> module.exports = function(code, encoding) {
<ide> const hash = crypto.createHash('sha1');
<ide> hash.update(code, encoding);
<ide> const digest = hash.digest('binary');
<del> const signature = Buffer(digest.length + 1);
<add> const signature = Buffer.alloc ? Buffer.alloc(digest.length + 1) : new Buffer(digest.length + 1); // remove the new Buffer call when RN drops support for Node 4
<ide> signature.write(digest, 'binary');
<ide> signature.writeUInt8(
<ide> constantFor(tryAsciiPromotion(code, encoding)), | 1 |
Text | Text | add step 1 instructions for maskgan. | de10c0c25630dd05aab871ece7a88e0e009a39ce | <ide><path>research/maskgan/README.md
<ide> tested. Pretraining may not work correctly.
<ide>
<ide> For training on PTB:
<ide>
<del>1. Pretrain a LM on PTB and store the checkpoint in `/tmp/pretrain-lm/`.
<del>Instructions WIP.
<add>1. Follow instructions here ([Tensorflow RNN Language Model Tutorial](https://www.tensorflow.org/tutorials/sequences/recurrent)) to train a language model on PTB dataset.
<add>Copy PTB data downloaded from the above tensorflow RNN tutorial to folder "/tmp/ptb". It should contain following three files: ptb.train.txt, ptb.test.txt, ptb.valid.txt
<add>Make folder /tmp/pretrain-lm and copy checkpoints from above Tensorflow RNN tutorial under this folder.
<add>
<ide>
<ide> 2. Run MaskGAN in MLE pretraining mode. If step 1 was not run, set
<ide> `language_model_ckpt_dir` to empty. | 1 |
Javascript | Javascript | remove event listeners on close | e4c9c9f412ca64435fbe93a2700d569b84ba7b36 | <ide><path>lib/readline.js
<ide> function Interface(input, output, completer, terminal) {
<ide>
<ide> this.terminal = !!terminal;
<ide>
<add> function ondata(data) {
<add> self._normalWrite(data);
<add> }
<add>
<add> function onend() {
<add> self.close();
<add> }
<add>
<add> function onkeypress(s, key) {
<add> self._ttyWrite(s, key);
<add> }
<add>
<add> function onresize() {
<add> self._refreshLine();
<add> }
<add>
<ide> if (!this.terminal) {
<del> input.on('data', function(data) {
<del> self._normalWrite(data);
<del> });
<del> input.on('end', function() {
<del> self.close();
<add> input.on('data', ondata);
<add> input.on('end', onend);
<add> self.once('close', function() {
<add> input.removeListener('data', ondata);
<add> input.removeListener('end', onend);
<ide> });
<ide> var StringDecoder = require('string_decoder').StringDecoder; // lazy load
<ide> this._decoder = new StringDecoder('utf8');
<ide> function Interface(input, output, completer, terminal) {
<ide> exports.emitKeypressEvents(input);
<ide>
<ide> // input usually refers to stdin
<del> input.on('keypress', function(s, key) {
<del> self._ttyWrite(s, key);
<del> });
<add> input.on('keypress', onkeypress);
<ide>
<ide> // Current line
<ide> this.line = '';
<ide> function Interface(input, output, completer, terminal) {
<ide> this.history = [];
<ide> this.historyIndex = -1;
<ide>
<del> output.on('resize', function() {
<del> self._refreshLine();
<add> output.on('resize', onresize);
<add> self.once('close', function() {
<add> input.removeListener('keypress', onkeypress);
<add> output.removeListener('resize', onresize);
<ide> });
<ide> }
<ide> }
<ide><path>test/simple/test-readline-interface.js
<ide> function FakeInput() {
<ide> }
<ide> inherits(FakeInput, EventEmitter);
<ide> FakeInput.prototype.resume = function() {};
<add>FakeInput.prototype.pause = function() {};
<ide>
<ide> var fi;
<ide> var rli;
<ide> rli.on('line', function(line) {
<ide> });
<ide> fi.emit('data', 'a');
<ide> assert.ok(!called);
<add>rli.close();
<ide>
<ide> // sending a single character with no newline and then a newline
<ide> fi = new FakeInput();
<ide> fi.emit('data', 'a');
<ide> assert.ok(!called);
<ide> fi.emit('data', '\n');
<ide> assert.ok(called);
<add>rli.close();
<ide>
<ide> // sending multiple newlines at once
<ide> fi = new FakeInput();
<ide> rli.on('line', function(line) {
<ide> });
<ide> fi.emit('data', expectedLines.join(''));
<ide> assert.equal(callCount, expectedLines.length);
<add>rli.close();
<ide>
<ide> // sending multiple newlines at once that does not end with a new line
<ide> fi = new FakeInput();
<ide> rli.on('line', function(line) {
<ide> });
<ide> fi.emit('data', expectedLines.join(''));
<ide> assert.equal(callCount, expectedLines.length - 1);
<add>rli.close();
<ide>
<ide> // sending a multi-byte utf8 char over multiple writes
<ide> var buf = Buffer('☮', 'utf8');
<ide> rli.on('line', function(line) {
<ide> assert.equal(callCount, 0);
<ide> fi.emit('data', '\n');
<ide> assert.equal(callCount, 1);
<add>rli.close();
<add>
<add>assert.deepEqual(fi.listeners('end'), []);
<add>assert.deepEqual(fi.listeners('data'), []);
<ide><path>test/simple/test-readline-set-raw-mode.js
<ide> assert(rawModeCalled);
<ide> assert(!resumeCalled);
<ide> assert(pauseCalled);
<ide>
<add>assert.deepEqual(stream.listeners('end'), []);
<add>assert.deepEqual(stream.listeners('keypress'), []);
<add>// one data listener for the keypress events.
<add>assert.equal(stream.listeners('data').length, 1); | 3 |
Javascript | Javascript | apply workaround for firefox bug | c685b9b0d0da246cbfb697bb32e02ee953fa762d | <ide><path>packages/next-server/lib/router/router.js
<del>/* global __NEXT_DATA__ */
<add>/* global __NEXT_DATA__, location */
<ide>
<ide> import { parse } from 'url'
<ide> import mitt from '../mitt'
<ide> export default class Router {
<ide> this.changeState('replaceState', formatWithValidation({ pathname, query }), as)
<ide>
<ide> window.addEventListener('popstate', this.onPopState)
<add>
<add> // Workaround for weird Firefox bug, see below links
<add> // https://github.com/zeit/next.js/issues/3817
<add> // https://bugzilla.mozilla.org/show_bug.cgi?id=1422334
<add> // TODO: let's remove this once the Firefox bug is resolved
<add> if (navigator.userAgent && navigator.userAgent.match(/firefox/i)) {
<add> window.addEventListener('unload', () => {
<add> if (location.search) location.replace(location)
<add> })
<add> }
<ide> }
<ide> }
<ide> | 1 |
Text | Text | use uppercase on windows path | cc8066e0d196f0180ddcfa04207de8bee69db285 | <ide><path>doc/api/fs.md
<ide> fs.open(Buffer.from('/open/some/file.txt'), 'r', (err, fd) => {
<ide>
<ide> On Windows, Node.js follows the concept of per-drive working directory. This
<ide> behavior can be observed when using a drive path without a backslash. For
<del>example `fs.readdirSync('c:\\')` can potentially return a different result than
<del>`fs.readdirSync('c:')`. For more information, see
<add>example `fs.readdirSync('C:\\')` can potentially return a different result than
<add>`fs.readdirSync('C:')`. For more information, see
<ide> [this MSDN page][MSDN-Rel-Path].
<ide>
<ide> ### URL object support
<ide><path>doc/api/path.md
<ide> path.posix.basename('/tmp/myfile.html');
<ide>
<ide> On Windows Node.js follows the concept of per-drive working directory.
<ide> This behavior can be observed when using a drive path without a backslash. For
<del>example, `path.resolve('c:\\')` can potentially return a different result than
<del>`path.resolve('c:')`. For more information, see
<add>example, `path.resolve('C:\\')` can potentially return a different result than
<add>`path.resolve('C:')`. For more information, see
<ide> [this MSDN page][MSDN-Rel-Path].
<ide>
<ide> ## `path.basename(path[, ext])` | 2 |
Javascript | Javascript | fix error in boxhelper with non-geometric object | cd2e24938f95f2364dd3c117ca80d2bc8310dc6c | <ide><path>src/extras/helpers/BoxHelper.js
<ide> THREE.BoxHelper.prototype.update = ( function () {
<ide>
<ide> box.setFromObject( object );
<ide>
<add> if ( box.empty() ) return;
<add>
<ide> var min = box.min;
<ide> var max = box.max;
<ide> | 1 |
PHP | PHP | fix tests for test case filename | 1f1f647c0561a40c01399c748423c41547f82678 | <ide><path>src/Console/Command/Task/TestTask.php
<ide> public function testCaseFileName($type, $className) {
<ide> $path .= $this->classTypes[$type] . DS;
<ide> }
<ide> list($namespace, $className) = namespaceSplit($this->getRealClassName($type, $className));
<del> return str_replace('/', DS, $path) . Inflector::camelize($className) . 'Test.php';
<add> return str_replace(['/', '\\'], DS, $path) . Inflector::camelize($className) . 'Test.php';
<ide> }
<ide>
<ide> /**
<ide><path>tests/TestCase/Console/Command/Task/TestTaskTest.php
<ide> public function testBakeControllerTest() {
<ide> $this->assertContains("'app.post'", $result);
<ide> }
<ide>
<add>/**
<add> * test baking controller test files
<add> *
<add> * @return void
<add> */
<add> public function testBakePrefixControllerTest() {
<add> $this->markTestIncomplete();
<add> }
<add>
<ide> /**
<ide> * test baking component test files,
<ide> *
<ide> public function testMockClassGeneration() {
<ide> * @return void
<ide> */
<ide> public function testBakeWithPlugin() {
<del> $this->markTestIncomplete('Model tests need reworking.');
<del> $this->Task->plugin = 'TestTest';
<add> $this->Task->plugin = 'TestPlugin';
<ide>
<del> //fake plugin path
<del> Plugin::load('TestTest', array('path' => APP . 'Plugin/TestTest/'));
<del> $path = APP . 'Plugin/TestTest/Test/TestCase/View/Helper/FormHelperTest.php';
<add> Plugin::load('TestPlugin');
<add> $path = TEST_APP . 'Plugin/TestPlugin/Test/TestCase/View/Helper/FormHelperTest.php';
<ide> $this->Task->expects($this->once())->method('createFile')
<ide> ->with($path, $this->anything());
<ide>
<ide> $this->Task->bake('Helper', 'Form');
<del> Plugin::unload();
<ide> }
<ide>
<ide> /**
<del> * test interactive with plugins lists from the plugin
<add> * Provider for test case file names.
<ide> *
<del> * @return void
<add> * @return array
<ide> */
<del> public function testInteractiveWithPlugin() {
<del> $this->markTestIncomplete();
<del> $testApp = TEST_APP . 'Plugin/';
<del> Plugin::load('TestPlugin');
<del>
<del> $this->Task->plugin = 'TestPlugin';
<del> $path = $testApp . 'TestPlugin/Test/TestCase/View/Helper/OtherHelperTest.php';
<del> $this->Task->expects($this->any())
<del> ->method('in')
<del> ->will($this->onConsecutiveCalls(
<del> 5, //helper
<del> 1 //OtherHelper
<del> ));
<del>
<del> $this->Task->expects($this->once())
<del> ->method('createFile')
<del> ->with($path, $this->anything());
<del>
<del> $this->Task->stdout->expects($this->at(21))
<del> ->method('write')
<del> ->with('1. OtherHelperHelper');
<del>
<del> $this->Task->execute();
<del> }
<del>
<ide> public static function caseFileNameProvider() {
<ide> return array(
<del> array('Model', 'Post', 'TestCase/Model/PostTest.php'),
<add> array('Table', 'Posts', 'TestCase/Model/Table/PostsTableTest.php'),
<add> array('Entity', 'Article', 'TestCase/Model/Entity/ArticleTest.php'),
<ide> array('Helper', 'Form', 'TestCase/View/Helper/FormHelperTest.php'),
<ide> array('Controller', 'Posts', 'TestCase/Controller/PostsControllerTest.php'),
<ide> array('Behavior', 'Tree', 'TestCase/Model/Behavior/TreeBehaviorTest.php'),
<ide> array('Component', 'Auth', 'TestCase/Controller/Component/AuthComponentTest.php'),
<del> array('model', 'Post', 'TestCase/Model/PostTest.php'),
<add> array('entity', 'Article', 'TestCase/Model/Entity/ArticleTest.php'),
<add> array('table', 'Posts', 'TestCase/Model/Table/PostsTableTest.php'),
<ide> array('helper', 'Form', 'TestCase/View/Helper/FormHelperTest.php'),
<ide> array('controller', 'Posts', 'TestCase/Controller/PostsControllerTest.php'),
<ide> array('behavior', 'Tree', 'TestCase/Model/Behavior/TreeBehaviorTest.php'),
<ide> public static function caseFileNameProvider() {
<ide> * @return void
<ide> */
<ide> public function testTestCaseFileName($type, $class, $expected) {
<del> $this->markTestIncomplete();
<ide> $this->Task->path = DS . 'my/path/tests/';
<ide>
<ide> $result = $this->Task->testCaseFileName($type, $class); | 2 |
Text | Text | add v3.16.4 to changelog.md | 0fad0261871916041f82187a6aed1f11ad092d53 | <ide><path>CHANGELOG.md
<ide> - [#18694](https://github.com/emberjs/ember.js/pull/18694) [BUGFIX] Ensure tag updates are buffered, remove error message
<ide> - [#18709](https://github.com/emberjs/ember.js/pull/18709) [BUGFIX] Fix `this` in `@tracked` initializer
<ide>
<add>### v3.16.4 (March 22, 2020)
<add>
<add>- [#18741](https://github.com/emberjs/ember.js/pull/18741) [BUGFIX] Don't setup mandatory setters on array indexes
<add>- [#18742](https://github.com/emberjs/ember.js/pull/18742) [BUGFIX] Fix `setDiff` computed macro used within glimmer component
<add>- [#18767](https://github.com/emberjs/ember.js/pull/18767) [BUGFIX] Fix `observer` leaks.
<add>- [#18780](https://github.com/emberjs/ember.js/pull/18780) [BUGFIX] Fix `owner.ownerInjection()` when used to create services directly
<add>- [#18810](https://github.com/emberjs/ember.js/pull/18810) [BUGFIX] Do not error (RE: elementId changing) if elementId is not changed
<add>
<ide> ### v3.16.3 (February 18, 2020)
<ide>
<ide> - [#18730](https://github.com/emberjs/ember.js/pull/18730) Workaround for the Glimmer VM bug which encodes/decodes integer literals correctly. | 1 |
PHP | PHP | fix incorrect aliasing | 48f5812bf87c0d78b2dde5d2bf860d1c60975786 | <ide><path>src/TestSuite/Fixture/FixtureManager.php
<ide> public function fixturize($test) {
<ide> protected function _aliasConnections() {
<ide> $connections = ConnectionManager::configured();
<ide> ConnectionManager::alias('test', 'default');
<del> $map = [
<del> 'test' => 'default',
<del> ];
<add> $map = [];
<ide> foreach ($connections as $connection) {
<add> if ($connection === 'test' || $connection === 'default') {
<add> continue;
<add> }
<ide> if (isset($map[$connection])) {
<ide> continue;
<ide> } | 1 |
Mixed | Text | tweak the source | 445a0dac37be59dba3d9c5190d1cc9ff8a85f479 | <add><path>docs/docs/refactor/01-why-react.md
<del><path>docs/docs/refactor/01-motivation.md
<del># Motivation / Why React?
<add># Why React?
<ide>
<ide> React is a JavaScript library for creating user interfaces by Facebook and Instagram. Many people choose to think of React as the **V** in **[MVC](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)**.
<ide>
<add><path>docs/docs/refactor/04-multiple-components.md
<del><path>docs/docs/refactor/04-scaling-up.md
<del># Scaling Up and Using Multiple Components
<add># Multiple components
<ide>
<ide> So far, we've looked at how to write a single component to display data and handle user input. Next let's examine one of React's finest features: composability.
<ide>
<add><path>docs/docs/refactor/05-reusable-components.md
<del><path>docs/docs/refactor/05-building-effective-reusable-components.md
<del>## Build reusable component libraries!
<add>## Reusable components
<ide>
<ide> When designing interfaces, break down the common design elements (buttons, form fields, layout components, etc) into reusable components with well-defined interfaces. That way, the next time you need to build some UI you can write much less code, which means faster development time, less bugs, and less bytes down the wire.
<ide>
<ide><path>docs/docs/refactor/07-working-with-the-browser.md
<ide> In addition to that philosphy, we've also taken the stance that we, as authors o
<ide> * `Date.now`
<ide> * `Array.prototype.some` (also in `es5-shim.js`)
<ide>
<del>All of these can be polyfilled using `es5-shim.js` from https://github.com/kriskowal/es5-shim.
<add>All of these can be polyfilled using `es5-shim.js` from [https://github.com/kriskowal/es5-shim](https://github.com/kriskowal/es5-shim).
<ide>
<del>* `console.*` - https://github.com/paulmillr/console-polyfill
<del>* `Object.create` - Provided in `es5-sham.js` @ https://github.com/kriskowal/es5-shim
<add>* `console.*` - [https://github.com/paulmillr/console-polyfill](https://github.com/paulmillr/console-polyfill)
<add>* `Object.create` - Provided in `es5-sham.js` @ [https://github.com/kriskowal/es5-shim](https://github.com/kriskowal/es5-shim)
<add><path>docs/docs/refactor/08-tooling-integration.md
<del><path>docs/docs/refactor/08-working-with-your-environment.md
<del># Working with your environment
<add># Tooling integration
<ide>
<ide> Every project uses a different system for building and deploying JavaScript. We've tried to make React as environment-agnostic as possible.
<ide>
<ide><path>docs/docs/refactor/09-reference.md
<ide> # Reference
<ide>
<add>## Examples
<add>
<add>### Production apps
<add>
<add>* All of [Instagram.com](http://instagram.com/) is built on React.
<add>* Many components on [Facebook.com](http://www.facebook.com/), including the commenting interface, ads creation flows, and page insights.
<add>* [Khan Academy](http://khanacademy.org/) is using React for its question editor.
<add>
<add>### Sample code
<add>
<add>* We've included **[a step-by-step comment box tutorial](./09.1-tutorial.md)**
<add>* There is also [a simple LikeButton tutorial](./likebutton/)
<add>* [The React starter kit](/react/downloads.md) includes several examples which you can [view online in our GitHub repo](https://github.com/facebook/react/tree/master/examples/)
<add>* [reactapp](https://github.com/jordwalke/reactapp) is a simple app template to get you up-and-running quickly with React.
<add>* [React one-hour email](https://github.com/petehunt/react-one-hour-email/commits/master) goes step-by-step from a static HTML mock to an interactive email reader (written in just one hour!)
<add>* [Rendr + React app template](https://github.com/petehunt/rendr-react-template/) demonstrates how to use React's server rendering capabilities.
<add>
<ide> ## API
<ide>
<ide> ### React
<ide> React has implemented a browser-independent events and DOM system for performanc
<ide> * All event objects conform to the W3C spec
<ide> * All DOM properties and attributes (including event handlers) should be camelCased to be consistent with standard JavaScript style. We intentionally break with the spec here, since the spec is inconsistent.
<ide> * `onChange` behaves as you would expect it to: whenever a form field is changed this event is fired rather than inconsistently on blur. We intentionally break from existing browser behavior because `onChange` is a misnomer for its behavior and React relies on this event to react to user input in real time.
<del>
<del>## Examples
<del>
<del>* React powers all of Instagram.com and many components on Facebook.com, including the commenting interface, ads creation flows, and page insights.
<del>* We've included [a step-by-step tutorial](./09.1-tutorial.md) for creating a comment box widget with React
<del>* [The React starter kit](/react/downloads.md) includes several examples which you can [view online in our GitHub repo](https://github.com/facebook/react/tree/master/examples/)
<del>* [reactapp](https://github.com/jordwalke/reactapp) is a simple app template to get you up-and-running quickly with React.
<del>* [React one-hour email](https://github.com/petehunt/react-one-hour-email/commits/master) goes step-by-step from a static HTML mock to an interactive email reader (written in just one hour!)
<del>* [Rendr + React app template](https://github.com/petehunt/rendr-react-template/) demonstrates how to use React's server rendering capabilities.
<ide>\ No newline at end of file
<ide><path>docs/docs/refactor/09.1-tutorial.md
<del>---
<del>id: docs-tutorial
<del>title: Tutorial
<del>layout: docs
<del>prev: getting-started.html
<del>next: common-questions.html
<del>---
<add># Tutorial
<ide>
<ide> We'll be building a simple, but realistic comments box that you can drop into a blog, similar to Disqus, LiveFyre or Facebook comments.
<ide>
<ide><path>docs/docs/refactor/build.py
<add>import glob
<add>import os
<add>
<add>def build_header(id, title, prev, next):
<add> prevtext = nexttext = ''
<add> if prev:
<add> prevtext = 'prev: ' + prev + '\n'
<add> if next:
<add> nexttext = 'next: ' + next + '\n'
<add> return '''---
<add>id: %s
<add>title: %s
<add>layout: docs
<add>%s%s---''' % (id, title, prevtext, nexttext)
<add>
<add>def sanitize(content):
<add> title,content = content.split('\n', 1)
<add> title = title[2:].strip()
<add> return title,content.replace('# ', '## ').strip()
<add>
<add>def get_dest(filename):
<add> return os.path.join(os.path.dirname(filename), '..', os.path.basename(filename))
<add>
<add>def relative_html(filename):
<add> if not filename:
<add> return None
<add> return os.path.splitext(os.path.basename(filename))[0] + '.html'
<add>
<add>def generate_nav_item(filename, title):
<add> basename = os.path.splitext(os.path.basename(filename))[0]
<add> return ' <li><a href="/react/docs/%s.html"{%% if page.id == \'%s\' %%} class="active"{%% endif %%}>%s</a></li>\n' % (basename, basename, title)
<add>
<add>def main():
<add> docs = [None] + glob.glob(os.path.join(os.path.dirname(os.path.abspath(__file__)), '*.md'))[:-1] + [None]
<add> nav = '''
<add><div class="nav-docs">
<add> <div class="nav-docs-section">
<add> <h3>React documentation</h3>
<add> <ul>
<add>%s
<add> </ul>
<add> </div>
<add></div>'''
<add> items = ''
<add> for i in xrange(1, len(docs) - 1):
<add> prev = relative_html(docs[i - 1])
<add> next = relative_html(docs[i + 1])
<add> with open(docs[i], 'r') as src, open(get_dest(docs[i]), 'w') as dest:
<add> title,content = sanitize(src.read())
<add> header = build_header(
<add> os.path.splitext(os.path.basename(docs[i]))[0],
<add> title,
<add> prev,
<add> next
<add> )
<add> dest.write(header + '\n' + content)
<add> if docs[i].count('.') == 1:
<add> items += generate_nav_item(docs[i], title)
<add> with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', '_includes', 'nav_docs.html'), 'w') as f:
<add> f.write(nav % items)
<add>
<add>if __name__ == '__main__':
<add> main() | 8 |
Ruby | Ruby | improve delayedjob wrapper logging | b1fbb6688c9e7b1909ca3ab71691822fc32daf1c | <ide><path>activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb
<ide> def initialize(job_data)
<ide> @job_data = job_data
<ide> end
<ide>
<add> def display_name
<add> "#{job_data['job_class']} [#{job_data['job_id']}] from DelayedJob(#{job_data['queue_name']}) with arguments: #{job_data['arguments']}"
<add> end
<add>
<ide> def perform
<ide> Base.execute(job_data)
<ide> end
<ide><path>activejob/test/integration/queuing_test.rb
<ide> class QueuingTest < ActiveSupport::TestCase
<ide> end
<ide> end
<ide>
<add> test "should supply a wrapped class name to DelayedJob" do
<add> skip unless adapter_is?(:delayed_job)
<add> ::HelloJob.perform_later
<add> job = Delayed::Job.first
<add> assert_match(/HelloJob \[[0-9a-f-]+\] from DelayedJob\(default\) with arguments: \[\]/, job.name)
<add> end
<add>
<ide> test "resque JobWrapper should have instance variable queue" do
<ide> skip unless adapter_is?(:resque)
<ide> job = ::HelloJob.set(wait: 5.seconds).perform_later | 2 |
Javascript | Javascript | use mustcall() in test-readline-interface | 36867786d095de89a37ced4378d07c8efe30cdfa | <ide><path>test/parallel/test-readline-interface.js
<ide> function isWarned(emitter) {
<ide> });
<ide>
<ide> const rl = readline.createInterface({
<del> input: new Readable({ read: common.noop }),
<add> input: new Readable({ read: common.mustCall() }),
<ide> output: output,
<ide> prompt: '$ ',
<ide> terminal: terminal | 1 |
Ruby | Ruby | add more documentation; remove unused assignment | 610e4d9f24b8fe0c372104481a733b48d2270c3f | <ide><path>actionpack/lib/action_view/helpers/date_helper.rb
<ide> def date_select(object_name, method, options = {}, html_options = {})
<ide>
<ide> # Returns a set of select tags (one for hour, minute and optionally second) pre-selected for accessing a
<ide> # specified time-based attribute (identified by +method+) on an object assigned to the template (identified by
<del> # +object+). You can include the seconds with <tt>:include_seconds</tt>.
<add> # +object+). You can include the seconds with <tt>:include_seconds</tt>. You can get hours in the AM/PM format
<add> # with <tt>:ampm</tt> option.
<ide> #
<ide> # This method will also generate 3 input hidden tags, for the actual year, month and day unless the option
<ide> # <tt>:ignore_date</tt> is set to +true+.
<ide> def date_select(object_name, method, options = {}, html_options = {})
<ide> # time_select("post", "written_on", :prompt => {:hour => true}) # generic prompt for hours
<ide> # time_select("post", "written_on", :prompt => true) # generic prompts for all
<ide> #
<add> # # You can set :ampm option to true which will show the hours as: 12 PM, 01 AM .. 11 PM.
<add> # time_select 'game', 'game_time', {:ampm => true}
<add> #
<ide> # The selects are prepared for multi-parameter assignment to an Active Record object.
<ide> #
<ide> # Note: If the day is not included as an option but the month is, the day will be set to the 1st to ensure that
<ide> def time_select(object_name, method, options = {}, html_options = {})
<ide> # # be stored in the trip variable in the departing attribute.
<ide> # datetime_select("trip", "departing", :default => 3.days.from_now)
<ide> #
<add> # # Generate a datetime select with hours in the AM/PM format
<add> # datetime_select("post", "written_on", :ampm => true)
<add> #
<ide> # # Generates a datetime select that discards the type that, when POSTed, will be stored in the post variable
<ide> # # as the written_on attribute.
<ide> # datetime_select("post", "written_on", :discard_type => true)
<ide> def datetime_select(object_name, method, options = {}, html_options = {})
<ide> # # my_date_time (four days after today)
<ide> # select_datetime(my_date_time, :discard_type => true)
<ide> #
<add> # # Generate a datetime field with hours in the AM/PM format
<add> # select_datetime(my_date_time, :ampm => true)
<add> #
<ide> # # Generates a datetime select that defaults to the datetime in my_date_time (four days after today)
<ide> # # prefixed with 'payday' rather than 'date'
<ide> # select_datetime(my_date_time, :prefix => 'payday')
<ide> def select_date(date = Date.current, options = {}, html_options = {})
<ide> # # separated by ':' and includes an input for seconds
<ide> # select_time(my_time, :time_separator => ':', :include_seconds => true)
<ide> #
<add> # # Generate a time select field with hours in the AM/PM format
<add> # select_time(my_time, :ampm => true)
<add> #
<ide> # # Generates a time select with a custom prompt. Use :prompt=>true for generic prompts.
<ide> # select_time(my_time, :prompt => {:day => 'Choose day', :month => 'Choose month', :year => 'Choose year'})
<ide> # select_time(my_time, :prompt => {:hour => true}) # generic prompt for hours
<ide> class DateTimeSelector #:nodoc:
<ide> POSITION = {
<ide> :year => 1, :month => 2, :day => 3, :hour => 4, :minute => 5, :second => 6
<ide> }.freeze
<del> ampm = ["AM","PM"].map do |s|
<del> ["12 #{s}"] + (1..11).map{|x| "#{sprintf('%02d',x)} #{s}"}
<del> end.flatten
<ide>
<ide> AMPM_TRANSLATION = Hash[
<ide> [[0, "12 AM"], [1, "01 AM"], [2, "02 AM"], [3, "03 AM"], | 1 |
Python | Python | add additional reduceat/accumulate tests | a8262a5a87835fcb8b64334334b3eca93a2ab8d5 | <ide><path>numpy/core/tests/test_ufunc.py
<ide> def test_object_array_accumulate_inplace(self):
<ide> np.array([[2]*i for i in [1, 3, 6, 10]], dtype=object),
<ide> )
<ide>
<add> def test_object_array_accumulate_failure(self):
<add> # Typical accumulation on object works as expected:
<add> res = np.add.accumulate(np.array([1, 0, 2], dtype=object))
<add> assert_array_equal(res, np.array([1, 1, 3], dtype=object))
<add> # But errors are propagated from the inner-loop if they occur:
<add> with pytest.raises(TypeError):
<add> np.add.accumulate([1, None, 2])
<add>
<ide> def test_object_array_reduceat_inplace(self):
<ide> # Checks that in-place reduceats work, see also gh-7465
<ide> arr = np.empty(4, dtype=object)
<ide> def test_object_array_reduceat_inplace(self):
<ide> np.add.reduceat(arr, np.arange(4), out=arr, axis=-1)
<ide> assert_array_equal(arr, out)
<ide>
<add> def test_object_array_reduceat_failure(self):
<add> # Reduceat works as expected when no invalid operation occurs (None is
<add> # not involved in an operation here)
<add> res = np.add.reduceat(np.array([1, None, 2], dtype=object), [1, 2])
<add> assert_array_equal(res, np.array([None, 2], dtype=object))
<add> # But errors when None would be involved in an operation:
<add> with pytest.raises(TypeError):
<add> np.add.reduceat([1, None, 2], [0, 2])
<add>
<ide> def test_zerosize_reduction(self):
<ide> # Test with default dtype and object dtype
<ide> for a in [[], np.array([], dtype=object)]: | 1 |
Java | Java | add extendmessageconverters to webmvcconfigurer | 24834f6d2fd8f47100b904036249187c1e2444f6 | <ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.java
<ide> protected void configureMessageConverters(List<HttpMessageConverter<?>> converte
<ide> this.configurers.configureMessageConverters(converters);
<ide> }
<ide>
<add> @Override
<add> protected void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
<add> this.configurers.extendMessageConverters(converters);
<add> }
<add>
<ide> @Override
<ide> protected void addFormatters(FormatterRegistry registry) {
<ide> this.configurers.addFormatters(registry);
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java
<ide> protected final List<HttpMessageConverter<?>> getMessageConverters() {
<ide> if (this.messageConverters.isEmpty()) {
<ide> addDefaultHttpMessageConverters(this.messageConverters);
<ide> }
<add> extendMessageConverters(this.messageConverters);
<ide> }
<ide> return this.messageConverters;
<ide> }
<ide> protected final List<HttpMessageConverter<?>> getMessageConverters() {
<ide> protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
<ide> }
<ide>
<add> protected void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
<add> }
<add>
<ide> /**
<ide> * Adds a set of default HttpMessageConverter instances to the given list.
<ide> * Subclasses can call this method from {@link #configureMessageConverters(List)}.
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.java
<ide> public interface WebMvcConfigurer {
<ide> void addFormatters(FormatterRegistry registry);
<ide>
<ide> /**
<del> * Configure the {@link HttpMessageConverter}s to use in argument resolvers
<del> * and return value handlers that support reading and/or writing to the
<del> * body of the request and response. If no message converters are added to
<del> * the list, default converters are added instead.
<add> * Configure the {@link HttpMessageConverter}s to use for reading or writing
<add> * to the body of the request or response. If no converters are added, a
<add> * default list of converters is registered.
<add> * <p><strong>Note</strong> that adding converters to the list, turns off
<add> * default converter registration. To simply add a converter without impacting
<add> * default registration, consider using the method
<add> * {@link #extendMessageConverters(java.util.List)} instead.
<ide> * @param converters initially an empty list of converters
<ide> */
<ide> void configureMessageConverters(List<HttpMessageConverter<?>> converters);
<ide>
<add> /**
<add> * A hook for extending or modifying the list of converters after it has been
<add> * configured. This may be useful for example to allow default converters to
<add> * be registered and then insert a custom converter through this method.
<add> * @param converters the list of configured converters to extend.
<add> * @since 4.1.3
<add> */
<add> void extendMessageConverters(List<HttpMessageConverter<?>> converters);
<add>
<ide> /**
<ide> * Provide a custom {@link Validator} instead of the one created by default.
<ide> * The default implementation, assuming JSR-303 is on the classpath, is:
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.java
<ide> public void addFormatters(FormatterRegistry registry) {
<ide> public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
<ide> }
<ide>
<add> /**
<add> * {@inheritDoc}
<add> * <p>This implementation is empty.
<add> */
<add> @Override
<add> public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
<add> }
<add>
<ide> /**
<ide> * {@inheritDoc}
<ide> * <p>This implementation returns {@code null}
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurerComposite.java
<ide> public void configureMessageConverters(List<HttpMessageConverter<?>> converters)
<ide> }
<ide> }
<ide>
<add> @Override
<add> public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
<add> for (WebMvcConfigurer delegate : this.delegates) {
<add> delegate.extendMessageConverters(converters);
<add> }
<add> }
<add>
<ide> @Override
<ide> public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
<ide> for (WebMvcConfigurer delegate : this.delegates) {
<ide><path>spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfigurationTests.java
<ide>
<ide> import org.springframework.core.convert.ConversionService;
<ide> import org.springframework.format.support.FormattingConversionService;
<add>import org.springframework.http.HttpMessage;
<ide> import org.springframework.http.converter.HttpMessageConverter;
<ide> import org.springframework.http.converter.StringHttpMessageConverter;
<ide> import org.springframework.util.PathMatcher;
<ide> public void requestMappingHandlerAdapter() throws Exception {
<ide>
<ide> @Test
<ide> public void configureMessageConverters() {
<add> final HttpMessageConverter customConverter = mock(HttpMessageConverter.class);
<add> final StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
<ide> List<WebMvcConfigurer> configurers = new ArrayList<WebMvcConfigurer>();
<ide> configurers.add(new WebMvcConfigurerAdapter() {
<ide> @Override
<ide> public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
<del> converters.add(new StringHttpMessageConverter());
<add> converters.add(stringConverter);
<add> }
<add> @Override
<add> public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
<add> converters.add(0, customConverter);
<ide> }
<ide> });
<ide> delegatingConfig = new DelegatingWebMvcConfiguration();
<ide> delegatingConfig.setConfigurers(configurers);
<ide>
<ide> RequestMappingHandlerAdapter adapter = delegatingConfig.requestMappingHandlerAdapter();
<del> assertEquals("Only one custom converter should be registered", 1, adapter.getMessageConverters().size());
<add> assertEquals("Only one custom converter should be registered", 2, adapter.getMessageConverters().size());
<add> assertSame(customConverter, adapter.getMessageConverters().get(0));
<add> assertSame(stringConverter, adapter.getMessageConverters().get(1));
<ide> }
<ide>
<ide> @Test
<ide><path>spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportExtensionTests.java
<ide> import org.springframework.http.HttpStatus;
<ide> import org.springframework.http.MediaType;
<ide> import org.springframework.http.converter.HttpMessageConverter;
<add>import org.springframework.http.converter.StringHttpMessageConverter;
<ide> import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
<ide> import org.springframework.mock.web.test.MockHttpServletRequest;
<ide> import org.springframework.mock.web.test.MockServletContext;
<ide> public void requestMappingHandlerAdapter() throws Exception {
<ide> assertEquals("converted", actual);
<ide>
<ide> // Message converters
<del> assertEquals(1, adapter.getMessageConverters().size());
<del> assertEquals(MappingJackson2HttpMessageConverter.class, adapter.getMessageConverters().get(0).getClass());
<del> ObjectMapper objectMapper = ((MappingJackson2HttpMessageConverter)adapter.getMessageConverters().get(0)).getObjectMapper();
<add> assertEquals(2, adapter.getMessageConverters().size());
<add> assertEquals(StringHttpMessageConverter.class, adapter.getMessageConverters().get(0).getClass());
<add> assertEquals(MappingJackson2HttpMessageConverter.class, adapter.getMessageConverters().get(1).getClass());
<add> ObjectMapper objectMapper = ((MappingJackson2HttpMessageConverter)adapter.getMessageConverters().get(1)).getObjectMapper();
<ide> assertFalse(objectMapper.getDeserializationConfig().isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION));
<ide> assertFalse(objectMapper.getSerializationConfig().isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION));
<ide> assertFalse(objectMapper.getDeserializationConfig().isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES));
<ide> public void configureMessageConverters(List<HttpMessageConverter<?>> converters)
<ide> converters.add(new MappingJackson2HttpMessageConverter());
<ide> }
<ide>
<add> @Override
<add> public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
<add> converters.add(0, new StringHttpMessageConverter());
<add> }
<add>
<ide> @Override
<ide> public Validator getValidator() {
<ide> return new Validator() { | 7 |
Python | Python | add riscv into host_arch_cc | 1d638976d5a167ff1e0f938e3eced06553e1f758 | <ide><path>configure.py
<ide> def host_arch_cc():
<ide> '__PPC__' : 'ppc64',
<ide> '__x86_64__' : 'x64',
<ide> '__s390x__' : 's390x',
<add> '__riscv' : 'riscv',
<ide> }
<ide>
<ide> rtn = 'ia32' # default
<ide> def host_arch_cc():
<ide> if rtn == 'mipsel' and '_LP64' in k:
<ide> rtn = 'mips64el'
<ide>
<add> if rtn == 'riscv':
<add> if k['__riscv_xlen'] == '64':
<add> rtn = 'riscv64'
<add> else:
<add> rtn = 'riscv32'
<add>
<ide> return rtn
<ide>
<ide> | 1 |
PHP | PHP | adjust test cases | ff98b4a15fb006aae3463b7d2e4b0e60624ad558 | <ide><path>tests/TestCase/Core/ConfigureTest.php
<ide> public function testRead()
<ide> */
<ide> public function testWrite()
<ide> {
<del> $writeResult = Configure::write('SomeName.someKey', 'myvalue');
<del> $this->assertTrue($writeResult);
<add> Configure::write('SomeName.someKey', 'myvalue');
<ide> $result = Configure::read('SomeName.someKey');
<ide> $this->assertEquals('myvalue', $result);
<ide>
<del> $writeResult = Configure::write('SomeName.someKey', null);
<del> $this->assertTrue($writeResult);
<add> Configure::write('SomeName.someKey', null);
<ide> $result = Configure::read('SomeName.someKey');
<ide> $this->assertNull($result);
<ide>
<ide> $expected = ['One' => ['Two' => ['Three' => ['Four' => ['Five' => 'cool']]]]];
<del> $writeResult = Configure::write('Key', $expected);
<del> $this->assertTrue($writeResult);
<add> Configure::write('Key', $expected);
<ide>
<ide> $result = Configure::read('Key');
<ide> $this->assertEquals($expected, $result);
<ide> public function testCheck()
<ide> */
<ide> public function testCheckingSavedEmpty()
<ide> {
<del> $this->assertTrue(Configure::write('ConfigureTestCase', 0));
<add> Configure::write('ConfigureTestCase', 0);
<ide> $this->assertTrue(Configure::check('ConfigureTestCase'));
<ide>
<del> $this->assertTrue(Configure::write('ConfigureTestCase', '0'));
<add> Configure::write('ConfigureTestCase', '0');
<ide> $this->assertTrue(Configure::check('ConfigureTestCase'));
<ide>
<del> $this->assertTrue(Configure::write('ConfigureTestCase', false));
<add> Configure::write('ConfigureTestCase', false);
<ide> $this->assertTrue(Configure::check('ConfigureTestCase'));
<ide>
<del> $this->assertTrue(Configure::write('ConfigureTestCase', null));
<add> Configure::write('ConfigureTestCase', null);
<ide> $this->assertFalse(Configure::check('ConfigureTestCase'));
<ide> }
<ide>
<ide> public function testCheckingSavedEmpty()
<ide> */
<ide> public function testCheckKeyWithSpaces()
<ide> {
<del> $this->assertTrue(Configure::write('Configure Test', 'test'));
<add> Configure::write('Configure Test', 'test');
<ide> $this->assertTrue(Configure::check('Configure Test'));
<ide> Configure::delete('Configure Test');
<ide>
<del> $this->assertTrue(Configure::write('Configure Test.Test Case', 'test'));
<add> Configure::write('Configure Test.Test Case', 'test');
<ide> $this->assertTrue(Configure::check('Configure Test.Test Case'));
<ide> }
<ide>
<ide> public function testCheckKeyWithSpaces()
<ide> public function testCheckEmpty()
<ide> {
<ide> $this->assertFalse(Configure::check(''));
<del> $this->assertFalse(Configure::check(null));
<ide> }
<ide>
<ide> /**
<ide> public function testEngineSetup()
<ide> public function testClear()
<ide> {
<ide> Configure::write('test', 'value');
<del> $this->assertTrue(Configure::clear());
<add> Configure::clear();
<ide> $this->assertNull(Configure::read('debug'));
<ide> $this->assertNull(Configure::read('test'));
<ide> }
<ide> public function testConsumeEmpty()
<ide>
<ide> $result = Configure::consume('');
<ide> $this->assertNull($result);
<del>
<del> $result = Configure::consume(null);
<del> $this->assertNull($result);
<ide> }
<ide>
<ide> /** | 1 |
Python | Python | use viewer role as example public role | 7f297f68c6d38da48983127e2092be18b56b53b9 | <ide><path>airflow/config_templates/default_webserver_config.py
<ide> # Uncomment to setup Full admin role name
<ide> # AUTH_ROLE_ADMIN = 'Admin'
<ide>
<del># Uncomment to setup Public role name, no authentication needed
<del># AUTH_ROLE_PUBLIC = 'Public'
<add># Uncomment and set to desired role to enable access without authentication
<add># AUTH_ROLE_PUBLIC = 'Viewer'
<ide>
<ide> # Will allow user self registration
<ide> # AUTH_USER_REGISTRATION = True | 1 |
Text | Text | update changelog for safetybuffer slice access | 1d42a661d8ff7795ebf9255cb7efd17de7b47fb0 | <ide><path>activesupport/CHANGELOG.md
<add>* Maintain `html_safe?` on html_safe strings when sliced
<add>
<add> string = "<div>test</div>".html_safe
<add> string[-1..1].html_safe? # => true
<add>
<add> *Elom Gomez, Yumin Wong*
<add>
<ide> * Add `Array#extract!`.
<ide>
<ide> The method removes and returns the elements for which the block returns a true value. | 1 |
Ruby | Ruby | add "homebrew/core" for relevant checks | 779304df68a5b49387a86bc3a12fc05a3201678b | <ide><path>Library/Homebrew/dev-cmd/audit.rb
<ide> def initialize(formula, options = {})
<ide> @except = options[:except]
<ide> # Accept precomputed style offense results, for efficiency
<ide> @style_offenses = options[:style_offenses]
<del> # Allow the formula tap to be set as `core`, for testing purposes
<add> # Allow the formula tap to be set as homebrew/core, for testing purposes
<ide> @core_tap = formula.tap&.core_tap? || options[:core_tap]
<ide> @problems = []
<ide> @new_formula_problems = []
<ide> def audit_formula_name
<ide>
<ide> name = formula.name
<ide>
<del> problem "'#{name}' is blacklisted." if MissingFormula.blacklisted_reason(name)
<add> problem "'#{name}' is blacklisted from homebrew/core." if MissingFormula.blacklisted_reason(name)
<ide>
<ide> if Formula.aliases.include? name
<del> problem "Formula name conflicts with existing aliases."
<add> problem "Formula name conflicts with existing aliases in homebrew/core."
<ide> return
<ide> end
<ide>
<ide> if oldname = CoreTap.instance.formula_renames[name]
<del> problem "'#{name}' is reserved as the old name of #{oldname}"
<add> problem "'#{name}' is reserved as the old name of #{oldname} in homebrew/core."
<ide> return
<ide> end
<ide>
<ide> def audit_deps
<ide>
<ide> if self.class.aliases.include?(dep.name) &&
<ide> (dep_f.core_formula? || !dep_f.versioned_formula?)
<del> problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'."
<add> problem "Dependency '#{dep.name}' from homebrew/core is an alias; " \
<add> "use the canonical name '#{dep.to_formula.full_name}'."
<ide> end
<ide>
<ide> if @new_formula &&
<ide> def audit_deps
<ide> next unless @core_tap
<ide>
<ide> if dep.tags.include?(:recommended) || dep.tags.include?(:optional)
<del> problem "Formulae should not have optional or recommended dependencies"
<add> problem "Formulae in homebrew/core should not have optional or recommended dependencies"
<ide> end
<ide> end
<ide>
<ide> next unless @core_tap
<ide>
<ide> if spec.requirements.map(&:recommended?).any? || spec.requirements.map(&:optional?).any?
<del> problem "Formulae should not have optional or recommended requirements"
<add> problem "Formulae in homebrew/core should not have optional or recommended requirements"
<ide> end
<ide> end
<ide> end
<ide> def audit_postgresql
<ide> begin
<ide> Formula[previous_formula_name]
<ide> rescue FormulaUnavailableError
<del> problem "Versioned #{previous_formula_name} must be created for " \
<add> problem "Versioned #{previous_formula_name} in homebrew/core must be created for " \
<ide> "`brew-postgresql-upgrade-database` and `pg_upgrade` to work."
<ide> end
<ide> end
<ide> def audit_versioned_keg_only
<ide>
<ide> return if keg_only_whitelist.include?(formula.name) || formula.name.start_with?("gcc@")
<ide>
<del> problem "Versioned formulae should use `keg_only :versioned_formula`"
<add> problem "Versioned formulae in homebrew/core should use `keg_only :versioned_formula`"
<ide> end
<ide>
<ide> def audit_homepage
<ide> def audit_bottle_spec
<ide>
<ide> return unless formula.bottle_defined?
<ide>
<del> new_formula_problem "New formulae should not have a `bottle do` block"
<add> new_formula_problem "New formulae in homebrew/core should not have a `bottle do` block"
<ide> end
<ide>
<ide> def audit_bottle_disabled
<ide> def audit_bottle_disabled
<ide>
<ide> return unless @core_tap
<ide>
<del> problem "Formulae should not use `bottle :disabled`"
<add> problem "Formulae in homebrew/core should not use `bottle :disabled`"
<ide> end
<ide>
<ide> def audit_github_repository
<ide> def audit_specs
<ide>
<ide> return unless @core_tap
<ide>
<del> problem "Formulae should not have a `devel` spec" if formula.devel
<add> problem "Formulae in homebrew/core should not have a `devel` spec" if formula.devel
<ide>
<ide> if formula.head && @versioned_formula
<ide> head_spec_message = "Formulae should not have a `HEAD` spec"
<ide> def line_problems(line, _lineno)
<ide>
<ide> return unless @core_tap
<ide>
<del> problem "`env :std` in `core` formulae is deprecated" if line.include?("env :std")
<add> problem "`env :std` in homebrew/core formulae is deprecated" if line.include?("env :std")
<ide> end
<ide>
<ide> def audit_reverse_migration
<ide><path>Library/Homebrew/rubocops/lines.rb
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> return unless formula_tap == "homebrew-core"
<ide>
<ide> find_method_with_args(body_node, :depends_on, "mpich") do
<del> problem "Use 'depends_on \"open-mpi\"' instead of '#{@offensive_node.source}'."
<add> problem "Formulae in homebrew/core should use 'depends_on \"open-mpi\"' " \
<add> "instead of '#{@offensive_node.source}'."
<ide> end
<ide> end
<ide>
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> next if formula_tap != "homebrew-core" || file_path&.include?("linuxbrew")
<ide>
<ide> find_instance_method_call(body_node, "OS", method_name) do |check|
<del> problem "Don't use #{check.source}; Homebrew/core only supports macOS"
<add> problem "Don't use #{check.source}; homebrew/core only supports macOS"
<ide> end
<ide> end
<ide>
<ide><path>Library/Homebrew/rubocops/options.rb
<ide> class Options < FormulaCop
<ide> DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so 32-bit options are deprecated."
<ide> UNI_DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so universal options are deprecated."
<ide>
<del> DEP_OPTION = "Formulae should not use `deprecated_option`"
<del> OPTION = "Formulae should not have an `option`"
<add> DEP_OPTION = "Formulae in homebrew/core should not use `deprecated_option`."
<add> OPTION = "Formulae in homebrew/core should not use `option`."
<ide>
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> option_call_nodes = find_every_method_call_by_name(body_node, :option)
<ide><path>Library/Homebrew/rubocops/text.rb
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> end
<ide>
<ide> if formula_tap == "homebrew-core" && (depends_on?("veclibfort") || depends_on?("lapack"))
<del> problem "Formulae should use OpenBLAS as the default serial linear algebra library."
<add> problem "Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library."
<ide> end
<ide>
<ide> if method_called_ever?(body_node, :virtualenv_create) ||
<ide><path>Library/Homebrew/rubocops/urls.rb
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> next if BINARY_FORMULA_URLS_WHITELIST.include?(@formula_name)
<ide> next if BINARY_URLS_WHITELIST.include?(url)
<ide>
<del> problem "#{url} looks like a binary package, not a source archive. " \
<del> "Homebrew/homebrew-core is source-only."
<add> problem "#{url} looks like a binary package, not a source archive; " \
<add> "homebrew/core is source-only."
<ide> end
<ide> end
<ide> end
<ide><path>Library/Homebrew/test/dev-cmd/audit_spec.rb
<ide> class FooAT11 < Formula
<ide> fa.audit_versioned_keg_only
<ide>
<ide> expect(fa.problems.first)
<del> .to match("Versioned formulae should use `keg_only :versioned_formula`")
<add> .to match("Versioned formulae in homebrew/core should use `keg_only :versioned_formula`")
<ide> end
<ide>
<ide> specify "it warns when a versioned formula has an incorrect `keg_only` reason" do
<ide> class FooAT11 < Formula
<ide> fa.audit_versioned_keg_only
<ide>
<ide> expect(fa.problems.first)
<del> .to match("Versioned formulae should use `keg_only :versioned_formula`")
<add> .to match("Versioned formulae in homebrew/core should use `keg_only :versioned_formula`")
<ide> end
<ide>
<ide> specify "it does not warn when a versioned formula has `keg_only :versioned_formula`" do
<ide><path>Library/Homebrew/test/rubocops/lines_spec.rb
<ide> class Foo < Formula
<ide> desc "foo"
<ide> url 'https://brew.sh/foo-1.0.tgz'
<ide> depends_on "mpich"
<del> ^^^^^^^^^^^^^^^^^^ Use 'depends_on "open-mpi"' instead of 'depends_on "mpich"'.
<add> ^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should use 'depends_on "open-mpi"' instead of 'depends_on "mpich"'.
<ide> end
<ide> RUBY
<ide>
<ide> class Foo < Formula
<ide> url 'https://brew.sh/foo-1.0.tgz'
<ide> bottle do
<ide> if OS.linux?
<del> ^^^^^^^^^ Don\'t use OS.linux?; Homebrew/core only supports macOS
<add> ^^^^^^^^^ Don\'t use OS.linux?; homebrew/core only supports macOS
<ide> nil
<ide> end
<ide> sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra
<ide><path>Library/Homebrew/test/rubocops/options_spec.rb
<ide> class Foo < Formula
<ide> class Foo < Formula
<ide> url 'https://brew.sh/foo-1.0.tgz'
<ide> deprecated_option "examples" => "with-examples"
<del> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae should not use `deprecated_option`
<add> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `deprecated_option`.
<ide> end
<ide> RUBY
<ide> end
<ide> class Foo < Formula
<ide> class Foo < Formula
<ide> url 'https://brew.sh/foo-1.0.tgz'
<ide> option "with-examples"
<del> ^^^^^^^^^^^^^^^^^^^^^^ Formulae should not have an `option`
<add> ^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `option`.
<ide> end
<ide> RUBY
<ide> end
<ide><path>Library/Homebrew/test/rubocops/text_spec.rb
<ide> class Foo < Formula
<ide> url "https://brew.sh/foo-1.0.tgz"
<ide> homepage "https://brew.sh"
<ide> depends_on "veclibfort"
<del> ^^^^^^^^^^^^^^^^^^^^^^^ Formulae should use OpenBLAS as the default serial linear algebra library.
<add> ^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library.
<ide> end
<ide> RUBY
<ide> end
<ide> class Foo < Formula
<ide> url "https://brew.sh/foo-1.0.tgz"
<ide> homepage "https://brew.sh"
<ide> depends_on "lapack"
<del> ^^^^^^^^^^^^^^^^^^^ Formulae should use OpenBLAS as the default serial linear algebra library.
<add> ^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library.
<ide> end
<ide> RUBY
<ide> end
<ide><path>Library/Homebrew/test/rubocops/urls_spec.rb
<ide> }, {
<ide> "url" => "https://brew.sh/example-darwin.x86_64.tar.gz",
<ide> "msg" => "https://brew.sh/example-darwin.x86_64.tar.gz looks like a binary package, " \
<del> "not a source archive. Homebrew/homebrew-core is source-only.",
<add> "not a source archive; homebrew/core is source-only.",
<ide> "col" => 2,
<ide> "formula_tap" => "homebrew-core",
<ide> }, {
<ide> "url" => "https://brew.sh/example-darwin.amd64.tar.gz",
<ide> "msg" => "https://brew.sh/example-darwin.amd64.tar.gz looks like a binary package, " \
<del> "not a source archive. Homebrew/homebrew-core is source-only.",
<add> "not a source archive; homebrew/core is source-only.",
<ide> "col" => 2,
<ide> "formula_tap" => "homebrew-core",
<ide> }] | 10 |
Go | Go | fix bug in volume driver test implementation | 9f19cbc2c4cb6e031b12b04ea33447d427870c29 | <ide><path>integration-cli/docker_cli_start_volume_driver_unix_test.go
<ide> package main
<ide> import (
<ide> "encoding/json"
<ide> "fmt"
<add> "io"
<ide> "io/ioutil"
<ide> "net/http"
<ide> "net/http/httptest"
<ide> func (s *DockerExternalVolumeSuite) SetUpSuite(c *check.C) {
<ide> s.server = httptest.NewServer(mux)
<ide>
<ide> type pluginRequest struct {
<del> name string
<add> Name string
<add> }
<add>
<add> type pluginResp struct {
<add> Mountpoint string `json:",omitempty"`
<add> Err string `json:",omitempty"`
<add> }
<add>
<add> read := func(b io.ReadCloser) (pluginRequest, error) {
<add> defer b.Close()
<add> var pr pluginRequest
<add> if err := json.NewDecoder(b).Decode(&pr); err != nil {
<add> return pr, err
<add> }
<add> return pr, nil
<add> }
<add>
<add> send := func(w http.ResponseWriter, data interface{}) {
<add> switch t := data.(type) {
<add> case error:
<add> http.Error(w, t.Error(), 500)
<add> case string:
<add> w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
<add> fmt.Fprintln(w, t)
<add> default:
<add> w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
<add> json.NewEncoder(w).Encode(&data)
<add> }
<ide> }
<ide>
<ide> mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
<ide> s.ec.activations++
<del>
<del> w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
<del> fmt.Fprintln(w, `{"Implements": ["VolumeDriver"]}`)
<add> send(w, `{"Implements": ["VolumeDriver"]}`)
<ide> })
<ide>
<ide> mux.HandleFunc("/VolumeDriver.Create", func(w http.ResponseWriter, r *http.Request) {
<ide> s.ec.creations++
<ide>
<del> w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
<del> fmt.Fprintln(w, `{}`)
<add> _, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<add> }
<add>
<add> send(w, nil)
<ide> })
<ide>
<ide> mux.HandleFunc("/VolumeDriver.Remove", func(w http.ResponseWriter, r *http.Request) {
<ide> s.ec.removals++
<ide>
<del> w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
<del> fmt.Fprintln(w, `{}`)
<add> pr, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<add> }
<add> if err := os.RemoveAll(hostVolumePath(pr.Name)); err != nil {
<add> send(w, &pluginResp{Err: err.Error()})
<add> return
<add> }
<add>
<add> send(w, nil)
<ide> })
<ide>
<ide> mux.HandleFunc("/VolumeDriver.Path", func(w http.ResponseWriter, r *http.Request) {
<ide> s.ec.paths++
<ide>
<del> var pr pluginRequest
<del> if err := json.NewDecoder(r.Body).Decode(&pr); err != nil {
<del> http.Error(w, err.Error(), 500)
<add> pr, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<ide> }
<add> p := hostVolumePath(pr.Name)
<ide>
<del> p := hostVolumePath(pr.name)
<del>
<del> w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
<ide> fmt.Fprintln(w, fmt.Sprintf("{\"Mountpoint\": \"%s\"}", p))
<ide> })
<ide>
<ide> mux.HandleFunc("/VolumeDriver.Mount", func(w http.ResponseWriter, r *http.Request) {
<ide> s.ec.mounts++
<ide>
<del> var pr pluginRequest
<del> if err := json.NewDecoder(r.Body).Decode(&pr); err != nil {
<del> http.Error(w, err.Error(), 500)
<add> pr, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<ide> }
<ide>
<del> p := hostVolumePath(pr.name)
<add> p := hostVolumePath(pr.Name)
<ide> if err := os.MkdirAll(p, 0755); err != nil {
<del> http.Error(w, err.Error(), 500)
<add> send(w, &pluginResp{Err: err.Error()})
<add> return
<ide> }
<ide>
<ide> if err := ioutil.WriteFile(filepath.Join(p, "test"), []byte(s.server.URL), 0644); err != nil {
<del> http.Error(w, err.Error(), 500)
<add> send(w, err)
<add> return
<ide> }
<ide>
<del> w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
<del> fmt.Fprintln(w, fmt.Sprintf("{\"Mountpoint\": \"%s\"}", p))
<add> send(w, &pluginResp{Mountpoint: p})
<ide> })
<ide>
<ide> mux.HandleFunc("/VolumeDriver.Unmount", func(w http.ResponseWriter, r *http.Request) {
<ide> s.ec.unmounts++
<ide>
<del> var pr pluginRequest
<del> if err := json.NewDecoder(r.Body).Decode(&pr); err != nil {
<del> http.Error(w, err.Error(), 500)
<add> _, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<ide> }
<ide>
<del> w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
<del> fmt.Fprintln(w, `{}`)
<add> fmt.Fprintln(w, nil)
<ide> })
<ide>
<ide> err := os.MkdirAll("/etc/docker/plugins", 0755)
<ide> func (s *DockerExternalVolumeSuite) TearDownSuite(c *check.C) {
<ide> c.Assert(err, checker.IsNil)
<ide> }
<ide>
<del>func (s *DockerExternalVolumeSuite) TestStartExternalNamedVolumeDriver(c *check.C) {
<add>func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverNamed(c *check.C) {
<ide> err := s.d.StartWithBusybox()
<ide> c.Assert(err, checker.IsNil)
<ide>
<ide> out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", "test-external-volume-driver", "busybox:latest", "cat", "/tmp/external-volume-test/test")
<del> c.Assert(err, checker.IsNil)
<del>
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<ide> c.Assert(out, checker.Contains, s.server.URL)
<ide>
<ide> p := hostVolumePath("external-volume-test")
<ide> _, err = os.Lstat(p)
<ide> c.Assert(err, checker.NotNil)
<del>
<del> if !os.IsNotExist(err) {
<del> c.Fatalf("Expected volume path in host to not exist: %s, %v\n", p, err)
<del> }
<add> c.Assert(os.IsNotExist(err), checker.True, check.Commentf("Expected volume path in host to not exist: %s, %v\n", p, err))
<ide>
<ide> c.Assert(s.ec.activations, checker.Equals, 1)
<ide> c.Assert(s.ec.creations, checker.Equals, 1)
<ide> func (s *DockerExternalVolumeSuite) TestStartExternalNamedVolumeDriver(c *check.
<ide> c.Assert(s.ec.unmounts, checker.Equals, 1)
<ide> }
<ide>
<del>func (s *DockerExternalVolumeSuite) TestStartExternalVolumeUnnamedDriver(c *check.C) {
<add>func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnnamed(c *check.C) {
<ide> err := s.d.StartWithBusybox()
<ide> c.Assert(err, checker.IsNil)
<ide>
<ide> out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "/tmp/external-volume-test", "--volume-driver", "test-external-volume-driver", "busybox:latest", "cat", "/tmp/external-volume-test/test")
<del> c.Assert(err, checker.IsNil)
<del>
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<ide> c.Assert(out, checker.Contains, s.server.URL)
<ide>
<ide> c.Assert(s.ec.activations, checker.Equals, 1)
<ide> func (s *DockerExternalVolumeSuite) TestStartExternalVolumeUnnamedDriver(c *chec
<ide> c.Assert(s.ec.unmounts, checker.Equals, 1)
<ide> }
<ide>
<del>func (s DockerExternalVolumeSuite) TestStartExternalVolumeDriverVolumesFrom(c *check.C) {
<add>func (s DockerExternalVolumeSuite) TestExternalVolumeDriverVolumesFrom(c *check.C) {
<ide> err := s.d.StartWithBusybox()
<ide> c.Assert(err, checker.IsNil)
<ide>
<ide> func (s DockerExternalVolumeSuite) TestStartExternalVolumeDriverVolumesFrom(c *c
<ide> c.Assert(s.ec.unmounts, checker.Equals, 2)
<ide> }
<ide>
<del>func (s DockerExternalVolumeSuite) TestStartExternalVolumeDriverDeleteContainer(c *check.C) {
<add>func (s DockerExternalVolumeSuite) TestExternalVolumeDriverDeleteContainer(c *check.C) {
<ide> err := s.d.StartWithBusybox()
<ide> c.Assert(err, checker.IsNil)
<ide>
<ide> func hostVolumePath(name string) string {
<ide> return fmt.Sprintf("/var/lib/docker/volumes/%s", name)
<ide> }
<ide>
<del>func (s *DockerExternalVolumeSuite) TestStartExternalNamedVolumeDriverCheckBindLocalVolume(c *check.C) {
<add>func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverNamedCheckBindLocalVolume(c *check.C) {
<ide> err := s.d.StartWithBusybox()
<ide> c.Assert(err, checker.IsNil)
<ide>
<ide> expected := s.server.URL
<del>
<ide> dockerfile := fmt.Sprintf(`FROM busybox:latest
<ide> RUN mkdir /nobindthenlocalvol
<ide> RUN echo %s > /nobindthenlocalvol/test
<ide> func (s *DockerExternalVolumeSuite) TestStartExternalNamedVolumeDriverCheckBindL
<ide> }
<ide>
<ide> // Make sure a request to use a down driver doesn't block other requests
<del>func (s *DockerExternalVolumeSuite) TestStartExternalVolumeDriverLookupNotBlocked(c *check.C) {
<add>func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverLookupNotBlocked(c *check.C) {
<ide> specPath := "/etc/docker/plugins/down-driver.spec"
<ide> err := ioutil.WriteFile("/etc/docker/plugins/down-driver.spec", []byte("tcp://127.0.0.7:9999"), 0644)
<ide> c.Assert(err, checker.IsNil)
<ide> func (s *DockerExternalVolumeSuite) TestStartExternalVolumeDriverLookupNotBlocke
<ide> cmd2.Process.Kill()
<ide> }
<ide> }
<del>
<del>func (s *DockerExternalVolumeSuite) TestStartExternalVolumeDriverRetryNotImmediatelyExists(c *check.C) {
<add>func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverRetryNotImmediatelyExists(c *check.C) {
<ide> err := s.d.StartWithBusybox()
<ide> c.Assert(err, checker.IsNil)
<ide>
<ide> func (s *DockerExternalVolumeSuite) TestStartExternalVolumeDriverRetryNotImmedia
<ide> go func() {
<ide> // wait for a retry to occur, then create spec to allow plugin to register
<ide> time.Sleep(2000 * time.Millisecond)
<del> if err := ioutil.WriteFile(specPath, []byte(s.server.URL), 0644); err != nil {
<del> c.Fatal(err)
<del> }
<add> // no need to check for an error here since it will get picked up by the timeout later
<add> ioutil.WriteFile(specPath, []byte(s.server.URL), 0644)
<ide> }()
<ide>
<ide> select {
<ide> func (s *DockerExternalVolumeSuite) TestStartExternalVolumeDriverRetryNotImmedia
<ide> c.Assert(s.ec.unmounts, checker.Equals, 1)
<ide> }
<ide>
<del>func (s *DockerExternalVolumeSuite) TestStartExternalVolumeDriverBindExternalVolume(c *check.C) {
<add>func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverBindExternalVolume(c *check.C) {
<ide> dockerCmd(c, "volume", "create", "-d", "test-external-volume-driver", "--name", "foo")
<ide> dockerCmd(c, "run", "-d", "--name", "testing", "-v", "foo:/bar", "busybox", "top")
<ide> | 1 |
PHP | PHP | remove odd inflection | a4740f02f1cac194b5013c63704f2da9c09c0831 | <ide><path>lib/Cake/Controller/Component/AclComponent.php
<ide> class AclComponent extends Component {
<ide> */
<ide> public function __construct(ComponentCollection $collection, $settings = array()) {
<ide> parent::__construct($collection, $settings);
<del> $name = Inflector::camelize(strtolower(Configure::read('Acl.classname')));
<add> $name = Configure::read('Acl.classname');
<ide> if (!class_exists($name)) {
<ide> list($plugin, $name) = pluginSplit($name, true);
<ide> App::uses($name . 'Component', $plugin . 'Controller/Component'); | 1 |
Go | Go | add support for ingress lb in localhost | 04f3247c3dc9f873c12c5eac014de3afbf2e58ea | <ide><path>libnetwork/service_linux.go
<ide> import (
<ide> "net"
<ide> "os"
<ide> "os/exec"
<add> "path/filepath"
<ide> "runtime"
<ide> "strconv"
<ide> "strings"
<ide> import (
<ide> "github.com/docker/docker/pkg/reexec"
<ide> "github.com/docker/libnetwork/iptables"
<ide> "github.com/docker/libnetwork/ipvs"
<add> "github.com/docker/libnetwork/ns"
<ide> "github.com/gogo/protobuf/proto"
<ide> "github.com/vishvananda/netlink/nl"
<ide> "github.com/vishvananda/netns"
<ide> func programIngress(gwIP net.IP, ingressPorts []*PortConfig, isDelete bool) erro
<ide> }
<ide> }
<ide> }
<add>
<add> oifName, err := findOIFName(gwIP)
<add> if err != nil {
<add> return fmt.Errorf("failed to find gateway bridge interface name for %s: %v", gwIP, err)
<add> }
<add>
<add> path := filepath.Join("/proc/sys/net/ipv4/conf", oifName, "route_localnet")
<add> if err := ioutil.WriteFile(path, []byte{'1', '\n'}, 0644); err != nil {
<add> return fmt.Errorf("could not write to %s: %v", path, err)
<add> }
<add>
<add> ruleArgs := strings.Fields(fmt.Sprintf("-m addrtype --src-type LOCAL -o %s -j MASQUERADE", oifName))
<add> if !iptables.Exists(iptables.Nat, "POSTROUTING", ruleArgs...) {
<add> if err := iptables.RawCombinedOutput(append([]string{"-t", "nat", "-I", "POSTROUTING"}, ruleArgs...)...); err != nil {
<add> return fmt.Errorf("failed to add ingress localhost POSTROUTING rule for %s: %v", oifName, err)
<add> }
<add> }
<ide> }
<ide>
<ide> for _, iPort := range ingressPorts {
<ide> func programIngress(gwIP net.IP, ingressPorts []*PortConfig, isDelete bool) erro
<ide> return nil
<ide> }
<ide>
<add>func findOIFName(ip net.IP) (string, error) {
<add> nlh := ns.NlHandle()
<add>
<add> routes, err := nlh.RouteGet(ip)
<add> if err != nil {
<add> return "", err
<add> }
<add>
<add> if len(routes) == 0 {
<add> return "", fmt.Errorf("no route to %s", ip)
<add> }
<add>
<add> // Pick the first route(typically there is only one route). We
<add> // don't support multipath.
<add> link, err := nlh.LinkByIndex(routes[0].LinkIndex)
<add> if err != nil {
<add> return "", err
<add> }
<add>
<add> return link.Attrs().Name, nil
<add>}
<add>
<ide> func plumbProxy(iPort *PortConfig, isDelete bool) error {
<ide> var (
<ide> err error | 1 |
Javascript | Javascript | add test for email change | 968c6f77009dd8f1317c9fc5176dbe05174de509 | <ide><path>cypress/integration/settings/email-change.js
<add>/* global cy */
<add>describe('Email input field', () => {
<add> before(() => {
<add> cy.login();
<add> cy.visit('/settings');
<add> });
<add>
<add> it('Should be possible to submit the new email', () => {
<add> cy.get('[id=new-email]')
<add> .type('[email protected]')
<add> .should('have.attr', 'value', '[email protected]');
<add>
<add> cy.get('[id=confirm-email]')
<add> .type('[email protected]')
<add> .should('have.attr', 'value', '[email protected]');
<add>
<add> cy.get('[id=form-update-email]').within(() => {
<add> cy.contains('Save').click();
<add> });
<add> });
<add>
<add> it('Displays an error message when there are problems with the submitted emails', () => {
<add> cy.get('[id=confirm-email]').clear().type('[email protected]');
<add>
<add> cy.get('[class=help-block]').contains(
<add> 'Both new email addresses must be the same'
<add> );
<add>
<add> cy.get('[id=new-email]').clear().type('[email protected]');
<add>
<add> cy.get('[class=help-block]').contains(
<add> 'This email is the same as your current email'
<add> );
<add> });
<add>
<add> it('Should be possible to get Quincys weekly email', () => {
<add> cy.contains('Yes please').click();
<add> });
<add>}); | 1 |
Text | Text | update configuring and running docker article | 9bfe6f0d24a9eb85c7689bc696487d9f016a67d4 | <ide><path>docs/sources/articles/configuring.md
<del>page_title: Configuring Docker
<del>page_description: Configuring the Docker daemon on various distributions
<del>page_keywords: docker, daemon, configuration
<add>page_title: Configuring and running Docker
<add>page_description: Configuring and running the Docker daemon on various distributions
<add>page_keywords: docker, daemon, configuration, running, process managers
<ide>
<del># Configuring Docker on various distributions
<add># Configuring and running Docker on various distributions
<ide>
<del>After successfully installing Docker, the `docker` daemon runs with it's default
<del>configuration. You can configure the `docker` daemon by passing configuration
<del>flags to it directly when you start it.
<add>After successfully installing Docker, the `docker` daemon runs with its default
<add>configuration.
<ide>
<ide> In a production environment, system administrators typically configure the
<del>`docker` daemon to start and stop according to an organization's requirements. In most
<add>`docker` daemon to start and stop according to an organization's requirements. In most
<ide> cases, the system administrator configures a process manager such as `SysVinit`, `Upstart`,
<ide> or `systemd` to manage the `docker` daemon's start and stop.
<ide>
<add>### Running the docker daemon directly
<add>
<add>The `docker` daemon can be run directly using the `-d` option. By default it listens on
<add>the Unix socket `unix:///var/run/docker.sock`
<add>
<add> $ docker -d
<add>
<add> INFO[0000] +job init_networkdriver()
<add> INFO[0000] +job serveapi(unix:///var/run/docker.sock)
<add> INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
<add> ...
<add> ...
<add>
<add>### Configuring the docker daemon directly
<add>
<add>If you're running the `docker` daemon directly by running `docker -d` instead
<add>of using a process manager, you can append the configuration options to the `docker` run
<add>command directly. Just like the `-d` option, other options can be passed to the `docker`
<add>daemon to configure it.
<add>
<ide> Some of the daemon's options are:
<ide>
<ide> | Flag | Description |
<ide> |-----------------------|-----------------------------------------------------------|
<del>| `-D`, `--debug=false` | Enable or disable debug mode. By default, this is false. |
<add>| `-D`, `--debug=false` | Enable or disable debug mode. By default, this is false. |
<ide> | `-H`,`--host=[]` | Daemon socket(s) to connect to. |
<ide> | `--tls=false` | Enable or disable TLS. By default, this is false. |
<ide>
<del>The command line reference has the [complete list of daemon flags](/reference/commandline/cli/#daemon).
<del>
<del>## Direct Configuration
<del>
<del>If you're running the `docker` daemon directly by running `docker -d` instead of using a process manager,
<del>you can append the config options to the run command directly.
<ide>
<add>Here is a an example of running the `docker` daemon with configuration options:
<ide>
<del>Here is a an example of running the `docker` daemon with config options:
<add> $ docker -d -D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376
<ide>
<del> docker -d -D --tls=false -H tcp://0.0.0.0:2375
<add>These options :
<ide>
<del>These options :
<del>
<del>- Enable `-D` (debug) mode
<del>- Set `tls` to false
<del>- Listen for connections on `tcp://0.0.0.0:2375`
<add>- Enable `-D` (debug) mode
<add>- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
<add>- Listen for connections on `tcp://192.168.59.3:2376`
<ide>
<add>The command line reference has the [complete list of daemon flags](/reference/commandline/cli/#daemon)
<add>with explanations.
<ide>
<ide> ## Ubuntu
<ide>
<del>After successfully [installing Docker for Ubuntu](/installation/ubuntulinux/), you can check the
<del>running status using Upstart in this way:
<add>As of `14.04`, Ubuntu uses Upstart as a process manager. By default, Upstart jobs
<add>are located in `/etc/init` and the `docker` Upstart job can be found at `/etc/init/docker.conf`.
<add>
<add>After successfully [installing Docker for Ubuntu](/installation/ubuntulinux/),
<add>you can check the running status using Upstart in this way:
<ide>
<ide> $ sudo status docker
<add>
<ide> docker start/running, process 989
<ide>
<del>You can start/stop/restart `docker` using
<add>### Running Docker
<add>
<add>You can start/stop/restart the `docker` daemon using
<ide>
<ide> $ sudo start docker
<ide>
<ide> You can start/stop/restart `docker` using
<ide> ### Configuring Docker
<ide>
<ide> You configure the `docker` daemon in the `/etc/default/docker` file on your
<del>system. You do this by specifying values in a `DOCKER_OPTS` variable.
<del>To configure Docker options:
<add>system. You do this by specifying values in a `DOCKER_OPTS` variable.
<ide>
<del>1. Log into your system as a user with `sudo` or `root` privileges.
<add>To configure Docker options:
<ide>
<del>2. If you don't have one, create the `/etc/default/docker` file in your system.
<add>1. Log into your host as a user with `sudo` or `root` privileges.
<ide>
<del> Depending on how you installed Docker, you may already have this file.
<add>2. If you don't have one, create the `/etc/default/docker` file on your host. Depending on how
<add>you installed Docker, you may already have this file.
<ide>
<ide> 3. Open the file with your favorite editor.
<ide>
<del> $ sudo vi /etc/default/docker
<del>
<add> ```
<add> $ sudo vi /etc/default/docker
<add> ```
<add>
<ide> 4. Add a `DOCKER_OPTS` variable with the following options. These options are appended to the
<ide> `docker` daemon's run command.
<ide>
<del> ```
<del> DOCKER_OPTS=" --dns 8.8.8.8 --dns 8.8.4.4 -D --tls=false -H tcp://0.0.0.0:2375 "
<del> ```
<del>
<del>These options :
<del>
<del>- Set `dns` server for all containers
<del>- Enable `-D` (debug) mode
<del>- Set `tls` to false
<del>- Listen for connections on `tcp://0.0.0.0:2375`
<del>
<add>```
<add> DOCKER_OPTS="-D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376"
<add>```
<add>
<add>These options :
<add>
<add>- Enable `-D` (debug) mode
<add>- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
<add>- Listen for connections on `tcp://192.168.59.3:2376`
<add>
<add>The command line reference has the [complete list of daemon flags](/reference/commandline/cli/#daemon)
<add>with explanations.
<add>
<add>
<ide> 5. Save and close the file.
<ide>
<ide> 6. Restart the `docker` daemon.
<ide>
<del> $ sudo restart docker
<add> ```
<add> $ sudo restart docker
<add> ```
<add>
<add>7. Verify that the `docker` daemon is running as specified with the `ps` command.
<add>
<add> ```
<add> $ ps aux | grep docker | grep -v grep
<add> ```
<add>
<add>### Logs
<add>
<add>By default logs for Upstart jobs are located in `/var/log/upstart` and the logs for `docker` daemon
<add>can be located at `/var/log/upstart/docker.log`
<add>
<add> $ tail -f /var/log/upstart/docker.log
<add> INFO[0000] Loading containers: done.
<add> INFO[0000] docker daemon: 1.6.0 4749651; execdriver: native-0.2; graphdriver: aufs
<add> INFO[0000] +job acceptconnections()
<add> INFO[0000] -job acceptconnections() = OK (0)
<add> INFO[0000] Daemon has completed initialization
<add>
<add>
<add>## CentOS / Red Hat Enterprise Linux / Fedora
<add>
<add>As of `7.x`, CentOS and RHEL use `systemd` as the process manager. As of `21`, Fedora uses
<add>`systemd` as its process manager.
<add>
<add>After successfully installing Docker for [CentOS](/installation/centos/)/[Red Hat Enterprise Linux]
<add>(/installation/rhel/)/[Fedora](/installation/fedora), you can check the running status in this way:
<add>
<add> $ sudo systemctl status docker
<add>
<add>### Running Docker
<add>
<add>You can start/stop/restart the `docker` daemon using
<add>
<add> $ sudo systemctl start docker
<add>
<add> $ sudo systemctl stop docker
<add>
<add> $ sudo systemctl restart docker
<add>
<add>If you want Docker to start at boot, you should also:
<add>
<add> $ sudo systemctl enable docker
<add>
<add>### Configuring Docker
<add>
<add>You configure the `docker` daemon in the `/etc/sysconfig/docker` file on your
<add>host. You do this by specifying values in a variable. For CentOS 7.x and RHEL 7.x, the name
<add>of the variable is `OPTIONS` and for CentOS 6.x and RHEL 6.x, the name of the variable is
<add>`other_args`. For this section, we will use CentOS 7.x as an example to configure the `docker`
<add>daemon.
<add>
<add>By default, systemd services are located either in `/etc/systemd/service`, `/lib/systemd/system`
<add>or `/usr/lib/systemd/system`. The `docker.service` file can be found in either of these three
<add>directories depending on your host.
<add>
<add>To configure Docker options:
<add>
<add>1. Log into your host as a user with `sudo` or `root` privileges.
<add>
<add>2. If you don't have one, create the `/etc/sysconfig/docker` file on your host. Depending on how
<add>you installed Docker, you may already have this file.
<add>
<add>3. Open the file with your favorite editor.
<add>
<add> ```
<add> $ sudo vi /etc/sysconfig/docker
<add> ```
<add>
<add>4. Add a `OPTIONS` variable with the following options. These options are appended to the
<add>command that starts the `docker` daemon.
<add>
<add>```
<add> OPTIONS="-D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376"
<add>```
<add>
<add>These options :
<add>
<add>- Enable `-D` (debug) mode
<add>- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
<add>- Listen for connections on `tcp://192.168.59.3:2376`
<add>
<add>The command line reference has the [complete list of daemon flags](/reference/commandline/cli/#daemon)
<add>with explanations.
<add>
<add>5. Save and close the file.
<add>
<add>6. Restart the `docker` daemon.
<add>
<add> ```
<add> $ sudo service docker restart
<add> ```
<add>
<add>7. Verify that the `docker` daemon is running as specified with the `ps` command.
<add>
<add> ```
<add> $ ps aux | grep docker | grep -v grep
<add> ```
<add>
<add>### Logs
<add>
<add>systemd has its own logging system called the journal. The logs for the `docker` daemon can
<add>be viewed using `journalctl -u docker`
<ide>
<del>7. Verify that the `docker` daemon is running as specified wit the `ps` command.
<add> $ sudo journalctl -u docker
<add> May 06 00:22:05 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
<add> May 06 00:22:05 localhost.localdomain docker[2495]: time="2015-05-06T00:22:05Z" level="info" msg="+job serveapi(unix:///var/run/docker.sock)"
<add> May 06 00:22:05 localhost.localdomain docker[2495]: time="2015-05-06T00:22:05Z" level="info" msg="Listening for HTTP on unix (/var/run/docker.sock)"
<add> May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="+job init_networkdriver()"
<add> May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="-job init_networkdriver() = OK (0)"
<add> May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="Loading containers: start."
<add> May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="Loading containers: done."
<add> May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="docker daemon: 1.5.0-dev fc0329b/1.5.0; execdriver: native-0.2; graphdriver: devicemapper"
<add> May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="+job acceptconnections()"
<add> May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="-job acceptconnections() = OK (0)"
<ide>
<del> $ ps aux | grep docker | grep -v grep
<add>_Note: Using and configuring journal is an advanced topic and is beyond the scope of this article._ | 1 |
Python | Python | fix schedule_interval in decorated dags | c982080ca1c824dd26c452bcb420df0f3da1afa8 | <ide><path>airflow/models/dag.py
<ide> def dag(
<ide> jinja_environment_kwargs: Optional[Dict] = None,
<ide> render_template_as_native_obj: bool = False,
<ide> tags: Optional[List[str]] = None,
<del> schedule: Optional[ScheduleArg] = None,
<add> schedule: ScheduleArg = NOTSET,
<ide> owner_links: Optional[Dict[str, str]] = None,
<ide> ) -> Callable[[Callable], Callable[..., DAG]]:
<ide> """
<ide><path>tests/models/test_dag.py
<ide> def test_following_previous_schedule_daily_dag_cet_to_cest(self):
<ide>
<ide> def test_following_schedule_relativedelta(self):
<ide> """
<del> Tests following_schedule a dag with a relativedelta schedule_interval
<add> Tests following_schedule a dag with a relativedelta schedule
<ide> """
<ide> dag_id = "test_schedule_dag_relativedelta"
<ide> delta = relativedelta(hours=+1)
<ide> def test_following_schedule_relativedelta(self):
<ide> _next = dag.following_schedule(_next)
<ide> assert _next.isoformat() == "2015-01-02T02:00:00+00:00"
<ide>
<add> def test_following_schedule_relativedelta_with_deprecated_schedule_interval(self):
<add> """
<add> Tests following_schedule a dag with a relativedelta schedule_interval
<add> """
<add> dag_id = "test_schedule_dag_relativedelta"
<add> delta = relativedelta(hours=+1)
<add> dag = DAG(dag_id=dag_id, schedule_interval=delta)
<add> dag.add_task(BaseOperator(task_id="faketastic", owner='Also fake', start_date=TEST_DATE))
<add>
<add> _next = dag.following_schedule(TEST_DATE)
<add> assert _next.isoformat() == "2015-01-02T01:00:00+00:00"
<add>
<add> _next = dag.following_schedule(_next)
<add> assert _next.isoformat() == "2015-01-02T02:00:00+00:00"
<add>
<add> def test_following_schedule_relativedelta_with_depr_schedule_interval_decorated_dag(self):
<add> """
<add> Tests following_schedule a dag with a relativedelta schedule_interval
<add> using decorated dag
<add> """
<add> from airflow.decorators import dag
<add>
<add> dag_id = "test_schedule_dag_relativedelta"
<add> delta = relativedelta(hours=+1)
<add>
<add> @dag(dag_id=dag_id, schedule_interval=delta)
<add> def mydag():
<add> BaseOperator(task_id="faketastic", owner='Also fake', start_date=TEST_DATE)
<add>
<add> _dag = mydag()
<add>
<add> _next = _dag.following_schedule(TEST_DATE)
<add> assert _next.isoformat() == "2015-01-02T01:00:00+00:00"
<add>
<add> _next = _dag.following_schedule(_next)
<add> assert _next.isoformat() == "2015-01-02T02:00:00+00:00"
<add>
<ide> def test_previous_schedule_datetime_timezone(self):
<ide> # Check that we don't get an AttributeError 'name' for self.timezone
<ide> | 2 |
PHP | PHP | fix dots in attribute names | 2d1d96272a94bce123676ed742af2d80ba628ba4 | <ide><path>src/Illuminate/View/DynamicComponent.php
<ide> public function __construct(string $component)
<ide> public function render()
<ide> {
<ide> $template = <<<'EOF'
<del><?php extract(collect($attributes->getAttributes())->mapWithKeys(function ($value, $key) { return [Illuminate\Support\Str::camel(str_replace(':', ' ', $key)) => $value]; })->all(), EXTR_SKIP); ?>
<add><?php extract(collect($attributes->getAttributes())->mapWithKeys(function ($value, $key) { return [Illuminate\Support\Str::camel(str_replace([':', '.'], ' ', $key)) => $value]; })->all(), EXTR_SKIP); ?>
<ide> {{ props }}
<ide> <x-{{ component }} {{ bindings }} {{ attributes }}>
<ide> {{ slots }}
<ide> protected function compileProps(array $bindings)
<ide> protected function compileBindings(array $bindings)
<ide> {
<ide> return collect($bindings)->map(function ($key) {
<del> return ':'.$key.'="$'.Str::camel(str_replace(':', ' ', $key)).'"';
<add> return ':'.$key.'="$'.Str::camel(str_replace([':', '.'], ' ', $key)).'"';
<ide> })->implode(' ');
<ide> }
<ide>
<ide><path>tests/Integration/View/BladeTest.php
<ide> public function test_rendering_a_dynamic_component()
<ide> {
<ide> $view = View::make('uses-panel-dynamically', ['name' => 'Taylor'])->render();
<ide>
<del> $this->assertEquals('<div class="ml-2" wire:model="foo">
<add> $this->assertEquals('<div class="ml-2" wire:model="foo" wire:model.lazy="bar">
<ide> Hello Taylor
<ide> </div>', trim($view));
<ide> }
<ide><path>tests/Integration/View/templates/uses-panel-dynamically.blade.php
<del><x-dynamic-component component="panel" class="ml-2" :name="$name" wire:model="foo">
<add><x-dynamic-component component="panel" class="ml-2" :name="$name" wire:model="foo" wire:model.lazy="bar">
<ide> Panel contents
<ide> </x-dynamic-component> | 3 |
Javascript | Javascript | view => emptyview | bb4492a3ca9afe2680d5d37b2d01238e74972a3c | <ide><path>lib/sproutcore-views/lib/views/collection_view.js
<ide> SC.CollectionView = SC.View.extend({
<ide>
<ide> this.set('emptyView', emptyView);
<ide> emptyView.createElement().$().appendTo(elem);
<del> this.childViews = [view];
<add> this.childViews = [emptyView];
<ide> }
<ide> }
<ide> }); | 1 |
Go | Go | add test for unmarshal default profile | a692823413a9b4a3ae8041f527beb915c3bd5bde | <ide><path>profiles/seccomp/seccomp_test.go
<ide> package seccomp // import "github.com/docker/docker/profiles/seccomp"
<ide>
<ide> import (
<add> "encoding/json"
<ide> "io/ioutil"
<ide> "testing"
<ide>
<ide> "github.com/opencontainers/runtime-spec/specs-go"
<add> "gotest.tools/v3/assert"
<ide> )
<ide>
<ide> func TestLoadProfile(t *testing.T) {
<ide> func TestLoadDefaultProfile(t *testing.T) {
<ide> }
<ide> }
<ide>
<add>func TestUnmarshalDefaultProfile(t *testing.T) {
<add> expected := DefaultProfile()
<add> if expected == nil {
<add> t.Skip("seccomp not supported")
<add> }
<add>
<add> f, err := ioutil.ReadFile("default.json")
<add> if err != nil {
<add> t.Fatal(err)
<add> }
<add> var profile Seccomp
<add> err = json.Unmarshal(f, &profile)
<add> if err != nil {
<add> t.Fatal(err)
<add> }
<add> assert.DeepEqual(t, expected.Architectures, profile.Architectures)
<add> assert.DeepEqual(t, expected.ArchMap, profile.ArchMap)
<add> assert.DeepEqual(t, expected.DefaultAction, profile.DefaultAction)
<add> assert.DeepEqual(t, expected.Syscalls, profile.Syscalls)
<add>}
<add>
<ide> func TestLoadConditional(t *testing.T) {
<ide> f, err := ioutil.ReadFile("fixtures/conditional_include.json")
<ide> if err != nil { | 1 |
PHP | PHP | remove dead code and prevent notices | f80916ef177c95346b8d3b1f7a37ae42a907036b | <ide><path>src/Routing/Filter/AssetFilter.php
<ide> protected function _getAssetFile($url) {
<ide> $parts = explode('/', $url);
<ide> $pluginPart = [];
<ide> for ($i = 0; $i < 2; $i++) {
<add> if (!isset($parts[$i])) {
<add> break;
<add> }
<ide> $pluginPart[] = Inflector::camelize($parts[$i]);
<ide> $plugin = implode('/', $pluginPart);
<del> if ($plugin && Plugin::loaded($plugin)) {
<add> if (Plugin::loaded($plugin)) {
<ide> $parts = array_slice($parts, $i + 1);
<ide> $fileFragment = implode(DS, $parts);
<ide> $pluginWebroot = Plugin::path($plugin) . 'webroot' . DS; | 1 |
Javascript | Javascript | use imageloader native module | 7455ae48b365af1d68964fdd4ab662a113ac1a4a | <ide><path>Libraries/Image/Image.ios.js
<ide> const resolveAssetSource = require('./resolveAssetSource');
<ide>
<ide> import type {ImageProps as ImagePropsType} from './ImageProps';
<ide> import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
<add>
<ide> import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
<add>import NativeImageLoader from './NativeImageLoader';
<ide>
<ide> const ImageViewManager = NativeModules.ImageViewManager;
<ide> const RCTImageView: HostComponent<mixed> = requireNativeComponent(
<ide> function getSize(
<ide> success: (width: number, height: number) => void,
<ide> failure?: (error: any) => void,
<ide> ) {
<del> ImageViewManager.getSize(
<del> uri,
<del> success,
<del> failure ||
<del> function() {
<del> console.warn('Failed to get size for image: ' + uri);
<del> },
<del> );
<add> NativeImageLoader.getSize(uri)
<add> .then(([width, height]) => success(width, height))
<add> .catch(
<add> failure ||
<add> function() {
<add> console.warn('Failed to get size for image ' + uri);
<add> },
<add> );
<ide> }
<ide>
<ide> function getSizeWithHeaders( | 1 |
Ruby | Ruby | remove the authorized check for now | 35ffec2c489bead9cc7f9c0525e9c63dc04e3038 | <ide><path>lib/action_cable/channel/base.rb
<ide> def initialize(connection, identifier, params = {})
<ide> # that the action requested is a public method on the channel declared by the user (so not one of the callbacks
<ide> # like #subscribed).
<ide> def process_action(data)
<del> if authorized?
<del> action = extract_action(data)
<del>
<del> if processable_action?(action)
<del> logger.info action_signature(action, data)
<del> public_send action, data
<del> else
<del> logger.error "Unable to process #{action_signature(action, data)}"
<del> end
<add> action = extract_action(data)
<add>
<add> if processable_action?(action)
<add> logger.info action_signature(action, data)
<add> public_send action, data
<ide> else
<del> unauthorized
<add> logger.error "Unable to process #{action_signature(action, data)}"
<ide> end
<ide> end
<ide>
<ide> def unsubscribe_from_channel
<ide>
<ide>
<ide> protected
<del> # Override in subclasses
<del> def authorized?
<del> true
<del> end
<del>
<del> def unauthorized
<del> logger.error "#{channel_name}: Unauthorized access"
<del> end
<del>
<ide> # Called once a consumer has become a subscriber of the channel. Usually the place to setup any streams
<ide> # you want this channel to be sending to the subscriber.
<ide> def subscribed
<ide> def unsubscribed
<ide> # Transmit a hash of data to the subscriber. The hash will automatically be wrapped in a JSON envelope with
<ide> # the proper channel identifier marked as the recipient.
<ide> def transmit(data, via: nil)
<del> if authorized?
<del> logger.info "#{channel_name} transmitting #{data.inspect}".tap { |m| m << " (via #{via})" if via }
<del> connection.transmit({ identifier: @identifier, message: data }.to_json)
<del> else
<del> unauthorized
<del> end
<add> logger.info "#{channel_name} transmitting #{data.inspect}".tap { |m| m << " (via #{via})" if via }
<add> connection.transmit({ identifier: @identifier, message: data }.to_json)
<ide> end
<ide>
<ide> | 1 |
Text | Text | fix an oxford comma | 7549f830a2b5e2ae7fcfc8f471551f0be0922cca | <ide><path>guides/source/getting_started.md
<ide> of the files and folders that Rails created by default:
<ide>
<ide> | File/Folder | Purpose |
<ide> | ----------- | ------- |
<del>|app/|Contains the controllers, models, views, helpers, mailers, channels, jobs and assets for your application. You'll focus on this folder for the remainder of this guide.|
<add>|app/|Contains the controllers, models, views, helpers, mailers, channels, jobs, and assets for your application. You'll focus on this folder for the remainder of this guide.|
<ide> |bin/|Contains the rails script that starts your app and can contain other scripts you use to setup, update, deploy, or run your application.|
<ide> |config/|Configure your application's routes, database, and more. This is covered in more detail in [Configuring Rails Applications](configuring.html).|
<ide> |config.ru|Rack configuration for Rack based servers used to start the application. For more information about Rack, see the [Rack website](https://rack.github.io/).| | 1 |
Python | Python | fix regression test for #771 | ec588c7896b70bf07a1b2ee00977ef4bc177729e | <ide><path>numpy/core/tests/test_regression.py
<ide> def test_copy_detection_corner_case2(self, level=rlevel):
<ide> """Ticket #771: strides are not set correctly when reshaping 0-sized
<ide> arrays"""
<ide> b = np.indices((0,3,4)).T.reshape(-1,3)
<del> assert_equal(b.strides, (24, 4))
<add> assert_equal(b.strides, (12, 4))
<ide>
<ide> def test_object_array_refcounting(self, level=rlevel):
<ide> """Ticket #633""" | 1 |
Python | Python | fix pytorch bilstm | afeddfff261a39635361e56c293ae371cf219ed2 | <ide><path>spacy/_ml.py
<ide>
<ide> try:
<ide> import torch.nn
<add> from thinc.extra.wrappers import PyTorchWrapperRNN
<ide> except:
<ide> torch = None
<ide>
<ide> def link_vectors_to_models(vocab):
<ide>
<ide> def PyTorchBiLSTM(nO, nI, depth, dropout=0.2):
<ide> if depth == 0:
<del> return noop()
<add> return layerize(noop())
<ide> model = torch.nn.LSTM(nI, nO//2, depth, bidirectional=True, dropout=dropout)
<ide> return with_square_sequences(PyTorchWrapperRNN(model))
<ide>
<ide> def Tok2Vec(width, embed_size, **kwargs):
<ide> ExtractWindow(nW=1)
<ide> >> LN(Maxout(width, width*3, pieces=cnn_maxout_pieces))
<ide> )
<del>
<ide> tok2vec = (
<ide> FeatureExtracter(cols)
<ide> >> with_flatten( | 1 |
Text | Text | correct javascript example in guide [ci skip] | 768a081751482a3e09d7051e205b39fcb97492d2 | <ide><path>guides/source/working_with_javascript_in_rails.md
<ide> respond to your Ajax request. You then have a corresponding
<ide> code that will be sent and executed on the client side.
<ide>
<ide> ```erb
<del>$("<%= escape_javascript(render @user) %>").appendTo("#users");
<add>$("#users").appendTo("<%= raw escape_javascript(render @user) %>");
<ide> ```
<ide>
<ide> Turbolinks | 1 |
Java | Java | remove unnecessary suppressing of deprecation | bc13d2b5589b7b4573485ccfe8f59519e7ff6f49 | <ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/CookieLocaleResolver.java
<ide> * @see #setDefaultLocale
<ide> * @see #setDefaultTimeZone
<ide> */
<del>@SuppressWarnings("deprecation")
<ide> public class CookieLocaleResolver extends AbstractLocaleContextResolver {
<ide>
<ide> /** | 1 |
Javascript | Javascript | add regression test for 512 bits dh key | cddf358f682349dea22e78ce8df5afe26cd5cd1c | <ide><path>test/parallel/test-tls-client-mindhsize.js
<ide> function testDHE2048() {
<ide>
<ide> testDHE1024();
<ide>
<add>assert.throws(() => test(512, true, assert.fail),
<add> /DH parameter is less than 1024 bits/);
<add>
<ide> process.on('exit', function() {
<ide> assert.equal(nsuccess, 1);
<ide> assert.equal(nerror, 1); | 1 |
Javascript | Javascript | remove usage of public require('util') | cd3a9eebca8d4914d1599855d813ea68ed3135cc | <ide><path>lib/https.js
<ide> require('internal/util').assertCrypto();
<ide>
<ide> const tls = require('tls');
<ide> const url = require('url');
<del>const util = require('util');
<ide> const { Agent: HttpAgent } = require('_http_agent');
<ide> const {
<ide> Server: HttpServer,
<ide> _connectionListener,
<ide> kServerResponse
<ide> } = require('_http_server');
<ide> const { ClientRequest } = require('_http_client');
<del>const { inherits } = util;
<del>const debug = util.debuglog('https');
<add>const debug = require('internal/util/debuglog').debuglog('https');
<ide> const { URL, urlToOptions, searchParamsSymbol } = require('internal/url');
<ide> const { IncomingMessage, ServerResponse } = require('http');
<ide> const { kIncomingMessage } = require('_http_common');
<ide> function Server(opts, requestListener) {
<ide> this.maxHeadersCount = null;
<ide> this.headersTimeout = 40 * 1000; // 40 seconds
<ide> }
<del>inherits(Server, tls.Server);
<add>Object.setPrototypeOf(Server.prototype, tls.Server.prototype);
<add>Object.setPrototypeOf(Server, tls.Server);
<ide>
<ide> Server.prototype.setTimeout = HttpServer.prototype.setTimeout;
<ide> | 1 |
Python | Python | add tests for casting output parameters | ced013e6beb0e9cc8655a586579ac4fd3ac29551 | <ide><path>numpy/core/tests/test_ufunc.py
<ide> def test_where_param(self):
<ide> np.subtract(a, 2, out=a, where=[True,False])
<ide> assert_equal(a, [[0, 27], [14, 5]])
<ide>
<add> # With casting on output
<add> a = np.ones(10, np.int64)
<add> b = np.ones(10, np.int64)
<add> c = np.ones(10, np.float64)
<add> np.add(a, b, out=c, where=[1,0,0,1,0,0,1,1,1,0])
<add> assert_equal(c, [2,1,1,2,1,1,2,2,2,1])
<add>
<ide> if __name__ == "__main__":
<ide> run_module_suite() | 1 |
Go | Go | use hcsshim osversion package for windows versions | 6b91ceff74f41f8cbf5c183011764b801f71a221 | <ide><path>cmd/dockerd/service_windows.go
<ide> import (
<ide> "time"
<ide> "unsafe"
<ide>
<del> "github.com/docker/docker/pkg/system"
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> "github.com/sirupsen/logrus"
<ide> "github.com/spf13/pflag"
<ide> "golang.org/x/sys/windows"
<ide> func registerService() error {
<ide>
<ide> // This dependency is required on build 14393 (RS1)
<ide> // it is added to the platform in newer builds
<del> if system.GetOSVersion().Build == 14393 {
<add> if osversion.Build() == osversion.RS1 {
<ide> depends = append(depends, "ConDrv")
<ide> }
<ide>
<ide><path>daemon/daemon_windows.go
<ide> import (
<ide> "strings"
<ide>
<ide> "github.com/Microsoft/hcsshim"
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> "github.com/docker/docker/api/types"
<ide> containertypes "github.com/docker/docker/api/types/container"
<ide> "github.com/docker/docker/container"
<ide> func verifyPlatformContainerResources(resources *containertypes.Resources, isHyp
<ide> return warnings, fmt.Errorf("range of CPUs is from 0.01 to %d.00, as there are only %d CPUs available", sysinfo.NumCPU(), sysinfo.NumCPU())
<ide> }
<ide>
<del> osv := system.GetOSVersion()
<del> if resources.NanoCPUs > 0 && isHyperv && osv.Build < 16175 {
<add> if resources.NanoCPUs > 0 && isHyperv && osversion.Build() < osversion.RS3 {
<ide> leftoverNanoCPUs := resources.NanoCPUs % 1e9
<ide> if leftoverNanoCPUs != 0 && resources.NanoCPUs > 1e9 {
<ide> resources.NanoCPUs = ((resources.NanoCPUs + 1e9/2) / 1e9) * 1e9
<ide> func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.
<ide> if hostConfig == nil {
<ide> return nil, nil
<ide> }
<del> osv := system.GetOSVersion()
<ide> hyperv := daemon.runAsHyperVContainer(hostConfig)
<ide>
<ide> // On RS5, we allow (but don't strictly support) process isolation on Client SKUs.
<ide> // Prior to RS5, we don't allow process isolation on Client SKUs.
<ide> // @engine maintainers. This block should not be removed. It partially enforces licensing
<ide> // restrictions on Windows. Ping Microsoft folks if there are concerns or PRs to change this.
<del> if !hyperv && system.IsWindowsClient() && osv.Build < 17763 {
<add> if !hyperv && system.IsWindowsClient() && osversion.Build() < osversion.RS5 {
<ide> return warnings, fmt.Errorf("Windows client operating systems earlier than version 1809 can only run Hyper-V containers")
<ide> }
<ide>
<ide> func checkSystem() error {
<ide> if osv.MajorVersion < 10 {
<ide> return fmt.Errorf("This version of Windows does not support the docker daemon")
<ide> }
<del> if osv.Build < 14393 {
<add> if osversion.Build() < osversion.RS1 {
<ide> return fmt.Errorf("The docker daemon requires build 14393 or later of Windows Server 2016 or Windows 10")
<ide> }
<ide>
<ide> func initBridgeDriver(controller libnetwork.NetworkController, config *config.Co
<ide> winlibnetwork.NetworkName: runconfig.DefaultDaemonNetworkMode().NetworkName(),
<ide> }
<ide>
<del> var ipamOption libnetwork.NetworkOption
<del> var subnetPrefix string
<del>
<add> subnetPrefix := defaultNetworkSpace
<ide> if config.BridgeConfig.FixedCIDR != "" {
<ide> subnetPrefix = config.BridgeConfig.FixedCIDR
<del> } else {
<del> // TP5 doesn't support properly detecting subnet
<del> osv := system.GetOSVersion()
<del> if osv.Build < 14360 {
<del> subnetPrefix = defaultNetworkSpace
<del> }
<ide> }
<ide>
<del> if subnetPrefix != "" {
<del> ipamV4Conf := libnetwork.IpamConf{}
<del> ipamV4Conf.PreferredPool = subnetPrefix
<del> v4Conf := []*libnetwork.IpamConf{&ipamV4Conf}
<del> v6Conf := []*libnetwork.IpamConf{}
<del> ipamOption = libnetwork.NetworkOptionIpam("default", "", v4Conf, v6Conf, nil)
<del> }
<add> ipamV4Conf := libnetwork.IpamConf{PreferredPool: subnetPrefix}
<add> v4Conf := []*libnetwork.IpamConf{&ipamV4Conf}
<add> v6Conf := []*libnetwork.IpamConf{}
<add> ipamOption := libnetwork.NetworkOptionIpam("default", "", v4Conf, v6Conf, nil)
<ide>
<ide> _, err := controller.NewNetwork(string(runconfig.DefaultDaemonNetworkMode()), runconfig.DefaultDaemonNetworkMode().NetworkName(), "",
<ide> libnetwork.NetworkOptionGeneric(options.Generic{
<ide> func (daemon *Daemon) stats(c *container.Container) (*types.StatsJSON, error) {
<ide> // daemon to run in. This is only applicable on Windows
<ide> func (daemon *Daemon) setDefaultIsolation() error {
<ide> daemon.defaultIsolation = containertypes.Isolation("process")
<del> osv := system.GetOSVersion()
<ide>
<ide> // On client SKUs, default to Hyper-V. @engine maintainers. This
<ide> // should not be removed. Ping Microsoft folks is there are PRs to
<ide> func (daemon *Daemon) setDefaultIsolation() error {
<ide> daemon.defaultIsolation = containertypes.Isolation("hyperv")
<ide> }
<ide> if containertypes.Isolation(val).IsProcess() {
<del> if system.IsWindowsClient() && osv.Build < 17763 {
<add> if system.IsWindowsClient() && osversion.Build() < osversion.RS5 {
<ide> // On RS5, we allow (but don't strictly support) process isolation on Client SKUs.
<ide> // @engine maintainers. This block should not be removed. It partially enforces licensing
<ide> // restrictions on Windows. Ping Microsoft folks if there are concerns or PRs to change this.
<ide><path>daemon/graphdriver/windows/windows.go
<ide> import (
<ide> "github.com/Microsoft/go-winio/backuptar"
<ide> "github.com/Microsoft/go-winio/vhd"
<ide> "github.com/Microsoft/hcsshim"
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> "github.com/docker/docker/daemon/graphdriver"
<ide> "github.com/docker/docker/pkg/archive"
<ide> "github.com/docker/docker/pkg/containerfs"
<ide> "github.com/docker/docker/pkg/idtools"
<ide> "github.com/docker/docker/pkg/ioutils"
<ide> "github.com/docker/docker/pkg/longpath"
<ide> "github.com/docker/docker/pkg/reexec"
<del> "github.com/docker/docker/pkg/system"
<ide> units "github.com/docker/go-units"
<ide> "github.com/pkg/errors"
<ide> "github.com/sirupsen/logrus"
<ide> func (d *Driver) Remove(id string) error {
<ide> // it is a transient error. Retry until it succeeds.
<ide> var computeSystems []hcsshim.ContainerProperties
<ide> retryCount := 0
<del> osv := system.GetOSVersion()
<ide> for {
<ide> // Get and terminate any template VMs that are currently using the layer.
<ide> // Note: It is unfortunate that we end up in the graphdrivers Remove() call
<ide> func (d *Driver) Remove(id string) error {
<ide> // not required.
<ide> computeSystems, err = hcsshim.GetContainers(hcsshim.ComputeSystemQuery{})
<ide> if err != nil {
<del> if (osv.Build < 15139) &&
<del> ((err == hcsshim.ErrVmcomputeOperationInvalidState) || (err == hcsshim.ErrVmcomputeOperationAccessIsDenied)) {
<add> if osversion.Build() >= osversion.RS3 {
<add> return err
<add> }
<add> if (err == hcsshim.ErrVmcomputeOperationInvalidState) || (err == hcsshim.ErrVmcomputeOperationAccessIsDenied) {
<ide> if retryCount >= 500 {
<ide> break
<ide> }
<ide><path>daemon/oci_windows.go
<ide> import (
<ide> "runtime"
<ide> "strings"
<ide>
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> containertypes "github.com/docker/docker/api/types/container"
<ide> "github.com/docker/docker/container"
<ide> "github.com/docker/docker/errdefs"
<ide> func (daemon *Daemon) createSpecWindowsFields(c *container.Container, s *specs.S
<ide> if isHyperV {
<ide> return errors.New("device assignment is not supported for HyperV containers")
<ide> }
<del> if system.GetOSVersion().Build < 17763 {
<add> if osversion.Build() < osversion.RS5 {
<ide> return errors.New("device assignment requires Windows builds RS5 (17763+) or later")
<ide> }
<ide> for _, deviceMapping := range c.HostConfig.Devices {
<ide><path>distribution/pull_v2_windows.go
<ide> import (
<ide> "strconv"
<ide> "strings"
<ide>
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> "github.com/containerd/containerd/platforms"
<ide> "github.com/docker/distribution"
<ide> "github.com/docker/distribution/manifest/manifestlist"
<ide> func (ld *v2LayerDescriptor) open(ctx context.Context) (distribution.ReadSeekClo
<ide> }
<ide>
<ide> func filterManifests(manifests []manifestlist.ManifestDescriptor, p specs.Platform) []manifestlist.ManifestDescriptor {
<del> version := system.GetOSVersion()
<add> version := osversion.Get()
<ide> osVersion := fmt.Sprintf("%d.%d.%d", version.MajorVersion, version.MinorVersion, version.Build)
<ide> logrus.Debugf("will prefer Windows entries with version %s", osVersion)
<ide>
<ide> func (mbv manifestsByVersion) Swap(i, j int) {
<ide> // Fixes https://github.com/moby/moby/issues/36184.
<ide> func checkImageCompatibility(imageOS, imageOSVersion string) error {
<ide> if imageOS == "windows" {
<del> hostOSV := system.GetOSVersion()
<add> hostOSV := osversion.Get()
<ide> splitImageOSVersion := strings.Split(imageOSVersion, ".") // eg 10.0.16299.nnnn
<ide> if len(splitImageOSVersion) >= 3 {
<ide> if imageOSBuild, err := strconv.Atoi(splitImageOSVersion[2]); err == nil {
<ide> func formatPlatform(platform specs.Platform) string {
<ide> if platform.OS == "" {
<ide> platform = platforms.DefaultSpec()
<ide> }
<del> return fmt.Sprintf("%s %s", platforms.Format(platform), system.GetOSVersion().ToString())
<add> return fmt.Sprintf("%s %s", platforms.Format(platform), osversion.Get().ToString())
<ide> }
<ide><path>integration-cli/docker_api_containers_windows_test.go
<ide> import (
<ide> "testing"
<ide>
<ide> winio "github.com/Microsoft/go-winio"
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> "github.com/docker/docker/api/types"
<ide> "github.com/docker/docker/api/types/container"
<ide> "github.com/docker/docker/api/types/mount"
<ide> import (
<ide> )
<ide>
<ide> func (s *DockerSuite) TestContainersAPICreateMountsBindNamedPipe(c *testing.T) {
<del> testRequires(c, testEnv.IsLocalDaemon, DaemonIsWindowsAtLeastBuild(16299)) // Named pipe support was added in RS3
<add> testRequires(c, testEnv.IsLocalDaemon, DaemonIsWindowsAtLeastBuild(osversion.RS3)) // Named pipe support was added in RS3
<ide>
<ide> // Create a host pipe to map into the container
<ide> hostPipeName := fmt.Sprintf(`\\.\pipe\docker-cli-test-pipe-%x`, rand.Uint64())
<ide><path>integration-cli/docker_api_images_test.go
<ide> import (
<ide> "strings"
<ide> "testing"
<ide>
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> "github.com/docker/docker/api/types"
<ide> "github.com/docker/docker/api/types/filters"
<ide> "github.com/docker/docker/client"
<ide> func (s *DockerSuite) TestAPIImagesFilter(c *testing.T) {
<ide>
<ide> func (s *DockerSuite) TestAPIImagesSaveAndLoad(c *testing.T) {
<ide> if runtime.GOOS == "windows" {
<add> // Note we parse kernel.GetKernelVersion rather than osversion.Build()
<add> // as test binaries aren't manifested, so would otherwise report build 9200.
<ide> v, err := kernel.GetKernelVersion()
<ide> assert.NilError(c, err)
<del> build, _ := strconv.Atoi(strings.Split(strings.SplitN(v.String(), " ", 3)[2][1:], ".")[0])
<del> if build <= 16299 {
<add> buildNumber, _ := strconv.Atoi(strings.Split(strings.SplitN(v.String(), " ", 3)[2][1:], ".")[0])
<add> if buildNumber <= osversion.RS3 {
<ide> c.Skip("Temporarily disabled on RS3 and older because they are too slow. See #39909")
<ide> }
<ide> }
<ide> func (s *DockerSuite) TestAPIImagesHistory(c *testing.T) {
<ide>
<ide> func (s *DockerSuite) TestAPIImagesImportBadSrc(c *testing.T) {
<ide> if runtime.GOOS == "windows" {
<add> // Note we parse kernel.GetKernelVersion rather than osversion.Build()
<add> // as test binaries aren't manifested, so would otherwise report build 9200.
<ide> v, err := kernel.GetKernelVersion()
<ide> assert.NilError(c, err)
<del> build, _ := strconv.Atoi(strings.Split(strings.SplitN(v.String(), " ", 3)[2][1:], ".")[0])
<del> if build == 16299 {
<add> buildNumber, _ := strconv.Atoi(strings.Split(strings.SplitN(v.String(), " ", 3)[2][1:], ".")[0])
<add> if buildNumber == osversion.RS3 {
<ide> c.Skip("Temporarily disabled on RS3 builds")
<ide> }
<ide> }
<ide><path>integration-cli/docker_cli_run_test.go
<ide> import (
<ide> "testing"
<ide> "time"
<ide>
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> "github.com/docker/docker/client"
<ide> "github.com/docker/docker/integration-cli/cli"
<ide> "github.com/docker/docker/integration-cli/cli/build"
<ide> func (s *DockerSuite) TestRunBindMounts(c *testing.T) {
<ide>
<ide> if testEnv.OSType == "windows" {
<ide> // Disabled prior to RS5 due to how volumes are mapped
<del> testRequires(c, DaemonIsWindowsAtLeastBuild(17763))
<add> testRequires(c, DaemonIsWindowsAtLeastBuild(osversion.RS5))
<ide> }
<ide>
<ide> prefix, _ := getPrefixAndSlashFromDaemonPlatform()
<ide> func (s *DockerSuite) TestRunNamedVolumesFromNotRemoved(c *testing.T) {
<ide> }
<ide>
<ide> func (s *DockerSuite) TestRunAttachFailedNoLeak(c *testing.T) {
<del> // TODO @msabansal - https://github.com/moby/moby/issues/35023. Duplicate
<del> // port mappings are not errored out on RS3 builds. Temporarily disabling
<del> // this test pending further investigation. Note we parse kernel.GetKernelVersion
<del> // rather than system.GetOSVersion as test binaries aren't manifested, so would
<del> // otherwise report build 9200.
<ide> if runtime.GOOS == "windows" {
<add> // TODO @msabansal - https://github.com/moby/moby/issues/35023. Duplicate
<add> // port mappings are not errored out on RS3 builds. Temporarily disabling
<add> // this test pending further investigation. Note we parse kernel.GetKernelVersion
<add> // rather than osversion.Build() as test binaries aren't manifested, so would
<add> // otherwise report build 9200.
<ide> v, err := kernel.GetKernelVersion()
<ide> assert.NilError(c, err)
<del> build, _ := strconv.Atoi(strings.Split(strings.SplitN(v.String(), " ", 3)[2][1:], ".")[0])
<del> if build == 16299 {
<add> buildNumber, _ := strconv.Atoi(strings.Split(strings.SplitN(v.String(), " ", 3)[2][1:], ".")[0])
<add> if buildNumber == osversion.RS3 {
<ide> c.Skip("Temporarily disabled on RS3 builds")
<ide> }
<ide> }
<ide> func (s *DockerSuite) TestRunAddDeviceCgroupRule(c *testing.T) {
<ide>
<ide> // Verifies that running as local system is operating correctly on Windows
<ide> func (s *DockerSuite) TestWindowsRunAsSystem(c *testing.T) {
<del> testRequires(c, DaemonIsWindowsAtLeastBuild(15000))
<add> testRequires(c, DaemonIsWindowsAtLeastBuild(osversion.RS3))
<ide> out, _ := dockerCmd(c, "run", "--net=none", `--user=nt authority\system`, "--hostname=XYZZY", minimalBaseImage(), "cmd", "/c", `@echo %USERNAME%`)
<ide> assert.Equal(c, strings.TrimSpace(out), "XYZZY$")
<ide> }
<ide><path>integration-cli/docker_cli_start_test.go
<ide> import (
<ide> "testing"
<ide> "time"
<ide>
<add> "github.com/Microsoft/hcsshim/osversion"
<add>
<ide> "github.com/docker/docker/integration-cli/cli"
<ide> "github.com/docker/docker/pkg/parsers/kernel"
<ide> "gotest.tools/assert"
<ide> func (s *DockerSuite) TestStartReturnCorrectExitCode(c *testing.T) {
<ide> v, err := kernel.GetKernelVersion()
<ide> assert.NilError(c, err)
<ide> build, _ := strconv.Atoi(strings.Split(strings.SplitN(v.String(), " ", 3)[2][1:], ".")[0])
<del> if build < 16299 {
<add> if build < osversion.RS3 {
<ide> c.Skip("FLAKY on Windows RS1, see #38521")
<ide> }
<ide> }
<ide><path>libcontainerd/local/local_windows.go
<ide> import (
<ide> "time"
<ide>
<ide> "github.com/Microsoft/hcsshim"
<add> "github.com/Microsoft/hcsshim/osversion"
<ide> opengcs "github.com/Microsoft/opengcs/client"
<ide> "github.com/containerd/containerd"
<ide> "github.com/containerd/containerd/cio"
<ide> func (c *client) createWindows(id string, spec *specs.Spec, runtimeOptions inter
<ide> }
<ide> }
<ide> configuration.MappedDirectories = mds
<del> if len(mps) > 0 && system.GetOSVersion().Build < 16299 { // RS3
<add> if len(mps) > 0 && osversion.Build() < osversion.RS3 {
<ide> return errors.New("named pipe mounts are not supported on this version of Windows")
<ide> }
<ide> configuration.MappedPipes = mps
<ide> func (c *client) createWindows(id string, spec *specs.Spec, runtimeOptions inter
<ide> if configuration.HvPartition {
<ide> return errors.New("device assignment is not supported for HyperV containers")
<ide> }
<del> if system.GetOSVersion().Build < 17763 { // RS5
<add> if osversion.Build() < osversion.RS5 {
<ide> return errors.New("device assignment requires Windows builds RS5 (17763+) or later")
<ide> }
<ide> for _, d := range spec.Windows.Devices {
<ide> func (c *client) createLinux(id string, spec *specs.Spec, runtimeOptions interfa
<ide> ReadOnly: readonly,
<ide> }
<ide> // If we are 1803/RS4+ enable LinuxMetadata support by default
<del> if system.GetOSVersion().Build >= 17134 {
<add> if osversion.Build() >= osversion.RS4 {
<ide> md.LinuxMetadata = true
<ide> }
<ide> mds = append(mds, md)
<ide><path>pkg/system/init_windows.go
<ide> var (
<ide>
<ide> // InitLCOW sets whether LCOW is supported or not. Requires RS5+
<ide> func InitLCOW(experimental bool) {
<del> v := GetOSVersion()
<del> if experimental && v.Build >= osversion.RS5 {
<add> if experimental && osversion.Build() >= osversion.RS5 {
<ide> lcowSupported = true
<ide> }
<ide> } | 11 |
Javascript | Javascript | fix native-url containing non-es5 usage | e465e90fe58ac16fbe736efef4a96325bcebf233 | <ide><path>packages/next/compiled/native-url/index.js
<del>module.exports=(()=>{var e={715:(e,t,o)=>{var a,s=(a=o(191))&&"object"==typeof a&&"default"in a?a.default:a,p=/https?|ftp|gopher|file/;function r(e){"string"==typeof e&&(e=d(e));var t=function(e,t,r){var o=e.auth,a=e.hostname,s=e.protocol||"",p=e.pathname||"",n=e.hash||"",c=e.query||"",h=!1;o=o?encodeURIComponent(o).replace(/%3A/i,":")+"@":"",e.host?h=o+e.host:a&&(h=o+(~a.indexOf(":")?"["+a+"]":a),e.port&&(h+=":"+e.port)),c&&"object"==typeof c&&(c=t.encode(c));var l=e.search||c&&"?"+c||"";return s&&":"!==s.substr(-1)&&(s+=":"),e.slashes||(!s||r.test(s))&&!1!==h?(h="//"+(h||""),p&&"/"!==p[0]&&(p="/"+p)):h||(h=""),n&&"#"!==n[0]&&(n="#"+n),l&&"?"!==l[0]&&(l="?"+l),{protocol:s,host:h,pathname:p=p.replace(/[?#]/g,encodeURIComponent),search:l=l.replace("#","%23"),hash:n}}(e,s,p);return""+t.protocol+t.host+t.pathname+t.search+t.hash}var n="http://",c="w.w",i=n+c,u=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,f=/https?|ftp|gopher|file/;function h(e,t){var o="string"==typeof e?d(e):e;e="object"==typeof e?r(e):e;var a=d(t),s="";o.protocol&&!o.slashes&&(s=o.protocol,e=e.replace(o.protocol,""),s+="/"===t[0]||"/"===e[0]?"/":""),s&&a.protocol&&(s="",a.slashes||(s=a.protocol,t=t.replace(a.protocol,"")));var p=e.match(u);p&&!a.protocol&&(e=e.substr((s=p[1]+(p[2]||"")).length),/^\/\/[^/]/.test(t)&&(s=s.slice(0,-1)));var c=new URL(e,i+"/"),h=new URL(t,c).toString().replace(i,""),l=a.protocol||o.protocol;return l+=o.slashes||a.slashes?"//":"",!s&&l?h=h.replace(n,l):s&&(h=h.replace(n,"")),f.test(h)||~t.indexOf(".")||"/"===e.slice(-1)||"/"===t.slice(-1)||"/"!==h.slice(-1)||(h=h.slice(0,-1)),s&&(h=s+("/"===h[0]?h.substr(1):h)),h}function l(){}l.prototype.parse=d,l.prototype.format=r,l.prototype.resolve=h,l.prototype.resolveObject=h;var m=/^https?|ftp|gopher|file/,v=/^(.*?)([#?].*)/,_=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,b=/^([a-z0-9.+-]*:)?\/\/\/*/i,g=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function d(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=!1),e&&"object"==typeof e&&e instanceof l)return e;var a=(e=e.trim()).match(v);e=a?a[1].replace(/\\/g,"/")+a[2]:e.replace(/\\/g,"/"),g.test(e)&&"/"!==e.slice(-1)&&(e+="/");var p=!/(^javascript)/.test(e)&&e.match(_),n=b.test(e),h="";p&&(m.test(p[1])||(h=p[1].toLowerCase(),e=""+p[2]+p[3]),p[2]||(n=!1,m.test(p[1])?(h=p[1],e=""+p[3]):e="//"+p[3]),3!==p[2].length&&1!==p[2].length||(h=p[1],e="/"+p[3]));var u,f=(a?a[1]:e).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),d=f&&f[1],y=new l,w="",C="";try{u=new URL(e)}catch(t){w=t,h||o||!/^\/\//.test(e)||/^\/\/.+[@.]/.test(e)||(C="/",e=e.substr(1));try{u=new URL(e,i)}catch(e){return y.protocol=h,y.href=h,y}}y.slashes=n&&!C,y.host=u.host===c?"":u.host,y.hostname=u.hostname===c?"":u.hostname.replace(/(\[|\])/g,""),y.protocol=w?h||null:u.protocol,y.search=u.search.replace(/\\/g,"%5C"),y.hash=u.hash.replace(/\\/g,"%5C");var U=e.split("#");!y.search&&~U[0].indexOf("?")&&(y.search="?"),y.hash||""!==U[1]||(y.hash="#"),y.query=t?s.decode(u.search.substr(1)):y.search.substr(1),y.pathname=C+(p?function(e){return e.replace(/['^|`]/g,function(e){return"%"+e.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(e,t){try{return decodeURIComponent(t).split("").map(function(e){var t=e.charCodeAt();return t>256||/^[a-z0-9]$/i.test(e)?e:"%"+t.toString(16).toUpperCase()}).join("")}catch(e){return t}})}(u.pathname):u.pathname),"about:"===y.protocol&&"blank"===y.pathname&&(y.protocol="",y.pathname=""),w&&"/"!==e[0]&&(y.pathname=y.pathname.substr(1)),h&&!m.test(h)&&"/"!==e.slice(-1)&&"/"===y.pathname&&(y.pathname=""),y.path=y.pathname+y.search,y.auth=[u.username,u.password].map(decodeURIComponent).filter(Boolean).join(":"),y.port=u.port,d&&!y.host.endsWith(d)&&(y.host+=d,y.port=d.slice(1)),y.href=C?""+y.pathname+y.search+y.hash:r(y);var j=/^(file)/.test(y.href)?["host","hostname"]:[];return Object.keys(y).forEach(function(e){~j.indexOf(e)||(y[e]=y[e]||null)}),y}t.parse=d,t.format=r,t.resolve=h,t.resolveObject=function(e,t){return d(h(e,t))},t.Url=l},191:e=>{"use strict";e.exports=require("querystring")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var o=t[r]={exports:{}};var a=true;try{e[r](o,o.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return o.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(715)})();
<ide>\ No newline at end of file
<add>module.exports=function(){var e={715:function(e,t,o){var a,s=(a=o(191))&&"object"==typeof a&&"default"in a?a.default:a,n=/https?|ftp|gopher|file/;function r(e){"string"==typeof e&&(e=d(e));var t=function(e,t,r){var o=e.auth,a=e.hostname,s=e.protocol||"",n=e.pathname||"",p=e.hash||"",c=e.query||"",h=!1;o=o?encodeURIComponent(o).replace(/%3A/i,":")+"@":"",e.host?h=o+e.host:a&&(h=o+(~a.indexOf(":")?"["+a+"]":a),e.port&&(h+=":"+e.port)),c&&"object"==typeof c&&(c=t.encode(c));var l=e.search||c&&"?"+c||"";return s&&":"!==s.substr(-1)&&(s+=":"),e.slashes||(!s||r.test(s))&&!1!==h?(h="//"+(h||""),n&&"/"!==n[0]&&(n="/"+n)):h||(h=""),p&&"#"!==p[0]&&(p="#"+p),l&&"?"!==l[0]&&(l="?"+l),{protocol:s,host:h,pathname:n=n.replace(/[?#]/g,encodeURIComponent),search:l=l.replace("#","%23"),hash:p}}(e,s,n);return""+t.protocol+t.host+t.pathname+t.search+t.hash}var p="http://",c="w.w",i=p+c,u=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,f=/https?|ftp|gopher|file/;function h(e,t){var o="string"==typeof e?d(e):e;e="object"==typeof e?r(e):e;var a=d(t),s="";o.protocol&&!o.slashes&&(s=o.protocol,e=e.replace(o.protocol,""),s+="/"===t[0]||"/"===e[0]?"/":""),s&&a.protocol&&(s="",a.slashes||(s=a.protocol,t=t.replace(a.protocol,"")));var n=e.match(u);n&&!a.protocol&&(e=e.substr((s=n[1]+(n[2]||"")).length),/^\/\/[^/]/.test(t)&&(s=s.slice(0,-1)));var c=new URL(e,i+"/"),h=new URL(t,c).toString().replace(i,""),l=a.protocol||o.protocol;return l+=o.slashes||a.slashes?"//":"",!s&&l?h=h.replace(p,l):s&&(h=h.replace(p,"")),f.test(h)||~t.indexOf(".")||"/"===e.slice(-1)||"/"===t.slice(-1)||"/"!==h.slice(-1)||(h=h.slice(0,-1)),s&&(h=s+("/"===h[0]?h.substr(1):h)),h}function l(){}l.prototype.parse=d,l.prototype.format=r,l.prototype.resolve=h,l.prototype.resolveObject=h;var m=/^https?|ftp|gopher|file/,v=/^(.*?)([#?].*)/,_=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,b=/^([a-z0-9.+-]*:)?\/\/\/*/i,g=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function d(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=!1),e&&"object"==typeof e&&e instanceof l)return e;var a=(e=e.trim()).match(v);e=a?a[1].replace(/\\/g,"/")+a[2]:e.replace(/\\/g,"/"),g.test(e)&&"/"!==e.slice(-1)&&(e+="/");var n=!/(^javascript)/.test(e)&&e.match(_),p=b.test(e),h="";n&&(m.test(n[1])||(h=n[1].toLowerCase(),e=""+n[2]+n[3]),n[2]||(p=!1,m.test(n[1])?(h=n[1],e=""+n[3]):e="//"+n[3]),3!==n[2].length&&1!==n[2].length||(h=n[1],e="/"+n[3]));var u,f=(a?a[1]:e).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),d=f&&f[1],y=new l,w="",C="";try{u=new URL(e)}catch(t){w=t,h||o||!/^\/\//.test(e)||/^\/\/.+[@.]/.test(e)||(C="/",e=e.substr(1));try{u=new URL(e,i)}catch(e){return y.protocol=h,y.href=h,y}}y.slashes=p&&!C,y.host=u.host===c?"":u.host,y.hostname=u.hostname===c?"":u.hostname.replace(/(\[|\])/g,""),y.protocol=w?h||null:u.protocol,y.search=u.search.replace(/\\/g,"%5C"),y.hash=u.hash.replace(/\\/g,"%5C");var U=e.split("#");!y.search&&~U[0].indexOf("?")&&(y.search="?"),y.hash||""!==U[1]||(y.hash="#"),y.query=t?s.decode(u.search.substr(1)):y.search.substr(1),y.pathname=C+(n?function(e){return e.replace(/['^|`]/g,function(e){return"%"+e.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(e,t){try{return decodeURIComponent(t).split("").map(function(e){var t=e.charCodeAt();return t>256||/^[a-z0-9]$/i.test(e)?e:"%"+t.toString(16).toUpperCase()}).join("")}catch(e){return t}})}(u.pathname):u.pathname),"about:"===y.protocol&&"blank"===y.pathname&&(y.protocol="",y.pathname=""),w&&"/"!==e[0]&&(y.pathname=y.pathname.substr(1)),h&&!m.test(h)&&"/"!==e.slice(-1)&&"/"===y.pathname&&(y.pathname=""),y.path=y.pathname+y.search,y.auth=[u.username,u.password].map(decodeURIComponent).filter(Boolean).join(":"),y.port=u.port,d&&!y.host.endsWith(d)&&(y.host+=d,y.port=d.slice(1)),y.href=C?""+y.pathname+y.search+y.hash:r(y);var j=/^(file)/.test(y.href)?["host","hostname"]:[];return Object.keys(y).forEach(function(e){~j.indexOf(e)||(y[e]=y[e]||null)}),y}t.parse=d,t.format=r,t.resolve=h,t.resolveObject=function(e,t){return d(h(e,t))},t.Url=l},191:function(e){"use strict";e.exports=require("querystring")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var o=t[r]={exports:{}};var a=true;try{e[r](o,o.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return o.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(715)}();
<ide>\ No newline at end of file
<ide><path>packages/next/taskfile.js
<ide> externals['native-url'] = 'next/dist/compiled/native-url'
<ide> export async function ncc_native_url(task, opts) {
<ide> await task
<ide> .source(opts.src || relative(__dirname, require.resolve('native-url')))
<del> .ncc({ packageName: 'native-url', externals })
<add> .ncc({ packageName: 'native-url', externals, target: 'es5' })
<ide> .target('compiled/native-url')
<ide> }
<ide> // eslint-disable-next-line camelcase
<ide><path>test/integration/production/pages/another.js
<add>import url from 'url'
<ide> import Link from 'next/link'
<ide>
<add>console.log(url.parse('https://example.com'))
<add>
<ide> export default () => (
<ide> <div>
<ide> <Link href="/">
<ide><path>test/integration/production/test/index.test.js
<ide> describe('Production Usage', () => {
<ide>
<ide> it('should navigate to nested index via client side', async () => {
<ide> const browser = await webdriver(appPort, '/another')
<add> await browser.eval('window.beforeNav = 1')
<add>
<ide> const text = await browser
<ide> .elementByCss('a')
<ide> .click()
<ide> describe('Production Usage', () => {
<ide> .text()
<ide>
<ide> expect(text).toBe('Hello World')
<add> expect(await browser.eval('window.beforeNav')).toBe(1)
<ide> await browser.close()
<ide> })
<ide> | 4 |
Javascript | Javascript | remove the comment duplicating the code | 8eb0532c0599dd36a58114072efecbda3ec65c1b | <ide><path>src/utils/compose.js
<ide> export default function compose(...funcs) {
<ide> return (...args) => {
<ide> if (funcs.length === 0) {
<del> // We weren't given any functions, just return the first passed in arg.
<ide> return args[0]
<ide> }
<ide> | 1 |
Python | Python | fix staticvectors class | 475d7c1c7c4520b280fad01e2a3c8db5d60a594b | <ide><path>spacy/ml/staticvectors.py
<ide> def forward(
<ide> if not len(docs):
<ide> return _handle_empty(model.ops, model.get_dim("nO"))
<ide> key_attr = model.attrs["key_attr"]
<del> W = cast(Floats2d, model.get_param("W"))
<add> W = cast(Floats2d, model.ops.as_contig(model.get_param("W")))
<ide> V = cast(Floats2d, docs[0].vocab.vectors.data)
<ide> mask = _get_drop_mask(model.ops, W.shape[0], model.attrs.get("dropout_rate"))
<del>
<ide> rows = model.ops.flatten(
<ide> [doc.vocab.vectors.find(keys=doc.to_array(key_attr)) for doc in docs]
<ide> )
<ide> output = Ragged(
<del> model.ops.gemm(V[rows], W, trans2=True),
<add> model.ops.gemm(model.ops.as_contig(V[rows]), W, trans2=True),
<ide> model.ops.asarray([len(doc) for doc in docs], dtype="i")
<ide> )
<ide> if mask is not None:
<ide> def forward(
<ide> def backprop(d_output: Ragged) -> List[Doc]:
<ide> if mask is not None:
<ide> d_output.data *= mask
<del> model.inc_grad("W", model.ops.gemm(d_output.data, V[rows], trans1=True))
<add> model.inc_grad(
<add> "W",
<add> model.ops.gemm(
<add> d_output.data,
<add> model.ops.as_contig(V[rows]),
<add> trans1=True
<add> )
<add> )
<ide> return []
<ide>
<ide> return output, backprop | 1 |
PHP | PHP | add the opposite method of isdirty, the isclean | 3a3dea2e1623dfc62d7d900cd764a2b4ffb4c535 | <ide><path>src/Illuminate/Database/Eloquent/Model.php
<ide> public function isDirty($attributes = null)
<ide> return false;
<ide> }
<ide>
<add> /**
<add> * Determine if the model or given attribute(s) have been remained the same.
<add> *
<add> * @param array|string|null $attributes
<add> * @return bool
<add> */
<add> public function isClean($attributes = null)
<add> {
<add> return ! $this->isDirty(...func_get_args());
<add> }
<add>
<ide> /**
<ide> * Get the attributes that have been changed since last sync.
<ide> *
<ide><path>tests/Database/DatabaseEloquentModelTest.php
<ide> public function testDirtyAttributes()
<ide> $this->assertTrue($model->isDirty(['foo', 'bar']));
<ide> }
<ide>
<add> public function testCleanAttributes()
<add> {
<add> $model = new EloquentModelStub(['foo' => '1', 'bar' => 2, 'baz' => 3]);
<add> $model->syncOriginal();
<add> $model->foo = 1;
<add> $model->bar = 20;
<add> $model->baz = 30;
<add>
<add> $this->assertFalse($model->isClean());
<add> $this->assertTrue($model->isClean('foo'));
<add> $this->assertFalse($model->isClean('bar'));
<add> $this->assertFalse($model->isClean('foo', 'bar'));
<add> $this->assertFalse($model->isClean(['foo', 'bar']));
<add> }
<add>
<ide> public function testCalculatedAttributes()
<ide> {
<ide> $model = new EloquentModelStub; | 2 |
Javascript | Javascript | add modularized vrmlloader | 8f43ad2e7f84e630ee775f960e1f864ca13de3b9 | <ide><path>examples/jsm/loaders/VRMLLoader.js
<ide> var VRMLLoader = ( function () {
<ide>
<ide> // an index of -1 indicates that the current face has ended and the next one begins
<ide>
<del> if ( index[ i + 3 ] === - 1 ) {
<add> if ( index[ i + 3 ] === - 1 || i + 3 >= l ) {
<ide>
<ide> i += 3;
<ide> start = i + 1;
<ide> var VRMLLoader = ( function () {
<ide>
<ide> // an index of -1 indicates that the current face has ended and the next one begins
<ide>
<del> if ( index[ i + 3 ] === - 1 ) {
<add> if ( index[ i + 3 ] === - 1 || i + 3 >= l ) {
<ide>
<ide> i += 3;
<ide> start ++;
<ide> var VRMLLoader = ( function () {
<ide>
<ide> // an index of -1 indicates that the current line has ended and the next one begins
<ide>
<del> if ( index[ i + 2 ] === - 1 ) {
<add> if ( index[ i + 2 ] === - 1 || i + 2 >= l ) {
<ide>
<ide> i += 2;
<ide>
<ide> var VRMLLoader = ( function () {
<ide>
<ide> // an index of -1 indicates that the current line has ended and the next one begins
<ide>
<del> if ( index[ i + 2 ] === - 1 ) {
<add> if ( index[ i + 2 ] === - 1 || i + 2 >= l ) {
<ide>
<ide> i += 2;
<ide> start ++; | 1 |
Ruby | Ruby | add test coverage for form with rich-text-area | 43a7adb0afd52a83b1d2850c43d007f9a4526034 | <ide><path>test/template/form_helper_test.rb
<ide> def form_with(*)
<ide>
<ide> assert_match "message[not_an_attribute]", output_buffer
<ide> end
<add>
<add> test "form with rich_text_area" do
<add> expected = '<form id="create-message" action="/messages" accept-charset="UTF-8" data-remote="true" method="post">'\
<add> '<input name="utf8" type="hidden" value="✓" />'\
<add> '<input type="hidden" name="message[content]" id="message_content_trix_input_message" />'\
<add> '<trix-editor id="message_content" input="message_content_trix_input_message" class="trix-content" data-direct-upload-url="http://test.host/rails/active_storage/direct_uploads" data-blob-url-template="http://test.host/rails/active_storage/blobs/:signed_id/:filename">'\
<add> '</trix-editor></form>'
<add>
<add> form_with(model: Message.new, scope: :message, id: "create-message") do |form|
<add> form.rich_text_area(:content)
<add> end
<add>
<add> assert_dom_equal expected, output_buffer
<add> end
<add>
<add> test "form with rich_text_area providing class option" do
<add> expected = '<form id="create-message" action="/messages" accept-charset="UTF-8" data-remote="true" method="post">'\
<add> '<input name="utf8" type="hidden" value="✓" />'\
<add> '<input type="hidden" name="message[content]" id="message_content_trix_input_message" />'\
<add> '<trix-editor id="message_content" input="message_content_trix_input_message" class="custom-class" data-direct-upload-url="http://test.host/rails/active_storage/direct_uploads" data-blob-url-template="http://test.host/rails/active_storage/blobs/:signed_id/:filename">'\
<add> '</trix-editor></form>'
<add>
<add> form_with(model: Message.new, scope: :message, id: "create-message") do |form|
<add> form.rich_text_area(:content, class: "custom-class")
<add> end
<add>
<add> assert_dom_equal expected, output_buffer
<add> end
<ide> end | 1 |
Go | Go | fix the typo | 9551dd03cfad2ec0a00d89c2177fb7b45b6ad885 | <ide><path>daemon/cluster/cluster.go
<ide> var ErrSwarmJoinTimeoutReached = fmt.Errorf("Timeout was reached before node was
<ide> // ErrSwarmLocked is returned if the swarm is encrypted and needs a key to unlock it.
<ide> var ErrSwarmLocked = fmt.Errorf("Swarm is encrypted and needs to be unlocked before it can be used. Please use \"docker swarm unlock\" to unlock it.")
<ide>
<del>// ErrSwarmCertificatesExipred is returned if docker was not started for the whole validity period and they had no chance to renew automatically.
<add>// ErrSwarmCertificatesExpired is returned if docker was not started for the whole validity period and they had no chance to renew automatically.
<ide> var ErrSwarmCertificatesExpired = errors.New("Swarm certificates have expired. To replace them, leave the swarm and join again.")
<ide>
<ide> // NetworkSubnetsProvider exposes functions for retrieving the subnets | 1 |
Text | Text | clarify role of writable.cork() | e9695d93e3d2d8e853d8285cee9441831fa44b89 | <ide><path>doc/api/stream.md
<ide> The `writable.cork()` method forces all written data to be buffered in memory.
<ide> The buffered data will be flushed when either the [`stream.uncork()`][] or
<ide> [`stream.end()`][stream-end] methods are called.
<ide>
<del>The primary intent of `writable.cork()` is to avoid a situation where writing
<del>many small chunks of data to a stream do not cause a backup in the internal
<del>buffer that would have an adverse impact on performance. In such situations,
<del>implementations that implement the `writable._writev()` method can perform
<del>buffered writes in a more optimized manner.
<del>
<del>See also: [`writable.uncork()`][].
<add>The primary intent of `writable.cork()` is to accommodate a situation in which
<add>several small chunks are written to the stream in rapid succession. Instead of
<add>immediately forwarding them to the underlying destination, `writable.cork()`
<add>buffers all the chunks until `writable.uncork()` is called, which will pass them
<add>all to `writable._writev()`, if present. This prevents a head-of-line blocking
<add>situation where data is being buffered while waiting for the first small chunk
<add>to be processed. However, use of `writable.cork()` without implementing
<add>`writable._writev()` may have an adverse effect on throughput.
<add>
<add>See also: [`writable.uncork()`][], [`writable._writev()`][stream-_writev].
<ide>
<ide> ##### `writable.destroy([error])`
<ide> <!-- YAML | 1 |
Ruby | Ruby | remove test for livecheck_formulae | 81510165311b8ef4a59cdad02626edec291d915f | <ide><path>Library/Homebrew/test/livecheck/livecheck_spec.rb
<ide> .to eq("https://github.com/Homebrew/brew.git")
<ide> end
<ide> end
<del>
<del> describe "::livecheck_formulae", :needs_network do
<del> it "checks for the latest versions of the formulae" do
<del> allow(args).to receive(:debug?).and_return(true)
<del> allow(args).to receive(:newer_only?).and_return(false)
<del>
<del> expectation = expect { livecheck.livecheck_formulae([f], args) }
<del> expectation.to output(/Strategy:.*PageMatch/).to_stdout
<del> expectation.to output(/test : 0\.0\.1 ==> (\d+(?:\.\d+)+)/).to_stdout
<del> .and not_to_output.to_stderr
<del> end
<del> end
<ide> end | 1 |
Javascript | Javascript | improve validation of report output | 060af324ae7093a390edd1524855d7679ce6837b | <ide><path>test/common/report.js
<ide> 'use strict';
<ide> const assert = require('assert');
<ide> const fs = require('fs');
<add>const os = require('os');
<ide> const path = require('path');
<ide>
<ide> function findReports(pid, dir) {
<ide> function validate(report) {
<ide> }
<ide>
<ide> function validateContent(data) {
<add> try {
<add> _validateContent(data);
<add> } catch (err) {
<add> err.stack += `\n------\nFailing Report:\n${data}`;
<add> throw err;
<add> }
<add>}
<add>
<add>function _validateContent(data) {
<add> const isWindows = process.platform === 'win32';
<ide> const report = JSON.parse(data);
<ide>
<del> // Verify that all sections are present.
<del> ['header', 'javascriptStack', 'nativeStack', 'javascriptHeap',
<del> 'libuv', 'environmentVariables', 'sharedObjects'].forEach((section) => {
<add> // Verify that all sections are present as own properties of the report.
<add> const sections = ['header', 'javascriptStack', 'nativeStack',
<add> 'javascriptHeap', 'libuv', 'environmentVariables',
<add> 'sharedObjects'];
<add> if (!isWindows)
<add> sections.push('resourceUsage', 'userLimits');
<add>
<add> if (report.uvthreadResourceUsage)
<add> sections.push('uvthreadResourceUsage');
<add>
<add> checkForUnknownFields(report, sections);
<add> sections.forEach((section) => {
<ide> assert(report.hasOwnProperty(section));
<add> assert(typeof report[section] === 'object' && report[section] !== null);
<add> });
<add>
<add> // Verify the format of the header section.
<add> const header = report.header;
<add> const headerFields = ['event', 'location', 'filename', 'dumpEventTime',
<add> 'dumpEventTimeStamp', 'processId', 'commandLine',
<add> 'nodejsVersion', 'wordSize', 'arch', 'platform',
<add> 'componentVersions', 'release', 'osName', 'osRelease',
<add> 'osVersion', 'osMachine', 'host', 'glibcVersionRuntime',
<add> 'glibcVersionCompiler'];
<add> checkForUnknownFields(header, headerFields);
<add> assert.strictEqual(typeof header.event, 'string');
<add> assert.strictEqual(typeof header.location, 'string');
<add> assert(typeof header.filename === 'string' || header.filename === null);
<add> assert.notStrictEqual(new Date(header.dumpEventTime).toString(),
<add> 'Invalid Date');
<add> if (isWindows)
<add> assert.strictEqual(header.dumpEventTimeStamp, undefined);
<add> else
<add> assert(String(+header.dumpEventTimeStamp), header.dumpEventTimeStamp);
<add>
<add> assert(Number.isSafeInteger(header.processId));
<add> assert(Array.isArray(header.commandLine));
<add> header.commandLine.forEach((arg) => {
<add> assert.strictEqual(typeof arg, 'string');
<add> });
<add> assert.strictEqual(header.nodejsVersion, process.version);
<add> assert(Number.isSafeInteger(header.wordSize));
<add> assert.strictEqual(header.arch, os.arch());
<add> assert.strictEqual(header.platform, os.platform());
<add> assert.deepStrictEqual(header.componentVersions, process.versions);
<add> assert.deepStrictEqual(header.release, process.release);
<add> assert.strictEqual(header.osName, os.type());
<add> assert.strictEqual(header.osRelease, os.release());
<add> assert.strictEqual(typeof header.osVersion, 'string');
<add> assert.strictEqual(typeof header.osMachine, 'string');
<add> assert.strictEqual(header.host, os.hostname());
<add>
<add> // Verify the format of the javascriptStack section.
<add> checkForUnknownFields(report.javascriptStack, ['message', 'stack']);
<add> assert.strictEqual(typeof report.javascriptStack.message, 'string');
<add> if (report.javascriptStack.stack !== undefined) {
<add> assert(Array.isArray(report.javascriptStack.stack));
<add> report.javascriptStack.stack.forEach((frame) => {
<add> assert.strictEqual(typeof frame, 'string');
<add> });
<add> }
<add>
<add> // Verify the format of the nativeStack section.
<add> assert(Array.isArray(report.nativeStack));
<add> report.nativeStack.forEach((frame) => {
<add> assert(typeof frame === 'object' && frame !== null);
<add> checkForUnknownFields(frame, ['pc', 'symbol']);
<add> assert.strictEqual(typeof frame.pc, 'string');
<add> assert(/^0x[0-9a-f]+$/.test(frame.pc));
<add> assert.strictEqual(typeof frame.symbol, 'string');
<add> });
<add>
<add> // Verify the format of the javascriptHeap section.
<add> const heap = report.javascriptHeap;
<add> const jsHeapFields = ['totalMemory', 'totalCommittedMemory', 'usedMemory',
<add> 'availableMemory', 'memoryLimit', 'heapSpaces'];
<add> checkForUnknownFields(heap, jsHeapFields);
<add> assert(Number.isSafeInteger(heap.totalMemory));
<add> assert(Number.isSafeInteger(heap.totalCommittedMemory));
<add> assert(Number.isSafeInteger(heap.usedMemory));
<add> assert(Number.isSafeInteger(heap.availableMemory));
<add> assert(Number.isSafeInteger(heap.memoryLimit));
<add> assert(typeof heap.heapSpaces === 'object' && heap.heapSpaces !== null);
<add> const heapSpaceFields = ['memorySize', 'committedMemory', 'capacity', 'used',
<add> 'available'];
<add> Object.keys(heap.heapSpaces).forEach((spaceName) => {
<add> const space = heap.heapSpaces[spaceName];
<add> checkForUnknownFields(space, heapSpaceFields);
<add> heapSpaceFields.forEach((field) => {
<add> assert(Number.isSafeInteger(space[field]));
<add> });
<add> });
<add>
<add> // Verify the format of the resourceUsage section on non-Windows platforms.
<add> if (!isWindows) {
<add> const usage = report.resourceUsage;
<add> const resourceUsageFields = ['userCpuSeconds', 'kernelCpuSeconds',
<add> 'cpuConsumptionPercent', 'maxRss',
<add> 'pageFaults', 'fsActivity'];
<add> checkForUnknownFields(usage, resourceUsageFields);
<add> assert.strictEqual(typeof usage.userCpuSeconds, 'number');
<add> assert.strictEqual(typeof usage.kernelCpuSeconds, 'number');
<add> assert.strictEqual(typeof usage.cpuConsumptionPercent, 'number');
<add> assert(Number.isSafeInteger(usage.maxRss));
<add> assert(typeof usage.pageFaults === 'object' && usage.pageFaults !== null);
<add> checkForUnknownFields(usage.pageFaults, ['IORequired', 'IONotRequired']);
<add> assert(Number.isSafeInteger(usage.pageFaults.IORequired));
<add> assert(Number.isSafeInteger(usage.pageFaults.IONotRequired));
<add> assert(typeof usage.fsActivity === 'object' && usage.fsActivity !== null);
<add> checkForUnknownFields(usage.fsActivity, ['reads', 'writes']);
<add> assert(Number.isSafeInteger(usage.fsActivity.reads));
<add> assert(Number.isSafeInteger(usage.fsActivity.writes));
<add> }
<add>
<add> // Verify the format of the uvthreadResourceUsage section, if present.
<add> if (report.uvthreadResourceUsage) {
<add> const usage = report.uvthreadResourceUsage;
<add> const threadUsageFields = ['userCpuSeconds', 'kernelCpuSeconds',
<add> 'cpuConsumptionPercent', 'fsActivity'];
<add> checkForUnknownFields(usage, threadUsageFields);
<add> assert.strictEqual(typeof usage.userCpuSeconds, 'number');
<add> assert.strictEqual(typeof usage.kernelCpuSeconds, 'number');
<add> assert.strictEqual(typeof usage.cpuConsumptionPercent, 'number');
<add> assert(typeof usage.fsActivity === 'object' && usage.fsActivity !== null);
<add> checkForUnknownFields(usage.fsActivity, ['reads', 'writes']);
<add> assert(Number.isSafeInteger(usage.fsActivity.reads));
<add> assert(Number.isSafeInteger(usage.fsActivity.writes));
<add> }
<add>
<add> // Verify the format of the libuv section.
<add> assert(Array.isArray(report.libuv));
<add> report.libuv.forEach((resource) => {
<add> assert.strictEqual(typeof resource.type, 'string');
<add> assert.strictEqual(typeof resource.address, 'string');
<add> assert(/^0x[0-9a-f]+$/.test(resource.address));
<add> assert.strictEqual(typeof resource.is_active, 'boolean');
<add> assert.strictEqual(typeof resource.is_referenced,
<add> resource.type === 'loop' ? 'undefined' : 'boolean');
<ide> });
<ide>
<del> assert.deepStrictEqual(report.header.componentVersions, process.versions);
<del> assert.deepStrictEqual(report.header.release, process.release);
<add> // Verify the format of the environmentVariables section.
<add> for (const [key, value] of Object.entries(report.environmentVariables)) {
<add> assert.strictEqual(typeof key, 'string');
<add> assert.strictEqual(typeof value, 'string');
<add> }
<add>
<add> // Verify the format of the userLimits section on non-Windows platforms.
<add> if (!isWindows) {
<add> const userLimitsFields = ['core_file_size_blocks', 'data_seg_size_kbytes',
<add> 'file_size_blocks', 'max_locked_memory_bytes',
<add> 'max_memory_size_kbytes', 'open_files',
<add> 'stack_size_bytes', 'cpu_time_seconds',
<add> 'max_user_processes', 'virtual_memory_kbytes'];
<add> checkForUnknownFields(report.userLimits, userLimitsFields);
<add> for (const [type, limits] of Object.entries(report.userLimits)) {
<add> assert.strictEqual(typeof type, 'string');
<add> assert(typeof limits === 'object' && limits !== null);
<add> checkForUnknownFields(limits, ['soft', 'hard']);
<add> assert(typeof limits.soft === 'number' || limits.soft === 'unlimited',
<add> `Invalid ${type} soft limit of ${limits.soft}`);
<add> assert(typeof limits.hard === 'number' || limits.hard === 'unlimited',
<add> `Invalid ${type} hard limit of ${limits.hard}`);
<add> }
<add> }
<add>
<add> // Verify the format of the sharedObjects section.
<add> assert(Array.isArray(report.sharedObjects));
<add> report.sharedObjects.forEach((sharedObject) => {
<add> assert.strictEqual(typeof sharedObject, 'string');
<add> });
<add>}
<add>
<add>function checkForUnknownFields(actual, expected) {
<add> Object.keys(actual).forEach((field) => {
<add> assert(expected.includes(field), `'${field}' not expected in ${expected}`);
<add> });
<ide> }
<ide>
<ide> module.exports = { findReports, validate, validateContent }; | 1 |
Text | Text | add changelog entry | 151167eb3d9510bfb0f1408c150b5564b44cb2e6 | <ide><path>activestorage/CHANGELOG.md
<add>* Use the [ImageProcessing](https://github.com/janko-m/image_processing) gem
<add> for Active Storage variants, and deprecate the MiniMagick backend.
<add>
<add> This means that variants are now automatically oriented if the original
<add> image was rotated. Also, in addition to the existing ImageMagick
<add> operations, variants can now use `:resize_to_fit`, `:resize_to_fill`, and
<add> other ImageProcessing macros. These are now recommended over raw `:resize`,
<add> as they also sharpen the thumbnail after resizing.
<add>
<add> The ImageProcessing gem also comes with a backend implemented on
<add> [libvips](http://jcupitt.github.io/libvips/), an alternative to
<add> ImageMagick which has significantly better performance than
<add> ImageMagick in most cases, both in terms of speed and memory usage. In
<add> Active Storage it's now possible to switch to the libvips backend by
<add> changing `Rails.application.config.active_storage.variant_processor` to
<add> `:vips`.
<add>
<add> *Janko Marohnić*
<add>
<ide> * Rails 6 requires Ruby 2.4.1 or newer.
<ide>
<ide> *Jeremy Daer* | 1 |
Python | Python | change error message in standardize_input_data | b32248d615abfd7835886a0f50962856f7d7c986 | <ide><path>keras/engine/training.py
<ide> def standardize_input_data(data, names, shapes=None, check_batch_dim=True,
<ide> arrays = []
<ide> for name in names:
<ide> if name not in data:
<del> raise Exception('No data provided for input "' +
<del> name + '". Input data keys: ' +
<add> raise Exception('No data provided for "' +
<add> name + '". Need data for each key in: ' +
<ide> str(data.keys()))
<ide> arrays.append(data[name])
<ide> elif type(data) is list: | 1 |
Python | Python | update pavement.py script | e4d9030e349c232440c139397e5366779f91126a | <ide><path>pavement.py
<ide> #-----------------------------------
<ide>
<ide> # Source of the release notes
<del>RELEASE_NOTES = 'doc/release/2.0.0-notes.rst'
<add>RELEASE_NOTES = 'doc/release/1.9.0-notes.rst'
<ide>
<ide> # Start/end of the log (from git)
<del>LOG_START = 'v1.6.0'
<add>LOG_START = 'v1.8.0b1'
<ide> LOG_END = 'master'
<ide>
<ide>
<ide> #-------------------------------------------------------
<ide> # Hardcoded build/install dirs, virtualenv options, etc.
<ide> #-------------------------------------------------------
<del>DEFAULT_PYTHON = "2.6"
<add>DEFAULT_PYTHON = "2.7"
<ide>
<ide> # Where to put the final installers, as put on sourceforge
<ide> SUPERPACK_BUILD = 'build-superpack'
<ide> )
<ide>
<ide> MPKG_PYTHON = {
<del> "2.5": ["/Library/Frameworks/Python.framework/Versions/2.5/bin/python"],
<ide> "2.6": ["/Library/Frameworks/Python.framework/Versions/2.6/bin/python"],
<ide> "2.7": ["/Library/Frameworks/Python.framework/Versions/2.7/bin/python"],
<del> "3.1": ["/Library/Frameworks/Python.framework/Versions/3.1/bin/python3"],
<ide> "3.2": ["/Library/Frameworks/Python.framework/Versions/3.2/bin/python3"],
<ide> "3.3": ["/Library/Frameworks/Python.framework/Versions/3.3/bin/python3"],
<ide> }
<ide> WINDOWS_PYTHON = {
<ide> "3.3": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python33/python.exe"],
<ide> "3.2": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python32/python.exe"],
<del> "3.1": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python31/python.exe"],
<ide> "2.7": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe"],
<ide> "2.6": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python26/python.exe"],
<del> "2.5": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python25/python.exe"]
<ide> }
<ide> WINDOWS_ENV = os.environ
<ide> WINDOWS_ENV["DYLD_FALLBACK_LIBRARY_PATH"] = "/usr/X11/lib:/usr/lib"
<ide> WINDOWS_PYTHON = {
<ide> "3.3": ["C:\Python33\python.exe"],
<ide> "3.2": ["C:\Python32\python.exe"],
<del> "3.1": ["C:\Python31\python.exe"],
<ide> "2.7": ["C:\Python27\python.exe"],
<ide> "2.6": ["C:\Python26\python.exe"],
<del> "2.5": ["C:\Python25\python.exe"],
<ide> }
<ide> # XXX: find out which env variable is necessary to avoid the pb with python
<ide> # 2.6 and random module when importing tempfile
<ide> WINDOWS_PYTHON = {
<ide> "3.3": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python33/python.exe"],
<ide> "3.2": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python32/python.exe"],
<del> "3.1": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python31/python.exe"],
<ide> "2.7": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe"],
<ide> "2.6": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python26/python.exe"],
<del> "2.5": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python25/python.exe"]
<ide> }
<ide> WINDOWS_ENV = os.environ
<ide> MAKENSIS = ["wine", "makensis"] | 1 |
Python | Python | fix rest markup in docstrings | 46768e679bbb8f2beabdafff51696d76e7caa920 | <ide><path>numpy/lib/function_base.py
<ide> def linspace(start, stop, num=50, endpoint=True, retstep=False):
<ide> endpoint is True, the last sample is stop. If retstep is
<ide> True then return (seq, step_value), where step_value used.
<ide>
<del> :Parameters:
<del> start : {float}
<del> The value the sequence starts at.
<del> stop : {float}
<del> The value the sequence stops at. If ``endpoint`` is false, then
<del> this is not included in the sequence. Otherwise it is
<del> guaranteed to be the last value.
<del> num : {integer}
<del> Number of samples to generate. Default is 50.
<del> endpoint : {boolean}
<del> If true, ``stop`` is the last sample. Otherwise, it is not
<del> included. Default is true.
<del> retstep : {boolean}
<del> If true, return ``(samples, step)``, where ``step`` is the
<del> spacing used in generating the samples.
<add> Parameters
<add> ----------
<add> start : {float}
<add> The value the sequence starts at.
<add> stop : {float}
<add> The value the sequence stops at. If ``endpoint`` is false, then
<add> this is not included in the sequence. Otherwise it is
<add> guaranteed to be the last value.
<add> num : {integer}
<add> Number of samples to generate. Default is 50.
<add> endpoint : {boolean}
<add> If true, ``stop`` is the last sample. Otherwise, it is not
<add> included. Default is true.
<add> retstep : {boolean}
<add> If true, return ``(samples, step)``, where ``step`` is the
<add> spacing used in generating the samples.
<add>
<add> Returns
<add> -------
<add> samples : {array}
<add> ``num`` equally spaced samples from the range [start, stop]
<add> or [start, stop).
<add> step : {float} (Only if ``retstep`` is true)
<add> Size of spacing between samples.
<add>
<add> See Also
<add> --------
<add> arange : Similiar to linspace, however, when used with
<add> a float endpoint, that endpoint may or may not be included.
<add> logspace
<ide>
<del> :Returns:
<del> samples : {array}
<del> ``num`` equally spaced samples from the range [start, stop]
<del> or [start, stop).
<del> step : {float} (Only if ``retstep`` is true)
<del> Size of spacing between samples.
<del>
<del> :See Also:
<del> `arange` : Similiar to linspace, however, when used with
<del> a float endpoint, that endpoint may or may not be included.
<del> `logspace`
<ide> """
<ide> num = int(num)
<ide> if num <= 0:
<ide> def histogram(a, bins=10, range=None, normed=False, weights=None, new=False):
<ide>
<ide> Parameters
<ide> ----------
<del>
<ide> a : array
<del> The data to histogram.
<add> The data to histogram.
<ide>
<ide> bins : int or sequence
<del> If an int, then the number of equal-width bins in the given range.
<del> If new=True, bins can also be the bin edges, allowing for non-constant
<del> bin widths.
<add> If an int, then the number of equal-width bins in the given
<add> range. If new=True, bins can also be the bin edges, allowing
<add> for non-constant bin widths.
<ide>
<ide> range : (float, float)
<del> The lower and upper range of the bins. If not provided, then
<del> range is simply (a.min(), a.max()). Using new=False, lower than range
<del> are ignored, and values higher than range are tallied in the rightmost
<del> bin. Using new=True, both lower and upper outliers are ignored.
<add> The lower and upper range of the bins. If not provided, range
<add> is simply (a.min(), a.max()). Using new=False, lower than
<add> range are ignored, and values higher than range are tallied in
<add> the rightmost bin. Using new=True, both lower and upper
<add> outliers are ignored.
<ide>
<ide> normed : bool
<del> If False, the result array will contain the number of samples in
<del> each bin. If True, the result array is the value of the
<del> probability *density* function at the bin normalized such that the
<del> *integral* over the range is 1. Note that the sum of all of the
<del> histogram values will not usually be 1; it is not a probability
<del> *mass* function.
<add> If False, the result array will contain the number of samples
<add> in each bin. If True, the result array is the value of the
<add> probability *density* function at the bin normalized such that
<add> the *integral* over the range is 1. Note that the sum of all
<add> of the histogram values will not usually be 1; it is not a
<add> probability *mass* function.
<ide>
<ide> weights : array
<del> An array of weights, the same shape as a. If normed is False, the
<del> histogram is computed by summing the weights of the values falling into
<del> each bin. If normed is True, the weights are normalized, so that the
<del> integral of the density over the range is 1. This option is only
<del> available with new=True.
<del>
<add> An array of weights, the same shape as a. If normed is False,
<add> the histogram is computed by summing the weights of the values
<add> falling into each bin. If normed is True, the weights are
<add> normalized, so that the integral of the density over the range
<add> is 1. This option is only available with new=True.
<add>
<ide> new : bool
<del> Compatibility argument to transition from the old version (v1.1) to
<del> the new version (v1.2).
<del>
<del>
<del> Return
<del> ------
<add> Compatibility argument to transition from the old version
<add> (v1.1) to the new version (v1.2).
<add>
<add> Returns
<add> -------
<ide> hist : array
<del> The values of the histogram. See `normed` and `weights` for a
<add> The values of the histogram. See `normed` and `weights` for a
<ide> description of the possible semantics.
<ide>
<ide> bin_edges : float array
<ide> With new=False, return the left bin edges (length(hist)).
<del> With new=True, return the bin edges (length(hist)+1).
<del>
<del> SeeAlso:
<add> With new=True, return the bin edges (length(hist)+1).
<ide>
<del> histogramdd
<add> See Also
<add> --------
<add> histogramdd
<ide>
<ide> """
<ide> # Old behavior
<ide> if new is False:
<ide> warnings.warn("""
<del> The semantics of histogram will be modified in
<del> release 1.2 to improve outlier handling. The new behavior can be
<del> obtained using new=True. Note that the new version accepts/returns
<del> the bin edges instead of the left bin edges.
<add> The semantics of histogram will be modified in
<add> release 1.2 to improve outlier handling. The new behavior can be
<add> obtained using new=True. Note that the new version accepts/returns
<add> the bin edges instead of the left bin edges.
<ide> Please read the docstring for more information.""", FutureWarning)
<ide> a = asarray(a).ravel()
<ide>
<ide> def histogram(a, bins=10, range=None, normed=False, weights=None, new=False):
<ide> if (mn > mx):
<ide> raise AttributeError, \
<ide> 'max must be larger than min in range parameter.'
<del>
<add>
<ide> if not iterable(bins):
<ide> if range is None:
<ide> range = (a.min(), a.max())
<ide> else:
<ide> warnings.warn("""
<del> Outliers handling will change in version 1.2.
<add> Outliers handling will change in version 1.2.
<ide> Please read the docstring for details.""", FutureWarning)
<ide> mn, mx = [mi+0.0 for mi in range]
<ide> if mn == mx:
<ide> mn -= 0.5
<ide> mx += 0.5
<ide> bins = linspace(mn, mx, bins, endpoint=False)
<ide> else:
<del> if normed:
<add> if normed:
<ide> raise ValueError, 'Use new=True to pass bin edges explicitly.'
<ide> warnings.warn("""
<del> The semantic for bins will change in version 1.2.
<add> The semantic for bins will change in version 1.2.
<ide> The bins will become the bin edges, instead of the left bin edges.
<ide> """, FutureWarning)
<ide> bins = asarray(bins)
<ide> if (np.diff(bins) < 0).any():
<ide> raise AttributeError, 'bins must increase monotonically.'
<del>
<del>
<add>
<add>
<ide> if weights is not None:
<ide> raise ValueError, 'weights are only available with new=True.'
<del>
<add>
<ide> # best block size probably depends on processor cache size
<ide> block = 65536
<ide> n = sort(a[:block]).searchsorted(bins)
<ide> for i in xrange(block, a.size, block):
<ide> n += sort(a[i:i+block]).searchsorted(bins)
<ide> n = concatenate([n, [len(a)]])
<ide> n = n[1:]-n[:-1]
<del>
<add>
<ide> if normed:
<ide> db = bins[1] - bins[0]
<ide> return 1.0/(a.size*db) * n, bins
<ide> else:
<ide> return n, bins
<ide>
<del>
<del>
<add>
<add>
<ide> # New behavior
<ide> elif new is True:
<ide> a = asarray(a)
<ide> def histogram(a, bins=10, range=None, normed=False, weights=None, new=False):
<ide> raise ValueError, 'weights should have the same shape as a.'
<ide> weights = weights.ravel()
<ide> a = a.ravel()
<del>
<add>
<ide> if (range is not None):
<ide> mn, mx = range
<ide> if (mn > mx):
<ide> raise AttributeError, \
<ide> 'max must be larger than min in range parameter.'
<del>
<add>
<ide> if not iterable(bins):
<ide> if range is None:
<ide> range = (a.min(), a.max())
<ide> def histogram(a, bins=10, range=None, normed=False, weights=None, new=False):
<ide> bins = asarray(bins)
<ide> if (np.diff(bins) < 0).any():
<ide> raise AttributeError, 'bins must increase monotonically.'
<del>
<add>
<ide> # Histogram is an integer or a float array depending on the weights.
<ide> if weights is None:
<ide> ntype = int
<ide> def histogram(a, bins=10, range=None, normed=False, weights=None, new=False):
<ide> tmp_w = weights[i:i+block]
<ide> sorting_index = np.argsort(tmp_a)
<ide> sa = tmp_a[sorting_index]
<del> sw = tmp_w[sorting_index]
<add> sw = tmp_w[sorting_index]
<ide> cw = np.concatenate(([zero,], sw.cumsum()))
<ide> bin_index = np.r_[sa.searchsorted(bins[:-1], 'left'), \
<ide> sa.searchsorted(bins[-1], 'right')]
<ide> n += cw[bin_index]
<del>
<add>
<ide> n = np.diff(n)
<del>
<add>
<ide> if normed is False:
<ide> return n, bins
<ide> elif normed is True:
<ide> db = array(np.diff(bins), float)
<ide> return n/(n*db).sum(), bins
<del>
<add>
<ide>
<ide> def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
<ide> """histogramdd(sample, bins=10, range=None, normed=False, weights=None)
<ide>
<ide> Return the N-dimensional histogram of the sample.
<ide>
<del> Parameters:
<del>
<del> sample : sequence or array
<del> A sequence containing N arrays or an NxM array. Input data.
<del>
<del> bins : sequence or scalar
<del> A sequence of edge arrays, a sequence of bin counts, or a scalar
<del> which is the bin count for all dimensions. Default is 10.
<del>
<del> range : sequence
<del> A sequence of lower and upper bin edges. Default is [min, max].
<del>
<del> normed : boolean
<del> If False, return the number of samples in each bin, if True,
<del> returns the density.
<add> Parameters
<add> ----------
<add> sample : sequence or array
<add> A sequence containing N arrays or an NxM array. Input data.
<ide>
<del> weights : array
<del> Array of weights. The weights are normed only if normed is True.
<del> Should the sum of the weights not equal N, the total bin count will
<del> not be equal to the number of samples.
<add> bins : sequence or scalar
<add> A sequence of edge arrays, a sequence of bin counts, or a scalar
<add> which is the bin count for all dimensions. Default is 10.
<ide>
<del> Returns:
<add> range : sequence
<add> A sequence of lower and upper bin edges. Default is [min, max].
<ide>
<del> hist : array
<del> Histogram array.
<add> normed : boolean
<add> If False, return the number of samples in each bin, if True,
<add> returns the density.
<ide>
<del> edges : list
<del> List of arrays defining the lower bin edges.
<add> weights : array
<add> Array of weights. The weights are normed only if normed is True.
<add> Should the sum of the weights not equal N, the total bin count will
<add> not be equal to the number of samples.
<ide>
<del> SeeAlso:
<add> Returns
<add> -------
<add> hist : array
<add> Histogram array.
<ide>
<del> histogram
<add> edges : list
<add> List of arrays defining the lower bin edges.
<ide>
<del> Example
<add> See Also
<add> --------
<add> histogram
<ide>
<del> >>> x = random.randn(100,3)
<del> >>> hist3d, edges = histogramdd(x, bins = (5, 6, 7))
<add> Examples
<add> --------
<add> >>> x = random.randn(100,3)
<add> >>> hist3d, edges = histogramdd(x, bins = (5, 6, 7))
<ide>
<ide> """
<ide>
<ide> def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
<ide> try:
<ide> M = len(bins)
<ide> if M != D:
<del> raise AttributeError, 'The dimension of bins must be a equal to the dimension of the sample x.'
<add> raise AttributeError, 'The dimension of bins must be equal ' \
<add> 'to the dimension of the sample x.'
<ide> except TypeError:
<ide> bins = D*[bins]
<ide>
<ide> def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
<ide> # Rounding precision
<ide> decimal = int(-log10(dedges[i].min())) +6
<ide> # Find which points are on the rightmost edge.
<del> on_edge = where(around(sample[:,i], decimal) == around(edges[i][-1], decimal))[0]
<add> on_edge = where(around(sample[:,i], decimal) == around(edges[i][-1],
<add> decimal))[0]
<ide> # Shift these points one bin to the left.
<ide> Ncount[i][on_edge] -= 1
<ide>
<ide> def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
<ide> xy += Ncount[ni[i]] * nbin[ni[i+1:]].prod()
<ide> xy += Ncount[ni[-1]]
<ide>
<del> # Compute the number of repetitions in xy and assign it to the flattened histmat.
<add> # Compute the number of repetitions in xy and assign it to the
<add> # flattened histmat.
<ide> if len(xy) == 0:
<ide> return zeros(nbin-2, int), edges
<ide>
<ide> def average(a, axis=None, weights=None, returned=False):
<ide> sum_of_weights is has the same type as the average.
<ide>
<ide>
<del> Example
<del> -------
<add> Examples
<add> --------
<ide> >>> average(range(1,11), weights=range(10,0,-1))
<ide> 4.0
<ide>
<del> Exceptions
<del> ----------
<add> Raises
<add> ------
<ide> ZeroDivisionError
<del> Raised when all weights along axis are zero. See numpy.ma.average for a
<add> When all weights along axis are zero. See numpy.ma.average for a
<ide> version robust to this type of error.
<ide> TypeError
<del> Raised when the length of 1D weights is not the same as the shape of a
<add> When the length of 1D weights is not the same as the shape of a
<ide> along axis.
<ide>
<ide> """
<ide> def sort_complex(a):
<ide> def trim_zeros(filt, trim='fb'):
<ide> """ Trim the leading and trailing zeros from a 1D array.
<ide>
<del> Example:
<del> >>> import numpy
<del> >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))
<del> >>> numpy.trim_zeros(a)
<del> array([1, 2, 3, 2, 1])
<add> Examples
<add> --------
<add> >>> import numpy
<add> >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))
<add> >>> numpy.trim_zeros(a)
<add> array([1, 2, 3, 2, 1])
<ide>
<ide> """
<ide> first = 0
<ide> def trim_zeros(filt, trim='fb'):
<ide> def unique(x):
<ide> """Return sorted unique items from an array or sequence.
<ide>
<del> Example:
<add> Examples
<add> --------
<ide> >>> unique([5,2,4,0,4,4,2,2,1])
<ide> array([0, 1, 2, 4, 5])
<ide>
<ide> def _get_nargs(obj):
<ide>
<ide> class vectorize(object):
<ide> """
<del> vectorize(somefunction, otypes=None, doc=None)
<del> Generalized Function class.
<add> vectorize(somefunction, otypes=None, doc=None)
<ide>
<del> Description:
<add> Generalized function class.
<ide>
<ide> Define a vectorized function which takes nested sequence
<ide> of objects or numpy arrays as inputs and returns a
<ide> class vectorize(object):
<ide> of data-types specifiers. There should be one data-type specifier for
<ide> each output.
<ide>
<del> Input:
<del>
<del> somefunction -- a Python function or method
<del>
<del> Example:
<add> Parameters
<add> ----------
<add> f : callable
<add> A Python function or method.
<ide>
<add> Examples
<add> --------
<ide> >>> def myfunc(a, b):
<ide> ... if a > b:
<ide> ... return a-b
<ide> def delete(arr, obj, axis=None):
<ide>
<ide> If axis is None, then ravel the array first.
<ide>
<del> Example:
<add> Examples
<add> --------
<ide> >>> arr = [[3,4,5],
<ide> ... [1,2,3],
<ide> ... [6,7,8]]
<ide> def insert(arr, obj, values, axis=None):
<ide> The obj argument can be an integer, a slice, or a sequence of
<ide> integers.
<ide>
<del> Example:
<add> Examples
<add> --------
<ide> >>> a = array([[1,2,3],
<ide> ... [4,5,6],
<ide> ... [7,8,9]]) | 1 |
Python | Python | update warning linebreaks per review | 68f4a16ce536df9a28ad5a6f40a7d04e73ab6be6 | <ide><path>numpy/__init__.py
<ide> def _mac_os_check():
<ide> error_message = "{}: {}".format(w[-1].category.__name__, str(w[-1].message))
<ide> msg = (
<ide> "Polyfit sanity test emitted a warning, most likely due "
<del> "to using a buggy Accelerate backend. If you compiled "
<del> "yourself, more information is available at "
<del> "https://numpy.org/doc/stable/user/building.html#accelerated-blas-lapack-libraries "
<del> "Otherwise report this to the vendor "
<add> "to using a buggy Accelerate backend.\nIf you compiled "
<add> "yourself, more information is available at:\n"
<add> "https://numpy.org/doc/stable/user/building.html#accelerated-blas-lapack-libraries"
<add> "\nOtherwise report this to the vendor "
<ide> "that provided NumPy.\n{}\n".format(error_message))
<ide> raise RuntimeError(msg)
<ide> del _mac_os_check | 1 |
Python | Python | use mkstemp instead | 1749a7f402ec5b0c8c5bf0c3d48339f447e68f91 | <ide><path>libcloud/test/storage/test_azure_blobs.py
<ide> def test_upload_small_block_object_success(self):
<ide> self.assertTrue('some-value' in obj.meta_data)
<ide>
<ide> def test_upload_big_block_object_success(self):
<del> file_path = tempfile.mktemp(suffix='.jpg')
<add> _, file_path = tempfile.mkstemp(suffix='.jpg')
<ide> file_size = AZURE_UPLOAD_CHUNK_SIZE + 1
<ide>
<ide> with open(file_path, 'w') as file_hdl:
<ide> def test_upload_small_block_object_success_with_lease(self):
<ide>
<ide> def test_upload_big_block_object_success_with_lease(self):
<ide> self.mock_response_klass.use_param = 'comp'
<del> file_path = tempfile.mktemp(suffix='.jpg')
<add> _, file_path = tempfile.mkstemp(suffix='.jpg')
<ide> file_size = AZURE_UPLOAD_CHUNK_SIZE * 2
<ide>
<ide> with open(file_path, 'w') as file_hdl: | 1 |
PHP | PHP | force usage getting timestamps columns | 93b5068214ddd1c1aa33bb09aea645fc916aed86 | <ide><path>src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
<ide> protected function serializeDate(DateTimeInterface $date)
<ide> */
<ide> public function getDates()
<ide> {
<del> $defaults = [static::CREATED_AT, static::UPDATED_AT];
<add> $defaults = [
<add> $this->getCreatedAtColumn(),
<add> $this->getUpdatedAtColumn(),
<add> ];
<ide>
<ide> return $this->usesTimestamps()
<ide> ? array_unique(array_merge($this->dates, $defaults))
<ide><path>src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php
<ide> protected function updateTimestamps()
<ide> {
<ide> $time = $this->freshTimestamp();
<ide>
<del> if (! is_null(static::UPDATED_AT) && ! $this->isDirty(static::UPDATED_AT)) {
<add> $updatedAtColumn = $this->getUpdatedAtColumn();
<add> if (! is_null($updatedAtColumn) && ! $this->isDirty($updatedAtColumn)) {
<ide> $this->setUpdatedAt($time);
<ide> }
<ide>
<del> if (! $this->exists && ! is_null(static::CREATED_AT) &&
<del> ! $this->isDirty(static::CREATED_AT)) {
<add> $createdAtColumn = $this->getCreatedAtColumn();
<add> if (! $this->exists && ! is_null($createdAtColumn) && ! $this->isDirty($createdAtColumn)) {
<ide> $this->setCreatedAt($time);
<ide> }
<ide> }
<ide> protected function updateTimestamps()
<ide> */
<ide> public function setCreatedAt($value)
<ide> {
<del> $this->{static::CREATED_AT} = $value;
<add> $this->{$this->getCreatedAtColumn()} = $value;
<ide>
<ide> return $this;
<ide> }
<ide> public function setCreatedAt($value)
<ide> */
<ide> public function setUpdatedAt($value)
<ide> {
<del> $this->{static::UPDATED_AT} = $value;
<add> $this->{$this->getUpdatedAtColumn()} = $value;
<ide>
<ide> return $this;
<ide> } | 2 |
Javascript | Javascript | implement transform styles, redux | 357a54500e5d50402aef4e55631d7b5fd4153042 | <ide><path>Libraries/Components/View/ViewStylePropTypes.js
<ide> var ViewStylePropTypes = {
<ide> ),
<ide> shadowOpacity: ReactPropTypes.number,
<ide> shadowRadius: ReactPropTypes.number,
<add> transform: ReactPropTypes.arrayOf(ReactPropTypes.object),
<ide> transformMatrix: ReactPropTypes.arrayOf(ReactPropTypes.number),
<add>
<add> // DEPRECATED
<ide> rotation: ReactPropTypes.number,
<ide> scaleX: ReactPropTypes.number,
<ide> scaleY: ReactPropTypes.number,
<ide><path>Libraries/ReactIOS/NativeMethodsMixin.js
<ide> var TextInputState = require('TextInputState');
<ide> var flattenStyle = require('flattenStyle');
<ide> var invariant = require('invariant');
<ide> var mergeFast = require('mergeFast');
<add>var precomputeStyle = require('precomputeStyle');
<ide>
<ide> type MeasureOnSuccessCallback = (
<ide> x: number,
<ide> var NativeMethodsMixin = {
<ide> break;
<ide> }
<ide> }
<del> var style = flattenStyle(nativeProps.style);
<add> var style = precomputeStyle(flattenStyle(nativeProps.style));
<ide>
<ide> var props = null;
<ide> if (hasOnlyStyle) {
<ide><path>Libraries/ReactIOS/ReactIOSNativeComponent.js
<ide> var styleDiffer = require('styleDiffer');
<ide> var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');
<ide> var diffRawProperties = require('diffRawProperties');
<ide> var flattenStyle = require('flattenStyle');
<add>var precomputeStyle = require('precomputeStyle');
<ide> var warning = require('warning');
<ide>
<ide> var registrationNames = ReactIOSEventEmitter.registrationNames;
<ide> ReactIOSNativeComponent.Mixin = {
<ide> // before actually doing the expensive flattening operation in order to
<ide> // compute the diff.
<ide> if (styleDiffer(nextProps.style, prevProps.style)) {
<del> var nextFlattenedStyle = flattenStyle(nextProps.style);
<add> var nextFlattenedStyle = precomputeStyle(flattenStyle(nextProps.style));
<ide> updatePayload = diffRawProperties(
<ide> updatePayload,
<ide> this.previousFlattenedStyle,
<ide><path>Libraries/StyleSheet/precomputeStyle.js
<add>/**
<add> * Copyright (c) 2015-present, Facebook, Inc.
<add> * All rights reserved.
<add> *
<add> * This source code is licensed under the BSD-style license found in the
<add> * LICENSE file in the root directory of this source tree. An additional grant
<add> * of patent rights can be found in the PATENTS file in the same directory.
<add> *
<add> * @providesModule precomputeStyle
<add> * @flow
<add> */
<add>'use strict';
<add>
<add>var MatrixMath = require('MatrixMath');
<add>var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');
<add>var invariant = require('invariant');
<add>
<add>/**
<add> * This method provides a hook where flattened styles may be precomputed or
<add> * otherwise prepared to become better input data for native code.
<add> */
<add>function precomputeStyle(style: ?Object): ?Object {
<add> if (!style || !style.transform) {
<add> return style;
<add> }
<add> invariant(
<add> !style.transformMatrix,
<add> 'transformMatrix and transform styles cannot be used on the same component'
<add> );
<add> var newStyle = _precomputeTransforms({...style});
<add> deepFreezeAndThrowOnMutationInDev(newStyle);
<add> return newStyle;
<add>}
<add>
<add>/**
<add> * Generate a transform matrix based on the provided transforms, and use that
<add> * within the style object instead.
<add> *
<add> * This allows us to provide an API that is similar to CSS and to have a
<add> * universal, singular interface to native code.
<add> */
<add>function _precomputeTransforms(style: Object): Object {
<add> var {transform} = style;
<add> var result = MatrixMath.createIdentityMatrix();
<add>
<add> transform.forEach(transformation => {
<add> var key = Object.keys(transformation)[0];
<add> var value = transformation[key];
<add> if (__DEV__) {
<add> _validateTransform(key, value, transformation);
<add> }
<add>
<add> switch (key) {
<add> case 'matrix':
<add> MatrixMath.multiplyInto(result, result, value);
<add> break;
<add> case 'rotate':
<add> _multiplyTransform(result, MatrixMath.reuseRotateZCommand, [_convertToRadians(value)]);
<add> break;
<add> case 'scale':
<add> _multiplyTransform(result, MatrixMath.reuseScaleCommand, [value]);
<add> break;
<add> case 'scaleX':
<add> _multiplyTransform(result, MatrixMath.reuseScaleXCommand, [value]);
<add> break;
<add> case 'scaleY':
<add> _multiplyTransform(result, MatrixMath.reuseScaleYCommand, [value]);
<add> break;
<add> case 'translate':
<add> _multiplyTransform(result, MatrixMath.reuseTranslate3dCommand, [value[0], value[1], value[2] || 0]);
<add> break;
<add> case 'translateX':
<add> _multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [value, 0]);
<add> break;
<add> case 'translateY':
<add> _multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [0, value]);
<add> break;
<add> default:
<add> throw new Error('Invalid transform name: ' + key);
<add> }
<add> });
<add>
<add> return {
<add> ...style,
<add> transformMatrix: result,
<add> };
<add>}
<add>
<add>/**
<add> * Performs a destructive operation on a transform matrix.
<add> */
<add>function _multiplyTransform(
<add> result: Array<number>,
<add> matrixMathFunction: Function,
<add> args: Array<number>
<add>): void {
<add> var matrixToApply = MatrixMath.createIdentityMatrix();
<add> var argsWithIdentity = [matrixToApply].concat(args);
<add> matrixMathFunction.apply(this, argsWithIdentity);
<add> MatrixMath.multiplyInto(result, result, matrixToApply);
<add>}
<add>
<add>/**
<add> * Parses a string like '0.5rad' or '60deg' into radians expressed in a float.
<add> * Note that validation on the string is done in `_validateTransform()`.
<add> */
<add>function _convertToRadians(value: string): number {
<add> var floatValue = parseFloat(value, 10);
<add> return value.indexOf('rad') > -1 ? floatValue : floatValue * Math.PI / 180;
<add>}
<add>
<add>function _validateTransform(key, value, transformation) {
<add> var multivalueTransforms = [
<add> 'matrix',
<add> 'translate',
<add> ];
<add> if (multivalueTransforms.indexOf(key) !== -1) {
<add> invariant(
<add> Array.isArray(value),
<add> 'Transform with key of %s must have an array as the value: %s',
<add> key,
<add> JSON.stringify(transformation)
<add> );
<add> }
<add> switch (key) {
<add> case 'matrix':
<add> invariant(
<add> value.length === 9 || value.length === 16,
<add> 'Matrix transform must have a length of 9 (2d) or 16 (3d). ' +
<add> 'Provided matrix has a length of %s: %s',
<add> value.length,
<add> JSON.stringify(transformation)
<add> );
<add> break;
<add> case 'translate':
<add> break;
<add> case 'rotate':
<add> invariant(
<add> typeof value === 'string',
<add> 'Transform with key of "%s" must be a string: %s',
<add> key,
<add> JSON.stringify(transformation)
<add> );
<add> invariant(
<add> value.indexOf('deg') > -1 || value.indexOf('rad') > -1,
<add> 'Rotate transform must be expressed in degrees (deg) or radians ' +
<add> '(rad): %s',
<add> JSON.stringify(transformation)
<add> );
<add> break;
<add> default:
<add> invariant(
<add> typeof value === 'number',
<add> 'Transform with key of "%s" must be a number: %s',
<add> key,
<add> JSON.stringify(transformation)
<add> );
<add> }
<add>}
<add>
<add>module.exports = precomputeStyle;
<ide><path>Libraries/Utilities/MatrixMath.js
<add>/**
<add> * Copyright 2004-present Facebook. All Rights Reserved.
<add> *
<add> * @providesModule MatrixMath
<add> */
<add>'use strict';
<add>
<add>/**
<add> * Memory conservative (mutative) matrix math utilities. Uses "command"
<add> * matrices, which are reusable.
<add> */
<add>var MatrixMath = {
<add> createIdentityMatrix: function() {
<add> return [
<add> 1,0,0,0,
<add> 0,1,0,0,
<add> 0,0,1,0,
<add> 0,0,0,1
<add> ];
<add> },
<add>
<add> createCopy: function(m) {
<add> return [
<add> m[0], m[1], m[2], m[3],
<add> m[4], m[5], m[6], m[7],
<add> m[8], m[9], m[10], m[11],
<add> m[12], m[13], m[14], m[15],
<add> ];
<add> },
<add>
<add> createTranslate2d: function(x, y) {
<add> var mat = MatrixMath.createIdentityMatrix();
<add> MatrixMath.reuseTranslate2dCommand(mat, x, y);
<add> return mat;
<add> },
<add>
<add> reuseTranslate2dCommand: function(matrixCommand, x, y) {
<add> matrixCommand[12] = x;
<add> matrixCommand[13] = y;
<add> },
<add>
<add> reuseTranslate3dCommand: function(matrixCommand, x, y, z) {
<add> matrixCommand[12] = x;
<add> matrixCommand[13] = y;
<add> matrixCommand[14] = z;
<add> },
<add>
<add> createScale: function(factor) {
<add> var mat = MatrixMath.createIdentityMatrix();
<add> MatrixMath.reuseScaleCommand(mat, factor);
<add> return mat;
<add> },
<add>
<add> reuseScaleCommand: function(matrixCommand, factor) {
<add> matrixCommand[0] = factor;
<add> matrixCommand[5] = factor;
<add> },
<add>
<add> reuseScale3dCommand: function(matrixCommand, x, y, z) {
<add> matrixCommand[0] = x;
<add> matrixCommand[5] = y;
<add> matrixCommand[10] = z;
<add> },
<add>
<add> reuseScaleXCommand(matrixCommand, factor) {
<add> matrixCommand[0] = factor;
<add> },
<add>
<add> reuseScaleYCommand(matrixCommand, factor) {
<add> matrixCommand[5] = factor;
<add> },
<add>
<add> reuseScaleZCommand(matrixCommand, factor) {
<add> matrixCommand[10] = factor;
<add> },
<add>
<add> reuseRotateYCommand: function(matrixCommand, amount) {
<add> matrixCommand[0] = Math.cos(amount);
<add> matrixCommand[2] = Math.sin(amount);
<add> matrixCommand[8] = Math.sin(-amount);
<add> matrixCommand[10] = Math.cos(amount);
<add> },
<add>
<add> createRotateZ: function(radians) {
<add> var mat = MatrixMath.createIdentityMatrix();
<add> MatrixMath.reuseRotateZCommand(mat, radians);
<add> return mat;
<add> },
<add>
<add> // http://www.w3.org/TR/css3-transforms/#recomposing-to-a-2d-matrix
<add> reuseRotateZCommand: function(matrixCommand, radians) {
<add> matrixCommand[0] = Math.cos(radians);
<add> matrixCommand[1] = Math.sin(radians);
<add> matrixCommand[4] = -Math.sin(radians);
<add> matrixCommand[5] = Math.cos(radians);
<add> },
<add>
<add> multiplyInto: function(out, a, b) {
<add> var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],
<add> a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
<add> a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],
<add> a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
<add>
<add> var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
<add> out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
<add> out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
<add> out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
<add> out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
<add>
<add> b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];
<add> out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
<add> out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
<add> out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
<add> out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
<add>
<add> b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];
<add> out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
<add> out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
<add> out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
<add> out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
<add>
<add> b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];
<add> out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
<add> out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
<add> out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
<add> out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
<add> }
<add>
<add>};
<add>
<add>module.exports = MatrixMath; | 5 |
Ruby | Ruby | fix plugin generation inside applications | 3dfa9b9e29ce7ccf78d7c7ee01334b4645393251 | <ide><path>railties/lib/rails/app_updater.rb
<ide> def app_generator
<ide> private
<ide> def generator_options
<ide> options = { api: !!Rails.application.config.api_only, update: true }
<add> options[:name] = Rails.application.class.name.chomp("::Application").underscore
<ide> options[:skip_active_job] = !defined?(ActiveJob::Railtie)
<ide> options[:skip_active_record] = !defined?(ActiveRecord::Railtie)
<ide> options[:skip_active_storage] = !defined?(ActiveStorage::Engine)
<ide><path>railties/lib/rails/generators/app_name.rb
<ide> def app_name
<ide> end
<ide>
<ide> def original_app_name
<del> @original_app_name ||= defined_app_const_base? ? defined_app_name : (options[:name] || File.basename(destination_root))
<add> @original_app_name ||= (options[:name] || File.basename(destination_root))
<ide> end
<ide>
<del> def defined_app_name
<del> defined_app_const_base.underscore
<del> end
<del>
<del> def defined_app_const_base
<del> Rails.respond_to?(:application) && defined?(Rails::Application) &&
<del> Rails.application.is_a?(Rails::Application) && Rails.application.class.name.chomp("::Application")
<del> end
<del>
<del> alias :defined_app_const_base? :defined_app_const_base
<del>
<ide> def app_const_base
<del> @app_const_base ||= defined_app_const_base || app_name.gsub(/\W/, "_").squeeze("_").camelize
<add> @app_const_base ||= app_name.gsub(/\W/, "_").squeeze("_").camelize
<ide> end
<ide> alias :camelized :app_const_base
<ide>
<ide><path>railties/test/application/generators_test.rb
<ide> def with_bare_config
<ide> assert File.exist?(File.join(rails_root, "vendor/plugins/bukkits/test/dummy/config/application.rb"))
<ide> end
<ide>
<add> test "allow generating plugin inside Rails app directory" do
<add> rails "generate", "plugin", "vendor/plugins/bukkits"
<add> assert File.exist?(File.join(rails_root, "vendor/plugins/bukkits/test/dummy/config/application.rb"))
<add> end
<add>
<ide> test "generators default values" do
<ide> with_bare_config do |c|
<ide> assert_equal(true, c.generators.colorize_logging)
<ide><path>railties/test/generators/db_system_change_generator_test.rb
<ide> class ChangeGeneratorTest < Rails::Generators::TestCase
<ide>
<ide> assert_file("config/database.yml") do |content|
<ide> assert_match "adapter: postgresql", content
<del> assert_match "database: test_app", content
<add> assert_match "database: tmp_production", content
<ide> end
<ide>
<ide> assert_file("Gemfile") do |content|
<ide> class ChangeGeneratorTest < Rails::Generators::TestCase
<ide>
<ide> assert_file("config/database.yml") do |content|
<ide> assert_match "adapter: mysql2", content
<del> assert_match "database: test_app", content
<add> assert_match "database: tmp_production", content
<ide> end
<ide>
<ide> assert_file("Gemfile") do |content|
<ide> class ChangeGeneratorTest < Rails::Generators::TestCase
<ide>
<ide> assert_file("config/database.yml") do |content|
<ide> assert_match "adapter: mysql2", content
<del> assert_match "database: test_app", content
<add> assert_match "database: tmp_production", content
<ide> end
<ide>
<ide> assert_file("Gemfile") do |content| | 4 |
PHP | PHP | add comprovation before replacing the namespace | 37d429d485b3dc36536e08e0b8b01d7941f73248 | <ide><path>src/Illuminate/Foundation/Console/PolicyMakeCommand.php
<ide> class PolicyMakeCommand extends GeneratorCommand
<ide> protected function buildClass($name)
<ide> {
<ide> $stub = parent::buildClass($name);
<del>
<add>
<ide> $stub = $this->replaceUserModelNamespace($stub);
<ide>
<ide> $model = $this->option('model');
<ide> protected function buildClass($name)
<ide> }
<ide>
<ide> /**
<del> * Replace the user model for the given stub.
<add> * Replace the user model namespace for the given stub.
<ide> *
<ide> * @param string $stub
<ide> * @return string
<ide> */
<ide> protected function replaceUserModelNamespace($stub)
<ide> {
<del> return str_replace($this->rootNamespace().'User', config('auth.providers.users.model'), $stub);
<add> if ($this->getDefaultUserNamespace() != $this->getRealUserNamespace()) {
<add> return str_replace($this->getDefaultUserNamespace(), $this->getRealUserNamespace(), $stub);
<add> }
<add>
<add> return $stub;
<add> }
<add>
<add> /**
<add> * Get the default namespace for the user model
<add> *
<add> * @return string
<add> */
<add> public function getDefaultUserNamespace()
<add> {
<add> return $this->rootNamespace() . 'User';
<add> }
<add>
<add> /**
<add> * Get the real namespace for the user model
<add> *
<add> * @return string
<add> */
<add> public function getRealUserNamespace()
<add> {
<add> return config('auth.providers.users.model');
<ide> }
<ide>
<ide> /** | 1 |
Javascript | Javascript | simplify createrequire() validation | 639b85950b15a1f4d1c71bfbd4caa39817f67b6b | <ide><path>lib/internal/modules/cjs/loader.js
<ide> const createRequireError = 'must be a file URL object, file URL string, or' +
<ide>
<ide> function createRequire(filename) {
<ide> let filepath;
<del> if (typeof filename === 'object' && !(filename instanceof URL)) {
<del> throw new ERR_INVALID_ARG_VALUE('filename', filename, createRequireError);
<del> } else if (typeof filename === 'object' ||
<del> typeof filename === 'string' && !path.isAbsolute(filename)) {
<add>
<add> if (filename instanceof URL ||
<add> (typeof filename === 'string' && !path.isAbsolute(filename))) {
<ide> try {
<ide> filepath = fileURLToPath(filename);
<ide> } catch { | 1 |
Go | Go | pass controller into createtestnetwork | 0411336b49495e95380f0fc960fef163053a7c4a | <ide><path>libnetwork/libnetwork_linux_test.go
<ide> var createTesthostNetworkOnce sync.Once
<ide> func getTesthostNetwork(t *testing.T) libnetwork.Network {
<ide> t.Helper()
<ide> createTesthostNetworkOnce.Do(func() {
<del> _, err := createTestNetwork("host", "testhost", options.Generic{}, nil, nil)
<add> _, err := createTestNetwork(controller, "host", "testhost", options.Generic{}, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func createGlobalInstance(t *testing.T) {
<ide> }
<ide>
<ide> net1 := getTesthostNetwork(t)
<del> net2, err := createTestNetwork("bridge", "network2", netOption, nil, nil)
<add> net2, err := createTestNetwork(controller, "bridge", "network2", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestEndpointJoin(t *testing.T) {
<ide> }
<ide>
<ide> // Now test the container joining another network
<del> n2, err := createTestNetwork(bridgeNetType, "testnetwork2",
<add> n2, err := createTestNetwork(controller, bridgeNetType, "testnetwork2",
<ide> options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork2",
<ide> func TestExternalKey(t *testing.T) {
<ide> func externalKeyTest(t *testing.T, reexec bool) {
<ide> defer testutils.SetupTestOSContext(t)()
<ide>
<del> n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
<add> n, err := createTestNetwork(controller, bridgeNetType, "testnetwork", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork",
<ide> },
<ide> func externalKeyTest(t *testing.T, reexec bool) {
<ide> }
<ide> }()
<ide>
<del> n2, err := createTestNetwork(bridgeNetType, "testnetwork2", options.Generic{
<add> n2, err := createTestNetwork(controller, bridgeNetType, "testnetwork2", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork2",
<ide> },
<ide> func TestEnableIPv6(t *testing.T) {
<ide> }
<ide> ipamV6ConfList := []*libnetwork.IpamConf{{PreferredPool: "fe99::/64", Gateway: "fe99::9"}}
<ide>
<del> n, err := createTestNetwork("bridge", "testnetwork", netOption, nil, ipamV6ConfList)
<add> n, err := createTestNetwork(controller, "bridge", "testnetwork", netOption, nil, ipamV6ConfList)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestResolvConf(t *testing.T) {
<ide> "BridgeName": "testnetwork",
<ide> },
<ide> }
<del> n, err := createTestNetwork("bridge", "testnetwork", netOption, nil, nil)
<add> n, err := createTestNetwork(controller, "bridge", "testnetwork", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestBridge(t *testing.T) {
<ide> ipamV4ConfList := []*libnetwork.IpamConf{{PreferredPool: "192.168.100.0/24", Gateway: "192.168.100.1"}}
<ide> ipamV6ConfList := []*libnetwork.IpamConf{{PreferredPool: "fe90::/64", Gateway: "fe90::22"}}
<ide>
<del> network, err := createTestNetwork(bridgeNetType, "testnetwork", netOption, ipamV4ConfList, ipamV6ConfList)
<add> network, err := createTestNetwork(controller, bridgeNetType, "testnetwork", netOption, ipamV4ConfList, ipamV6ConfList)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide><path>libnetwork/libnetwork_test.go
<ide> func createController() error {
<ide> return err
<ide> }
<ide>
<del>func createTestNetwork(networkType, networkName string, netOption options.Generic, ipamV4Configs, ipamV6Configs []*libnetwork.IpamConf) (libnetwork.Network, error) {
<del> return controller.NewNetwork(networkType, networkName, "",
<add>func createTestNetwork(c libnetwork.NetworkController, networkType, networkName string, netOption options.Generic, ipamV4Configs, ipamV6Configs []*libnetwork.IpamConf) (libnetwork.Network, error) {
<add> return c.NewNetwork(networkType, networkName, "",
<ide> libnetwork.NetworkOptionGeneric(netOption),
<ide> libnetwork.NetworkOptionIpam(ipamapi.DefaultIPAM, "", ipamV4Configs, ipamV6Configs, nil))
<ide> }
<ide> func TestNull(t *testing.T) {
<ide> t.Fatal(err)
<ide> }
<ide>
<del> network, err := createTestNetwork("null", "testnull", options.Generic{}, nil, nil)
<add> network, err := createTestNetwork(controller, "null", "testnull", options.Generic{}, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestNull(t *testing.T) {
<ide> func TestUnknownDriver(t *testing.T) {
<ide> defer testutils.SetupTestOSContext(t)()
<ide>
<del> _, err := createTestNetwork("unknowndriver", "testnetwork", options.Generic{}, nil, nil)
<add> _, err := createTestNetwork(controller, "unknowndriver", "testnetwork", options.Generic{}, nil, nil)
<ide> if err == nil {
<ide> t.Fatal("Expected to fail. But instead succeeded")
<ide> }
<ide> func TestNetworkName(t *testing.T) {
<ide> },
<ide> }
<ide>
<del> _, err := createTestNetwork(bridgeNetType, "", netOption, nil, nil)
<add> _, err := createTestNetwork(controller, bridgeNetType, "", netOption, nil, nil)
<ide> if err == nil {
<ide> t.Fatal("Expected to fail. But instead succeeded")
<ide> }
<ide> func TestNetworkName(t *testing.T) {
<ide> }
<ide>
<ide> networkName := "testnetwork"
<del> n, err := createTestNetwork(bridgeNetType, networkName, netOption, nil, nil)
<add> n, err := createTestNetwork(controller, bridgeNetType, networkName, netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestNetworkType(t *testing.T) {
<ide> },
<ide> }
<ide>
<del> n, err := createTestNetwork(bridgeNetType, "testnetwork", netOption, nil, nil)
<add> n, err := createTestNetwork(controller, bridgeNetType, "testnetwork", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestNetworkID(t *testing.T) {
<ide> },
<ide> }
<ide>
<del> n, err := createTestNetwork(bridgeNetType, "testnetwork", netOption, nil, nil)
<add> n, err := createTestNetwork(controller, bridgeNetType, "testnetwork", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestDeleteNetworkWithActiveEndpoints(t *testing.T) {
<ide> netlabel.GenericData: netOption,
<ide> }
<ide>
<del> network, err := createTestNetwork(bridgeNetType, "testnetwork", option, nil, nil)
<add> network, err := createTestNetwork(controller, bridgeNetType, "testnetwork", option, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestUnknownNetwork(t *testing.T) {
<ide> netlabel.GenericData: netOption,
<ide> }
<ide>
<del> network, err := createTestNetwork(bridgeNetType, "testnetwork", option, nil, nil)
<add> network, err := createTestNetwork(controller, bridgeNetType, "testnetwork", option, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestUnknownEndpoint(t *testing.T) {
<ide> }
<ide> ipamV4ConfList := []*libnetwork.IpamConf{{PreferredPool: "192.168.100.0/24"}}
<ide>
<del> network, err := createTestNetwork(bridgeNetType, "testnetwork", option, ipamV4ConfList, nil)
<add> network, err := createTestNetwork(controller, bridgeNetType, "testnetwork", option, ipamV4ConfList, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestNetworkEndpointsWalkers(t *testing.T) {
<ide> },
<ide> }
<ide>
<del> net1, err := createTestNetwork(bridgeNetType, "network1", netOption, nil, nil)
<add> net1, err := createTestNetwork(controller, bridgeNetType, "network1", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestNetworkEndpointsWalkers(t *testing.T) {
<ide> },
<ide> }
<ide>
<del> net2, err := createTestNetwork(bridgeNetType, "network2", netOption, nil, nil)
<add> net2, err := createTestNetwork(controller, bridgeNetType, "network2", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestDuplicateEndpoint(t *testing.T) {
<ide> "BridgeName": "testnetwork",
<ide> },
<ide> }
<del> n, err := createTestNetwork(bridgeNetType, "testnetwork", netOption, nil, nil)
<add> n, err := createTestNetwork(controller, bridgeNetType, "testnetwork", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestControllerQuery(t *testing.T) {
<ide> "BridgeName": "network1",
<ide> },
<ide> }
<del> net1, err := createTestNetwork(bridgeNetType, "network1", netOption, nil, nil)
<add> net1, err := createTestNetwork(controller, bridgeNetType, "network1", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestControllerQuery(t *testing.T) {
<ide> "BridgeName": "network2",
<ide> },
<ide> }
<del> net2, err := createTestNetwork(bridgeNetType, "network2", netOption, nil, nil)
<add> net2, err := createTestNetwork(controller, bridgeNetType, "network2", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func TestNetworkQuery(t *testing.T) {
<ide> "BridgeName": "network1",
<ide> },
<ide> }
<del> net1, err := createTestNetwork(bridgeNetType, "network1", netOption, nil, nil)
<add> net1, err := createTestNetwork(controller, bridgeNetType, "network1", netOption, nil, nil)
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<ide> func (f *fakeSandbox) DisableService() error {
<ide> func TestEndpointDeleteWithActiveContainer(t *testing.T) {
<ide> defer testutils.SetupTestOSContext(t)()
<ide>
<del> n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
<add> n, err := createTestNetwork(controller, bridgeNetType, "testnetwork", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork",
<ide> },
<ide> func TestEndpointDeleteWithActiveContainer(t *testing.T) {
<ide> }
<ide> }()
<ide>
<del> n2, err := createTestNetwork(bridgeNetType, "testnetwork2", options.Generic{
<add> n2, err := createTestNetwork(controller, bridgeNetType, "testnetwork2", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork2",
<ide> },
<ide> func TestEndpointDeleteWithActiveContainer(t *testing.T) {
<ide> func TestEndpointMultipleJoins(t *testing.T) {
<ide> defer testutils.SetupTestOSContext(t)()
<ide>
<del> n, err := createTestNetwork(bridgeNetType, "testmultiple", options.Generic{
<add> n, err := createTestNetwork(controller, bridgeNetType, "testmultiple", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testmultiple",
<ide> },
<ide> func TestEndpointMultipleJoins(t *testing.T) {
<ide> func TestLeaveAll(t *testing.T) {
<ide> defer testutils.SetupTestOSContext(t)()
<ide>
<del> n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
<add> n, err := createTestNetwork(controller, bridgeNetType, "testnetwork", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork",
<ide> },
<ide> func TestLeaveAll(t *testing.T) {
<ide> }
<ide> }()
<ide>
<del> n2, err := createTestNetwork(bridgeNetType, "testnetwork2", options.Generic{
<add> n2, err := createTestNetwork(controller, bridgeNetType, "testnetwork2", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork2",
<ide> },
<ide> func TestLeaveAll(t *testing.T) {
<ide> func TestContainerInvalidLeave(t *testing.T) {
<ide> defer testutils.SetupTestOSContext(t)()
<ide>
<del> n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
<add> n, err := createTestNetwork(controller, bridgeNetType, "testnetwork", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork",
<ide> },
<ide> func TestContainerInvalidLeave(t *testing.T) {
<ide> func TestEndpointUpdateParent(t *testing.T) {
<ide> defer testutils.SetupTestOSContext(t)()
<ide>
<del> n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
<add> n, err := createTestNetwork(controller, bridgeNetType, "testnetwork", options.Generic{
<ide> netlabel.GenericData: options.Generic{
<ide> "BridgeName": "testnetwork",
<ide> }, | 2 |
Javascript | Javascript | remove platform check from websocket module | b9be28915cf323eb36f1d7c77821cdf994954074 | <ide><path>Libraries/WebSocket/WebSocket.js
<ide> const EventTarget = require('event-target-shim');
<ide> const NativeEventEmitter = require('NativeEventEmitter');
<ide> const BlobManager = require('BlobManager');
<ide> const NativeModules = require('NativeModules');
<del>const Platform = require('Platform');
<ide> const WebSocketEvent = require('WebSocketEvent');
<ide>
<ide> /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
<ide> class WebSocket extends EventTarget(...WEBSOCKET_EVENTS) {
<ide> }
<ide>
<ide> _close(code?: number, reason?: string): void {
<del> if (Platform.OS === 'android') {
<add> if (WebSocketModule.close.length === 3) {
<ide> // See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
<ide> const statusCode = typeof code === 'number' ? code : CLOSE_NORMAL;
<ide> const closeReason = typeof reason === 'string' ? reason : ''; | 1 |
Text | Text | update index.md fonts | ffefb3cdccb3f24c5c94ca621ee50c3d1e3a42dd | <ide><path>guide/english/css/fonts/index.md
<ide> p {
<ide> font-family: "Times New Roman", Times, serif;
<ide> }
<ide> ```
<del>
<ide> In the above example, "Times New Roman" and "Times" are <family-name>s and "serif" is a <generic-name>. Generic names are used as a fallback mechanism for preserving style if the <family-name> is unavailable. A generic name should always be the last item in the list of font family names. The generic family name options are:
<ide>
<ide> * serif
<ide> p {
<ide> - [CSSFontStack](https://www.cssfontstack.com/)
<ide> - [Google Fonts](https://fonts.google.com/)
<ide> - [Google Docs: How to get started](https://developers.google.com/fonts/docs/getting_started)
<add>- [W3 Schools - Examples of websafe fonts](https://www.w3schools.com/cssref/css_websafe_fonts.asp)
<ide>\ No newline at end of file | 1 |
Text | Text | add 0.70.3 changelog | 4a786d6b0d7a3420afdfb6b136d2ee3fa3b53145 | <ide><path>CHANGELOG.md
<ide> # Changelog
<ide>
<add>## v0.70.3
<add>
<add>### Fixed
<add>
<add>- Stop styles from being reset when detaching Animated.Values in old renderer ([2f58e52006](https://github.com/facebook/react-native/commit/2f58e520061a31ab90f7bbeef59e2bf723605106) by [@javache](https://github.com/javache))
<add>- Revert "Fix TextInput dropping text when used as uncontrolled component with `defaultValue`" to fix TextInputs not being settable to undefined programmatically ([e2645a5](https://github.com/facebook/react-native/commit/e2645a59f6211116d2069967443502910c167d6f)) by Garrett Forbes Monroe
<add>
<add>#### Android specific
<add>
<add>- Use NMake generator for Hermes build on Windows ([9d08d55bbe](https://github.com/facebook/react-native/commit/9d08d55bbef4e79a8843deef90bef828f7b9a6ef) by [@mganandraj](https://github.com/mganandraj))
<add>- Fixing failure building RN codegen CLI on Windows ([85c0c0f21f](https://github.com/facebook/react-native/commit/85c0c0f21fdb52543e603687a3c42dc40dff572b) by [@mganandraj](https://github.com/mganandraj))
<add>
<add>#### iOS specific
<add>
<add>- Add xcode 14 workaround (turn off signing resource bundles) for `React-Core` ([967de03f30](https://github.com/facebook/react-native/commit/967de03f304404ac8817936da37ca39514a09e33) by [@kelset](https://github.com/kelset))
<add>
<ide> ## v0.70.2
<ide>
<ide> ### Added | 1 |
Mixed | Javascript | pass fabric flag from native to js | cbb7c7c193ff3ba183e3c2243ec16e196d290996 | <ide><path>Libraries/Components/View/TestFabricView.js
<del>/**
<del> * Copyright (c) 2015-present, Facebook, Inc.
<del> *
<del> * This source code is licensed under the MIT license found in the
<del> * LICENSE file in the root directory of this source tree.
<del> *
<del> * @providesModule TestFabricView
<del> * @flow
<del> * @format
<del> */
<del>'use strict';
<del>
<del>/**
<del> * This is a switch on the correct View to use for Fabric testing purposes
<del> */
<del>let TestFabricView;
<del>const FabricTestModule = require('NativeModules').FabricTestModule;
<del>if (FabricTestModule && FabricTestModule.IS_FABRIC_ENABLED) {
<del> TestFabricView = require('FabricView');
<del>} else {
<del> TestFabricView = require('View');
<del>}
<del>
<del>module.exports = TestFabricView;
<ide><path>Libraries/Components/View/requireFabricView.js
<add>/**
<add> * Copyright (c) 2015-present, Facebook, Inc.
<add> *
<add> * This source code is licensed under the MIT license found in the
<add> * LICENSE file in the root directory of this source tree.
<add> *
<add> * @providesModule requireFabricView
<add> * @flow
<add> * @format
<add> */
<add>'use strict';
<add>
<add>/**
<add> * This is a switch on the correct view to use for Fabric
<add> */
<add>module.exports = (name: string, fabric: boolean) => {
<add> switch (name) {
<add> case 'View':
<add> return fabric ? require('FabricView') : require('View');
<add> case 'Text':
<add> return fabric ? require('FabricText') : require('Text');
<add> default:
<add> throw new Error(name + ' is not supported by Fabric yet');
<add> }
<add>};
<ide><path>Libraries/ReactNative/AppRegistry.js
<ide> export type AppConfig = {
<ide> component?: ComponentProvider,
<ide> run?: Function,
<ide> section?: boolean,
<del> fabric?: boolean,
<ide> };
<ide> export type Runnable = {
<ide> component?: ComponentProvider,
<ide> const AppRegistry = {
<ide> appConfig.appKey,
<ide> appConfig.component,
<ide> appConfig.section,
<del> appConfig.fabric,
<ide> );
<ide> }
<ide> });
<ide> const AppRegistry = {
<ide> appKey: string,
<ide> componentProvider: ComponentProvider,
<ide> section?: boolean,
<del> fabric?: boolean,
<ide> ): string {
<ide> runnables[appKey] = {
<ide> componentProvider,
<ide> run: appParameters => {
<ide> let renderFunc = renderApplication;
<del> if (fabric) {
<add> if (appParameters.fabric) {
<ide> invariant(
<ide> fabricRendererProvider != null,
<ide> 'A Fabric renderer provider must be set to render Fabric components',
<ide><path>Libraries/ReactNative/renderFabricSurface.js
<ide> function renderFabricSurface<Props: Object>(
<ide> fabric={true}
<ide> rootTag={rootTag}
<ide> WrapperComponent={WrapperComponent}>
<del> <RootComponent {...initialProps} rootTag={rootTag} />
<add> <RootComponent {...initialProps} rootTag={rootTag} fabric={true} />
<ide> </AppContainer>
<ide> );
<ide>
<ide><path>Libraries/Text/TestFabricText.js
<del>/**
<del> * Copyright (c) 2015-present, Facebook, Inc.
<del> *
<del> * This source code is licensed under the MIT license found in the
<del> * LICENSE file in the root directory of this source tree.
<del> *
<del> * @providesModule TestFabricText
<del> * @flow
<del> * @format
<del> */
<del>'use strict';
<del>
<del>/**
<del> * This is a switch on the correct Text to use for Fabric testing purposes
<del> */
<del>let TestFabricText;
<del>const FabricTestModule = require('NativeModules').FabricTestModule;
<del>if (FabricTestModule && FabricTestModule.IS_FABRIC_ENABLED) {
<del> TestFabricText = require('FabricText');
<del>} else {
<del> TestFabricText = require('Text');
<del>}
<del>
<del>module.exports = TestFabricText;
<ide><path>ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactInstrumentationTest.java
<ide> import android.view.ViewGroup;
<ide> import com.facebook.react.bridge.JavaScriptModule;
<ide> import com.facebook.react.bridge.ReactContext;
<del>import com.facebook.react.testing.fabric.FabricTestModule;
<ide> import com.facebook.react.testing.idledetection.IdleWaiter;
<ide>
<ide> /**
<ide> protected <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface) {
<ide> * Override this method to provide extra native modules to be loaded before the app starts
<ide> */
<ide> protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {
<del> ReactInstanceSpecForTest instanceSpec = new ReactInstanceSpecForTest();
<del> if (isFabricTest()) {
<del> instanceSpec.addNativeModule(new FabricTestModule(isFabricTest()));
<del> }
<del> return instanceSpec;
<add> return new ReactInstanceSpecForTest();
<ide> }
<ide>
<ide> /**
<ide><path>ReactAndroid/src/androidTest/java/com/facebook/react/testing/fabric/FabricTestModule.java
<del>/**
<del> * Copyright (c) 2014-present, Facebook, Inc.
<del> *
<del> * This source code is licensed under the MIT license found in the
<del> * LICENSE file in the root directory of this source tree.
<del> */
<del>
<del>package com.facebook.react.testing.fabric;
<del>
<del>import com.facebook.react.common.MapBuilder;
<del>import java.util.Map;
<del>import javax.annotation.Nullable;
<del>
<del>import com.facebook.react.bridge.BaseJavaModule;
<del>import com.facebook.react.bridge.ReactMethod;
<del>import com.facebook.react.bridge.ReadableArray;
<del>import com.facebook.react.bridge.ReadableMap;
<del>
<del>/**
<del> * Module to indicate if a test is using Fabric
<del> */
<del>public final class FabricTestModule extends BaseJavaModule {
<del>
<del> private final boolean mIsFabricEnabled;
<del>
<del> public FabricTestModule(boolean isFabricEnabled) {
<del> mIsFabricEnabled = isFabricEnabled;
<del> }
<del>
<del> @Override
<del> public String getName() {
<del> return "FabricTestModule";
<del> }
<del>
<del> @Override
<del> public Map<String, Object> getConstants() {
<del> return MapBuilder.<String, Object>of("IS_FABRIC_ENABLED", mIsFabricEnabled);
<del> }
<del>}
<ide><path>ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java
<ide> private void defaultJSEntryPoint() {
<ide> if (appProperties != null) {
<ide> appParams.putMap("initialProps", Arguments.fromBundle(appProperties));
<ide> }
<add> if (isFabric()) {
<add> appParams.putBoolean("fabric", true);
<add> }
<ide>
<ide> mShouldLogContentAppeared = true;
<ide> | 8 |
Go | Go | fix validation for utsmode, usernsmode, pidmode | e7d75c8db7da8be0ae45a1abba5652658c536a2a | <ide><path>api/types/container/hostconfig.go
<ide> func (n UsernsMode) IsHost() bool {
<ide>
<ide> // IsPrivate indicates whether the container uses the a private userns.
<ide> func (n UsernsMode) IsPrivate() bool {
<del> return !(n.IsHost())
<add> return !n.IsHost()
<ide> }
<ide>
<ide> // Valid indicates whether the userns is valid.
<ide> func (n UsernsMode) Valid() bool {
<del> if string(n) == "" {
<del> return true
<del> }
<del>
<del> switch mode, _, _ := strings.Cut(string(n), ":"); mode {
<del> case "host":
<del> return true
<del> default:
<del> return false
<del> }
<add> return n == "" || n.IsHost()
<ide> }
<ide>
<ide> // CgroupSpec represents the cgroup to use for the container.
<ide> type UTSMode string
<ide>
<ide> // IsPrivate indicates whether the container uses its private UTS namespace.
<ide> func (n UTSMode) IsPrivate() bool {
<del> return !(n.IsHost())
<add> return !n.IsHost()
<ide> }
<ide>
<ide> // IsHost indicates whether the container uses the host's UTS namespace.
<ide> func (n UTSMode) IsHost() bool {
<ide>
<ide> // Valid indicates whether the UTS namespace is valid.
<ide> func (n UTSMode) Valid() bool {
<del> parts := strings.Split(string(n), ":")
<del> switch mode := parts[0]; mode {
<del> case "", "host":
<del> default:
<del> return false
<del> }
<del> return true
<add> return n == "" || n.IsHost()
<ide> }
<ide>
<ide> // PidMode represents the pid namespace of the container.
<ide> func (n PidMode) IsContainer() bool {
<ide>
<ide> // Valid indicates whether the pid namespace is valid.
<ide> func (n PidMode) Valid() bool {
<del> mode, v, ok := strings.Cut(string(n), ":")
<del> switch mode {
<del> case "", "host":
<del> return true
<del> case "container":
<del> return ok && v != ""
<del> default:
<del> return false
<del> }
<add> return n == "" || n.IsHost() || n.IsContainer()
<ide> }
<ide>
<ide> // Container returns the name of the container whose pid namespace is going to be used.
<ide><path>api/types/container/hostconfig_unix_test.go
<ide> func TestCgroupnsMode(t *testing.T) {
<ide> "": {private: false, host: false, empty: true, valid: true},
<ide> "something:weird": {private: false, host: false, empty: false, valid: false},
<ide> "host": {private: false, host: true, empty: false, valid: true},
<del> "host:name": {private: false, host: false, empty: false, valid: false},
<add> "host:": {valid: false},
<add> "host:name": {valid: false},
<add> ":name": {valid: false},
<add> ":": {valid: false},
<ide> "private": {private: true, host: false, empty: false, valid: true},
<ide> "private:name": {private: false, host: false, empty: false, valid: false},
<ide> }
<ide> func TestIpcMode(t *testing.T) {
<ide> "something:weird": {},
<ide> ":weird": {},
<ide> "host": {host: true, valid: true},
<add> "host:": {valid: false},
<add> "host:name": {valid: false},
<add> ":name": {valid: false},
<add> ":": {valid: false},
<ide> "container": {},
<ide> "container:": {container: true, valid: true, ctrName: ""},
<ide> "container:name": {container: true, valid: true, ctrName: "name"},
<ide> func TestUTSMode(t *testing.T) {
<ide> "": {private: true, host: false, valid: true},
<ide> "something:weird": {private: true, host: false, valid: false},
<ide> "host": {private: false, host: true, valid: true},
<del> "host:name": {private: true, host: false, valid: true},
<add> "host:": {private: true, valid: false},
<add> "host:name": {private: true, valid: false},
<add> ":name": {private: true, valid: false},
<add> ":": {private: true, valid: false},
<ide> }
<ide> for mode, expected := range modes {
<ide> t.Run("mode="+string(mode), func(t *testing.T) {
<ide> func TestUsernsMode(t *testing.T) {
<ide> "": {private: true, host: false, valid: true},
<ide> "something:weird": {private: true, host: false, valid: false},
<ide> "host": {private: false, host: true, valid: true},
<del> "host:name": {private: true, host: false, valid: true},
<add> "host:": {private: true, valid: false},
<add> "host:name": {private: true, valid: false},
<add> ":name": {private: true, valid: false},
<add> ":": {private: true, valid: false},
<ide> }
<ide> for mode, expected := range modes {
<ide> t.Run("mode="+string(mode), func(t *testing.T) {
<ide> func TestPidMode(t *testing.T) {
<ide> "": {private: true, host: false, valid: true},
<ide> "something:weird": {private: true, host: false, valid: false},
<ide> "host": {private: false, host: true, valid: true},
<del> "host:name": {private: true, host: false, valid: true},
<add> "host:": {private: true, valid: false},
<add> "host:name": {private: true, valid: false},
<add> ":name": {private: true, valid: false},
<add> ":": {private: true, valid: false},
<ide> }
<ide> for mode, expected := range modes {
<ide> t.Run("mode="+string(mode), func(t *testing.T) { | 2 |
Python | Python | add morphologizer pipeline component to language | 63502349294e0ee34a3a76ec201eefd702c7583a | <ide><path>spacy/language.py
<ide> from .pipeline import SimilarityHook, TextCategorizer, SentenceSegmenter
<ide> from .pipeline import merge_noun_chunks, merge_entities, merge_subtokens
<ide> from .pipeline import EntityRuler
<add>from ._morphologizer import Morphologizer
<ide> from .compat import json_dumps, izip, basestring_
<ide> from .gold import GoldParse
<ide> from .scorer import Scorer
<ide> class Language(object):
<ide> 'tokenizer': lambda nlp: nlp.Defaults.create_tokenizer(nlp),
<ide> 'tensorizer': lambda nlp, **cfg: Tensorizer(nlp.vocab, **cfg),
<ide> 'tagger': lambda nlp, **cfg: Tagger(nlp.vocab, **cfg),
<add> 'morphologizer': lambda nlp, **cfg: Morphologizer(nlp.vocab, **cfg),
<ide> 'parser': lambda nlp, **cfg: DependencyParser(nlp.vocab, **cfg),
<ide> 'ner': lambda nlp, **cfg: EntityRecognizer(nlp.vocab, **cfg),
<ide> 'similarity': lambda nlp, **cfg: SimilarityHook(nlp.vocab, **cfg), | 1 |
Text | Text | add nice paragraph from @jhnns | 40d284e130cb2f0b7970535b1fc2e828dd529c2d | <ide><path>CONTRIBUTING.md
<ide> that include your webpack.config.js and relevant files are more likely to receiv
<ide>
<ide> **If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.**
<ide>
<del>If you have created your own loader/plugin please incude it on the relevant documentation pages:
<add>If you have created your own loader/plugin please incude it on the relevant
<add>documentation pages:
<ide>
<ide> [List of loaders](http://webpack.github.io/docs/list-of-loaders.html)
<ide> [List of plugins](http://webpack.github.io/docs/list-of-plugins.html)
<ide>
<ide> ### Documentation
<ide>
<del>Webpack is insanely feature rich and documentation is a huge time sink. We greatly appreciate any
<del>time spent fixing typos or clarifying sections in the documentation.
<add>Webpack is insanely feature rich and documentation is a huge time sink. We
<add>greatly appreciate any time spent fixing typos or clarifying sections in the
<add>documentation.
<ide>
<ide>
<ide> ## Submitting Changes
<ide>
<del>* Push to your fork and submit a pull request.
<del>* Wait for feedback. We may suggest some changes or improvements or alternatives.
<add>From opening a bug report to creating a pull request: every contribution is
<add>appreciated and welcome. If you're planing to implement a new feature or change
<add>the api please create an issue first. This way we can ensure that your precious
<add>work is not in vain.
<add>
<add>After getting some feedback, push to your fork and submit a pull request. We
<add>may suggest some changes or improvements or alternatives, but for small changes
<add>your pull request should be accepted quickly.
<ide>
<ide> Some things that will increase the chance that your pull request is accepted:
<ide>
<del>* Write tests.
<del>* Follow our coding style.
<add>* Write tests
<add>* Follow the existing coding style
<ide> * Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
<ide> | 1 |
Text | Text | add title, width, and height attributes | 0876ff6e3032a09ec10efa15550f68f57f69ae8f | <ide><path>guide/english/html/elements/img-tag/index.md
<ide> title: Img Tag
<ide> A simple HTML Image element can be included in an HTML document like this:
<ide>
<ide> ```html
<del><img src="path/to/image/file" alt="this is a cool picture">
<add><img src="path/to/image/file" alt="this is a cool picture" title="Some descriptive text goes here">
<ide> ```
<ide>
<ide> `alt` tags provide alternate text for an image. One use of the `alt` tag is for visually impaired people using a screen reader; they can be read the `alt` tag of the image in order to understand the image's meaning.
<ide>
<add>The `title` attribute is optional and will provide additional information about the image. Most browsers display this information in a tooltip when the user hovers over it.
<add>
<ide> Note that the path to the image file can be either relative or absolute. Also, remember that the `img` element is self-closing, meaning that it does not close with the `<img />` tag and instead closes with just a single `>`.
<ide>
<ide> Example:
<ide>
<ide> ```html
<del><img src="https://example.com/image.png" alt="my picture">
<add><img src="https://example.com/image.png" alt="my picture" title="This is an example picture">
<ide> ```
<ide>
<ide> (This is assuming that the html file is at https://example.com/index.html, so it's in the same folder as the image file)
<ide>
<ide> is the same as:
<ide>
<ide> ```html
<del><img src="image.png" alt="my picture">
<add><img src="image.png" alt="my picture" title="This is an example picture">
<add>```
<add>
<add>Sometimes an <img> element will also use two other attributes to specify its size, `height` and `width`, as shown below:
<add>
<add>```html
<add><img src="image.png" alt="my picture" width="650" height="400" />
<ide> ```
<ide>
<add>The values are specified in pixels, but the size is usually specified in CSS rather than HTML.
<ide>
<ide> #### More Information:
<ide> <!-- Please add any articles you think might be helpful to read before writing the article --> | 1 |
PHP | PHP | move test cases into the correct class | 47b99406eb7adc3a28d41628dfbbbc0c32e029ff | <ide><path>tests/TestCase/ORM/Association/BelongsToManyTest.php
<ide> public function testEagerLoadingBelongsToManyLimitedFields()
<ide> $this->assertNotEmpty($result->tags[0]->id);
<ide> $this->assertEmpty($result->tags[0]->name);
<ide> }
<add>
<add> /**
<add> * Test that association proxy find() applies joins when conditions are involved.
<add> *
<add> * @return void
<add> */
<add> public function testAssociationProxyFindWithConditions()
<add> {
<add> $table = TableRegistry::get('Articles');
<add> $table->belongsToMany('Tags', [
<add> 'foreignKey' => 'article_id',
<add> 'associationForeignKey' => 'tag_id',
<add> 'conditions' => ['SpecialTags.highlighted' => true],
<add> 'through' => 'SpecialTags'
<add> ]);
<add> $query = $table->Tags->find();
<add> $result = $query->toArray();
<add> $this->assertCount(1, $result);
<add> }
<add>
<add> /**
<add> * Test that matching() works on belongsToMany associations.
<add> *
<add> * @return void
<add> */
<add> public function testBelongsToManyAssociationWithConditions()
<add> {
<add> $table = TableRegistry::get('Articles');
<add> $table->belongsToMany('Tags', [
<add> 'foreignKey' => 'article_id',
<add> 'associationForeignKey' => 'tag_id',
<add> 'conditions' => ['SpecialTags.highlighted' => true],
<add> 'through' => 'SpecialTags'
<add> ]);
<add> $query = $table->find()->matching('Tags', function ($q) {
<add> return $q->where(['Tags.name' => 'tag1']);
<add> });
<add> $results = $query->toArray();
<add> $this->assertCount(1, $results);
<add> $this->assertNotEmpty($results[0]->_matchingData);
<add> }
<add>
<add> /**
<add> * Test that association proxy find() with matching resolves joins correctly
<add> *
<add> * @return void
<add> */
<add> public function testAssociationProxyFindWithConditionsMatching()
<add> {
<add> $table = TableRegistry::get('Articles');
<add> $table->belongsToMany('Tags', [
<add> 'foreignKey' => 'article_id',
<add> 'associationForeignKey' => 'tag_id',
<add> 'conditions' => ['SpecialTags.highlighted' => true],
<add> 'through' => 'SpecialTags'
<add> ]);
<add> $query = $table->Tags->find()->matching('Articles', function ($query) {
<add> return $query->where(['Articles.id' => 1]);
<add> });
<add> // The inner join on special_tags excludes the results.
<add> $this->assertEquals(0, $query->count());
<add> }
<ide> }
<ide><path>tests/TestCase/ORM/QueryRegressionTest.php
<ide> public function testEagerLoadingBelongsToManyList()
<ide> $table->find()->contain('Tags')->toArray();
<ide> }
<ide>
<del> /**
<del> * Test that association proxy find() applies joins when conditions are involved.
<del> *
<del> * @return void
<del> */
<del> public function testBelongsToManyAssociationProxyFindWithConditions()
<del> {
<del> $table = TableRegistry::get('Articles');
<del> $table->belongsToMany('Tags', [
<del> 'foreignKey' => 'article_id',
<del> 'associationForeignKey' => 'tag_id',
<del> 'conditions' => ['SpecialTags.highlighted' => true],
<del> 'through' => 'SpecialTags'
<del> ]);
<del> $query = $table->Tags->find();
<del> $result = $query->toArray();
<del> $this->assertCount(1, $result);
<del> }
<del>
<del> /**
<del> * Test that matching() works on belongsToMany associations.
<del> *
<del> * @return void
<del> */
<del> public function testMatchingOnBelongsToManyAssociationWithConditions()
<del> {
<del> $table = TableRegistry::get('Articles');
<del> $table->belongsToMany('Tags', [
<del> 'foreignKey' => 'article_id',
<del> 'associationForeignKey' => 'tag_id',
<del> 'conditions' => ['SpecialTags.highlighted' => true],
<del> 'through' => 'SpecialTags'
<del> ]);
<del> $query = $table->find()->matching('Tags', function ($q) {
<del> return $q->where(['Tags.name' => 'tag1']);
<del> });
<del> $results = $query->toArray();
<del> $this->assertCount(1, $results);
<del> $this->assertNotEmpty($results[0]->_matchingData);
<del> }
<del>
<del> /**
<del> * Test that association proxy find() with matching resolves joins correctly
<del> *
<del> * @return void
<del> */
<del> public function testBelongsToManyAssociationProxyFindWithConditionsMatching()
<del> {
<del> $table = TableRegistry::get('Articles');
<del> $table->belongsToMany('Tags', [
<del> 'foreignKey' => 'article_id',
<del> 'associationForeignKey' => 'tag_id',
<del> 'conditions' => ['SpecialTags.highlighted' => true],
<del> 'through' => 'SpecialTags'
<del> ]);
<del> $query = $table->Tags->find()->matching('Articles', function ($query) {
<del> return $query->where(['Articles.id' => 1]);
<del> });
<del> // The inner join on special_tags excludes the results.
<del> $this->assertEquals(0, $query->count());
<del> }
<del>
<ide> /**
<ide> * Tests that duplicate aliases in contain() can be used, even when they would
<ide> * naturally be attached to the query instead of eagerly loaded. What should | 2 |
Python | Python | set accelerating batch size in conll train script | 6a27a4f77c78b228325cf2e1211c8ef9ddee98b8 | <ide><path>examples/training/conllu.py
<ide> def main(spacy_model, conllu_train_loc, text_train_loc, conllu_dev_loc, text_dev
<ide> n_train_words = sum(len(doc) for doc in docs)
<ide> print(n_train_words)
<ide> print("Begin training")
<add> # Batch size starts at 1 and grows, so that we make updates quickly
<add> # at the beginning of training.
<add> batch_sizes = spacy.util.compounding(spacy.util.env_opt('batch_from', 1),
<add> spacy.util.env_opt('batch_to', 8),
<add> spacy.util.env_opt('batch_compound', 1.001))
<ide> for i in range(10):
<ide> with open(text_train_loc) as file_:
<ide> docs = get_docs(nlp, file_.read())
<ide> docs = docs[:len(golds)]
<ide> with tqdm.tqdm(total=n_train_words, leave=False) as pbar:
<ide> losses = {}
<del> for batch in minibatch(list(zip(docs, golds)), size=1):
<add> for batch in minibatch(list(zip(docs, golds)), size=batch_sizes):
<ide> if not batch:
<ide> continue
<ide> batch_docs, batch_gold = zip(*batch) | 1 |
Text | Text | fix typo in glossary.md | eb7bc48f5092434cd73b154627fd8908e00b0e08 | <ide><path>docs/understanding/thinking-in-redux/Glossary.md
<ide> A store creator is a function that creates a Redux store. Like with dispatching
<ide> type StoreEnhancer = (next: StoreCreator) => StoreCreator
<ide> ```
<ide>
<del>A store enhancer is a higher-order function that composes a store creator to return a new, enhanced store creator. This is similar to middleware in that it allows you to alter the store interface in a composable way.
<add>A store enhancer is a higher-order function that composes a store creator to return a new enhanced store creator. This is similar to middleware in that it allows you to alter the store interface in a composable way.
<ide>
<ide> Store enhancers are much the same concept as higher-order components in React, which are also occasionally called “component enhancers”.
<ide> | 1 |
PHP | PHP | hide empty paginators. | e9d5846d5f6a767285bc071c178ee0f5ff4ee2c5 | <ide><path>src/Illuminate/Pagination/resources/views/bootstrap-4.blade.php
<del><ul class="pagination">
<del> <!-- Previous Page Link -->
<del> @if ($paginator->onFirstPage())
<del> <li class="page-item disabled"><span class="page-link">«</span></li>
<del> @else
<del> <li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
<del> @endif
<del>
<del> <!-- Pagination Elements -->
<del> @foreach ($elements as $element)
<del> <!-- "Three Dots" Separator -->
<del> @if (is_string($element))
<del> <li class="page-item disabled"><span class="page-link">{{ $element }}</span></li>
<add>@if ($paginator->count() > 1)
<add> <ul class="pagination">
<add> <!-- Previous Page Link -->
<add> @if ($paginator->onFirstPage())
<add> <li class="page-item disabled"><span class="page-link">«</span></li>
<add> @else
<add> <li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
<ide> @endif
<ide>
<del> <!-- Array Of Links -->
<del> @if (is_array($element))
<del> @foreach ($element as $page => $url)
<del> @if ($page == $paginator->currentPage())
<del> <li class="page-item active"><span class="page-link">{{ $page }}</span></li>
<del> @else
<del> <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
<del> @endif
<del> @endforeach
<del> @endif
<del> @endforeach
<add> <!-- Pagination Elements -->
<add> @foreach ($elements as $element)
<add> <!-- "Three Dots" Separator -->
<add> @if (is_string($element))
<add> <li class="page-item disabled"><span class="page-link">{{ $element }}</span></li>
<add> @endif
<ide>
<del> <!-- Next Page Link -->
<del> @if ($paginator->hasMorePages())
<del> <li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
<del> @else
<del> <li class="page-item disabled"><span class="page-link">»</span></li>
<del> @endif
<del></ul>
<add> <!-- Array Of Links -->
<add> @if (is_array($element))
<add> @foreach ($element as $page => $url)
<add> @if ($page == $paginator->currentPage())
<add> <li class="page-item active"><span class="page-link">{{ $page }}</span></li>
<add> @else
<add> <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
<add> @endif
<add> @endforeach
<add> @endif
<add> @endforeach
<add>
<add> <!-- Next Page Link -->
<add> @if ($paginator->hasMorePages())
<add> <li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
<add> @else
<add> <li class="page-item disabled"><span class="page-link">»</span></li>
<add> @endif
<add> </ul>
<add>@endif
<ide><path>src/Illuminate/Pagination/resources/views/default.blade.php
<del><ul class="pagination">
<del> <!-- Previous Page Link -->
<del> @if ($paginator->onFirstPage())
<del> <li class="disabled"><span>«</span></li>
<del> @else
<del> <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
<del> @endif
<del>
<del> <!-- Pagination Elements -->
<del> @foreach ($elements as $element)
<del> <!-- "Three Dots" Separator -->
<del> @if (is_string($element))
<del> <li class="disabled"><span>{{ $element }}</span></li>
<add>@if ($paginator->count() > 1)
<add> <ul class="pagination">
<add> <!-- Previous Page Link -->
<add> @if ($paginator->onFirstPage())
<add> <li class="disabled"><span>«</span></li>
<add> @else
<add> <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
<ide> @endif
<ide>
<del> <!-- Array Of Links -->
<del> @if (is_array($element))
<del> @foreach ($element as $page => $url)
<del> @if ($page == $paginator->currentPage())
<del> <li class="active"><span>{{ $page }}</span></li>
<del> @else
<del> <li><a href="{{ $url }}">{{ $page }}</a></li>
<del> @endif
<del> @endforeach
<del> @endif
<del> @endforeach
<add> <!-- Pagination Elements -->
<add> @foreach ($elements as $element)
<add> <!-- "Three Dots" Separator -->
<add> @if (is_string($element))
<add> <li class="disabled"><span>{{ $element }}</span></li>
<add> @endif
<ide>
<del> <!-- Next Page Link -->
<del> @if ($paginator->hasMorePages())
<del> <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
<del> @else
<del> <li class="disabled"><span>»</span></li>
<del> @endif
<del></ul>
<add> <!-- Array Of Links -->
<add> @if (is_array($element))
<add> @foreach ($element as $page => $url)
<add> @if ($page == $paginator->currentPage())
<add> <li class="active"><span>{{ $page }}</span></li>
<add> @else
<add> <li><a href="{{ $url }}">{{ $page }}</a></li>
<add> @endif
<add> @endforeach
<add> @endif
<add> @endforeach
<add>
<add> <!-- Next Page Link -->
<add> @if ($paginator->hasMorePages())
<add> <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
<add> @else
<add> <li class="disabled"><span>»</span></li>
<add> @endif
<add> </ul>
<add>@endif
<ide><path>src/Illuminate/Pagination/resources/views/simple-bootstrap-4.blade.php
<del><ul class="pagination">
<del> <!-- Previous Page Link -->
<del> @if ($paginator->onFirstPage())
<del> <li class="page-item disabled"><span class="page-link">«</span></li>
<del> @else
<del> <li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
<del> @endif
<add>@if ($paginator->count() > 1)
<add> <ul class="pagination">
<add> <!-- Previous Page Link -->
<add> @if ($paginator->onFirstPage())
<add> <li class="page-item disabled"><span class="page-link">«</span></li>
<add> @else
<add> <li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
<add> @endif
<ide>
<del> <!-- Next Page Link -->
<del> @if ($paginator->hasMorePages())
<del> <li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
<del> @else
<del> <li class="page-item disabled"><span class="page-link">»</span></li>
<del> @endif
<del></ul>
<add> <!-- Next Page Link -->
<add> @if ($paginator->hasMorePages())
<add> <li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
<add> @else
<add> <li class="page-item disabled"><span class="page-link">»</span></li>
<add> @endif
<add> </ul>
<add>@endif
<ide><path>src/Illuminate/Pagination/resources/views/simple-default.blade.php
<del><ul class="pagination">
<del> <!-- Previous Page Link -->
<del> @if ($paginator->onFirstPage())
<del> <li class="disabled"><span>«</span></li>
<del> @else
<del> <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
<del> @endif
<add>@if ($paginator->count() > 1)
<add> <ul class="pagination">
<add> <!-- Previous Page Link -->
<add> @if ($paginator->onFirstPage())
<add> <li class="disabled"><span>«</span></li>
<add> @else
<add> <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
<add> @endif
<ide>
<del> <!-- Next Page Link -->
<del> @if ($paginator->hasMorePages())
<del> <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
<del> @else
<del> <li class="disabled"><span>»</span></li>
<del> @endif
<del></ul>
<add> <!-- Next Page Link -->
<add> @if ($paginator->hasMorePages())
<add> <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
<add> @else
<add> <li class="disabled"><span>»</span></li>
<add> @endif
<add> </ul>
<add>@endif | 4 |
Text | Text | replace american spelling with british spelling | 1e57ca70d34ed2504aadbbb2b40bef88a5f781df | <ide><path>docs/Bottles.md
<ide> Bottles will not be used if the user requests it (see above), if the formula req
<ide> ## Creation
<ide> Bottles are created using the [Brew Test Bot](Brew-Test-Bot.md). This happens mostly when people submit pull requests to Homebrew and the `bottle do` block is updated by maintainers when they `brew pull --bottle` the contents of a pull request. For the Homebrew organisations' taps they are uploaded to and downloaded from [Bintray](https://bintray.com/homebrew).
<ide>
<del>By default, bottles will be built for the oldest CPU supported by the OS/architecture you're building for (Core 2 for 64-bit OSs). This ensures that bottles are compatible with all computers you might distribute them to. If you *really* want your bottles to be optimized for something else, you can pass the `--bottle-arch=` option to build for another architecture; for example, `brew install foo --build-bottle --bottle-arch=penryn`. Just remember that if you build for a newer architecture some of your users might get binaries they can't run and that would be sad!
<add>By default, bottles will be built for the oldest CPU supported by the OS/architecture you're building for (Core 2 for 64-bit OSs). This ensures that bottles are compatible with all computers you might distribute them to. If you *really* want your bottles to be optimised for something else, you can pass the `--bottle-arch=` option to build for another architecture; for example, `brew install foo --build-bottle --bottle-arch=penryn`. Just remember that if you build for a newer architecture some of your users might get binaries they can't run and that would be sad!
<ide>
<ide> ## Format
<ide> Bottles are simple gzipped tarballs of compiled binaries. Any metadata is stored in a formula's bottle DSL and in the bottle filename (i.e. macOS version, revision).
<ide><path>docs/Formula-Cookbook.md
<ide> so you can override this with `brew create <URL> --set-name <name>`.
<ide>
<ide> An SSL/TLS (https) [`homepage`](https://rubydoc.brew.sh/Formula#homepage%3D-class_method) is preferred, if one is available.
<ide>
<del>Try to summarize from the [`homepage`](https://rubydoc.brew.sh/Formula#homepage%3D-class_method) what the formula does in the [`desc`](https://rubydoc.brew.sh/Formula#desc%3D-class_method)ription. Note that the [`desc`](https://rubydoc.brew.sh/Formula#desc%3D-class_method)ription is automatically prepended with the formula name.
<add>Try to summarise from the [`homepage`](https://rubydoc.brew.sh/Formula#homepage%3D-class_method) what the formula does in the [`desc`](https://rubydoc.brew.sh/Formula#desc%3D-class_method)ription. Note that the [`desc`](https://rubydoc.brew.sh/Formula#desc%3D-class_method)ription is automatically prepended with the formula name.
<ide>
<ide> ### Check the build system
<ide>
<ide> correct. Add an explicit [`version`](https://rubydoc.brew.sh/Formula#version-cla
<ide> Everything is built on Git, so contribution is easy:
<ide>
<ide> ```sh
<del>brew update # required in more ways than you think (initializes the brew git repository if you don't already have it)
<add>brew update # required in more ways than you think (initialises the brew git repository if you don't already have it)
<ide> cd $(brew --repo homebrew/core)
<ide> # Create a new git branch for your formula so your pull request is easy to
<ide> # modify if any changes come up during review.
<ide> Some software requires a Fortran compiler. This can be declared by adding `depen
<ide>
<ide> ## MPI
<ide>
<del>Formula requiring MPI should use [OpenMPI](https://www.open-mpi.org/) by adding `depends_on "open-mpi"` to the formula, rather than [MPICH](https://www.mpich.org/). These packages have conflicts and provide the same standardized interfaces. Choosing a default implementation and requiring it to be adopted allows software to link against multiple libraries that rely on MPI without creating un-anticipated incompatibilities due to differing MPI runtimes.
<add>Formula requiring MPI should use [OpenMPI](https://www.open-mpi.org/) by adding `depends_on "open-mpi"` to the formula, rather than [MPICH](https://www.mpich.org/). These packages have conflicts and provide the same standardised interfaces. Choosing a default implementation and requiring it to be adopted allows software to link against multiple libraries that rely on MPI without creating un-anticipated incompatibilities due to differing MPI runtimes.
<ide>
<ide> ## Linear algebra libraries
<ide>
<ide><path>docs/Homebrew-and-Python.md
<ide> Homebrew provides formulae to brew Python 3.x and a more up-to-date Python 2.7.x
<ide> ## Python 3.x or Python 2.x
<ide> Homebrew provides one formula for Python 3.x (`python`) and another for Python 2.7.x (`python@2`).
<ide>
<del>The executables are organized as follows so that Python 2 and Python 3 can both be installed without conflict:
<add>The executables are organised as follows so that Python 2 and Python 3 can both be installed without conflict:
<ide>
<ide> * `python3` points to Homebrew's Python 3.x (if installed)
<ide> * `python2` points to Homebrew's Python 2.7.x (if installed)
<ide><path>docs/Homebrew-linuxbrew-core-Maintainer-Guide.md
<ide> This is due to a bug with Azure Pipelines and its handling of merge
<ide> commits. Master branch builds also fail for the same reason. This is
<ide> OK.
<ide>
<del>Once the PR is approved by other Homebrew developers, you can finalize
<add>Once the PR is approved by other Homebrew developers, you can finalise
<ide> the merge with:
<ide>
<ide> ```bash
<ide><path>docs/Manpage.md
<ide> automatically when you install formulae but can be useful for DIY installations.
<ide>
<ide> List all installed formulae.
<ide>
<del>If *`formula`* is provided, summarize the paths within its current keg.
<add>If *`formula`* is provided, summarise the paths within its current keg.
<ide>
<ide> * `--full-name`:
<ide> Print formulae with fully-qualified names. If `--full-name` is not passed, other options (i.e. `-1`, `-l`, `-r` and `-t`) are passed to `ls`(1) which produces the actual output.
<ide> would be installed, without any sort of versioned directory as the last path.
<ide>
<ide> ### `--env` [*`options`*]
<ide>
<del>Summarize Homebrew's build environment as a plain list.
<add>Summarise Homebrew's build environment as a plain list.
<ide>
<ide> If the command's output is sent through a pipe and no shell is specified, the
<ide> list is formatted for export to `bash`(1) unless `--plain` is passed. | 5 |
Javascript | Javascript | remove duplicated test | f7245ee05c288dbce94a6540af6222baa4a3f674 | <ide><path>packages/ember-handlebars/tests/helpers/each_test.js
<ide> test("#each accepts a name binding and can display child properties", function()
<ide> equal(view.$().text(), "My Cool Each Test 1My Cool Each Test 2");
<ide> });
<ide>
<del>test("#each accepts 'this' as the right hand side", function() {
<del> view = Ember.View.create({
<del> template: templateFor("{{#each item in this}}{{view.title}} {{item.name}}{{/each}}"),
<del> title: "My Cool Each Test",
<del> controller: Ember.A([{ name: 1 }, { name: 2 }])
<del> });
<del>
<del> append(view);
<del>
<del> equal(view.$().text(), "My Cool Each Test 1My Cool Each Test 2");
<del>});
<ide> test("#each accepts 'this' as the right hand side", function() {
<ide> view = Ember.View.create({
<ide> template: templateFor("{{#each item in this}}{{view.title}} {{item.name}}{{/each}}"), | 1 |
Text | Text | add initial changelog | 0b60829df795bc5178feb8f266b1f7e35a91f6da | <ide><path>CHANGELOG.md
<add># Changelog
<add>
<add>## 0.2.0 (dev)
<add> - Fix Vagrant in windows and OSX
<add> - Fix TTY behavior
<add> - Fix attach/detach/run behavior
<add> - Fix memory/fds leaks
<add> - Fix various race conditions
<add> - Fix `docker diff` for removed files
<add> - Fix `docker stop` for ghost containers
<add> - Fix lxc 0.9 compatibility
<add> - Implement an escape sequence `C-p C-q` in order to detach containers in tty mode
<add> - Implement `-a stdin` in order to write on container's stdin while retrieving its ID
<add> - Implement the possiblity to choose the publicly exposed port
<add> - Implement progress bar for registry push/pull
<add> - Improve documentation
<add> - Improve `docker rmi` in order to remove images by name
<add> - Shortened containers and images IDs
<add> - Add cgroup capabilities detection
<add> - Automatically try to load AUFS module
<add> - Automatically create and configure a bridge `dockbr0`
<add> - Remove the standalone mode
<add>
<add>## 0.1.0 (03/23/2013)
<add> - Open-source the project
<add> - Implement registry in order to push/pull images
<add> - Fix termcaps on Linux
<add> - Add the documentation
<add> - Add Vagrant support with Vagrantfile
<add> - Add unit tests
<add> - Add repository/tags to ease the image management
<add> - Improve the layer implementation | 1 |
PHP | PHP | remove methods for bc and deprecation | 7f8c5695bc4b7cfa7b226876cadd733d0a8f2777 | <ide><path>Cake/Utility/Time.php
<ide> class Time {
<ide> */
<ide> protected static $_time = null;
<ide>
<del>/**
<del> * Magic set method for backward compatibility.
<del> *
<del> * Used by TimeHelper to modify static variables in this class
<del> *
<del> * @param string $name Variable name
<del> * @param mixes $value Variable value
<del> * @return void
<del> */
<del> public function __set($name, $value) {
<del> switch ($name) {
<del> case 'niceFormat':
<del> static::${$name} = $value;
<del> break;
<del> }
<del> }
<del>
<del>/**
<del> * Magic set method for backward compatibility.
<del> *
<del> * Used by TimeHelper to get static variables in this class.
<del> *
<del> * @param string $name Variable name
<del> * @return mixed
<del> */
<del> public function __get($name) {
<del> switch ($name) {
<del> case 'niceFormat':
<del> return static::${$name};
<del> default:
<del> return null;
<del> }
<del> }
<del>
<ide> /**
<ide> * Converts a string representing the format for the function strftime and returns a
<ide> * windows safe and i18n aware format.
<ide><path>Cake/View/Helper/TimeHelper.php
<ide> public function __construct(View $View, $settings = array()) {
<ide> }
<ide> }
<ide>
<del>/**
<del> * Magic accessor for deprecated attributes.
<del> *
<del> * @param string $name Name of the attribute to set.
<del> * @param string $value Value of the attribute to set.
<del> * @return void
<del> */
<del> public function __set($name, $value) {
<del> switch ($name) {
<del> case 'niceFormat':
<del> $this->_engine->{$name} = $value;
<del> break;
<del> default:
<del> $this->{$name} = $value;
<del> }
<del> }
<del>
<del>/**
<del> * Magic isset check for deprecated attributes.
<del> *
<del> * @param string $name Name of the attribute to check.
<del> * @return boolean
<del> */
<del> public function __isset($name) {
<del> if (isset($this->{$name})) {
<del> return true;
<del> }
<del> $magicGet = array('niceFormat');
<del> if (in_array($name, $magicGet)) {
<del> return $this->__get($name) !== null;
<del> }
<del> return null;
<del> }
<del>
<del>/**
<del> * Magic accessor for attributes that were deprecated.
<del> *
<del> * @param string $name Name of the attribute to get.
<del> * @return mixed
<del> */
<del> public function __get($name) {
<del> if (isset($this->_engine->{$name})) {
<del> return $this->_engine->{$name};
<del> }
<del> $magicGet = array('niceFormat');
<del> if (in_array($name, $magicGet)) {
<del> return $this->_engine->{$name};
<del> }
<del> return null;
<del> }
<del>
<ide> /**
<ide> * Call methods from Cake\Utility\Time utility class
<ide> * @return mixed Whatever is returned by called method, or false on failure | 2 |
PHP | PHP | add uncheck method | b44def9a5ae4385333f9ef848461f740ffad0aee | <ide><path>src/Illuminate/Foundation/Testing/CrawlerTrait.php
<ide> protected function check($element)
<ide> {
<ide> return $this->storeInput($element, true);
<ide> }
<add>
<add> /**
<add> * Uncheck a checkbox on the page.
<add> *
<add> * @param string $element
<add> * @return $this
<add> */
<add> protected function uncheck($element)
<add> {
<add> return $this->storeInput($element, false);
<add> }
<ide>
<ide> /**
<ide> * Select an option from a drop-down. | 1 |
Text | Text | correct a typo in link | bf6e06a8e1074760f6544335ce2c5959512ef46b | <ide><path>curriculum/challenges/english/09-information-security/information-security-projects/stock-price-checker.md
<ide> dashedName: stock-price-checker
<ide>
<ide> # --description--
<ide>
<del>Build a full stack JavaScript app that is functionally similar to this: <a href="https://stock-price-checker.freecodecamp.rocks/> target="_blank" rel="noopener noreferrer nofollow">https://stock-price-checker.freecodecamp.rocks/</a>.
<add>Build a full stack JavaScript app that is functionally similar to this: <a href="https://stock-price-checker.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://stock-price-checker.freecodecamp.rocks/</a>.
<ide>
<ide> Since all reliable stock price APIs require an API key, we've built a workaround. Use <a href="https://stock-price-checker-proxy.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://stock-price-checker-proxy.freecodecamp.rocks/</a> to get up-to-date stock price information without needing to sign up for your own key.
<ide> | 1 |
Java | Java | fix issue with deferredresult on @restcontroller | cf7889e226519bec62345affa7c401b0abbebecc | <ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethod.java
<ide> private String getReturnValueHandlingErrorMessage(String message, Object returnV
<ide> }
<ide>
<ide> /**
<del> * Return a ServletInvocableHandlerMethod that will process the value returned
<del> * from an async operation essentially either applying return value handling or
<del> * raising an exception if the end result is an Exception.
<add> * Create a ServletInvocableHandlerMethod that will return the given value from an
<add> * async operation instead of invoking the controller method again. The async result
<add> * value is then either processed as if the controller method returned it or an
<add> * exception is raised if the async result value itself is an Exception.
<ide> */
<ide> ServletInvocableHandlerMethod wrapConcurrentResult(final Object result) {
<ide>
<ide> else if (result instanceof Throwable) {
<ide>
<ide>
<ide> /**
<del> * A ServletInvocableHandlerMethod sub-class that invokes a given
<del> * {@link Callable} and "inherits" the annotations of the containing class
<del> * instance, useful for invoking a Callable returned from a HandlerMethod.
<add> * A sub-class of {@link HandlerMethod} that invokes the given {@link Callable}
<add> * instead of the target controller method. This is useful for resuming processing
<add> * with the result of an async operation. The goal is to process the value returned
<add> * from the Callable as if it was returned by the target controller method, i.e.
<add> * taking into consideration both method and type-level controller annotations (e.g.
<add> * {@code @ResponseBody}, {@code @ResponseStatus}, etc).
<ide> */
<ide> private class CallableHandlerMethod extends ServletInvocableHandlerMethod {
<ide>
<ide> public CallableHandlerMethod(Callable<?> callable) {
<ide> this.setHandlerMethodReturnValueHandlers(ServletInvocableHandlerMethod.this.returnValueHandlers);
<ide> }
<ide>
<add> /**
<add> * Bridge to type-level annotations of the target controller method.
<add> */
<add> @Override
<add> public Class<?> getBeanType() {
<add> return ServletInvocableHandlerMethod.this.getBeanType();
<add> }
<add>
<add> /**
<add> * Bridge to method-level annotations of the target controller method.
<add> */
<ide> @Override
<ide> public <A extends Annotation> A getMethodAnnotation(Class<A> annotationType) {
<ide> return ServletInvocableHandlerMethod.this.getMethodAnnotation(annotationType);
<ide><path>spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethodTests.java
<ide> */
<ide>
<ide> package org.springframework.web.servlet.mvc.method.annotation;
<del>import static org.junit.Assert.assertEquals;
<del>import static org.junit.Assert.assertNotNull;
<del>import static org.junit.Assert.assertTrue;
<del>import static org.junit.Assert.fail;
<del>
<ide> import java.lang.reflect.Method;
<add>import java.util.ArrayList;
<add>import java.util.List;
<ide>
<ide> import javax.servlet.http.HttpServletResponse;
<ide>
<ide> import org.junit.Before;
<ide> import org.junit.Test;
<ide> import org.springframework.core.MethodParameter;
<ide> import org.springframework.http.HttpStatus;
<add>import org.springframework.http.ResponseEntity;
<add>import org.springframework.http.converter.HttpMessageConverter;
<ide> import org.springframework.http.converter.HttpMessageNotWritableException;
<add>import org.springframework.http.converter.StringHttpMessageConverter;
<ide> import org.springframework.mock.web.test.MockHttpServletRequest;
<ide> import org.springframework.mock.web.test.MockHttpServletResponse;
<ide> import org.springframework.web.bind.annotation.RequestParam;
<add>import org.springframework.web.bind.annotation.ResponseBody;
<ide> import org.springframework.web.bind.annotation.ResponseStatus;
<ide> import org.springframework.web.context.request.NativeWebRequest;
<ide> import org.springframework.web.context.request.ServletWebRequest;
<add>import org.springframework.web.context.request.async.DeferredResult;
<ide> import org.springframework.web.method.annotation.RequestParamMethodArgumentResolver;
<ide> import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
<ide> import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
<ide> import org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite;
<ide> import org.springframework.web.method.support.ModelAndViewContainer;
<ide> import org.springframework.web.servlet.view.RedirectView;
<ide>
<add>import static org.junit.Assert.*;
<add>
<ide> /**
<ide> * Test fixture with {@link ServletInvocableHandlerMethod}.
<ide> *
<ide> public void setUp() throws Exception {
<ide>
<ide> @Test
<ide> public void invokeAndHandle_VoidWithResponseStatus() throws Exception {
<del> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("responseStatus");
<add> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod(new Handler(), "responseStatus");
<ide> handlerMethod.invokeAndHandle(webRequest, mavContainer);
<ide>
<ide> assertTrue("Null return value + @ResponseStatus should result in 'request handled'",
<ide> public void invokeAndHandle_VoidWithResponseStatus() throws Exception {
<ide> public void invokeAndHandle_VoidWithHttpServletResponseArgument() throws Exception {
<ide> argumentResolvers.addResolver(new ServletResponseMethodArgumentResolver());
<ide>
<del> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("httpServletResponse", HttpServletResponse.class);
<add> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod(new Handler(), "httpServletResponse", HttpServletResponse.class);
<ide> handlerMethod.invokeAndHandle(webRequest, mavContainer);
<ide>
<ide> assertTrue("Null return value + HttpServletResponse arg should result in 'request handled'",
<ide> public void invokeAndHandle_VoidRequestNotModified() throws Exception {
<ide> int lastModifiedTimestamp = 1000 * 1000;
<ide> webRequest.checkNotModified(lastModifiedTimestamp);
<ide>
<del> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("notModified");
<add> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod(new Handler(), "notModified");
<ide> handlerMethod.invokeAndHandle(webRequest, mavContainer);
<ide>
<ide> assertTrue("Null return value + 'not modified' request should result in 'request handled'",
<ide> public void invokeAndHandle_VoidRequestNotModified() throws Exception {
<ide>
<ide> @Test
<ide> public void invokeAndHandle_NotVoidWithResponseStatusAndReason() throws Exception {
<del> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("responseStatusWithReason");
<add> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod(new Handler(), "responseStatusWithReason");
<ide> handlerMethod.invokeAndHandle(webRequest, mavContainer);
<ide>
<ide> assertTrue("When a phrase is used, the response should not be used any more", mavContainer.isRequestHandled());
<ide> public void invokeAndHandle_NotVoidWithResponseStatusAndReason() throws Exceptio
<ide> public void invokeAndHandle_Exception() throws Exception {
<ide> returnValueHandlers.addHandler(new ExceptionRaisingReturnValueHandler());
<ide>
<del> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("handle");
<add> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod(new Handler(), "handle");
<ide> handlerMethod.invokeAndHandle(webRequest, mavContainer);
<ide> fail("Expected exception");
<ide> }
<ide> public void invokeAndHandle_DynamicReturnValue() throws Exception {
<ide> returnValueHandlers.addHandler(new ViewNameMethodReturnValueHandler());
<ide>
<ide> // Invoke without a request parameter (String return value)
<del> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod("dynamicReturnValue", String.class);
<add> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod(new Handler(), "dynamicReturnValue", String.class);
<ide> handlerMethod.invokeAndHandle(webRequest, mavContainer);
<ide>
<ide> assertNotNull(mavContainer.getView());
<ide> public void invokeAndHandle_DynamicReturnValue() throws Exception {
<ide> assertEquals("view", mavContainer.getViewName());
<ide> }
<ide>
<add> @Test
<add> public void wrapConcurrentResult_MethodLevelResponseBody() throws Exception {
<add> wrapConcurrentResult_ResponseBody(new MethodLevelResponseBodyHandler());
<add> }
<add>
<add> @Test
<add> public void wrapConcurrentResult_TypeLevelResponseBody() throws Exception {
<add> wrapConcurrentResult_ResponseBody(new TypeLevelResponseBodyHandler());
<add> }
<add>
<add> private void wrapConcurrentResult_ResponseBody(Object handler) throws Exception {
<add> List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
<add> converters.add(new StringHttpMessageConverter());
<add> returnValueHandlers.addHandler(new RequestResponseBodyMethodProcessor(converters));
<add> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod(handler, "handle");
<add> handlerMethod = handlerMethod.wrapConcurrentResult("bar");
<add> handlerMethod.invokeAndHandle(webRequest, mavContainer);
<add>
<add> assertEquals("bar", response.getContentAsString());
<add> }
<add>
<add> @Test
<add> public void wrapConcurrentResult_ResponseEntity() throws Exception {
<add> List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
<add> converters.add(new StringHttpMessageConverter());
<add> returnValueHandlers.addHandler(new HttpEntityMethodProcessor(converters));
<add> ServletInvocableHandlerMethod handlerMethod = getHandlerMethod(new ResponseEntityHandler(), "handle");
<add> handlerMethod = handlerMethod.wrapConcurrentResult(new ResponseEntity<>("bar", HttpStatus.OK));
<add> handlerMethod.invokeAndHandle(webRequest, mavContainer);
<add>
<add> assertEquals("bar", response.getContentAsString());
<add> }
<ide>
<del> private ServletInvocableHandlerMethod getHandlerMethod(String methodName, Class<?>... argTypes)
<del> throws NoSuchMethodException {
<del> Method method = Handler.class.getDeclaredMethod(methodName, argTypes);
<del> ServletInvocableHandlerMethod handlerMethod = new ServletInvocableHandlerMethod(new Handler(), method);
<add>
<add> private ServletInvocableHandlerMethod getHandlerMethod(Object controller,
<add> String methodName, Class<?>... argTypes) throws NoSuchMethodException {
<add>
<add> Method method = controller.getClass().getDeclaredMethod(methodName, argTypes);
<add> ServletInvocableHandlerMethod handlerMethod = new ServletInvocableHandlerMethod(controller, method);
<ide> handlerMethod.setHandlerMethodArgumentResolvers(argumentResolvers);
<ide> handlerMethod.setHandlerMethodReturnValueHandlers(returnValueHandlers);
<ide> return handlerMethod;
<ide> public Object dynamicReturnValue(@RequestParam(required=false) String param) {
<ide> }
<ide> }
<ide>
<add> private static class MethodLevelResponseBodyHandler {
<add>
<add> @ResponseBody
<add> public DeferredResult<String> handle() {
<add> return new DeferredResult<>();
<add> }
<add> }
<add>
<add> @ResponseBody
<add> private static class TypeLevelResponseBodyHandler {
<add>
<add> @SuppressWarnings("unused")
<add> public DeferredResult<String> handle() {
<add> return new DeferredResult<String>();
<add> }
<add> }
<add>
<add> private static class ResponseEntityHandler {
<add>
<add> public DeferredResult<ResponseEntity<String>> handle() {
<add> return new DeferredResult<>();
<add> }
<add> }
<add>
<add>
<ide> private static class ExceptionRaisingReturnValueHandler implements HandlerMethodReturnValueHandler {
<ide>
<ide> @Override | 2 |
Mixed | Go | add ability to add multiple tags with docker build | c2eb37f9aeb6215293483e02613514e49011cf2c | <ide><path>api/client/build.go
<ide> const (
<ide> // Usage: docker build [OPTIONS] PATH | URL | -
<ide> func (cli *DockerCli) CmdBuild(args ...string) error {
<ide> cmd := Cli.Subcmd("build", []string{"PATH | URL | -"}, Cli.DockerCommands["build"].Description, true)
<del> tag := cmd.String([]string{"t", "-tag"}, "", "Repository name (and optionally a tag) for the image")
<add> flTags := opts.NewListOpts(validateTag)
<add> cmd.Var(&flTags, []string{"t", "-tag"}, "Name and optionally a tag in the 'name:tag' format")
<ide> suppressOutput := cmd.Bool([]string{"q", "-quiet"}, false, "Suppress the verbose output generated by the containers")
<ide> noCache := cmd.Bool([]string{"#no-cache", "-no-cache"}, false, "Do not use cache when building the image")
<ide> rm := cmd.Bool([]string{"#rm", "-rm"}, true, "Remove intermediate containers after a successful build")
<ide> func (cli *DockerCli) CmdBuild(args ...string) error {
<ide> memorySwap = parsedMemorySwap
<ide> }
<ide> }
<del> // Send the build context
<del> v := &url.Values{}
<ide>
<del> //Check if the given image name can be resolved
<del> if *tag != "" {
<del> repository, tag := parsers.ParseRepositoryTag(*tag)
<del> if err := registry.ValidateRepositoryName(repository); err != nil {
<del> return err
<del> }
<del> if len(tag) > 0 {
<del> if err := tags.ValidateTagName(tag); err != nil {
<del> return err
<del> }
<del> }
<add> // Send the build context
<add> v := url.Values{
<add> "t": flTags.GetAll(),
<ide> }
<del>
<del> v.Set("t", *tag)
<del>
<ide> if *suppressOutput {
<ide> v.Set("q", "1")
<ide> }
<ide> func (cli *DockerCli) CmdBuild(args ...string) error {
<ide> return nil
<ide> }
<ide>
<add>// validateTag checks if the given image name can be resolved.
<add>func validateTag(rawRepo string) (string, error) {
<add> repository, tag := parsers.ParseRepositoryTag(rawRepo)
<add> if err := registry.ValidateRepositoryName(repository); err != nil {
<add> return "", err
<add> }
<add>
<add> if len(tag) == 0 {
<add> return rawRepo, nil
<add> }
<add>
<add> if err := tags.ValidateTagName(tag); err != nil {
<add> return "", err
<add> }
<add>
<add> return rawRepo, nil
<add>}
<add>
<ide> // isUNC returns true if the path is UNC (one starting \\). It always returns
<ide> // false on Linux.
<ide> func isUNC(path string) bool {
<ide><path>api/server/router/local/image.go
<ide> func (s *router) postBuild(ctx context.Context, w http.ResponseWriter, r *http.R
<ide> buildConfig.Pull = true
<ide> }
<ide>
<del> repoName, tag := parsers.ParseRepositoryTag(r.FormValue("t"))
<del> if repoName != "" {
<del> if err := registry.ValidateRepositoryName(repoName); err != nil {
<del> return errf(err)
<del> }
<del> if len(tag) > 0 {
<del> if err := tags.ValidateTagName(tag); err != nil {
<del> return errf(err)
<del> }
<del> }
<add> repoAndTags, err := sanitizeRepoAndTags(r.Form["t"])
<add> if err != nil {
<add> return errf(err)
<ide> }
<ide>
<ide> buildConfig.DockerfileName = r.FormValue("dockerfile")
<ide> func (s *router) postBuild(ctx context.Context, w http.ResponseWriter, r *http.R
<ide> var (
<ide> context builder.ModifiableContext
<ide> dockerfileName string
<del> err error
<ide> )
<ide> context, dockerfileName, err = daemonbuilder.DetectContextFromRemoteURL(r.Body, remoteURL, pReader)
<ide> if err != nil {
<ide> func (s *router) postBuild(ctx context.Context, w http.ResponseWriter, r *http.R
<ide> return errf(err)
<ide> }
<ide>
<del> if repoName != "" {
<del> if err := s.daemon.TagImage(repoName, tag, string(imgID), true); err != nil {
<add> for _, rt := range repoAndTags {
<add> if err := s.daemon.TagImage(rt.repo, rt.tag, string(imgID), true); err != nil {
<ide> return errf(err)
<ide> }
<ide> }
<ide>
<ide> return nil
<ide> }
<ide>
<add>// repoAndTag is a helper struct for holding the parsed repositories and tags of
<add>// the input "t" argument.
<add>type repoAndTag struct {
<add> repo, tag string
<add>}
<add>
<add>// sanitizeRepoAndTags parses the raw "t" parameter received from the client
<add>// to a slice of repoAndTag.
<add>// It also validates each repoName and tag.
<add>func sanitizeRepoAndTags(names []string) ([]repoAndTag, error) {
<add> var (
<add> repoAndTags []repoAndTag
<add> // This map is used for deduplicating the "-t" paramter.
<add> uniqNames = make(map[string]struct{})
<add> )
<add> for _, repo := range names {
<add> name, tag := parsers.ParseRepositoryTag(repo)
<add> if name == "" {
<add> continue
<add> }
<add>
<add> if err := registry.ValidateRepositoryName(name); err != nil {
<add> return nil, err
<add> }
<add>
<add> nameWithTag := name
<add> if len(tag) > 0 {
<add> if err := tags.ValidateTagName(tag); err != nil {
<add> return nil, err
<add> }
<add> nameWithTag += ":" + tag
<add> } else {
<add> nameWithTag += ":" + tags.DefaultTag
<add> }
<add> if _, exists := uniqNames[nameWithTag]; !exists {
<add> uniqNames[nameWithTag] = struct{}{}
<add> repoAndTags = append(repoAndTags, repoAndTag{repo: name, tag: tag})
<add> }
<add> }
<add> return repoAndTags, nil
<add>}
<add>
<ide> func (s *router) getImagesJSON(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
<ide> if err := httputils.ParseForm(r); err != nil {
<ide> return err
<ide><path>docs/reference/api/docker_remote_api_v1.21.md
<ide> Query Parameters:
<ide>
<ide> - **dockerfile** - Path within the build context to the Dockerfile. This is
<ide> ignored if `remote` is specified and points to an individual filename.
<del>- **t** – A repository name (and optionally a tag) to apply to
<del> the resulting image in case of success.
<add>- **t** – A name and optional tag to apply to the image in the `name:tag` format.
<add> If you omit the `tag` the default `latest` value is assumed.
<add> You can provide one or more `t` parameters.
<ide> - **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
<ide> URI specifies a filename, the file's contents are placed into a file
<ide> called `Dockerfile`.
<ide><path>docs/reference/api/docker_remote_api_v1.22.md
<ide> Query Parameters:
<ide>
<ide> - **dockerfile** - Path within the build context to the Dockerfile. This is
<ide> ignored if `remote` is specified and points to an individual filename.
<del>- **t** – A repository name (and optionally a tag) to apply to
<del> the resulting image in case of success.
<add>- **t** – A name and optional tag to apply to the image in the `name:tag` format.
<add> If you omit the `tag` the default `latest` value is assumed.
<add> You can provide one or more `t` parameters.
<ide> - **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
<ide> URI specifies a filename, the file's contents are placed into a file
<ide> called `Dockerfile`.
<ide><path>docs/reference/builder.md
<ide> the build succeeds:
<ide>
<ide> $ docker build -t shykes/myapp .
<ide>
<add>To tag the image into multiple repositories after the build,
<add>add multiple `-t` parameters when you run the `build` command:
<add>
<add> $ docker build -t shykes/myapp:1.0.2 -t shykes/myapp:latest .
<add>
<ide> The Docker daemon runs the instructions in the `Dockerfile` one-by-one,
<ide> committing the result of each instruction
<ide> to a new image if necessary, before finally outputting the ID of your
<ide><path>docs/reference/commandline/build.md
<ide> parent = "smn_cli"
<ide> --pull=false Always attempt to pull a newer version of the image
<ide> -q, --quiet=false Suppress the verbose output generated by the containers
<ide> --rm=true Remove intermediate containers after a successful build
<del> -t, --tag="" Repository name (and optionally a tag) for the image
<add> -t, --tag=[] Name and optionally a tag in the 'name:tag' format
<ide> --ulimit=[] Ulimit options
<ide>
<ide> Builds Docker images from a Dockerfile and a "context". A build's context is
<ide> uploaded context. The builder reference contains detailed information on
<ide> This will build like the previous example, but it will then tag the resulting
<ide> image. The repository name will be `vieux/apache` and the tag will be `2.0`
<ide>
<add>You can apply multiple tags to an image. For example, you can apply the `latest`
<add>tag to a newly built image and add another tag that references a specific
<add>version.
<add>For example, to tag an image both as `whenry/fedora-jboss:latest` and
<add>`whenry/fedora-jboss:v2.1`, use the following:
<add>
<add> $ docker build -t whenry/fedora-jboss:latest -t whenry/fedora-jboss:v2.1 .
<add>
<ide> ### Specify Dockerfile (-f)
<ide>
<ide> $ docker build -f Dockerfile.debug .
<ide><path>integration-cli/docker_cli_build_test.go
<ide> func (s *DockerSuite) TestBuildTagEvent(c *check.C) {
<ide> c.Fatal("The 'tag' event not heard from the server")
<ide> }
<ide> }
<add>
<add>// #15780
<add>func (s *DockerSuite) TestBuildMultipleTags(c *check.C) {
<add> dockerfile := `
<add> FROM busybox
<add> MAINTAINER test-15780
<add> `
<add> cmd := exec.Command(dockerBinary, "build", "-t", "tag1", "-t", "tag2:v2",
<add> "-t", "tag1:latest", "-t", "tag1", "--no-cache", "-")
<add> cmd.Stdin = strings.NewReader(dockerfile)
<add> _, err := runCommand(cmd)
<add> c.Assert(err, check.IsNil)
<add>
<add> id1, err := getIDByName("tag1")
<add> c.Assert(err, check.IsNil)
<add> id2, err := getIDByName("tag2:v2")
<add> c.Assert(err, check.IsNil)
<add> c.Assert(id1, check.Equals, id2)
<add>}
<ide><path>integration-cli/docker_utils.go
<ide> func buildImageCmd(name, dockerfile string, useCache bool, buildFlags ...string)
<ide> buildCmd := exec.Command(dockerBinary, args...)
<ide> buildCmd.Stdin = strings.NewReader(dockerfile)
<ide> return buildCmd
<del>
<ide> }
<ide>
<ide> func buildImageWithOut(name, dockerfile string, useCache bool, buildFlags ...string) (string, string, error) {
<ide><path>man/docker-build.1.md
<ide> docker-build - Build a new image from the source code at PATH
<ide> [**--pull**[=*false*]]
<ide> [**-q**|**--quiet**[=*false*]]
<ide> [**--rm**[=*true*]]
<del>[**-t**|**--tag**[=*TAG*]]
<add>[**-t**|**--tag**[=*[]*]]
<ide> [**-m**|**--memory**[=*MEMORY*]]
<ide> [**--memory-swap**[=*MEMORY-SWAP*]]
<ide> [**--cpu-period**[=*0*]]
<ide> set as the **URL**, the repository is cloned locally and then sent as the contex
<ide> Remove intermediate containers after a successful build. The default is *true*.
<ide>
<ide> **-t**, **--tag**=""
<del> Repository name (and optionally a tag) to be applied to the resulting image in case of success
<add> Repository names (and optionally with tags) to be applied to the resulting image in case of success.
<ide>
<ide> **-m**, **--memory**=*MEMORY*
<ide> Memory limit
<ide> If you do not provide a version tag then Docker will assign `latest`:
<ide>
<ide> When you list the images, the image above will have the tag `latest`.
<ide>
<add>You can apply multiple tags to an image. For example, you can apply the `latest`
<add>tag to a newly built image and add another tag that references a specific
<add>version.
<add>For example, to tag an image both as `whenry/fedora-jboss:latest` and
<add>`whenry/fedora-jboss:v2.1`, use the following:
<add>
<add> docker build -t whenry/fedora-jboss:latest -t whenry/fedora-jboss:v2.1 .
<add>
<ide> So renaming an image is arbitrary but consideration should be given to
<ide> a useful convention that makes sense for consumers and should also take
<ide> into account Docker community conventions.
<ide><path>opts/opts.go
<ide> func (opts *ListOpts) Delete(key string) {
<ide>
<ide> // GetMap returns the content of values in a map in order to avoid
<ide> // duplicates.
<del>// FIXME: can we remove this?
<ide> func (opts *ListOpts) GetMap() map[string]struct{} {
<ide> ret := make(map[string]struct{})
<ide> for _, k := range *opts.values {
<ide> func (opts *ListOpts) GetMap() map[string]struct{} {
<ide> }
<ide>
<ide> // GetAll returns the values of slice.
<del>// FIXME: Can we remove this?
<ide> func (opts *ListOpts) GetAll() []string {
<ide> return (*opts.values)
<ide> } | 10 |
PHP | PHP | fix broken tests | daffbb87062daa79e168598bc879d83aec1e431e | <ide><path>tests/TestCase/Http/ResponseTransformerTest.php
<ide> public function testToPsrBodyFileResponseFileRange()
<ide>
<ide> $result = ResponseTransformer::toPsr($cake);
<ide> $this->assertEquals(
<del> 'bytes 10-20/15640',
<add> 'bytes 10-20/15641',
<ide> $result->getHeaderLine('Content-Range'),
<ide> 'Content-Range header missing'
<ide> );
<ide><path>tests/TestCase/Mailer/EmailTest.php
<ide> public function testSendRenderBoth()
<ide> "\r\n" .
<ide> "\r\n" .
<ide> "\r\n" .
<del> "This email was sent using the CakePHP Framework, http://cakephp.org." .
<add> "This email was sent using the CakePHP Framework, https://cakephp.org." .
<ide> "\r\n" .
<ide> "\r\n" .
<ide> "--$boundary\r\n" .
<ide> public function testSendRenderJapanese()
<ide> $this->Email->charset = 'ISO-2022-JP';
<ide> $result = $this->Email->send();
<ide>
<del> $expected = mb_convert_encoding('CakePHP Framework を使って送信したメールです。 http://cakephp.org.', 'ISO-2022-JP');
<add> $expected = mb_convert_encoding('CakePHP Framework を使って送信したメールです。 https://cakephp.org.', 'ISO-2022-JP');
<ide> $this->assertContains($expected, $result['message']);
<ide> $this->assertContains('Message-ID: ', $result['headers']);
<ide> $this->assertContains('To: ', $result['headers']);
<ide> public function testMessage()
<ide> $this->Email->emailFormat('both');
<ide> $this->Email->send();
<ide>
<del> $expected = '<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p>';
<add> $expected = '<p>This email was sent using the <a href="https://cakephp.org">CakePHP Framework</a></p>';
<ide> $this->assertContains($expected, $this->Email->message(Email::MESSAGE_HTML));
<ide>
<ide> $expected = 'This email was sent using the CakePHP Framework, http://cakephp.org.';
<ide><path>tests/TestCase/ORM/Behavior/TreeBehaviorTest.php
<ide> public function testFindTreeListCustom()
<ide> '/lorem/ipsum.html' => ' 4',
<ide> '/what/the.html' => ' 5',
<ide> '/yeah/another-link.html' => '6',
<del> 'http://cakephp.org' => ' 7',
<add> 'https://cakephp.org' => ' 7',
<ide> '/page/who-we-are.html' => '8'
<ide> ];
<ide> $this->assertEquals($expected, $result);
<ide> public function testFormatTreeListCustom()
<ide> '/lorem/ipsum.html' => ' 4',
<ide> '/what/the.html' => ' 5',
<ide> '/yeah/another-link.html' => '6',
<del> 'http://cakephp.org' => ' 7',
<add> 'https://cakephp.org' => ' 7',
<ide> '/page/who-we-are.html' => '8'
<ide> ];
<ide> $this->assertEquals($expected, $result); | 3 |
Javascript | Javascript | add timer example | 360d04e9c86cf7af7d946331dba91adcdc845ad6 | <ide><path>Examples/UIExplorer/TimerExample.js
<ide> var React = require('react-native');
<ide> var {
<ide> AlertIOS,
<add> Platform,
<ide> Text,
<add> ToastAndroid,
<ide> TouchableHighlight,
<ide> View,
<ide> } = React;
<ide> var TimerTester = React.createClass({
<ide> var msg = 'Finished ' + this._ii + ' ' + this.props.type + ' calls.\n' +
<ide> 'Elapsed time: ' + e + ' ms\n' + (e / this._ii) + ' ms / iter';
<ide> console.log(msg);
<del> AlertIOS.alert(msg);
<add> if (Platform.OS === 'ios') {
<add> AlertIOS.alert(msg);
<add> } else if (Platform.OS === 'android') {
<add> ToastAndroid.show(msg, ToastAndroid.SHORT);
<add> }
<ide> this._start = 0;
<ide> this.forceUpdate(() => { this._ii = 0; });
<ide> return;
<ide><path>Examples/UIExplorer/UIExplorerButton.js
<ide> var UIExplorerButton = React.createClass({
<ide>
<ide> var styles = StyleSheet.create({
<ide> button: {
<del> borderColor: 'dimgray',
<add> borderColor: '#696969',
<ide> borderRadius: 8,
<ide> borderWidth: 1,
<ide> padding: 10,
<ide> margin: 5,
<ide> alignItems: 'center',
<ide> justifyContent: 'center',
<del> backgroundColor: 'lightgrey',
<add> backgroundColor: '#d3d3d3',
<ide> },
<ide> });
<ide> | 2 |
Javascript | Javascript | add deprecated syntax selectors | 93512ba174d8ec442526dcc4894c7c690231129c | <ide><path>src/deprecated-syntax-selectors.js
<add>module.exports = [
<add> 'AFDKO', 'AVX', 'AVX2', 'AVX512', 'AVX512BW', 'AVX512DQ', 'Alpha',
<add> 'Animation', 'ArchaeologyDigSiteFrame', 'Arrow__', 'AtLilyPond',
<add> 'AttrBaseType', 'AttrSetVal__', 'Button', 'C99', 'CharacterSet', 'Chatscript',
<add> 'CheckButton', 'ClipboardType', 'Clipboard__', 'Codepages__', 'ColourActual',
<add> 'ColourReal', 'ColourSize', 'ConfCachePolicy', 'ControlPoint', 'DBE', 'DDL',
<add> 'DML', 'Database__', 'DdcMode', 'DiscussionFilterType', 'DiscussionStatus',
<add> 'DisplaySchemes', 'Document-Structuring-Comment', 'Edit',
<add> 'ExternalLinkBehaviour', 'ExternalLinkDirection', 'F16c', 'FMA', 'Font',
<add> 'FontInstance', 'FontString', 'Fonts__', 'Frame', 'GameTooltip', 'GroupList',
<add> 'HLE', 'HeaderEvent', 'HistoryType', 'HttpVerb', 'II', 'IO', 'Icon', 'IconID',
<add> 'InPlaceBox__', 'InPlaceEditEvent', 'Info', 'JSXEndTagStart',
<add> 'JSXStartTagEnd', 'KNC', 'Kotlin', 'LUW', 'Language', 'LdapItemList',
<add> 'LinkFilter', 'LinkLimit', 'Locales__', 'Lock', 'LoginPolicy', 'MA_End__',
<add> 'MA_StdCombo__', 'MA_StdItem__', 'MA_StdMenu__', 'MISSING', 'MessageFrame',
<add> 'Minimap', 'Path', 'PlayerModel', 'Proof', 'RTM', 'RecentModule__', 'Regexp',
<add> 'SCADABasic', 'Script__', 'ScrollEvent', 'ScrollSide',
<add> 'ScrollingMessageFrame', 'Sensitivity', 'Slider', 'Stream', 'Style',
<add> 'TM_COMMENT_END_2', 'TM_COMMENT_START', 'TODO', 'ToolType', 'Translation',
<add> 'TriggerStatus', 'UIObject', 'UserClass', 'UserList', 'UserNotifyList',
<add> 'VisibleRegion', 'ZipType', 'a', 'a10networks', 'aaa', 'abaqus', 'abbrev',
<add> 'abbreviated', 'abcnotation', 'abl', 'abp', 'abstract', 'academic', 'access',
<add> 'access-control', 'access-qualifiers', 'accessed', 'accessibility',
<add> 'accessible', 'accessor', 'account', 'ace', 'acl', 'act', 'action',
<add> 'actionpack', 'actions', 'actionscript', 'actionscript-file-encoding',
<add> 'activerecord', 'activesupport', 'ada', 'add', 'addition',
<add> 'additional-character', 'addon', 'address', 'address-of', 'addrfam',
<add> 'adjustment', 'adverb', 'adx', 'aerospace', 'aes', 'aes_functions', 'aesni',
<add> 'aexLightGreen', 'af', 'after-expression', 'agda', 'aggregate', 'aggregation',
<add> 'ahk', 'alabel', 'alda', 'alert', 'alias', 'aliases', 'align', 'alignment',
<add> 'all', 'all-once', 'all-solutions', 'allocatable', 'allocate', 'alloy',
<add> 'alloyglobals', 'alloyxml', 'alog', 'alpha', 'alphabeticalllt',
<add> 'alphabeticallyge', 'alphabeticallygt', 'alphabeticallyle', 'alt', 'alter',
<add> 'alternate-wysiwyg-string', 'alternates', 'alternatives', 'amd', 'amd3DNow',
<add> 'amdnops', 'ameter', 'amount', 'ampl', 'ampscript', 'analytics', 'anb',
<add> 'anchor', 'and', 'angelscript', 'angle', 'angle-brackets', 'angular',
<add> 'annotate', 'annotation', 'annotation-arguments', 'anon', 'anonymous', 'ansi',
<add> 'ansi-c', 'ansible', 'answer', 'antl', 'antlr', 'antlr4', 'anubis', 'any',
<add> 'any-method', 'aolserver', 'apache', 'apache-config', 'apc', 'apdl', 'apex',
<add> 'api', 'api-notation', 'apiary', 'apib', 'apl', 'apostrophe', 'applescript',
<add> 'application', 'application-name', 'application-process', 'approx-equal',
<add> 'aqua', 'ar', 'arbitrary-radix', 'arbitrary-repetition',
<add> 'arbitrary-repitition', 'architecture', 'arduino', 'arendelle', 'args',
<add> 'argument', 'argument-label', 'argument-separator', 'argument-seperator',
<add> 'arguments', 'arith', 'arithmetic', 'arithmetical', 'arithmeticcql', 'ark',
<add> 'arm', 'armaConfig', 'arnoldc', 'arp', 'arpop', 'arr', 'array',
<add> 'array-expression', 'array-item', 'arrays', 'arrow', 'articulation',
<add> 'artihmetic', 'as', 'as3', 'asciidoc', 'asdoc', 'ash', 'ashx', 'asl', 'asm',
<add> 'asm-instruction', 'asm-type-prefix', 'asn', 'asp', 'asp-core-2', 'aspx',
<add> 'ass', 'assembly', 'assert', 'assertion', 'assigment', 'assign', 'assigned',
<add> 'assigned-class', 'assigned-value', 'assignee', 'assignment', 'associate',
<add> 'association', 'associativity', 'assocs', 'asterisk', 'async', 'asynchronous',
<add> 'at-rule', 'at-sign', 'atml3', 'atoemp', 'atom', 'atomic', 'att',
<add> 'attachment', 'attr', 'attribute', 'attribute-key-value', 'attribute-list',
<add> 'attribute-lookup', 'attribute-name', 'attribute-selector',
<add> 'attribute-specification', 'attribute-value', 'attribute-values',
<add> 'attribute-with-value', 'attribute_list', 'attribute_value2', 'attributelist',
<add> 'attributes', 'attrset', 'audio-file', 'auditor', 'augmented', 'auth',
<add> 'auth_basic', 'author', 'authorization', 'auto', 'autoconf', 'autoindex',
<add> 'autoit', 'automake', 'automatic', 'autotools', 'avdl', 'avrasm', 'avrdisasm',
<add> 'avs', 'avx', 'avx2', 'awk', 'axis', 'b', 'babel', 'back', 'back-from',
<add> 'back-reference', 'back-slash', 'backend', 'background', 'backlash',
<add> 'backreference', 'backslash', 'backspace', 'backtick', 'bad-ampersand',
<add> 'bad-angle-bracket', 'bad-comments-or-CDATA', 'bad-escape', 'bang', 'banner',
<add> 'bar', 'bareword', 'barline', 'base-11', 'base-13', 'base-15', 'base-17',
<add> 'base-19', 'base-21', 'base-23', 'base-25', 'base-27', 'base-29', 'base-3',
<add> 'base-31', 'base-33', 'base-35', 'base-5', 'base-7', 'base-9', 'base-integer',
<add> 'base64', 'base85', 'base_pound_number_pound', 'basetype', 'basic',
<add> 'basic-arithmetic', 'basic_functions', 'bat', 'batch', 'batchfile',
<add> 'battlesim', 'bb', 'bbcode', 'bcmath', 'be', 'beam', 'beamer', 'beancount',
<add> 'begin', 'begin-document', 'begin-end-group', 'behaviour', 'bell', 'bem',
<add> 'between-tag-pair', 'bff', 'bg-black', 'bg-blue', 'bg-cyan', 'bg-green',
<add> 'bg-normal', 'bg-purple', 'bg-red', 'bg-white', 'bg-yellow', 'bhtml', 'bhv',
<add> 'bibtex', 'bif', 'big-arrow', 'bigdecimal', 'bigint', 'biicode', 'biiconf',
<add> 'bin', 'binOp', 'binary', 'binding', 'bindings', 'bioinformatics',
<add> 'biosphere', 'bison', 'bit', 'bit-and-byte', 'bit-wise', 'bitarray',
<add> 'bits-mov', 'bitwise', 'black', 'blade', 'blaze', 'blenc', 'blend',
<add> 'blending', 'block', 'block-dartdoc', 'block-data', 'block-directive',
<add> 'block-level', 'block-params', 'blockid', 'blockname', 'blockquote',
<add> 'blocktitle', 'blue', 'blueprint', 'bm', 'bmi1', 'bmi2', 'bnd', 'bnf', 'body',
<add> 'bold', 'bolt', 'boo', 'boogie', 'bool', 'boolean', 'boolean-test', 'boot',
<add> 'border', 'bottom', 'bounded', 'bounds', 'bow', 'box', 'bpl', 'brace',
<add> 'braced', 'braces', 'bracket', 'bracketed', 'brackets', 'brainfuck', 'branch',
<add> 'break', 'breakpoint', 'bridle', 'brightscript', 'bro', 'broken', 'browser',
<add> 'bsl', 'buffered', 'buffers', 'bugzilla-number', 'build', 'buildin',
<add> 'built-in', 'built-ins', 'builtin', 'bulk', 'bullet', 'bullet-point',
<add> 'bundle', 'but', 'buttons', 'by-name', 'by-number', 'byref', 'byte', 'bz2',
<add> 'c', 'c-style', 'c0', 'c1', 'c2hs', 'c99', 'ca', 'cabal-keyword', 'cache',
<add> 'cache-management', 'cacheability-control', 'cake', 'calc', 'calca',
<add> 'calendar', 'call', 'callmethod', 'callout', 'camlp4', 'camlp4-stream',
<add> 'capability', 'capnp', 'cappuccino', 'caps', 'caption', 'capture', 'cascade',
<add> 'case', 'case-block', 'case-body', 'case-statement', 'case-terminator',
<add> 'case_control', 'cassius', 'cast', 'catch', 'catch-exception', 'catcode',
<add> 'categort', 'category', 'cbot', 'cc65', 'cdata', 'cdef', 'cell', 'cellwall',
<add> 'ceq', 'ces', 'cexpr', 'cf', 'cfdg', 'cfengine', 'cfg', 'cfml', 'cfunction',
<add> 'cg', 'cgx', 'chain', 'chainname', 'changed', 'changelogs', 'changes',
<add> 'channel', 'chapel', 'chapter', 'char', 'character', 'character-class',
<add> 'character-data-not-allowed-here', 'character-literal-too-long',
<add> 'character-not-allowed-here', 'character_not_allowed_here', 'characters',
<add> 'chars', 'charset', 'check', 'children', 'chord', 'chorus', 'chuck', 'chunk',
<add> 'cirru', 'cisco', 'citation', 'cite', 'citrine', 'cjam', 'cjson', 'class',
<add> 'class-constraint', 'class-constraints', 'class-declaration', 'class-fns',
<add> 'class-instance', 'class-struct-block', 'class-type', 'class-type-definition',
<add> 'classes', 'classicalb', 'classname', 'classobj', 'clause',
<add> 'clause-head-body', 'clauses', 'clear', 'cleared', 'clflushopt', 'click',
<add> 'client', 'clip', 'clipboard', 'clips', 'clmul', 'clock', 'clojure', 'close',
<add> 'closed', 'closing', 'closure', 'cm', 'cmake', 'cmb', 'cmd', 'cobject',
<add> 'cocoa', 'cocor', 'cod4mp', 'code', 'code-example', 'codeblock', 'codetag',
<add> 'codimension', 'codstr', 'coffee', 'coffeescript', 'coil', 'collection',
<add> 'colon', 'colons', 'color', 'colour', 'colspan', 'column', 'column-specials',
<add> 'com', 'combinators', 'comboboxes', 'comma', 'comma-parenthesis', 'command',
<add> 'commandline', 'comment', 'comment-italic', 'commentblock', 'commented-out',
<add> 'commentinline', 'commit-command', 'common', 'common-lisp', 'commonform',
<add> 'communications', 'community', 'compare', 'compareOp', 'comparison',
<add> 'compatibility-version', 'compile', 'compile-only', 'compiled',
<add> 'compiled-papyrus', 'compiler', 'complement', 'complete_tag', 'complex',
<add> 'component', 'component_instantiation', 'compositor', 'compound',
<add> 'compound-assignment', 'compress', 'computercraft', 'concatenator',
<add> 'concrete', 'condition', 'conditional', 'conditional-directive',
<add> 'conditionals', 'conditions', 'conf', 'config', 'configuration', 'confluence',
<add> 'conftype', 'conjunction', 'conky', 'connstate', 'cons',
<add> 'consider_option_subnode', 'consider_options_subnode', 'considering',
<add> 'console', 'const', 'const-data', 'constant', 'constants', 'constrained',
<add> 'constraint', 'constraints', 'construct', 'constructor', 'constructs',
<add> 'consult', 'container', 'contains', 'content', 'content-detective',
<add> 'contentSupplying', 'context', 'context-free', 'context-signature',
<add> 'contigous', 'continuation', 'continuations', 'continue', 'continuum',
<add> 'contol', 'contract', 'contracts', 'control', 'control-management',
<add> 'control-systems', 'control-transfer', 'controller', 'conventional',
<add> 'conversion', 'convert-type', 'cookie', 'cool', 'coord1', 'coord2',
<add> 'coordinates', 'coq', 'core', 'core-parse', 'core-rule', 'cos', 'counter',
<add> 'counters', 'cover', 'cplkg', 'cplusplus', 'cpp', 'cpp-type', 'cpp_type',
<add> 'cpu12', 'cql', 'cram', 'crc32', 'create', 'creation', 'critic', 'crl',
<add> 'crontab', 'crypto', 'crystal', 'cs', 'csharp', 'cshtml', 'csi', 'csound',
<add> 'csound-document', 'csound-score', 'cspm', 'css', 'csv', 'csx', 'ct', 'ctkey',
<add> 'ctxvar', 'ctxvarbracket', 'ctype', 'cubic-bezier', 'cucumber', 'cuda',
<add> 'cuesheet', 'cup', 'cupsym', 'curl', 'curley', 'curly', 'currency',
<add> 'curve-fitting', 'custom', 'custom-media', 'cut', 'cve-number', 'cvs',
<add> 'cy-GB', 'cyan', 'cycle', 'cypher', 'cyrix', 'cython', 'd', 'daml', 'dana',
<add> 'danger', 'dark_aqua', 'dark_blue', 'dark_gray', 'dark_green', 'dark_purple',
<add> 'dark_red', 'dart', 'dartdoc', 'dash', 'dasm', 'data', 'data-acquisition',
<add> 'data-index', 'data-integrity', 'data-step', 'data-transfer', 'database',
<add> 'database-name', 'datablock', 'datafeed', 'datatype', 'datatypes', 'date',
<add> 'date-time', 'datetime', 'day', 'db', 'dba', 'dbx', 'dc', 'dcon', 'dd', 'de',
<add> 'dealii', 'deallocate', 'deb-control', 'debug', 'debug-password', 'debugger',
<add> 'dec', 'decimal', 'decision', 'decl', 'declaration', 'declaration-prod',
<add> 'declarator', 'declare', 'decoration', 'decorator', 'decrement', 'def',
<add> 'default', 'default-frame-rate', 'default-script-limits', 'default-size',
<add> 'defaults-css-files', 'defaults-css-url', 'deferred', 'define', 'definedness',
<add> 'definition', 'definitions', 'defintions', 'deflate', 'delete', 'deleted',
<add> 'deletion', 'delimited', 'delimiter', 'delimiters', 'dense', 'deprecated',
<add> 'dereference', 'derived', 'derived-type', 'desc', 'describe', 'description',
<add> 'design', 'desktop', 'destination', 'destructor', 'destructured', 'developer',
<add> 'device', 'diagnostic', 'dialogue', 'dict', 'dictionary', 'dictionaryname',
<add> 'diff', 'difference', 'different', 'dimension', 'dip', 'dir', 'dircolors',
<add> 'direct', 'direction', 'directive', 'directives', 'directory', 'dirtyblue',
<add> 'dirtygreen', 'disable', 'disable-markdown', 'discarded', 'disjunction',
<add> 'disk', 'disk-folder-file', 'divider', 'django', 'dl', 'dlv', 'dm', 'dml',
<add> 'dnl', 'do', 'dobody', 'doc', 'doc-comment', 'docRoot', 'dockerfile',
<add> 'doconce', 'docstring', 'doctype', 'document', 'documentation',
<add> 'documentroot', 'doki', 'dollar', 'dollar_variable', 'dom', 'domain',
<add> 'dontcollect', 'doors', 'dot', 'dot-access', 'dotenv', 'dots', 'dotted',
<add> 'double', 'double-arrow', 'double-colon', 'double-dash', 'double-dot',
<add> 'double-number-sign', 'double-percentage', 'double-quote', 'double-quoted',
<add> 'double-slash', 'doublequote', 'doubleslash', 'dougle', 'doxyfile', 'doxygen',
<add> 'drive', 'droiuby', 'drop', 'drop-shadow', 'droplevel', 'drummode', 'drupal',
<add> 'dsl', 'dt', 'dtl', 'dummy', 'dummy-variable', 'dump', 'duration', 'dust',
<add> 'dust_Conditional', 'dust_filter', 'dust_partial_not_self_closing',
<add> 'dust_section_context', 'dust_self_closing_section_tag',
<add> 'dust_start_section_tag', 'dustjs', 'dwscript', 'dxl', 'dylan', 'dyndoc',
<add> 'dyon', 'e', 'each', 'eachin', 'earl-grey', 'ebuild', 'echo', 'ecmascript',
<add> 'eco', 'ecr', 'ect', 'ect2', 'ect3', 'ect4', 'edasm', 'edge', 'ee',
<add> 'eel-expression', 'eex', 'effect', 'effectgroup', 'eiffel', 'eight', 'eio',
<add> 'el_expression', 'elasticsearch', 'elasticsearch2', 'element', 'elemental',
<add> 'elements', 'elemnt', 'elif', 'elision', 'elixir', 'ellipsis', 'elm', 'elmx',
<add> 'else', 'elseif', 'elsewhere', 'eltype', 'elvis', 'em', 'email', 'embed',
<add> 'embedded', 'embedded-c', 'embedded-ruby', 'embedded2', 'embeded', 'ember',
<add> 'emberscript', 'emblem', 'emoji', 'emojicode', 'emph', 'emphasis', 'empty',
<add> 'empty-dictionary', 'empty-list', 'empty-string', 'empty-tag', 'empty-tuple',
<add> 'empty-typing-pair', 'empty_gif', 'emptyelement', 'en', 'en-au', 'en-old',
<add> 'enable', 'enc', 'enchant', 'end', 'end-definition', 'end-document',
<add> 'end-of-line', 'end-statement', 'endassociate', 'enddo', 'endfile',
<add> 'endforall', 'endfunction', 'endif', 'ending', 'endinterface', 'endmodule',
<add> 'endprogram', 'endselect', 'endsubmodule', 'endsubroutine', 'endtype',
<add> 'endwhere', 'engine', 'entity', 'entity_instantiation', 'entitytype', 'entry',
<add> 'entry-definition', 'entry-key', 'entry-type', 'entrypoint', 'enum',
<add> 'enumeration', 'enumerator', 'enumerator-specification', 'env', 'environment',
<add> 'environment-variable', 'eof', 'epatch', 'eq', 'equal', 'equalexpr', 'equals',
<add> 'equals-sign', 'equation', 'erb', 'ereg', 'erlang', 'error', 'error-control',
<add> 'errorfunc', 'errors', 'errorstop', 'es', 'es6', 'es6import', 'escape',
<add> 'escape-code', 'escape-sequence', 'escaped', 'escaped-content', 'escapes',
<add> 'escript', 'eso-lua', 'eso-txt', 'essence', 'eth', 'ethaddr', 'etpl',
<add> 'european', 'evaled', 'evaluation', 'even-tab', 'event', 'event-call',
<add> 'event-handler', 'eventType', 'eventb', 'eventend', 'events', 'exactly',
<add> 'example', 'exampleText', 'examples', 'excel-link', 'exception', 'exceptions',
<add> 'exclamation', 'exec', 'execution-context', 'exif', 'existential', 'exit',
<add> 'exp', 'expected-array-separator', 'expected-dictionary-separator',
<add> 'expected-extends', 'expected-implements', 'expected-range-separator',
<add> 'expires', 'explicit', 'exponential', 'export', 'expr', 'expression',
<add> 'expression-seperator', 'expressions', 'expressions-and-types', 'ext',
<add> 'extempore', 'extend', 'extended', 'extends', 'extension',
<add> 'extension-specification', 'extensions', 'extern', 'external', 'externs',
<add> 'extersk', 'extglob', 'extra', 'extra-characters', 'extra-equals-sign',
<add> 'extracted', 'extrassk', 'f5networks', 'fa', 'fact', 'factor', 'fail',
<add> 'fakeroot', 'fallback', 'false', 'fandoc', 'fann', 'fantom', 'fastcgi',
<add> 'fbaccidental', 'fbgroupclose', 'fbgroupopen', 'fbp', 'feature', 'features',
<add> 'fenced', 'fhem', 'field', 'field-name', 'field-tag', 'fields', 'figuregroup',
<add> 'filder-design-hdl-coder', 'file', 'file-name', 'file-path', 'fileinfo',
<add> 'filename', 'filter', 'filter-pipe', 'filteredtranscludeblock', 'filters',
<add> 'final', 'final-procedure', 'financial', 'financial-derivatives', 'find-m',
<add> 'finder', 'finish', 'finn', 'firebug', 'first', 'first-class', 'first-line',
<add> 'fish', 'fix_this_later', 'fixed', 'fixed-income', 'fixed-point', 'fixme',
<add> 'fl', 'flag', 'flags', 'flash', 'flash-type', 'flash9', 'flatbuffers',
<add> 'flex-config', 'float', 'float-exponent', 'floating-point', 'floating_point',
<add> 'flow', 'flowtype', 'flush', 'fma', 'fn', 'folder-actions', 'following',
<add> 'font', 'font-name', 'font-size', 'fontface', 'fonts', 'footer', 'footnote',
<add> 'for', 'for-loop', 'for-quantity', 'forall', 'foreach', 'foreign',
<add> 'forge-config', 'forin', 'form', 'format', 'format-verb', 'formatted',
<add> 'formfeed', 'forth', 'fortran', 'forward', 'foundation', 'fountain', 'four',
<add> 'fourd-command', 'fourd-comment', 'fourd-constant', 'fourd-constant-hex',
<add> 'fourd-constant-number', 'fourd-constant-string', 'fourd-control-begin',
<add> 'fourd-control-end', 'fourd-declaration', 'fourd-declaration-array',
<add> 'fourd-dollar', 'fourd-local-variable', 'fourd-parameter', 'fourd-script',
<add> 'fourd-table', 'fourd-tag', 'fourd-variable', 'fpm', 'fpu', 'fpu_x87', 'fr',
<add> 'fragment', 'frame', 'frames', 'frametitle', 'framexml', 'freebasic',
<add> 'freefem', 'from', 'from-file', 'front-matter', 'fsgsbase', 'fsharp', 'fsl',
<add> 'fsm', 'ftl', 'fuck', 'full-line', 'fun', 'func', 'func-tag', 'funchand',
<add> 'function', 'function-call', 'function-definition', 'function-parameter',
<add> 'function-parameters', 'function-recursive', 'function-return',
<add> 'function-type', 'function-with-body', 'functionDeclarationArgument',
<add> 'function_definition', 'function_prototype', 'functioncall', 'functionend',
<add> 'functions', 'fundimental', 'funk', 'funtion-definition', 'fus',
<add> 'fuzzy-logic', 'fx', 'g', 'galaxy', 'gallery', 'gamebusk', 'gamescript',
<add> 'gams', 'gams-lst', 'gap', 'garch', 'gather', 'gcode', 'gdb', 'gdscript',
<add> 'gdx', 'ge', 'geck-keyword', 'general', 'general-purpose', 'generate',
<add> 'generator', 'generic', 'generic-spec', 'generic-type', 'generic_list',
<add> 'genericcall', 'genetic-algorithms', 'geo', 'geom', 'geometric',
<add> 'geometry-adjustment', 'get', 'getproperty', 'getset', 'getter', 'gettext',
<add> 'getword', 'gfm', 'gfm-todotxt', 'gfx', 'gh-number', 'gherkin', 'gisdk',
<add> 'git', 'git-attributes', 'git-commit', 'git-config', 'git-rebase',
<add> 'gitignore', 'given', 'gj', 'global', 'globalsection', 'glsl',
<add> 'glyph_class_name', 'glyphname-value', 'gml', 'gmp', 'gms', 'gmsh', 'gmx',
<add> 'gn', 'gnuplot', 'go', 'goatee', 'godmode', 'gohtml', 'gold', 'golo',
<add> 'google', 'gotemplate', 'goto', 'goto-label', 'gradle', 'grails', 'grammar',
<add> 'grammar-action', 'grammar-rule', 'grammar_production', 'grapahql', 'graph',
<add> 'graphics', 'graphql', 'gray', 'greater', 'greek', 'green', 'gridlists',
<add> 'grog', 'groovy', 'groovy-properties', 'group', 'group-title', 'growl', 'gs',
<add> 'gsc', 'gsp', 'gt', 'guard', 'gui', 'guid', 'guillemot', 'gzip',
<add> 'gzip_static', 'h', 'h1', 'hack', 'haddock', 'hairpin', 'ham', 'haml',
<add> 'hamlbars', 'hamlet', 'hamlpy', 'handlebars', 'handler', 'haproxy-config',
<add> 'harbou', 'harbour', 'hardlinebreaks', 'hash', 'hash-tick', 'hashicorp',
<add> 'hashkey', 'haskell', 'haxe', 'haxedoc', 'hbs', 'hcl', 'hdl', 'hdr', 'he',
<add> 'head', 'header', 'header-value', 'headers', 'heading', 'heading-1',
<add> 'heading-2', 'heading-3', 'heading-4', 'heading-5', 'heading-6', 'height',
<add> 'helen', 'helpers', 'heredoc', 'heredoc-token', 'herestring', 'heritage',
<add> 'hex', 'hex-byte', 'hex-literal', 'hex-string', 'hex-value', 'hex8',
<add> 'hexadecimal', 'hexidecimal', 'hexprefix', 'hidden', 'hide', 'highlight',
<add> 'hive', 'hjson', 'hl7', 'hlsl', 'hn', 'hoa', 'hoc', 'hocomment', 'hocon',
<add> 'hocontinuation', 'hocontrol', 'hombrew-formula', 'homematic', 'hook',
<add> 'hostname', 'hosts', 'hour', 'hours', 'hps', 'hql', 'hr', 'hs', 'hsc2hs',
<add> 'htaccess', 'html', 'html_entity', 'htmlbars', 'http', 'hu', 'hxinst', 'hy',
<add> 'hyperlink', 'hyphen', 'hyphenation', 'i18n', 'iRev', 'ice', 'icinga2',
<add> 'icmpv6type', 'iconv', 'id', 'identical', 'identifier',
<add> 'identifiers-and-DTDs', 'idl', 'idris', 'ieee', 'if', 'if-block', 'if-branch',
<add> 'if-condition', 'ifdef', 'ifndef', 'ignore', 'ignore-eol', 'ignorebii',
<add> 'ignored', 'iisfunc', 'ilasm', 'illeagal', 'illegal', 'image',
<add> 'image-acquisition', 'image-processing', 'imaginary', 'imba', 'immediate',
<add> 'immutable', 'impex', 'implementation', 'implemented', 'implements',
<add> 'implicit', 'import', 'import-all', 'importall', 'important', 'impure', 'in',
<add> 'in-block', 'inappropriate', 'include', 'include-libraries',
<add> 'include-resource-bundles', 'incode', 'incomplete',
<add> 'incomplete-variable-assignment', 'inconsistent', 'increment',
<add> 'increment-decrement', 'indepimage', 'index', 'index-seperator', 'indexed',
<add> 'indexer', 'indexes', 'indices', 'inet', 'inetprototype', 'inferred', 'infes',
<add> 'infinity', 'infix', 'info', 'inform', 'inform6', 'inform7', 'inherit',
<add> 'inheritDoc', 'inheritance', 'inherited', 'inherited-class', 'ini', 'init',
<add> 'initialization', 'initializer-list', 'inline', 'inline-data',
<add> 'inline-expression', 'inlineblock', 'inner', 'inner-class', 'inno', 'inout',
<add> 'input', 'inquire', 'inserted', 'insertion-and-extraction', 'inside',
<add> 'install', 'instance', 'instantiation', 'instruction', 'instructions',
<add> 'instrument', 'instrument-control', 'int', 'int64', 'integer',
<add> 'integer-float', 'intel', 'intel-hex', 'intent', 'intepreted', 'interbase',
<add> 'interface', 'interface-or-protocol', 'interfaces', 'internal',
<add> 'internalsubset', 'internet', 'interpolated', 'interpolation', 'interrupt',
<add> 'intersection', 'intl', 'intrinsic', 'intuicio4', 'invalid',
<add> 'invalid-inequality', 'invalid-quote', 'invalid-variable-name', 'invocation',
<add> 'invoke', 'io', 'ip', 'ip-port', 'ipkg', 'ipv4', 'ipv6', 'ipynb', 'irct',
<add> 'is', 'isa', 'isc', 'iscexport', 'isclass', 'isml', 'issue', 'italic', 'item',
<add> 'item-access', 'itemlevel', 'items', 'iteration', 'itunes', 'ivar', 'ja',
<add> 'jack', 'jade', 'java', 'java-properties', 'java-props', 'javadoc',
<add> 'javascript', 'jbeam', 'jekyll', 'jflex', 'jibo-rule', 'jinja', 'jison',
<add> 'jisonlex', 'jmp', 'joker', 'jolie', 'jpl', 'jq', 'jquery', 'js', 'jsdoc',
<add> 'jsduck', 'jsim', 'json', 'json5', 'jsoniq', 'jsonnet', 'jsont', 'jsp', 'jsx',
<add> 'julia', 'julius', 'jump', 'juniper', 'junit-test-report', 'junos', 'juttle',
<add> 'kag', 'kagex', 'kbd', 'keep-as3-metadata', 'kerboscript', 'kernel',
<add> 'kevscript', 'kewyword', 'key', 'key-assignment', 'key-pair', 'key-path',
<add> 'key-value', 'keyframe', 'keyframes', 'keygroup', 'keyvalue', 'keyword',
<add> 'keyword_arrays', 'keyword_objects', 'keyword_roots', 'keyword_string',
<add> 'keywords', 'kickstart', 'kind', 'kmd', 'kn', 'knitr', 'kos', 'kotlin', 'krl',
<add> 'kspcfg', 'kurumin', 'kv', 'l20n', 'label', 'labeled', 'labeled-parameter',
<add> 'lambda', 'langauge', 'language', 'languagebabel', 'languages', 'langversion',
<add> 'largesk', 'lasso', 'last', 'latex', 'latex2', 'latino', 'latte', 'layout',
<add> 'layoutbii', 'lbsearch', 'lc', 'lcb', 'ldap', 'ldif', 'le', 'leading',
<add> 'leading-tabs', 'lean', 'left', 'left-margin', 'leftshift', 'legacy', 'lemon',
<add> 'length', 'leopard', 'less', 'less-equal', 'let', 'letter', 'level', 'levels',
<add> 'lex', 'lhs', 'li', 'lib', 'library', 'libxml', 'lifetime', 'ligature',
<add> 'light_purple', 'lilypond', 'lilypond-figuregroup', 'lilypond-internals',
<add> 'lilypond-lyricsmode', 'lilypond-notemode', 'lilypond-schememode',
<add> 'limit_zone', 'line', 'line-break', 'line-continuation',
<add> 'line-continuation-operator', 'line-number', 'linebreak', 'linefeed',
<add> 'linenumber', 'link', 'link-label', 'link-report', 'link-text', 'link-url',
<add> 'linkage', 'linkedsockets', 'linkplain', 'linkplain-label', 'linq',
<add> 'linuxcncgcode', 'liquid', 'lisp', 'list', 'list-directive', 'list-separator',
<add> 'list_item', 'listnum', 'listvalues', 'litcoffee', 'literal',
<add> 'literal-string', 'literate', 'litword', 'livecodescript', 'livescript',
<add> 'livescriptscript', 'll', 'llvm', 'load-constants', 'load-externs',
<add> 'load-hint', 'loader', 'local', 'local-variables', 'locale-element',
<add> 'localized', 'localized-description', 'localized-title', 'localname',
<add> 'locals', 'location', 'lock', 'log', 'log-debug', 'log-error', 'log-info',
<add> 'log-patch', 'log-success', 'log-verbose', 'log-warning', 'logging', 'logic',
<add> 'logical', 'logical-expression', 'logicblox', 'logo', 'logstash', 'logtalk',
<add> 'lol', 'long', 'look-ahead', 'look-behind', 'lookahead', 'lookaround',
<add> 'lookbehind', 'loop', 'loop-control', 'lp', 'lparen', 'lsg', 'lsl',
<add> 'lst-cpu12', 'lstdo', 'lt', 'lt-gt', 'lua', 'lucee', 'luceecomment',
<add> 'luceescript', 'lucius', 'lury', 'lv', 'lyricsmode', 'm', 'm4', 'm4sh',
<add> 'm65816', 'm68k', 'mac-classic', 'machine', 'macro', 'macro-usage', 'macro11',
<add> 'madoko', 'magenta', 'magic', 'magik', 'mail', 'mailer', 'main', 'makefile',
<add> 'mako', 'mamba', 'manager-class', 'map', 'mapfile', 'mapkey', 'mapping',
<add> 'maprange', 'marasm', 'margin', 'marginpar', 'mark', 'markdown', 'marker',
<add> 'marko', 'marko-attribute', 'marko-tag', 'markup', 'markupmode', 'mask',
<add> 'mason', 'mat', 'mata', 'match', 'match-condition', 'match-definition',
<add> 'match-option', 'match-pattern', 'material', 'math', 'math_complex',
<add> 'math_real', 'mathematic', 'mathematical', 'mathematical-symbols',
<add> 'mathematics', 'matlab', 'matrix', 'maude', 'max-cached-fonts',
<add> 'max-execution-time', 'maxscript', 'maybe', 'mb', 'mbstring', 'mc', 'mcc',
<add> 'mccolor', 'mch', 'mcn', 'mcode', 'mcr', 'mcrypt', 'mcs', 'md', 'media',
<add> 'media-feature', 'mediawiki', 'mei', 'mel', 'memaddress', 'member',
<add> 'member-function-attribute', 'membership', 'memcache', 'memcached', 'memoir',
<add> 'memory-management', 'menhir', 'mention', 'mercury', 'merlin', 'message',
<add> 'message-forwarding-handler', 'messages', 'meta', 'meta-data', 'meta-info',
<add> 'metadata', 'metakey', 'metascript', 'meteor', 'method', 'method-call',
<add> 'method-definition', 'method-mofification', 'method-parameter',
<add> 'method-parameters', 'method-restriction', 'methods', 'mhash', 'microsites',
<add> 'middle', 'migration', 'mime', 'min', 'minelua', 'minetweaker',
<add> 'minitemplate', 'minus', 'mips', 'mirah', 'misc', 'miscellaneous',
<add> 'mismatched', 'missing', 'missing-asterisk', 'missing-inheritance',
<add> 'missing-parameters', 'missing-section-begin', 'missingend', 'mixin', 'mjml',
<add> 'ml', 'mlab', 'mls', 'mm', 'mml', 'mmx', 'mmx_instructions', 'mnemonic',
<add> 'mochi', 'mod', 'mod_perl', 'modblock', 'model', 'model-based-calibration',
<add> 'model-predictive-control', 'modelica', 'modelicascript', 'modern',
<add> 'modifier', 'modl', 'modr', 'mods', 'modula-2', 'module', 'module-alias',
<add> 'module-binding', 'module-definition', 'module-expression',
<add> 'module-reference', 'module-rename', 'module-sum', 'module-type', 'modules',
<add> 'modulo', 'mojolicious', 'mojom', 'mond', 'money', 'mongo', 'mongodb',
<add> 'monicelli', 'monitor', 'monkberry', 'monkey', 'monospace', 'monte', 'month',
<add> 'moon', 'moos', 'moose', 'moosecpp', 'mouse', 'mov', 'mozu', 'mpw', 'mpx',
<add> 'mscgen', 'mscript', 'msg', 'msgctxt', 'msgenny', 'msgstr', 'mson',
<add> 'mson-block', 'mss', 'mta', 'mucow', 'multi', 'multi-line', 'multi-threading',
<add> 'multids-file', 'multiline', 'multiplication', 'multiplicative', 'multiply',
<add> 'multiverse', 'mumps', 'mundosk', 'mustache', 'mut', 'mutable', 'mutator',
<add> 'mx', 'mxml', 'mydsl1', 'mysql', 'mysqli', 'mysqlnd-memcache', 'mysqlnd-ms',
<add> 'mysqlnd-qc', 'mysqlnd-uh', 'mzn', 'nabla', 'nagios', 'name', 'name-list',
<add> 'name-of-parameter', 'named', 'named-tuple', 'nameless-typed', 'namelist',
<add> 'namespace', 'namespace-block', 'namespace-definition', 'namespace-reference',
<add> 'namespaces', 'nan', 'nant', 'narration', 'nas', 'nastran', 'nat', 'native',
<add> 'nativeint', 'natural', 'navigation', 'ncf', 'ncl', 'ndash', 'nearley',
<add> 'negate', 'negated', 'negation', 'negative', 'negative-look-ahead',
<add> 'negative-look-behind', 'neko', 'nesc', 'nested', 'nested_braces',
<add> 'nested_ltgt', 'nesty', 'net', 'netbios', 'network', 'neural-network', 'new',
<add> 'new-object', 'newline', 'newline-spacing', 'newlinetext', 'newlisp', 'nez',
<add> 'nft', 'ngdoc', 'nginx', 'nickname', 'nil', 'nim', 'ninja', 'ninjaforce',
<add> 'nit', 'nitro', 'nix', 'nl', 'nlf', 'nm', 'nm7', 'no-capture',
<add> 'no-completions', 'no-content', 'no-default', 'no-indent',
<add> 'no-trailing-digits', 'no-validate-params', 'nocapture', 'node', 'nogc',
<add> 'noindent', 'non', 'non-capturing', 'non-immediate', 'non-intrinsic',
<add> 'non-null-typehinted', 'non-overridable', 'non-standard', 'non-terminal',
<add> 'non_recursive', 'none', 'none-parameter', 'nonlocal', 'nonterminal', 'noon',
<add> 'nop', 'nopass', 'normal', 'normal_numeric', 'normal_objects', 'normal_text',
<add> 'not', 'not-a-number', 'notation', 'note', 'notechord', 'notemode',
<add> 'notequal', 'notequalexpr', 'notidentical', 'notification', 'nowdoc', 'noweb',
<add> 'nrtdrv', 'nsapi', 'nscript', 'nse', 'nsis', 'nsl', 'ntriples', 'nul', 'null',
<add> 'nullify', 'nullological', 'nulltype', 'num', 'number', 'number-sign',
<add> 'numbered', 'numberic', 'numbersign', 'numeric', 'numeric_std', 'nunjucks',
<add> 'nut', 'nvatom', 'nxc', 'objc', 'objcpp', 'objdump', 'object',
<add> 'object-comments', 'object-definition', 'objj', 'obsolete', 'ocaml',
<add> 'ocamllex', 'occam', 'occurrences', 'oci8', 'ocmal', 'oct', 'octal', 'octave',
<add> 'octo', 'octobercms', 'octothorpe', 'odd-tab', 'odedsl', 'ods', 'offset',
<add> 'ofx', 'ogre', 'ok', 'ol', 'old', 'old-style', 'omap', 'omitted', 'on',
<add> 'on-background', 'on-error', 'one', 'oniguruma', 'only', 'only-in', 'onoff',
<add> 'ooc', 'op-domain', 'opa', 'opaque', 'opc', 'opcache', 'opcode', 'open',
<add> 'opencl', 'opendss', 'opening', 'openmp', 'openssl', 'opentype', 'operand',
<add> 'operands', 'operation', 'operator', 'operator2', 'operators', 'opmaskregs',
<add> 'optimization', 'optimize', 'option', 'option-toggle', 'optional',
<add> 'optional-parameter', 'optional-parameter-assignment', 'optionals',
<add> 'optionname', 'options', 'or', 'oracle', 'orcam', 'orchestra', 'order',
<add> 'ordered', 'ordered-block', 'orgtype', 'origin', 'other', 'others',
<add> 'otherwise', 'out', 'outer', 'output', 'overload', 'override', 'overtype',
<add> 'owner', 'oz', 'p5', 'p8', 'pa', 'package', 'package-definition',
<add> 'package_body', 'packed', 'packed-arithmetic', 'packed-blending',
<add> 'packed-comparison', 'packed-floating-point', 'packed-integer', 'packed-math',
<add> 'packed-mov', 'packed-other', 'packed-shift', 'packed-shuffle', 'packed-test',
<add> 'page', 'page-props', 'pair', 'pandoc', 'papyrus', 'papyrus-assembly',
<add> 'paragraph', 'param', 'param-list', 'paramater', 'parameter',
<add> 'parameter-entity', 'parameterless', 'parameters', 'paramless', 'params',
<add> 'paren', 'paren-group', 'parens', 'parent', 'parent-reference', 'parenthases',
<add> 'parentheses', 'parenthesis', 'parenthesized', 'parenthetical_list',
<add> 'parenthetical_pair', 'parfor-quantity', 'parse', 'parser-token', 'parser3',
<add> 'particle', 'pascal', 'pass', 'pass-through', 'passthrough', 'password',
<add> 'password-hash', 'patch', 'path', 'path-pattern', 'pattern',
<add> 'pattern-definition', 'pause', 'payee', 'pbtxt', 'pcntl', 'pdd', 'pddl',
<add> 'peg', 'pegcoffee', 'pegjs', 'pending', 'percentage', 'percussionnote',
<add> 'period', 'perl', 'perl-section', 'perl6', 'perl6fe', 'perlfe', 'perlt6e',
<add> 'perm', 'permutations', 'personalization', 'pf', 'pfm', 'pfx', 'pgn', 'pgsql',
<add> 'phone-number', 'php', 'php_apache', 'php_dom', 'php_ftp', 'php_imap',
<add> 'php_mssql', 'php_odbc', 'php_pcre', 'php_spl', 'php_zip', 'phpdoc',
<add> 'phrasemodifiers', 'phraslur', 'physics', 'pi', 'pic', 'pick', 'pig',
<add> 'pillar', 'pink', 'pipe', 'pipeline', 'piratesk', 'placeholder',
<add> 'placeholder-selector', 'plain', 'plainsimple-heading', 'plainsimple-number',
<add> 'plantuml', 'playerversion', 'plist', 'plsql', 'plugin', 'plus', 'pmc', 'pml',
<add> 'pmlPhysics-arrangecharacter', 'pmlPhysics-emphasisequote',
<add> 'pmlPhysics-graphic', 'pmlPhysics-header', 'pmlPhysics-htmlencoded',
<add> 'pmlPhysics-links', 'pmlPhysics-listtable', 'pmlPhysics-physicalquantity',
<add> 'pmlPhysics-relationships', 'pmlPhysics-slides', 'pmlPhysics-slidestacks',
<add> 'pmlPhysics-speech', 'pmlPhysics-structure', 'pnt', 'po', 'pod', 'poe',
<add> 'pogoscript', 'pointer', 'pointer-arith', 'policiesbii', 'polydelim',
<add> 'polymorphic', 'polymorphic-variant', 'polysep', 'pony', 'port', 'positional',
<add> 'positive', 'posix', 'posix-reserved', 'post', 'post-match', 'postblit',
<add> 'postcss', 'postfix', 'postpone', 'postscript', 'potigol', 'potion', 'pound',
<add> 'power', 'powershell', 'pp', 'ppd', 'praat', 'pragma', 'pragma-all-once',
<add> 'pragma-mark', 'pragma-message', 'pragma-newline-spacing-value',
<add> 'pragma-stg-value', 'pre', 'pre-defined', 'preamble', 'prec', 'precedence',
<add> 'pred', 'predefined', 'predicate', 'prefetchwt', 'prefix', 'prefixed-uri',
<add> 'prefixes', 'preinst', 'prelude', 'prepare', 'prepocessor', 'preposition',
<add> 'prepositional', 'preprocessor', 'prerequisites', 'previous', 'primitive',
<add> 'primitive-datatypes', 'primitive-field', 'print', 'priority', 'prism',
<add> 'private', 'privileged', 'pro', 'probe', 'proc', 'procedure',
<add> 'procedure_definition', 'procedure_prototype', 'process',
<add> 'process-substitution', 'processes', 'processing', 'proctitle', 'profile',
<add> 'program', 'program-block', 'progressbars', 'proguard', 'project', 'prolog',
<add> 'prologue', 'promoted', 'prompt', 'prompt-prefix', 'prop', 'properties',
<add> 'properties_literal', 'property', 'property-list', 'property-name',
<add> 'property-value', 'propertyend', 'proposition', 'protected', 'protection',
<add> 'proto', 'protobuf', 'protobufs', 'protocol', 'protocol-list', 'prototype',
<add> 'proxy', 'psci', 'pseudo', 'pseudo-class', 'pseudo-element', 'pseudo-method',
<add> 'pseudo-mnemonic', 'pseudo-variable', 'pshdl', 'pspell', 'psql', 'pt',
<add> 'ptc-config', 'pthread', 'public', 'pug', 'punchcard', 'punctual',
<add> 'punctuation', 'punctutation', 'puncuation', 'puppet', 'pure', 'purebasic',
<add> 'purescript', 'pweave', 'py2pml', 'pymol', 'pyresttest', 'python',
<add> 'python-function', 'q', 'q-bracket', 'q-paren', 'qa', 'qml', 'qoute', 'qq',
<add> 'qq-bracket', 'qq-paren', 'qry', 'qtpro', 'quad', 'qual', 'qualifier',
<add> 'quality', 'quant', 'quantifier', 'quantifiers', 'quartz', 'quasi',
<add> 'quasiquote', 'quasiquotes', 'query', 'query-dsl', 'question', 'questionmark',
<add> 'quicktime-file', 'quotation', 'quote', 'quoted', 'quoted-expression',
<add> 'quoted-identifier', 'quoted-object', 'quotes', 'qx', 'r', 'rabl', 'racket',
<add> 'radix', 'rails', 'rainmeter', 'raml', 'randomsk', 'range', 'rant', 'rapid',
<add> 'rarity', 'ratio', 'raw', 'raw-regex', 'rd', 'rdfs-type', 'rdrand', 'rdseed',
<add> 'read', 'readline', 'readwrite', 'real', 'realip', 'rebeca', 'rebol', 'rec',
<add> 'receive-channel', 'recipient-subscriber-list', 'recode', 'record',
<add> 'record-field', 'record-usage', 'recordfield', 'recursive', 'recutils', 'red',
<add> 'redirect', 'redirection', 'ref', 'reference', 'referer', 'refinement',
<add> 'reflection', 'reg', 'regex', 'regexname', 'regexp', 'regexp-option',
<add> 'region', 'register', 'register-64', 'registers', 'reiny', 'reject',
<add> 'relation', 'relational', 'relations', 'relationship-pattern',
<add> 'relationship-pattern-end', 'relationship-pattern-start',
<add> 'relationship-type-or', 'relationship-type-start', 'rem', 'reminder',
<add> 'remoting', 'rename', 'renaming', 'render', 'reparator', 'repeat', 'replace',
<add> 'replaceXXX', 'replacement', 'reply', 'repo', 'reporter', 'repository',
<add> 'request', 'request-type', 'require', 'required', 'requirements', 'rescue',
<add> 'reserved', 'reset', 'resource', 'resource-bundle-list', 'response',
<add> 'response-type', 'rest', 'rester', 'restriced', 'restructuredtext', 'result',
<add> 'result-separator', 'results', 'return', 'return-type', 'return-value',
<add> 'returns', 'rev', 'reversed', 'review', 'rewrite', 'rf', 'rfc',
<add> 'rgb-percentage', 'rgb-value', 'rhap', 'rhs', 'rhtml', 'right', 'riot',
<add> 'rivescript', 'rl', 'rmarkdown', 'rnc', 'roboconf', 'robot', 'robotc',
<add> 'robust-control', 'role', 'root', 'round', 'round-brackets', 'routeros',
<add> 'routine', 'row', 'row2', 'rowspan', 'roxygen', 'rparent', 'rpc', 'rpm-spec',
<add> 'rpmspec', 'rpt', 'rq', 'rrd', 'rsl', 'rsl-url', 'rspec', 'rtemplate', 'ru',
<add> 'ruby', 'rubymotion', 'rule', 'ruleDefinition', 'rules', 'run', 'rune',
<add> 'runtime', 'runtime-shared-library-path', 'rust', 'safe-call',
<add> 'safe-navigation', 'safe-trap', 'safer', 'safety', 'sage', 'sampler',
<add> 'sampler-comparison', 'samplerarg', 'sampling', 'sas', 'sass',
<add> 'sass-script-maps', 'satcom', 'save', 'scad', 'scala', 'scaladoc', 'scalar',
<add> 'scam', 'scenario', 'scenario_outline', 'scene', 'schem', 'scheme',
<add> 'schememode', 'scilab', 'sck', 'scope', 'scope-name', 'scope-resolution',
<add> 'scribble', 'script', 'script-metadata', 'script-tag', 'scriptblock',
<add> 'scripting', 'scriptlet', 'scriptlocal', 'scriptname-declaration',
<add> 'scrollbars', 'scss', 'sdbl', 'sdl', 'sdo', 'search', 'seawolf', 'second',
<add> 'section', 'section-item', 'sectionname', 'sections', 'see', 'select',
<add> 'select-block', 'selectionset', 'selector', 'self', 'self-binding', 'sem',
<add> 'semantic', 'semi-colon', 'semicolon', 'semicoron', 'semireserved',
<add> 'send-channel', 'senum', 'separator', 'sepatator', 'seperator', 'sequence',
<add> 'sequences', 'serpent', 'server', 'service', 'service-rpc', 'services',
<add> 'session', 'set', 'set_node', 'setname', 'setproperty', 'setter', 'setting',
<add> 'settings', 'settype', 'setword', 'severity', 'sexpr', 'sfst', 'sgml', 'sha',
<add> 'sha256', 'sha512', 'sha_functions', 'shade', 'shaderlab', 'shared',
<add> 'shared-static', 'sharpequal', 'sharpge', 'sharpgt', 'sharple', 'sharplt',
<add> 'shebang', 'shell', 'shell-session', 'shift', 'shift-and-rotate',
<add> 'shift-right', 'shipflow', 'shmop', 'short', 'shortcut', 'shortcuts',
<add> 'shorthandpropertyname', 'show', 'show-actionscript-warnings',
<add> 'show-argument', 'show-binding-warnings',
<add> 'show-shadowed-device-font-warnings', 'show-unused-type-selector-warnings',
<add> 'shutdown', 'sigil', 'sign-line', 'signal', 'signal-processing', 'signature',
<add> 'simd', 'simd-integer', 'simple', 'simple-element', 'simple_delimiter',
<add> 'simplexml', 'simplez', 'since', 'singe', 'single', 'single-line',
<add> 'single-quote', 'single-quoted', 'single_quote', 'singleton', 'six', 'size',
<add> 'sized_integer', 'sizeof', 'sjs', 'sjson', 'skaction', 'skdragon', 'skeeland',
<add> 'sketchplugin', 'skew', 'skip', 'skmorkaz', 'skquery', 'skrambled',
<add> 'skrayfall', 'skript', 'skrpg', 'sksharp', 'skstuff', 'skutilities',
<add> 'skvoice', 'sl', 'slash', 'slash-option', 'slashes', 'slashstar', 'sleet',
<add> 'slice', 'slim', 'slm', 'sln', 'slot', 'slot_subnode', 'slugignore', 'sma',
<add> 'smali', 'smalltalk', 'smarty', 'sml', 'smpte', 'smx', 'snlog', 'snmp',
<add> 'soap', 'socketgroup', 'sockets', 'somearg', 'something', 'soql', 'sort',
<add> 'souce', 'source', 'source-constant', 'source-path', 'soy', 'sp', 'space',
<add> 'space-after-command', 'spacebars', 'spaces', 'sparql', 'spath', 'spec',
<add> 'special', 'special-attributes', 'special-functions', 'special-method',
<add> 'special-tokens', 'specification', 'sphinx', 'spice', 'spider', 'splat',
<add> 'spline', 'splunk', 'splus', 'spn', 'spread', 'spreadmap', 'sproto',
<add> 'sproutcore', 'sqf', 'sql', 'sqlite', 'sqlsrv', 'sqsp', 'square', 'squart',
<add> 'squirrel', 'sr-Latn', 'src', 'srltext', 'ss', 'sse', 'sse2', 'sse2_simd',
<add> 'sse3', 'sse4_simd', 'sse_simd', 'ssh-config', 'ssi', 'ssl', 'st', 'stable',
<add> 'stack', 'stack-effect', 'stackframe', 'stan', 'standard', 'standard-links',
<add> 'standard-suite', 'standardadditions', 'standoc', 'star', 'start',
<add> 'start-block', 'start-condition', 'start-symbol', 'starting-functions-point',
<add> 'startshape', 'statamic', 'state', 'state-management', 'stateend',
<add> 'stategrouparg', 'stategroupval', 'statement', 'statement-separator',
<add> 'states', 'statestart', 'static', 'static-assert', 'static-if', 'static-rsls',
<add> 'staticimages', 'statistics', 'stats', 'std', 'std_logic', 'stdint',
<add> 'stdlibcall', 'step', 'steps', 'stg', 'stk', 'stmt', 'stop', 'stopping',
<add> 'storage', 'stp', 'stray-comment-end', 'stream', 'streamsfuncs', 'streem',
<add> 'strict', 'strike', 'strikethrough', 'string', 'string-constant',
<add> 'string-format', 'string-interpolation', 'string-long-single-quote',
<add> 'strings', 'strong', 'struct', 'struct-union-block', 'structdef', 'structs',
<add> 'structure', 'stuff', 'style', 'styleblock', 'styles', 'stylus', 'sub',
<add> 'sub-pattern', 'subckt', 'subcmd', 'subexp', 'subexpression', 'subkey',
<add> 'subkeys', 'subl', 'submodule', 'subroutine', 'subscript', 'subsection',
<add> 'subsections', 'subshell', 'subsort', 'substitute', 'substitution',
<add> 'subtitle', 'subtlegradient', 'subtraction', 'suffix', 'sugly',
<add> 'sugly-control-keywords', 'sugly-delcare-operator', 'sugly-delcare-variable',
<add> 'sugly-encode-clause', 'sugly-function-groups', 'sugly-function-recursion',
<add> 'sugly-general-operators', 'sugly-generic-types', 'sugly-int-constants',
<add> 'sugly-invoke-function', 'sugly-json-clause', 'sugly-language-constants',
<add> 'sugly-math-clause', 'sugly-math-constants',
<add> 'sugly-multiple-parameter-function', 'sugly-number-constants',
<add> 'sugly-print-clause', 'sugly-subject-or-predicate', 'sugly-type-function',
<add> 'sugly-uri-clause', 'super', 'superclass', 'supercollider', 'superscript',
<add> 'supertype', 'supervisor', 'supplemental', 'supplimental', 'support',
<add> 'supports', 'suppressed', 'svg', 'svm', 'svn', 'swift', 'swig', 'switch',
<add> 'switch-block', 'switch-expression', 'switch-statement', 'switchStart',
<add> 'swizzle', 'sybase', 'symbol', 'symbol-type', 'symbolic', 'symbolic-math',
<add> 'symbols', 'symmetry', 'synchronization', 'synchronize', 'synchronized',
<add> 'synergy', 'syntax', 'sys-types', 'syslog-ng', 'system', 'system-events',
<add> 'system-identification', 'systemreference', 'sytem-events', 't4', 't5', 't7',
<add> 'ta', 'tab', 'table', 'table-name', 'tablename', 'tabs', 'tabular', 'tacacs',
<add> 'taco', 'tads3', 'tag', 'tag-not-recognized', 'tag-string', 'tag-value',
<add> 'tagbraces', 'tagdef', 'tagged', 'tagger_script', 'taglib', 'tagnamedjango',
<add> 'tags', 'taint', 'target', 'task', 'tasks', 'tbdfile', 'tbody', 'tcl',
<add> 'tcoffee', 'td', 'tdl', 'tea', 'telegram', 'tell', 'temp', 'template',
<add> 'templatetag', 'temporal', 'term', 'terminal', 'termination', 'terminator',
<add> 'terms_node', 'ternary', 'ternary-if', 'terra', 'terraform', 'testcase',
<add> 'testing', 'tests', 'testsuite', 'tex', 'texshop', 'text', 'text-reference',
<add> 'text-suite', 'textbf', 'textile', 'textio', 'textit', 'texttt', 'th',
<add> 'thead', 'theme', 'then', 'therefore', 'thin', 'third', 'this', 'thrift',
<add> 'throw', 'throwables', 'throws', 'tick', 'ticket-num', 'ticket-psa',
<add> 'tid-file', 'tidal', 'tidalcycles', 'tiddler', 'tiddler-field', 'tidy',
<add> 'tieslur', 'time', 'times', 'timespan', 'timestamp', 'timing', 'titanium',
<add> 'title', 'title-text', 'tjs', 'tl', 'tla', 'tmpl', 'tmsim', 'tmux', 'to',
<add> 'to-file', 'toc', 'toc-list', 'todo', 'todo_extra', 'todo_node', 'todotxt',
<add> 'token', 'token-def', 'token-paste', 'token-type', 'tokenizer', 'toml',
<add> 'toolbox', 'tools', 'tooltip', 'top', 'top-level', 'topic', 'tornado',
<add> 'torque', 'torquescript', 'tosca', 'total-config', 'totaljs', 'tpye', 'tr',
<add> 'trace', 'trace-argument', 'traceback', 'trader', 'trail', 'trailing',
<add> 'trailing-match', 'trailing-whitespace', 'trait', 'traits', 'transaction',
<add> 'transcendental', 'transcludeblock', 'transcludeinline', 'transclusion',
<add> 'transitionable-property-value', 'transpose', 'transposed-matrix',
<add> 'transposed-parens', 'transposed-variable', 'trap', 'treetop', 'trenni',
<add> 'trigEvent_', 'trigLevel_', 'trigger', 'triple', 'triple-slash', 'true',
<add> 'truncate', 'truncation', 'try', 'trycatch', 'ts', 'tsql', 'tss', 'tsv',
<add> 'tsx', 'tt', 'ttpmacro', 'tts', 'tubaina2', 'tup', 'tuple', 'turtle', 'tutch',
<add> 'tvml', 'tw5', 'twig', 'twigil', 'twiki', 'two', 'txt', 'txt2tags', 'type',
<add> 'type-cast', 'type-constrained', 'type-constraint', 'type-declaration',
<add> 'type-def', 'type-definition', 'type-definition-group', 'type-of', 'type-or',
<add> 'type-parameters', 'type-signature', 'type_params', 'type_trait',
<add> 'typeabbrev', 'typeclass', 'typedblock', 'typedcoffeescript', 'typedef',
<add> 'typehint', 'typehinted', 'typeid', 'typename', 'types', 'typesbii',
<add> 'typescriptish', 'typoscript', 'uc', 'ucicfg', 'ucicmd', 'udaf', 'udf', 'udl',
<add> 'udtf', 'ui', 'ui-block', 'uintptr', 'ujm', 'uk', 'ul', 'unOp', 'unary',
<add> 'unbuffered', 'uncleared', 'unclosed', 'unclosed-string', 'undef',
<add> 'undefined', 'underline', 'underscore', 'undocumented', 'unescaped-quote',
<add> 'unexpected', 'unexpected-extends', 'unexpected-extends-character',
<add> 'unexpected-text', 'unformatted', 'unicode', 'unicode-16-bit',
<add> 'unicode-escape', 'unicode-raw', 'unicode-raw-regex', 'unify', 'union',
<add> 'unit', 'unit-test', 'unit_test', 'unittest', 'unity', 'universal-match',
<add> 'unknown', 'unknown-escape', 'unknown-rune', 'unlabeled', 'unnumbered', 'uno',
<add> 'unoconfig', 'unop', 'unoproj', 'unordered', 'unordered-block', 'unosln',
<add> 'unpack', 'unpacking', 'unquoted', 'unrecognized', 'unrecognized-character',
<add> 'unrecognized-character-escape', 'unrecognized-string-escape', 'unsafe',
<add> 'unsupplied', 'until', 'untitled', 'untyped', 'uopz', 'update', 'upstream',
<add> 'uri', 'url', 'usable', 'usage', 'use', 'use-as', 'usebean', 'usecase',
<add> 'user', 'user-defined', 'user-defined-property', 'user-defined-type',
<add> 'user-interaction', 'userid', 'username', 'using',
<add> 'using-namespace-declaration', 'using_animtree', 'utility', 'uvu', 'ux',
<add> 'uxc', 'uz', 'val', 'vala', 'valgrind', 'valid', 'valid-ampersand', 'valign',
<add> 'value', 'value-pair', 'value-size', 'value-type', 'valuepair', 'vamos',
<add> 'var', 'var-single-variable', 'var1', 'var2', 'variable', 'variable-access',
<add> 'variable-declaration', 'variable-modifier', 'variable-parameter',
<add> 'variable-reference', 'variable-usage', 'variables', 'variant-definition',
<add> 'varname', 'varnish', 'vb', 'vbnet', 'vbs', 'vc', 'vcl', 'vector',
<add> 'vector-load', 'vectors', 'velocity', 'vendor-prefix', 'verbatim',
<add> 'verbose-stacktraces', 'verdict', 'verilog', 'version', 'vertical-tab', 'vex',
<add> 'vhdl', 'via', 'view', 'viewhelpers', 'vim', 'viml', 'virtual',
<add> 'virtual-reality', 'visibility', 'visualforce', 'vmap', 'voice', 'void',
<add> 'volatile', 'volt', 'vpath', 'vplus', 'vue', 'w3c-extended-color-name',
<add> 'w3c-standard-color-name', 'wait', 'waitress-rb', 'warn',
<add> 'warn-array-tostring-changes', 'warn-assignment-within-conditional',
<add> 'warn-bad-array-cast', 'warn-bad-bool-assignment', 'warn-bad-date-cast',
<add> 'warn-bad-es3-type-method', 'warn-bad-es3-type-prop',
<add> 'warn-bad-nan-comparison', 'warn-bad-null-assignment',
<add> 'warn-bad-null-comparison', 'warn-bad-undefined-comparison',
<add> 'warn-boolean-constructor-with-no-args', 'warn-changes-in-resolve',
<add> 'warn-class-is-sealed', 'warn-const-not-initialized',
<add> 'warn-constructor-returns-value', 'warn-deprecated-event-handler-error',
<add> 'warn-deprecated-function-error', 'warn-deprecated-property-error',
<add> 'warn-duplicate-argument-names', 'warn-duplicate-variable-def',
<add> 'warn-for-var-in-changes', 'warn-import-hides-class',
<add> 'warn-instance-of-changes', 'warn-internal-error', 'warn-level-not-supported',
<add> 'warn-missing-namespace-decl', 'warn-negative-uint-literal',
<add> 'warn-no-constructor', 'warn-no-explicit-super-call-in-constructor',
<add> 'warn-no-type-decl', 'warn-number-from-string-changes',
<add> 'warn-scoping-change-in-this', 'warn-slow-text-field-addition',
<add> 'warn-unlikely-function-value', 'warn-xml-class-has-changed', 'warning',
<add> 'warnings', 'wast', 'wavelet', 'wddx', 'weave', 'webidl', 'webspeed',
<add> 'weekday', 'weirdland', 'wh', 'whatever', 'when', 'where', 'while',
<add> 'while-condition', 'while-loop', 'whiskey', 'white', 'whitespace', 'widget',
<add> 'width', 'wiki', 'wiki-link', 'wildcard', 'wildsk', 'win', 'window-classes',
<add> 'windows', 'with', 'with-arg', 'with-args', 'with-arguments', 'with-params',
<add> 'with-side-effects', 'without-arguments', 'without-attributes', 'wla-dx',
<add> 'word', 'word-op', 'words', 'world', 'wow', 'wp', 'write',
<add> 'wrong-access-type', 'wrong-division-assignment', 'ws', 'x10', 'x86',
<add> 'x86_64', 'x86asm', 'xbase', 'xchg', 'xflags-mark', 'xhprof', 'xhtml',
<add> 'xikij', 'xml', 'xmlrpc', 'xmlwriter', 'xop', 'xor', 'xq', 'xquery', 'xref',
<add> 'xsave', 'xsd_nillable', 'xsd_optional', 'xsl', 'xsse3_simd', 'xst', 'xtend',
<add> 'xtoy', 'xtpl', 'xu', 'xvc', 'xve', 'yaml', 'yaml-ext', 'yang', 'yara',
<add> 'yard', 'yate', 'year', 'yellow', 'yield', 'yorick', 'you-forgot-semicolon',
<add> 'z80', 'zap', 'zapper', 'zep', 'zepon', 'zepto', 'zero', 'zh-CN', 'zig',
<add> 'zip', 'zlib', 'zoomfilter'
<add>] | 1 |
Mixed | Go | add isolation to ps filter | 9c5814171ce7ab3af48867da36f4d374f804c4a6 | <ide><path>daemon/list.go
<ide> func includeContainerInList(container *Container, ctx *listContext) iterationAct
<ide> return excludeContainer
<ide> }
<ide>
<add> // Do not include container if the isolation mode doesn't match
<add> if excludeContainer == excludeByIsolation(container, ctx) {
<add> return excludeContainer
<add> }
<add>
<ide> // Do not include container if it's in the list before the filter container.
<ide> // Set the filter container to nil to include the rest of containers after this one.
<ide> if ctx.beforeContainer != nil {
<ide><path>daemon/list_unix.go
<add>// +build linux freebsd
<add>
<add>package daemon
<add>
<add>// excludeByIsolation is a platform specific helper function to support PS
<add>// filtering by Isolation. This is a Windows-only concept, so is a no-op on Unix.
<add>func excludeByIsolation(container *Container, ctx *listContext) iterationAction {
<add> return includeContainer
<add>}
<ide><path>daemon/list_windows.go
<add>package daemon
<add>
<add>import "strings"
<add>
<add>// excludeByIsolation is a platform specific helper function to support PS
<add>// filtering by Isolation. This is a Windows-only concept, so is a no-op on Unix.
<add>func excludeByIsolation(container *Container, ctx *listContext) iterationAction {
<add> i := strings.ToLower(string(container.hostConfig.Isolation))
<add> if i == "" {
<add> i = "default"
<add> }
<add> if !ctx.filters.Match("isolation", i) {
<add> return excludeContainer
<add> }
<add> return includeContainer
<add>}
<ide><path>docs/reference/api/docker_remote_api.md
<ide> This section lists each version from latest to oldest. Each listing includes a
<ide>
<ide> [Docker Remote API v1.22](docker_remote_api_v1.22.md) documentation
<ide>
<add>* `GET /containers/json` supports filter `isolation` on Windows.
<ide>
<ide> ### v1.21 API changes
<ide>
<ide><path>docs/reference/api/docker_remote_api_v1.22.md
<ide> Query Parameters:
<ide> - `exited=<int>`; -- containers with exit code of `<int>` ;
<ide> - `status=`(`created`|`restarting`|`running`|`paused`|`exited`)
<ide> - `label=key` or `label="key=value"` of a container label
<add> - `isolation=`(`default`|`hyperv`) (Windows daemon only)
<ide>
<ide> Status Codes:
<ide>
<ide><path>docs/reference/commandline/ps.md
<ide> The currently supported filters are:
<ide> * exited (int - the code of exited containers. Only useful with `--all`)
<ide> * status (created|restarting|running|paused|exited)
<ide> * ancestor (`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) - filters containers that were created from the given image or a descendant.
<add>* isolation (default|hyperv) (Windows daemon only)
<ide>
<ide>
<ide> #### Label | 6 |
Ruby | Ruby | fix a typo | 7cfa80f81222c72753d2a8a47da425a2179e0b59 | <ide><path>activestorage/app/models/active_storage/variant.rb
<ide> def key
<ide> # Returns the URL of the variant on the service. This URL is intended to be short-lived for security and not used directly
<ide> # with users. Instead, the `service_url` should only be exposed as a redirect from a stable, possibly authenticated URL.
<ide> # Hiding the `service_url` behind a redirect also gives you the power to change services without updating all URLs. And
<del> # it allows permanent URLs that redirec to the `service_url` to be cached in the view.
<add> # it allows permanent URLs that redirect to the `service_url` to be cached in the view.
<ide> #
<ide> # Use `url_for(variant)` (or the implied form, like `link_to variant` or `redirect_to variant`) to get the stable URL
<ide> # for a variant that points to the `ActiveStorage::VariantsController`, which in turn will use this `#service_call` method | 1 |
Python | Python | fix weight regularizers | c429e651c1d4fe83c84bc6a4405d5645faac6a2e | <ide><path>keras/regularizers.py
<ide> def __call__(self, loss):
<ide> 'ActivityRegularizer '
<ide> '(i.e. activity_regularizer="l2" instead '
<ide> 'of activity_regularizer="activity_l2".')
<del> loss += K.sum(K.abs(self.p)) * self.l1
<del> loss += K.sum(K.square(self.p)) * self.l2
<del> return loss
<add> regularized_loss = loss + K.sum(K.abs(self.p)) * self.l1
<add> regularized_loss += K.sum(K.square(self.p)) * self.l2
<add> return K.in_train_phase(regularized_loss, loss)
<ide>
<ide> def get_config(self):
<ide> return {'name': self.__class__.__name__, | 1 |
Python | Python | fix deebert tests | 92f8ce2ed65f23f91795ce6eafb8cce1e226cd38 | <ide><path>examples/deebert/test_glue_deebert.py
<ide> def get_setup_file():
<ide>
<ide>
<ide> class DeeBertTests(unittest.TestCase):
<del> @slow
<del> def test_glue_deebert(self):
<add> def setup(self) -> None:
<ide> stream_handler = logging.StreamHandler(sys.stdout)
<ide> logger.addHandler(stream_handler)
<ide>
<add> @slow
<add> def test_glue_deebert_train(self):
<add>
<ide> train_args = """
<ide> run_glue_deebert.py
<ide> --model_type roberta
<ide> def test_glue_deebert(self):
<ide> --overwrite_cache
<ide> --eval_after_first_stage
<ide> """.split()
<add> with patch.object(sys, "argv", train_args):
<add> result = run_glue_deebert.main()
<add> for value in result.values():
<add> self.assertGreaterEqual(value, 0.666)
<ide>
<ide> eval_args = """
<ide> run_glue_deebert.py
<ide> def test_glue_deebert(self):
<ide> --overwrite_cache
<ide> --per_gpu_eval_batch_size=1
<ide> """.split()
<add> with patch.object(sys, "argv", eval_args):
<add> result = run_glue_deebert.main()
<add> for value in result.values():
<add> self.assertGreaterEqual(value, 0.666)
<ide>
<ide> entropy_eval_args = """
<ide> run_glue_deebert.py
<ide> def test_glue_deebert(self):
<ide> --overwrite_cache
<ide> --per_gpu_eval_batch_size=1
<ide> """.split()
<del>
<del> with patch.object(sys, "argv", train_args):
<del> result = run_glue_deebert.main()
<del> for value in result.values():
<del> self.assertGreaterEqual(value, 0.75)
<del>
<del> with patch.object(sys, "argv", eval_args):
<del> result = run_glue_deebert.main()
<del> for value in result.values():
<del> self.assertGreaterEqual(value, 0.75)
<del>
<ide> with patch.object(sys, "argv", entropy_eval_args):
<ide> result = run_glue_deebert.main()
<ide> for value in result.values():
<del> self.assertGreaterEqual(value, 0.75)
<add> self.assertGreaterEqual(value, 0.666) | 1 |
Javascript | Javascript | react challenges showing unwanted brackets | 183740d73976afa82ef44f1fd2f6d8f6d308c7b9 | <ide><path>common/app/routes/Challenges/utils/index.js
<ide> export function createTests({ tests = [] }) {
<ide> .map(test => {
<ide> if (typeof test === 'string') {
<ide> return {
<del> text: ('' + test).split('message: ').pop().replace(/\'\);/g, ''),
<add> text: ('' + test).split('message: ')
<add> .pop().replace(/(\'\);(\s*\};)?)/g, ''),
<ide> testString: test
<ide> };
<ide> } | 1 |
PHP | PHP | add test for merged wheres in withcount | 356e19914614896e0f7ec940468e24848135d552 | <ide><path>tests/Database/DatabaseEloquentBuilderTest.php
<ide> public function testWithCountAndSelect()
<ide> $this->assertEquals('select "id", (select count(*) from "eloquent_builder_test_model_close_related_stubs" where "eloquent_builder_test_model_parent_stubs"."foo_id" = "eloquent_builder_test_model_close_related_stubs"."id") as "foo_count" from "eloquent_builder_test_model_parent_stubs"', $builder->toSql());
<ide> }
<ide>
<add> public function testWithCountAndMergedWheres()
<add> {
<add> $model = new EloquentBuilderTestModelParentStub;
<add>
<add> $builder = $model->select('id')->withCount(['activeFoo' => function($q){
<add> $q->where('bam', '>', 'qux');
<add> }]);
<add>
<add> $this->assertEquals('select "id", (select count(*) from "eloquent_builder_test_model_close_related_stubs" where "eloquent_builder_test_model_parent_stubs"."foo_id" = "eloquent_builder_test_model_close_related_stubs"."id" and "active" = ? and "bam" > ?) as "active_foo_count" from "eloquent_builder_test_model_parent_stubs"', $builder->toSql());
<add> $this->assertEquals([true, 'qux'], $builder->getBindings());
<add> }
<add>
<ide> public function testWithCountAndContraintsAndHaving()
<ide> {
<ide> $model = new EloquentBuilderTestModelParentStub;
<ide> public function foo()
<ide> {
<ide> return $this->belongsTo('EloquentBuilderTestModelCloseRelatedStub');
<ide> }
<add>
<add> public function activeFoo()
<add> {
<add> return $this->belongsTo('EloquentBuilderTestModelCloseRelatedStub', 'foo_id')->where('active', true);
<add> }
<ide> }
<ide>
<ide> class EloquentBuilderTestModelCloseRelatedStub extends Illuminate\Database\Eloquent\Model | 1 |
Python | Python | add timeout to requests requets.. | cc1dd36e94d6def087c24ddff4261b5c8f417c5d | <ide><path>glances/plugins/glances_cloud.py
<ide> def run(self):
<ide> for k, v in iteritems(self.AWS_EC2_API_METADATA):
<ide> r_url = '{}/{}'.format(self.AWS_EC2_API_URL, v)
<ide> try:
<del> r = requests.get(r_url)
<add> # Local request, a timeout of 3 seconds is OK
<add> r = requests.get(r_url, timeout=3)
<add> except requests.exceptions.ConnectTimeout:
<add> logger.debug('cloud plugin - Connection to {} timed out'.format(r_url))
<add> break
<ide> except Exception as e:
<del> logger.debug('Can not connect to the AWS EC2 API {}'.format(r_url, e))
<add> logger.debug('cloud plugin - Can not connect to the AWS EC2 API {}'.format(r_url, e))
<ide> break
<ide> else:
<ide> if r.ok:
<ide><path>glances/plugins/glances_docker.py
<ide> def get_export(self):
<ide> try:
<ide> ret = self.stats['containers']
<ide> except KeyError as e:
<del> logger.debug("Docker export error {}".format(e))
<add> logger.debug("docker plugin - Docker export error {}".format(e))
<ide> return ret
<ide>
<ide> def __connect_old(self, version):
<ide> def __connect_old(self, version):
<ide> init_docker = docker.Client
<ide> else:
<ide> # Can not found init method (new API version ?)
<del> logger.error("Can not found any way to init the Docker API")
<add> logger.error("docker plugin - Can not found any way to init the Docker API")
<ide> return None
<ide> # Init connection to the Docker API
<ide> try:
<ide> def connect(self, version=None):
<ide> # Check the server connection with the version() method
<ide> try:
<ide> ret.version()
<add> except requests.exceptions.ConnectTimeout:
<add> logger.debug('docker plugin - Connection to {} timed out'.format(r_url))
<add> break
<ide> except requests.exceptions.ConnectionError as e:
<ide> # Connexion error (Docker not detected)
<ide> # Let this message in debug mode
<del> logger.debug("Can't connect to the Docker server (%s)" % e)
<add> logger.debug("docker plugin - Can't connect to the Docker server (%s)" % e)
<ide> return None
<ide> except docker.errors.APIError as e:
<ide> if version is None:
<ide> # API error (Version mismatch ?)
<del> logger.debug("Docker API error (%s)" % e)
<add> logger.debug("docker plugin - Docker API error (%s)" % e)
<ide> # Try the connection with the server version
<ide> version = re.search('(?:server API version|server)\:\ (.*)\)\".*\)', str(e))
<ide> if version:
<del> logger.debug("Try connection with Docker API version %s" % version.group(1))
<add> logger.debug("docker plugin - Try connection with Docker API version %s" % version.group(1))
<ide> ret = self.connect(version=version.group(1))
<ide> else:
<del> logger.debug("Can not retreive Docker server version")
<add> logger.debug("docker plugin - Can not retreive Docker server version")
<ide> ret = None
<ide> else:
<ide> # API error
<del> logger.error("Docker API error (%s)" % e)
<add> logger.error("docker plugin - Docker API error (%s)" % e)
<ide> ret = None
<ide> except Exception as e:
<ide> # Others exceptions...
<ide> # Connexion error (Docker not detected)
<del> logger.error("Can't connect to the Docker server (%s)" % e)
<add> logger.error("docker plugin - Can't connect to the Docker server (%s)" % e)
<ide> ret = None
<ide>
<ide> # Log an info if Docker plugin is disabled
<ide> if ret is None:
<del> logger.debug("Docker plugin is disable because an error has been detected")
<add> logger.debug("docker plugin - Docker plugin is disable because an error has been detected")
<ide>
<ide> return ret
<ide>
<ide> def get_docker_cpu(self, container_id, all_stats):
<ide> cpu_new['nb_core'] = len(all_stats['cpu_stats']['cpu_usage']['percpu_usage'] or [])
<ide> except KeyError as e:
<ide> # all_stats do not have CPU information
<del> logger.debug("Cannot grab CPU usage for container {} ({})".format(container_id, e))
<add> logger.debug("docker plugin - Cannot grab CPU usage for container {} ({})".format(container_id, e))
<ide> logger.debug(all_stats)
<ide> else:
<ide> # Previous CPU stats stored in the cpu_old variable
<ide> def get_docker_memory(self, container_id, all_stats):
<ide> ret['max_usage'] = all_stats['memory_stats']['max_usage']
<ide> except (KeyError, TypeError) as e:
<ide> # all_stats do not have MEM information
<del> logger.debug("Cannot grab MEM usage for container {} ({})".format(container_id, e))
<add> logger.debug("docker plugin - Cannot grab MEM usage for container {} ({})".format(container_id, e))
<ide> logger.debug(all_stats)
<ide> # Return the stats
<ide> return ret
<ide> def get_docker_network(self, container_id, all_stats):
<ide> netcounters = all_stats["networks"]
<ide> except KeyError as e:
<ide> # all_stats do not have NETWORK information
<del> logger.debug("Cannot grab NET usage for container {} ({})".format(container_id, e))
<add> logger.debug("docker plugin - Cannot grab NET usage for container {} ({})".format(container_id, e))
<ide> logger.debug(all_stats)
<ide> # No fallback available...
<ide> return network_new
<ide> def get_docker_network(self, container_id, all_stats):
<ide> network_new['cumulative_tx'] = netcounters["eth0"]["tx_bytes"]
<ide> except KeyError as e:
<ide> # all_stats do not have INTERFACE information
<del> logger.debug("Cannot grab network interface usage for container {} ({})".format(container_id, e))
<add> logger.debug("docker plugin - Cannot grab network interface usage for container {} ({})".format(container_id, e))
<ide> logger.debug(all_stats)
<ide>
<ide> # Save stats to compute next bitrate
<ide> def get_docker_io(self, container_id, all_stats):
<ide> iocounters = all_stats["blkio_stats"]
<ide> except KeyError as e:
<ide> # all_stats do not have io information
<del> logger.debug("Cannot grab block IO usage for container {} ({})".format(container_id, e))
<add> logger.debug("docker plugin - Cannot grab block IO usage for container {} ({})".format(container_id, e))
<ide> logger.debug(all_stats)
<ide> # No fallback available...
<ide> return io_new
<ide> def get_docker_io(self, container_id, all_stats):
<ide> iow_old = [i for i in self.iocounters_old[container_id]['io_service_bytes_recursive'] if i['op'] == 'Write'][0]['value']
<ide> except (IndexError, KeyError) as e:
<ide> # all_stats do not have io information
<del> logger.debug("Cannot grab block IO usage for container {} ({})".format(container_id, e))
<add> logger.debug("docker plugin - Cannot grab block IO usage for container {} ({})".format(container_id, e))
<ide> else:
<ide> io_new['time_since_update'] = getTimeSinceLastUpdate('docker_io_{}'.format(container_id))
<ide> io_new['ior'] = ior - ior_old | 2 |
Ruby | Ruby | move all the helpers to protected section | 5979ad31fd2249303fd9e436e63568d6f0e22b8a | <ide><path>actionpack/test/template/form_helper_test.rb
<ide> def test_form_for_with_labelled_builder
<ide> assert_dom_equal expected, output_buffer
<ide> end
<ide>
<del> def hidden_fields(method = nil)
<del> txt = %{<div style="margin:0;padding:0;display:inline">}
<del> txt << %{<input name="utf8" type="hidden" value="✓" />}
<del> if method && !method.to_s.in?(['get', 'post'])
<del> txt << %{<input name="_method" type="hidden" value="#{method}" />}
<del> end
<del> txt << %{</div>}
<del> end
<del>
<del> def form_text(action = "/", id = nil, html_class = nil, remote = nil, multipart = nil, method = nil)
<del> txt = %{<form accept-charset="UTF-8" action="#{action}"}
<del> txt << %{ enctype="multipart/form-data"} if multipart
<del> txt << %{ data-remote="true"} if remote
<del> txt << %{ class="#{html_class}"} if html_class
<del> txt << %{ id="#{id}"} if id
<del> method = method.to_s == "get" ? "get" : "post"
<del> txt << %{ method="#{method}">}
<del> end
<del>
<del> def whole_form(action = "/", id = nil, html_class = nil, options = nil)
<del> contents = block_given? ? yield : ""
<del>
<del> if options.is_a?(Hash)
<del> method, remote, multipart = options.values_at(:method, :remote, :multipart)
<del> else
<del> method = options
<del> end
<del>
<del> form_text(action, id, html_class, remote, multipart, method) + hidden_fields(method) + contents + "</form>"
<del> end
<del>
<ide> def test_default_form_builder
<ide> old_default_form_builder, ActionView::Base.default_form_builder =
<ide> ActionView::Base.default_form_builder, LabelledFormBuilder
<ide> def test_fields_for_returns_block_result
<ide>
<ide> protected
<ide>
<add> def hidden_fields(method = nil)
<add> txt = %{<div style="margin:0;padding:0;display:inline">}
<add> txt << %{<input name="utf8" type="hidden" value="✓" />}
<add> if method && !method.to_s.in?(['get', 'post'])
<add> txt << %{<input name="_method" type="hidden" value="#{method}" />}
<add> end
<add> txt << %{</div>}
<add> end
<add>
<add> def form_text(action = "/", id = nil, html_class = nil, remote = nil, multipart = nil, method = nil)
<add> txt = %{<form accept-charset="UTF-8" action="#{action}"}
<add> txt << %{ enctype="multipart/form-data"} if multipart
<add> txt << %{ data-remote="true"} if remote
<add> txt << %{ class="#{html_class}"} if html_class
<add> txt << %{ id="#{id}"} if id
<add> method = method.to_s == "get" ? "get" : "post"
<add> txt << %{ method="#{method}">}
<add> end
<add>
<add> def whole_form(action = "/", id = nil, html_class = nil, options = nil)
<add> contents = block_given? ? yield : ""
<add>
<add> if options.is_a?(Hash)
<add> method, remote, multipart = options.values_at(:method, :remote, :multipart)
<add> else
<add> method = options
<add> end
<add>
<add> form_text(action, id, html_class, remote, multipart, method) + hidden_fields(method) + contents + "</form>"
<add> end
<add>
<ide> def protect_against_forgery?
<ide> false
<ide> end | 1 |
Python | Python | fix use of undefined ‘unicode’ in python 3 | a802f7366e46726a90e07f1329502e38f09544a4 | <ide><path>numpy/ma/core.py
<ide> from numpy import ndarray, amax, amin, iscomplexobj, bool_, _NoValue
<ide> from numpy import array as narray
<ide> from numpy.lib.function_base import angle
<del>from numpy.compat import getargspec, formatargspec, long, basestring
<add>from numpy.compat import getargspec, formatargspec, long, basestring, unicode, bytes, sixu
<ide> from numpy import expand_dims as n_expand_dims
<ide>
<ide> if sys.version_info[0] >= 3:
<ide> class MaskError(MAError):
<ide> 'f': 1.e20,
<ide> 'i': 999999,
<ide> 'O': '?',
<del> 'S': 'N/A',
<add> 'S': b'N/A',
<ide> 'u': 999999,
<ide> 'V': '???',
<del> 'U': 'N/A'
<add> 'U': sixu('N/A')
<ide> }
<ide>
<ide> # Add datetime64 and timedelta64 types
<ide> def default_fill_value(obj):
<ide> defval = default_filler['f']
<ide> elif isinstance(obj, int) or isinstance(obj, long):
<ide> defval = default_filler['i']
<del> elif isinstance(obj, str):
<add> elif isinstance(obj, bytes):
<ide> defval = default_filler['S']
<ide> elif isinstance(obj, unicode):
<ide> defval = default_filler['U']
<ide><path>numpy/ma/tests/test_core.py
<ide> def test_check_on_scalar(self):
<ide> fval = _check_fill_value(0, "|S3")
<ide> assert_equal(fval, asbytes("0"))
<ide> fval = _check_fill_value(None, "|S3")
<del> assert_equal(fval, default_fill_value("|S3"))
<add> assert_equal(fval, default_fill_value(b"camelot!"))
<ide> self.assertRaises(TypeError, _check_fill_value, 1e+20, int)
<ide> self.assertRaises(TypeError, _check_fill_value, 'stuff', int)
<ide>
<ide> def test_append_masked_array_along_axis():
<ide> assert_array_equal(result.mask, expected.mask)
<ide>
<ide>
<add>def test_default_fill_value_complex():
<add> # regression test for Python 3, where 'unicode' was not defined
<add> assert default_fill_value(1 + 1j) == 1.e20 + 0.0j
<add>
<add>###############################################################################
<ide> if __name__ == "__main__":
<ide> run_module_suite() | 2 |
Javascript | Javascript | add default entries to main.js | ef2bbfee5acada10be2e943e421a7e080cedf067 | <ide><path>server/build/webpack.js
<ide> const relativeResolve = rootModuleRelativePath(require)
<ide> export default async function createCompiler (dir, { dev = false, quiet = false, buildDir } = {}) {
<ide> dir = resolve(dir)
<ide> const config = getConfig(dir)
<del> const defaultEntries = dev
<del> ? [join(__dirname, '..', '..', 'client/webpack-hot-middleware-client')] : []
<add> const defaultEntries = dev ? [
<add> join(__dirname, '..', '..', 'client', 'webpack-hot-middleware-client'),
<add> join(__dirname, '..', '..', 'client', 'on-demand-entries-client')
<add> ] : []
<ide> const mainJS = dev
<ide> ? require.resolve('../../client/next-dev') : require.resolve('../../client/next')
<ide>
<ide> let minChunks
<ide>
<ide> const entry = async () => {
<del> const entries = { 'main.js': mainJS }
<add> const entries = {
<add> 'main.js': [
<add> ...defaultEntries,
<add> mainJS
<add> ]
<add> }
<ide>
<ide> const pages = await glob('pages/**/*.js', { cwd: dir })
<ide> const devPages = pages.filter((p) => p === 'pages/_document.js' || p === 'pages/_error.js')
<ide> export default async function createCompiler (dir, { dev = false, quiet = false,
<ide> // managing pages.
<ide> if (dev) {
<ide> for (const p of devPages) {
<del> entries[join('bundles', p)] = [...defaultEntries, `./${p}?entry`]
<add> entries[join('bundles', p)] = `./${p}?entry`
<ide> }
<ide> } else {
<ide> for (const p of pages) {
<del> entries[join('bundles', p)] = [...defaultEntries, `./${p}?entry`]
<add> entries[join('bundles', p)] = `./${p}?entry`
<ide> }
<ide> }
<ide>
<ide><path>server/on-demand-entry-handler.js
<ide> export default function onDemandEntryHandler (devMiddleware, compiler, {
<ide> const pathname = await resolvePath(pagePath)
<ide> const name = join('bundles', pathname.substring(dir.length))
<ide>
<del> const entry = [
<del> join(__dirname, '..', 'client/webpack-hot-middleware-client'),
<del> join(__dirname, '..', 'client', 'on-demand-entries-client'),
<del> `${pathname}?entry`
<del> ]
<add> const entry = `${pathname}?entry`
<ide>
<ide> await new Promise((resolve, reject) => {
<ide> const entryInfo = entries[page] | 2 |
Ruby | Ruby | use ld.so.conf.d where possible | 07f5951b764e646307a412309d39dc8d42e34741 | <ide><path>Library/Homebrew/extend/os/linux/install.rb
<ide> module Install
<ide> def perform_preinstall_checks(all_fatal: false, cc: nil)
<ide> generic_perform_preinstall_checks(all_fatal: all_fatal, cc: cc)
<ide> symlink_ld_so
<del> symlink_gcc_libs
<add> setup_preferred_gcc_libs
<ide> end
<ide>
<ide> def global_post_install
<ide> generic_global_post_install
<ide> symlink_ld_so
<del> symlink_gcc_libs
<add> setup_preferred_gcc_libs
<ide> end
<ide>
<ide> def check_cpu
<ide> def symlink_ld_so
<ide> end
<ide> private_class_method :symlink_ld_so
<ide>
<del> def symlink_gcc_libs
<add> def setup_preferred_gcc_libs
<ide> gcc_opt_prefix = HOMEBREW_PREFIX/"opt/#{OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA}"
<add> glibc_installed = (HOMEBREW_PREFIX/"opt/glibc/lib/ld-linux-x86-64.so.2").readable?
<add>
<add> return unless gcc_opt_prefix.readable?
<add>
<add> if glibc_installed
<add> ld_so_conf_d = HOMEBREW_PREFIX/"etc/ld.so.conf.d"
<add> unless ld_so_conf_d.exist?
<add> ld_so_conf_d.mkpath
<add> FileUtils.chmod "go-w", ld_so_conf_d
<add> end
<add>
<add> # Add gcc to ld search paths
<add> ld_gcc_conf = ld_so_conf_d/"50-homebrew-preferred-gcc.conf"
<add> unless ld_gcc_conf.exist?
<add> ld_gcc_conf.atomic_write <<~EOS
<add> # This file is generated by Homebrew. Do not modify.
<add> #{gcc_opt_prefix}/lib/gcc/#{PREFERRED_GCC_RUNTIME_VERSION}
<add> EOS
<add> FileUtils.chmod "u=rw,go-wx", ld_gcc_conf
<add>
<add> FileUtils.rm_f HOMEBREW_PREFIX/"etc/ld.so.cache"
<add> system HOMEBREW_PREFIX/"opt/glibc/sbin/ldconfig"
<add> end
<add> else
<add> odie "#{HOMEBREW_PREFIX}/lib does not exist!" unless (HOMEBREW_PREFIX/"lib").readable?
<add> end
<ide>
<ide> GCC_RUNTIME_LIBS.each do |library|
<del> gcc_library = gcc_opt_prefix/"lib/gcc/#{PREFERRED_GCC_RUNTIME_VERSION}/#{library}"
<ide> gcc_library_symlink = HOMEBREW_PREFIX/"lib/#{library}"
<del> # Skip if the link target doesn't exist.
<del> next unless gcc_library.readable?
<ide>
<del> # Also skip if the symlink already exists.
<del> next if gcc_library_symlink.readable? && (gcc_library_symlink.readlink == gcc_library)
<add> if glibc_installed
<add> # Remove legacy symlinks
<add> FileUtils.rm gcc_library_symlink if gcc_library_symlink.symlink?
<add> else
<add> gcc_library = gcc_opt_prefix/"lib/gcc/#{PREFERRED_GCC_RUNTIME_VERSION}/#{library}"
<add> # Skip if the link target doesn't exist.
<add> next unless gcc_library.readable?
<ide>
<del> odie "#{HOMEBREW_PREFIX}/lib does not exist!" unless (HOMEBREW_PREFIX/"lib").readable?
<add> # Also skip if the symlink already exists.
<add> next if gcc_library_symlink.readable? && (gcc_library_symlink.readlink == gcc_library)
<ide>
<del> FileUtils.ln_sf gcc_library, gcc_library_symlink
<add> FileUtils.ln_sf gcc_library, gcc_library_symlink
<add> end
<ide> end
<ide> end
<del> private_class_method :symlink_gcc_libs
<add> private_class_method :setup_preferred_gcc_libs
<ide> end
<ide> end | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.