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 |
|---|---|---|---|---|---|
Python | Python | fix documentation for apply_along_axis | 3963ed0ea4e7d89174b1e992d84b47c0751f533f | <ide><path>numpy/lib/shape_base.py
<ide> def apply_along_axis(func1d, axis, arr, *args, **kwargs):
<ide> """
<ide> Apply a function to 1-D slices along the given axis.
<ide>
<del> Execute `func1d(a, *args)` where `func1d` operates on 1-D arrays and `a`
<del> is a 1-D slice of `arr` along `axis`.
<add> Execute `func1d(a, *args, **kwargs)` where `func1d` operates on 1-D arrays
<add> and `a` is a 1-D slice of `arr` along `axis`.
<ide>
<ide> This is equivalent to (but faster than) the following use of `ndindex` and
<ide> `s_`, which sets each of ``ii``, ``jj``, and ``kk`` to a tuple of indices:: | 1 |
Text | Text | add introduced_in metadata to _toc.md | 13861da9c01a652191220a7648b7dd814d61d613 | <ide><path>doc/api/_toc.md
<ide> @// NB(chrisdickinson): if you move this file, be sure to update
<ide> @// tools/doc/html.js to point at the new location.
<add>
<add><!--introduced_in=v0.10.0-->
<add>
<ide> * [About these Docs](documentation.html)
<ide> * [Usage & Example](synopsis.html)
<ide> | 1 |
Javascript | Javascript | correct the jqlite.removeclass method | e3fad0feb35f02191ace77638a102c79daad63ac | <ide><path>src/jqLite.js
<ide> function JQLiteRemoveClass(element, selector) {
<ide> element.className = trim(
<ide> (" " + element.className + " ")
<ide> .replace(/[\n\t]/g, " ")
<del> .replace(" " + selector + " ", "")
<add> .replace(" " + selector + " ", " ")
<ide> );
<ide> }
<ide>
<ide><path>test/jqLiteSpec.js
<ide> describe('jqLite', function(){
<ide> expect(jqLite(a).hasClass('abc')).toEqual(false);
<ide> expect(jqLite(b).hasClass('abc')).toEqual(false);
<ide> });
<add>
<add> it('should correctly remove middle class', function() {
<add> var element = jqLite('<div class="foo bar baz"></div>');
<add> expect(element.hasClass('bar')).toBe(true);
<add>
<add> element.removeClass('bar');
<add>
<add> expect(element.hasClass('foo')).toBe(true);
<add> expect(element.hasClass('bar')).toBe(false);
<add> expect(element.hasClass('baz')).toBe(true);
<add> });
<ide> });
<ide> });
<ide> | 2 |
Javascript | Javascript | fix overrideaccessors for ember data tests | ac54388c817881fc14072b3dfce49cfa1ef63f10 | <ide><path>packages/ember-metal/lib/accessors.js
<ide> set = function set(obj, keyName, value, tolerant) {
<ide>
<ide> // Currently used only by Ember Data tests
<ide> if (Ember.config.overrideAccessors) {
<add> Ember.get = get;
<add> Ember.set = set;
<ide> Ember.config.overrideAccessors();
<ide> get = Ember.get;
<ide> set = Ember.set; | 1 |
Javascript | Javascript | return geometry after calling applymatrix() | b4ea42b634bff4578913eae75968564eaa49a210 | <ide><path>src/core/BufferGeometry.js
<ide> THREE.BufferGeometry.prototype = {
<ide>
<ide> }
<ide>
<add> return this;
<add>
<ide> },
<ide>
<ide> rotateX: function () { | 1 |
Ruby | Ruby | use native string#capitalize | 16e3b65674e3a41afe0415c88c75667e72fd0de9 | <ide><path>activesupport/lib/active_support/multibyte/chars.rb
<ide> def limit(limit)
<ide> slice(0...translate_offset(limit))
<ide> end
<ide>
<del> # Converts the first character to uppercase and the remainder to lowercase.
<del> #
<del> # 'über'.mb_chars.capitalize.to_s # => "Über"
<del> def capitalize
<del> (slice(0) || chars("")).upcase + (slice(1..-1) || chars("")).downcase
<del> end
<del>
<ide> # Capitalizes the first letter of every word, when possible.
<ide> #
<ide> # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró"
<ide> def as_json(options = nil) #:nodoc:
<ide> to_s.as_json(options)
<ide> end
<ide>
<del> %w(capitalize reverse tidy_bytes).each do |method|
<add> %w(reverse tidy_bytes).each do |method|
<ide> define_method("#{method}!") do |*args|
<ide> @wrapped_string = send(method, *args).to_s
<ide> self
<ide><path>activesupport/test/multibyte_chars_test.rb
<ide> def test_respond_to_knows_which_methods_the_proxy_responds_to
<ide>
<ide> def test_method_works_for_proxyed_methods
<ide> assert_equal "ll", "hello".mb_chars.method(:slice).call(2..3) # Defined on Chars
<del> chars = "hello".mb_chars
<add> chars = +"hello".mb_chars
<ide> assert_equal "Hello", chars.method(:capitalize!).call # Defined on Chars
<ide> assert_equal "Hello", chars
<ide> assert_equal "jello", "hello".mb_chars.method(:gsub).call(/h/, "j") # Defined on String | 2 |
Python | Python | replace source files with lib | 0d4faf4ec45e7835056107027191d29de7db549b | <ide><path>numpy/core/setup.py
<ide> def generate_umath_c(ext, build_dir):
<ide>
<ide> config.add_extension('_multiarray_umath',
<ide> sources=multiarray_src + umath_src +
<del> npymath_sources + common_src +
<add> common_src +
<ide> [generate_config_h,
<ide> generate_numpyconfig_h,
<ide> generate_numpy_api,
<ide> def generate_umath_c(ext, build_dir):
<ide> ],
<ide> depends=deps + multiarray_deps + umath_deps +
<ide> common_deps,
<del> libraries=['npysort'],
<add> libraries=['npymath', 'npysort'],
<ide> extra_info=extra_info)
<ide>
<ide> ####################################################################### | 1 |
Javascript | Javascript | add regression test for | e9c1445ba09ac0ae73465f28514f9aa45074b7c7 | <ide><path>packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
<ide> describe('ReactHooksWithNoopRenderer', () => {
<ide> });
<ide> expect(ReactNoop).toMatchRenderedOutput('ABC');
<ide> });
<add>
<add> it('keeps intermediate state updates (issue #18497)', () => {
<add> let _dispatch;
<add> function Counter() {
<add> const [list, dispatch] = React.useReducer((l, c) => l.concat([c]), []);
<add> _dispatch = dispatch;
<add>
<add> const json = JSON.stringify(list);
<add> Scheduler.unstable_yieldValue('Render ' + json);
<add> useLayoutEffect(() => {
<add> Scheduler.unstable_yieldValue('Commit ' + json);
<add> });
<add>
<add> return json;
<add> }
<add>
<add> act(() => {
<add> ReactNoop.render(<Counter />);
<add> expect(Scheduler).toFlushAndYieldThrough(['Render []', 'Commit []']);
<add> expect(ReactNoop).toMatchRenderedOutput('[]');
<add> });
<add>
<add> act(() => {
<add> _dispatch(1);
<add> expect(Scheduler).toFlushAndYieldThrough(['Render [1]']);
<add>
<add> _dispatch(2);
<add> expect(Scheduler).toFlushAndYieldThrough(['Commit [1]']);
<add> expect(ReactNoop).toMatchRenderedOutput('[1]');
<add>
<add> expect(Scheduler).toFlushAndYieldThrough(['Render [1,2]']);
<add> _dispatch(3);
<add>
<add> expect(Scheduler).toFlushAndYieldThrough([
<add> 'Render [1,2,3]',
<add> 'Commit [1,2,3]',
<add> ]);
<add> expect(ReactNoop).toMatchRenderedOutput('[1,2,3]');
<add> });
<add> });
<ide> });
<ide><path>scripts/jest/matchers/schedulerTestMatchers.js
<ide> function assertYieldsWereCleared(Scheduler) {
<ide> const actualYields = Scheduler.unstable_clearYields();
<ide> if (actualYields.length !== 0) {
<ide> throw new Error(
<del> 'Log of yielded values is not empty. ' +
<add> 'Log of yielded values is not empty: ' +
<add> JSON.stringify(actualYields) +
<add> '. ' +
<ide> 'Call expect(Scheduler).toHaveYielded(...) first.'
<ide> );
<ide> } | 2 |
Javascript | Javascript | fix flaky test for symlinks | 1c5784511895bbc416a5d1ae8a1e22d9dbf612ec | <ide><path>test/parallel/test-fs-link.js
<add>'use strict';
<add>const common = require('../common');
<add>const assert = require('assert');
<add>const path = require('path');
<add>const fs = require('fs');
<add>
<add>common.refreshTmpDir();
<add>
<add>// test creating and reading hard link
<add>const srcPath = path.join(common.fixturesDir, 'cycles', 'root.js');
<add>const dstPath = path.join(common.tmpDir, 'link1.js');
<add>
<add>const callback = function(err) {
<add> if (err) throw err;
<add> const srcContent = fs.readFileSync(srcPath, 'utf8');
<add> const dstContent = fs.readFileSync(dstPath, 'utf8');
<add> assert.strictEqual(srcContent, dstContent);
<add>};
<add>
<add>fs.link(srcPath, dstPath, common.mustCall(callback));
<ide><path>test/parallel/test-fs-symlink.js
<ide> 'use strict';
<del>var common = require('../common');
<del>var assert = require('assert');
<del>var path = require('path');
<del>var fs = require('fs');
<del>var exec = require('child_process').exec;
<del>var completed = 0;
<del>var expected_async = 4;
<add>const common = require('../common');
<add>const assert = require('assert');
<add>const path = require('path');
<add>const fs = require('fs');
<add>const exec = require('child_process').exec;
<add>
<ide> var linkTime;
<ide> var fileTime;
<ide>
<del>common.refreshTmpDir();
<del>
<del>var runtest = function(skip_symlinks) {
<del> if (!skip_symlinks) {
<del> // test creating and reading symbolic link
<del> var linkData = path.join(common.fixturesDir, '/cycles/root.js');
<del> var linkPath = path.join(common.tmpDir, 'symlink1.js');
<del>
<del> fs.symlink(linkData, linkPath, function(err) {
<del> if (err) throw err;
<del> console.log('symlink done');
<del>
<del> fs.lstat(linkPath, function(err, stats) {
<del> if (err) throw err;
<del> linkTime = stats.mtime.getTime();
<del> completed++;
<del> });
<del>
<del> fs.stat(linkPath, function(err, stats) {
<del> if (err) throw err;
<del> fileTime = stats.mtime.getTime();
<del> completed++;
<del> });
<del>
<del> fs.readlink(linkPath, function(err, destination) {
<del> if (err) throw err;
<del> assert.equal(destination, linkData);
<del> completed++;
<del> });
<del> });
<del> }
<del>
<del> // test creating and reading hard link
<del> var srcPath = path.join(common.fixturesDir, 'cycles', 'root.js');
<del> var dstPath = path.join(common.tmpDir, 'link1.js');
<del>
<del> fs.link(srcPath, dstPath, function(err) {
<del> if (err) throw err;
<del> console.log('hard link done');
<del> var srcContent = fs.readFileSync(srcPath, 'utf8');
<del> var dstContent = fs.readFileSync(dstPath, 'utf8');
<del> assert.equal(srcContent, dstContent);
<del> completed++;
<del> });
<del>};
<del>
<ide> if (common.isWindows) {
<ide> // On Windows, creating symlinks requires admin privileges.
<ide> // We'll only try to run symlink test if we have enough privileges.
<ide> exec('whoami /priv', function(err, o) {
<ide> if (err || o.indexOf('SeCreateSymbolicLinkPrivilege') == -1) {
<del> expected_async = 1;
<del> runtest(true);
<del> } else {
<del> runtest(false);
<add> console.log('1..0 # Skipped: insufficient privileges');
<add> return;
<ide> }
<ide> });
<del>} else {
<del> runtest(false);
<ide> }
<ide>
<del>process.on('exit', function() {
<del> assert.equal(completed, expected_async);
<del> assert(linkTime !== fileTime);
<add>common.refreshTmpDir();
<add>
<add>// test creating and reading symbolic link
<add>const linkData = path.join(common.fixturesDir, '/cycles/root.js');
<add>const linkPath = path.join(common.tmpDir, 'symlink1.js');
<add>
<add>fs.symlink(linkData, linkPath, function(err) {
<add> if (err) throw err;
<add>
<add> fs.lstat(linkPath, common.mustCall(function(err, stats) {
<add> if (err) throw err;
<add> linkTime = stats.mtime.getTime();
<add> }));
<add>
<add> fs.stat(linkPath, common.mustCall(function(err, stats) {
<add> if (err) throw err;
<add> fileTime = stats.mtime.getTime();
<add> }));
<add>
<add> fs.readlink(linkPath, common.mustCall(function(err, destination) {
<add> if (err) throw err;
<add> assert.equal(destination, linkData);
<add> }));
<ide> });
<ide>
<add>
<add>process.on('exit', function() {
<add> assert.notStrictEqual(linkTime, fileTime);
<add>}); | 2 |
Javascript | Javascript | add w3cpointerevent example to rntester ios | cf2d05c4fe40839295817ac4d069fb208fda1f07 | <ide><path>packages/rn-tester/js/utils/RNTesterList.ios.js
<ide> const APIs: Array<RNTesterModuleInfo> = [
<ide> module: require('../examples/Dimensions/DimensionsExample'),
<ide> supportsTVOS: true,
<ide> },
<add> {
<add> key: 'W3C PointerEvents',
<add> category: 'Experimental',
<add> module: require('../examples/Experimental/W3CPointerEventsExample').default,
<add> },
<ide> {
<ide> key: 'LayoutAnimationExample',
<ide> module: require('../examples/Layout/LayoutAnimationExample'), | 1 |
PHP | PHP | move getvartype() to core/functions.php | b3489445b6ec0f81c0dfa4694f0098095d9baa9d | <ide><path>src/Core/functions.php
<ide> function deprecationWarning($message, $stackFrame = 2)
<ide> trigger_error($message, E_USER_DEPRECATED);
<ide> }
<ide> }
<add>
<add>if (!function_exists('getVarType')) {
<add> /**
<add> * Returns the objects class or var type of it's not an object
<add> *
<add> * @param mixed $var Variable to check
<add> * @return string Returns the class name or variable type
<add> */
<add> function getVarType($var)
<add> {
<add> return is_object($var) ? get_class($var) : gettype($var);
<add> }
<add>}
<ide><path>src/basics.php
<ide> function loadPHPUnitAliases()
<ide> require_once dirname(__DIR__) . DS . 'tests' . DS . 'phpunit_aliases.php';
<ide> }
<ide> }
<del>
<del>if (!function_exists('getVarType')) {
<del> /**
<del> * Returns the objects class or var type of it's not an object
<del> *
<del> * @param mixed $var Variable to check
<del> * @return string Returns the class name or variable type
<del> */
<del> function getVarType($var)
<del> {
<del> return is_object($var) ? get_class($var) : gettype($var);
<del> }
<del>} | 2 |
Go | Go | move mounts into types.go | 156987c118f6f4067794e09e90aabeee0002d05c | <ide><path>pkg/libcontainer/container.go
<ide> type Network struct {
<ide> Gateway string `json:"gateway,omitempty"`
<ide> Mtu int `json:"mtu,omitempty"`
<ide> }
<del>
<del>type Mounts []Mount
<del>
<del>func (s Mounts) OfType(t string) Mounts {
<del> out := Mounts{}
<del> for _, m := range s {
<del> if m.Type == t {
<del> out = append(out, m)
<del> }
<del> }
<del> return out
<del>}
<del>
<del>type Mount struct {
<del> Type string `json:"type,omitempty"`
<del> Source string `json:"source,omitempty"` // Source path, in the host namespace
<del> Destination string `json:"destination,omitempty"` // Destination path, in the container
<del> Writable bool `json:"writable,omitempty"`
<del> Private bool `json:"private,omitempty"`
<del>}
<ide><path>pkg/libcontainer/mount/init.go
<ide> func setupBindmounts(rootfs string, bindMounts libcontainer.Mounts) error {
<ide> return nil
<ide> }
<ide>
<add>// TODO: this is crappy right now and should be cleaned up with a better way of handling system and
<add>// standard bind mounts allowing them to be more dymanic
<ide> func newSystemMounts(rootfs, mountLabel string, mounts libcontainer.Mounts) []mount {
<del> devMounts := []mount{
<del> {source: "shm", path: filepath.Join(rootfs, "dev", "shm"), device: "tmpfs", flags: defaultMountFlags, data: label.FormatMountLabel("mode=1777,size=65536k", mountLabel)},
<del> {source: "devpts", path: filepath.Join(rootfs, "dev", "pts"), device: "devpts", flags: syscall.MS_NOSUID | syscall.MS_NOEXEC, data: label.FormatMountLabel("newinstance,ptmxmode=0666,mode=620,gid=5", mountLabel)},
<del> }
<del>
<ide> systemMounts := []mount{
<ide> {source: "proc", path: filepath.Join(rootfs, "proc"), device: "proc", flags: defaultMountFlags},
<ide> }
<ide>
<ide> if len(mounts.OfType("devtmpfs")) == 1 {
<ide> systemMounts = append(systemMounts, mount{source: "tmpfs", path: filepath.Join(rootfs, "dev"), device: "tmpfs", flags: syscall.MS_NOSUID | syscall.MS_STRICTATIME, data: "mode=755"})
<ide> }
<del> systemMounts = append(systemMounts, devMounts...)
<add> systemMounts = append(systemMounts,
<add> mount{source: "shm", path: filepath.Join(rootfs, "dev", "shm"), device: "tmpfs", flags: defaultMountFlags, data: label.FormatMountLabel("mode=1777,size=65536k", mountLabel)},
<add> mount{source: "devpts", path: filepath.Join(rootfs, "dev", "pts"), device: "devpts", flags: syscall.MS_NOSUID | syscall.MS_NOEXEC, data: label.FormatMountLabel("newinstance,ptmxmode=0666,mode=620,gid=5", mountLabel)})
<ide>
<ide> if len(mounts.OfType("sysfs")) == 1 {
<ide> systemMounts = append(systemMounts, mount{source: "sysfs", path: filepath.Join(rootfs, "sys"), device: "sysfs", flags: defaultMountFlags})
<ide><path>pkg/libcontainer/types.go
<ide> var (
<ide> ErrUnsupported = errors.New("Unsupported method")
<ide> )
<ide>
<add>type Mounts []Mount
<add>
<add>func (s Mounts) OfType(t string) Mounts {
<add> out := Mounts{}
<add> for _, m := range s {
<add> if m.Type == t {
<add> out = append(out, m)
<add> }
<add> }
<add> return out
<add>}
<add>
<add>type Mount struct {
<add> Type string `json:"type,omitempty"`
<add> Source string `json:"source,omitempty"` // Source path, in the host namespace
<add> Destination string `json:"destination,omitempty"` // Destination path, in the container
<add> Writable bool `json:"writable,omitempty"`
<add> Private bool `json:"private,omitempty"`
<add>}
<add>
<ide> // namespaceList is used to convert the libcontainer types
<ide> // into the names of the files located in /proc/<pid>/ns/* for
<ide> // each namespace | 3 |
PHP | PHP | fix cs error | 1464c047c8c09bf3a57fb0150627af94cde2f876 | <ide><path>tests/TestCase/View/ViewTest.php
<ide> public function testBlockExist() {
<ide> $this->assertTrue($this->View->exists('test'));
<ide> }
<ide>
<del> /**
<add>/**
<ide> * Test setting a block's content to null
<ide> *
<ide> * @return void | 1 |
Javascript | Javascript | use random port to initialize chromedriver | 91b53d4b3b9e87d42d9a369769db3b60ff8eb8ac | <ide><path>spec/integration/helpers/start-atom.js
<ide> const chromeDriverDown = done => {
<ide> };
<ide>
<ide> const buildAtomClient = async (args, env) => {
<add> // Since ChromeDriver v2.41, ChromeDriver will only connect if, either we precise a port
<add> // for remote debugging, either the embedder (ie electron) made sure to pass `USER_DATA_DIR`
<add> // to the remote debugging server.
<add> // So, for now, we'll just use a random port (we don't care about its value since we're not
<add> // connecting through it).
<add> // (inspired by https://github.com/electron/spectron/pull/361/commits/737db138bd8a6daaf80f9c2bff710ce4a5fff39b).
<add> // TodoElectronIssue: Remove the whole remote-debugging-port param once we upgrade
<add> // to Electron v5, since this was fixes there (see electron/electron#17800).
<add> const randomPort = Math.floor(Math.random() * (9999 - 9000) + 9000);
<add>
<ide> const userDataDir = temp.mkdirSync('atom-user-data-dir');
<ide> const client = await webdriverio.remote({
<ide> host: 'localhost',
<ide> const buildAtomClient = async (args, env) => {
<ide> .join(' ')}`,
<ide> 'dev',
<ide> 'safe',
<del> `user-data-dir=${userDataDir}`
<add> `user-data-dir=${userDataDir}`,
<add> `remote-debugging-port=${randomPort}`
<ide> ]
<ide> }
<ide> } | 1 |
Javascript | Javascript | read current time without marking event start time | 1022ee0ec140b8fce47c43ec57ee4a9f80f42eca | <ide><path>packages/react-reconciler/src/ReactFiberBeginWork.js
<ide> import {
<ide> } from './ReactFiber';
<ide> import {
<ide> markSpawnedWork,
<del> requestCurrentTime,
<add> requestCurrentTimeForUpdate,
<ide> retryDehydratedSuspenseBoundary,
<ide> scheduleWork,
<ide> renderDidSuspendDelayIfPossible,
<ide> function mountDehydratedSuspenseComponent(
<ide> // a protocol to transfer that time, we'll just estimate it by using the current
<ide> // time. This will mean that Suspense timeouts are slightly shifted to later than
<ide> // they should be.
<del> let serverDisplayTime = requestCurrentTime();
<add> let serverDisplayTime = requestCurrentTimeForUpdate();
<ide> // Schedule a normal pri update to render this content.
<ide> let newExpirationTime = computeAsyncExpiration(serverDisplayTime);
<ide> if (enableSchedulerTracing) {
<ide><path>packages/react-reconciler/src/ReactFiberClassComponent.js
<ide> import {
<ide> } from './ReactFiberContext';
<ide> import {readContext} from './ReactFiberNewContext';
<ide> import {
<del> requestCurrentTime,
<add> requestCurrentTimeForUpdate,
<ide> computeExpirationForFiber,
<ide> scheduleWork,
<ide> } from './ReactFiberWorkLoop';
<ide> const classComponentUpdater = {
<ide> isMounted,
<ide> enqueueSetState(inst, payload, callback) {
<ide> const fiber = getInstance(inst);
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> const suspenseConfig = requestCurrentSuspenseConfig();
<ide> const expirationTime = computeExpirationForFiber(
<ide> currentTime,
<ide> const classComponentUpdater = {
<ide> },
<ide> enqueueReplaceState(inst, payload, callback) {
<ide> const fiber = getInstance(inst);
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> const suspenseConfig = requestCurrentSuspenseConfig();
<ide> const expirationTime = computeExpirationForFiber(
<ide> currentTime,
<ide> const classComponentUpdater = {
<ide> },
<ide> enqueueForceUpdate(inst, callback) {
<ide> const fiber = getInstance(inst);
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> const suspenseConfig = requestCurrentSuspenseConfig();
<ide> const expirationTime = computeExpirationForFiber(
<ide> currentTime,
<ide><path>packages/react-reconciler/src/ReactFiberDevToolsHook.js
<ide> */
<ide>
<ide> import {enableProfilerTimer} from 'shared/ReactFeatureFlags';
<del>import {requestCurrentTime} from './ReactFiberWorkLoop';
<add>import {getCurrentTime} from './ReactFiberWorkLoop';
<ide> import {inferPriorityFromExpirationTime} from './ReactFiberExpirationTime';
<ide>
<ide> import type {Fiber} from './ReactFiber';
<ide> export function injectInternals(internals: Object): boolean {
<ide> try {
<ide> const didError = (root.current.effectTag & DidCapture) === DidCapture;
<ide> if (enableProfilerTimer) {
<del> const currentTime = requestCurrentTime();
<add> const currentTime = getCurrentTime();
<ide> const priorityLevel = inferPriorityFromExpirationTime(
<ide> currentTime,
<ide> expirationTime,
<ide><path>packages/react-reconciler/src/ReactFiberHooks.js
<ide> import {
<ide> import {
<ide> scheduleWork,
<ide> computeExpirationForFiber,
<del> requestCurrentTime,
<add> requestCurrentTimeForUpdate,
<ide> warnIfNotCurrentlyActingEffectsInDEV,
<ide> warnIfNotCurrentlyActingUpdatesInDev,
<ide> warnIfNotScopedWithMatchingAct,
<ide> function dispatchAction<S, A>(
<ide> lastRenderPhaseUpdate.next = update;
<ide> }
<ide> } else {
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> const suspenseConfig = requestCurrentSuspenseConfig();
<ide> const expirationTime = computeExpirationForFiber(
<ide> currentTime,
<ide><path>packages/react-reconciler/src/ReactFiberReconciler.js
<ide> import {
<ide> import {createFiberRoot} from './ReactFiberRoot';
<ide> import {injectInternals} from './ReactFiberDevToolsHook';
<ide> import {
<del> requestCurrentTime,
<add> requestCurrentTimeForUpdate,
<ide> computeExpirationForFiber,
<ide> scheduleWork,
<ide> flushRoot,
<ide> export function updateContainer(
<ide> callback: ?Function,
<ide> ): ExpirationTime {
<ide> const current = container.current;
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> if (__DEV__) {
<ide> // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
<ide> if ('undefined' !== typeof jest) {
<ide> export function attemptSynchronousHydration(fiber: Fiber): void {
<ide> // If we're still blocked after this, we need to increase
<ide> // the priority of any promises resolving within this
<ide> // boundary so that they next attempt also has higher pri.
<del> let retryExpTime = computeInteractiveExpiration(requestCurrentTime());
<add> let retryExpTime = computeInteractiveExpiration(
<add> requestCurrentTimeForUpdate(),
<add> );
<ide> markRetryTimeIfNotHydrated(fiber, retryExpTime);
<ide> break;
<ide> }
<ide> export function attemptUserBlockingHydration(fiber: Fiber): void {
<ide> // Suspense.
<ide> return;
<ide> }
<del> let expTime = computeInteractiveExpiration(requestCurrentTime());
<add> let expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());
<ide> scheduleWork(fiber, expTime);
<ide> markRetryTimeIfNotHydrated(fiber, expTime);
<ide> }
<ide> export function attemptContinuousHydration(fiber: Fiber): void {
<ide> // Suspense.
<ide> return;
<ide> }
<del> let expTime = computeContinuousHydrationExpiration(requestCurrentTime());
<add> let expTime = computeContinuousHydrationExpiration(
<add> requestCurrentTimeForUpdate(),
<add> );
<ide> scheduleWork(fiber, expTime);
<ide> markRetryTimeIfNotHydrated(fiber, expTime);
<ide> }
<ide> export function attemptHydrationAtCurrentPriority(fiber: Fiber): void {
<ide> // their priority other than synchronously flush it.
<ide> return;
<ide> }
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> const expTime = computeExpirationForFiber(currentTime, fiber, null);
<ide> scheduleWork(fiber, expTime);
<ide> markRetryTimeIfNotHydrated(fiber, expTime);
<ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.js
<ide> let spawnedWorkDuringRender: null | Array<ExpirationTime> = null;
<ide> // receive the same expiration time. Otherwise we get tearing.
<ide> let currentEventTime: ExpirationTime = NoWork;
<ide>
<del>export function requestCurrentTime() {
<add>export function requestCurrentTimeForUpdate() {
<ide> if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
<ide> // We're inside React, so it's fine to read the actual time.
<ide> return msToExpirationTime(now());
<ide> export function requestCurrentTime() {
<ide> return currentEventTime;
<ide> }
<ide>
<add>export function getCurrentTime() {
<add> return msToExpirationTime(now());
<add>}
<add>
<ide> export function computeExpirationForFiber(
<ide> currentTime: ExpirationTime,
<ide> fiber: Fiber,
<ide> function ensureRootIsScheduled(root: FiberRoot) {
<ide>
<ide> // TODO: If this is an update, we already read the current time. Pass the
<ide> // time as an argument.
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> const priorityLevel = inferPriorityFromExpirationTime(
<ide> currentTime,
<ide> expirationTime,
<ide> function performConcurrentWorkOnRoot(root, didTimeout) {
<ide> if (didTimeout) {
<ide> // The render task took too long to complete. Mark the current time as
<ide> // expired to synchronously render all expired work in a single batch.
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> markRootExpiredAtTime(root, currentTime);
<ide> // This will schedule a synchronous callback.
<ide> ensureRootIsScheduled(root);
<ide> function retryTimedOutBoundary(
<ide> // likely unblocked. Try rendering again, at a new expiration time.
<ide> if (retryTime === NoWork) {
<ide> const suspenseConfig = null; // Retries don't carry over the already committed update.
<del> const currentTime = requestCurrentTime();
<add> const currentTime = requestCurrentTimeForUpdate();
<ide> retryTime = computeExpirationForFiber(
<ide> currentTime,
<ide> boundaryFiber,
<ide><path>packages/react/src/__tests__/ReactProfilerDevToolsIntegration-test.internal.js
<ide> describe('ReactProfiler DevTools integration', () => {
<ide> {name: 'some event', timestamp: eventTime},
<ide> ]);
<ide> });
<add>
<add> it('regression test: #17159', () => {
<add> function Text({text}) {
<add> Scheduler.unstable_yieldValue(text);
<add> return text;
<add> }
<add>
<add> const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
<add>
<add> // Commit something
<add> root.update(<Text text="A" />);
<add> expect(Scheduler).toFlushAndYield(['A']);
<add> expect(root).toMatchRenderedOutput('A');
<add>
<add> // Advance time by many seconds, larger than the default expiration time
<add> // for updates.
<add> Scheduler.unstable_advanceTime(10000);
<add> // Schedule an update.
<add> root.update(<Text text="B" />);
<add>
<add> // Update B should not instantly expire.
<add> expect(Scheduler).toFlushExpired([]);
<add>
<add> expect(Scheduler).toFlushAndYield(['B']);
<add> expect(root).toMatchRenderedOutput('B');
<add> });
<ide> }); | 7 |
Text | Text | update the path to the pr image | c49ddbada60f7189dfc0e62fa03fadd27ccffe8e | <ide><path>docs/CONTRIBUTING.md
<ide> A pull request (PR) is a method of submitting proposed changes to the freeCodeCa
<ide> 2. By default, all pull requests should be against the freeCodeCamp Curriculum repo’s `dev` branch.
<ide> **Make sure that your Base Fork is set to freeCodeCamp/curriculum when raising a pull request.**
<ide>
<del> 
<add> 
<ide>
<ide> 3. Submit a [pull request](http://forum.freecodecamp.org/t/how-to-contribute-via-a-pull-request/19368) from your branch to the freeCodeCamp Curriculum `dev` branch.
<ide> | 1 |
Javascript | Javascript | add test and mocks | d8e8ea5cbbfae10f1eb0ccfaeb7e8b0668020083 | <ide><path>src/renderers/native/ReactNative/__mocks__/InitializeJavaScriptAppEngine.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// Noop
<add>
<add>// TODO: Move all initialization callers back into react-native
<ide><path>src/renderers/native/ReactNative/__mocks__/InteractionManager.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// TODO: Figure out a way to drop this dependency
<add>
<add>var InteractionManager = {};
<add>
<add>module.exports = InteractionManager;
<ide><path>src/renderers/native/ReactNative/__mocks__/JSTimersExecution.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// Noop
<add>
<add>// TODO: Move all initialization callers back into react-native
<ide><path>src/renderers/native/ReactNative/__mocks__/Platform.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// Mock of the Native Hooks
<add>
<add>var Platform = {};
<add>
<add>module.exports = Platform;
<ide><path>src/renderers/native/ReactNative/__mocks__/RCTEventEmitter.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// Noop
<add>
<add>// TODO: Move all initialization callers back into react-native
<ide><path>src/renderers/native/ReactNative/__mocks__/RCTLog.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// Noop
<add>
<add>// TODO: Move all initialization callers back into react-native
<ide><path>src/renderers/native/ReactNative/__mocks__/TextInputState.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// Mock of the Native Hooks
<add>// TODO: Should this move into the components themselves? E.g. focusable
<add>
<add>var TextInputState = {};
<add>
<add>module.exports = TextInputState;
<ide><path>src/renderers/native/ReactNative/__mocks__/UIManager.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// Mock of the Native Hooks
<add>
<add>var RCTUIManager = {
<add> createView: jest.genMockFunction(),
<add> setChildren: jest.genMockFunction(),
<add> manageChildren: jest.genMockFunction(),
<add> updateView: jest.genMockFunction(),
<add>};
<add>
<add>module.exports = RCTUIManager;
<ide><path>src/renderers/native/ReactNative/__mocks__/deepDiffer.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// TODO: Move deepDiffer into react
<add>
<add>var deepDiffer = function(one: any, two: any): bool {
<add> if (one === two) {
<add> // Short circuit on identical object references instead of traversing them.
<add> return false;
<add> }
<add> if ((typeof one === 'function') && (typeof two === 'function')) {
<add> // We consider all functions equal
<add> return false;
<add> }
<add> if ((typeof one !== 'object') || (one === null)) {
<add> // Primitives can be directly compared
<add> return one !== two;
<add> }
<add> if ((typeof two !== 'object') || (two === null)) {
<add> // We know they are different because the previous case would have triggered
<add> // otherwise.
<add> return true;
<add> }
<add> if (one.constructor !== two.constructor) {
<add> return true;
<add> }
<add> if (Array.isArray(one)) {
<add> // We know two is also an array because the constructors are equal
<add> var len = one.length;
<add> if (two.length !== len) {
<add> return true;
<add> }
<add> for (var ii = 0; ii < len; ii++) {
<add> if (deepDiffer(one[ii], two[ii])) {
<add> return true;
<add> }
<add> }
<add> } else {
<add> for (var key in one) {
<add> if (deepDiffer(one[key], two[key])) {
<add> return true;
<add> }
<add> }
<add> for (var twoKey in two) {
<add> // The only case we haven't checked yet is keys that are in two but aren't
<add> // in one, which means they are different.
<add> if (one[twoKey] === undefined && two[twoKey] !== undefined) {
<add> return true;
<add> }
<add> }
<add> }
<add> return false;
<add>};
<add>
<add>module.exports = deepDiffer;
<ide><path>src/renderers/native/ReactNative/__mocks__/deepFreezeAndThrowOnMutationInDev.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// TODO: move into react or fbjs
<add>
<add>var deepFreezeAndThrowOnMutationInDev = function() { };
<add>
<add>module.exports = deepFreezeAndThrowOnMutationInDev;
<ide><path>src/renderers/native/ReactNative/__mocks__/flattenStyle.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// TODO: Move flattenStyle into react
<add>
<add>var flattenStyle = function() { };
<add>
<add>module.exports = flattenStyle;
<ide><path>src/renderers/native/ReactNative/__mocks__/merge.js
<add>/**
<add> * Copyright 2013-2015, 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>
<add>'use strict';
<add>
<add>// TODO: Replace all callers with spread
<add>
<add>var merge = function(a, b) {
<add> return {...a, ...b};
<add>};
<add>
<add>module.exports = merge;
<ide><path>src/renderers/native/ReactNative/__tests__/ReactNativeAttributePayload-test.js
<ide>
<ide> jest.dontMock('ReactNativeAttributePayload');
<ide> jest.dontMock('ReactNativePropRegistry');
<del>jest.dontMock('deepDiffer');
<del>jest.dontMock('flattenStyle');
<add>// jest.dontMock('deepDiffer');
<add>// jest.dontMock('flattenStyle');
<ide>
<ide> var ReactNativeAttributePayload = require('ReactNativeAttributePayload');
<ide> var ReactNativePropRegistry = require('ReactNativePropRegistry');
<ide><path>src/renderers/native/ReactNative/__tests__/ReactNativeMount-test.js
<add>/**
<add> * Copyright 2013-2015, 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> * @emails react-core
<add> */
<add>
<add>'use strict';
<add>
<add>var React;
<add>var ReactNative;
<add>var createReactNativeComponentClass;
<add>
<add>describe('ReactNative', function() {
<add> beforeEach(function() {
<add> React = require('React');
<add> ReactNative = require('ReactNative');
<add> createReactNativeComponentClass = require('createReactNativeComponentClass');
<add> });
<add>
<add> it('should be able to create and render a native component', function() {
<add> var View = createReactNativeComponentClass({
<add> validAttributes: { foo: true },
<add> uiViewClassName: 'View',
<add> });
<add>
<add> ReactNative.render(<View foo="test" />, 1);
<add> });
<add>
<add>}); | 14 |
Text | Text | fix typo in subheader (#4) | 886f595c37c13dbacf45cb59f03768911167d9e6 | <ide><path>README.md
<ide> An example on how to use this class is given in the `run_classifier.py` script w
<ide>
<ide> ### 3. `BertForQuestionAnswering`
<ide>
<del>`BertForSequenceClassification` is a fine-tuning model that includes `BertModel` with a token-level classifiers on top of the full sequence of last hidden states.
<add>`BertForQuestionAnswering` is a fine-tuning model that includes `BertModel` with a token-level classifiers on top of the full sequence of last hidden states.
<ide>
<ide> The token-level classifier takes as input the full sequence of the last hidden state and compute several (e.g. two) scores for each tokens that can for example respectively be the score that a given token is a `start_span` and a `end_span` token (see Figures 3c and 3d in the BERT paper).
<ide> | 1 |
PHP | PHP | accept older blowfish hashes | 390441d3b939b4b4818a819c7eb58515c3c5da30 | <ide><path>lib/Cake/Utility/Security.php
<ide> protected static function _crypt($password, $salt = false) {
<ide> $salt = vsprintf('$2a$%02d$%s', array(self::$hashCost, $salt));
<ide> }
<ide>
<del> if ($salt === true || strpos($salt, '$2a$') !== 0 || strlen($salt) < 29) {
<add> $invalidCipher = (
<add> strpos($salt, '$2y$') !== 0 &&
<add> strpos($salt, '$2x$') !== 0 &&
<add> strpos($salt, '$2a$') !== 0
<add> );
<add> if ($salt === true || $invalidCipher || strlen($salt) < 29) {
<ide> trigger_error(__d(
<ide> 'cake_dev',
<ide> 'Invalid salt: %s for %s Please visit http://www.php.net/crypt and read the appropriate section for building %s salts.', | 1 |
Java | Java | update contentdisposition to rfc 6266 | ea4f1ca5d5c45db40da47684ceb522fec8fd294c | <ide><path>spring-web/src/main/java/org/springframework/http/ContentDisposition.java
<ide> import static java.time.format.DateTimeFormatter.RFC_1123_DATE_TIME;
<ide>
<ide> /**
<del> * Represent the Content-Disposition type and parameters as defined in RFC 2183.
<add> * Represent the Content-Disposition type and parameters as defined in RFC 6266.
<ide> *
<ide> * @author Sebastien Deleuze
<ide> * @author Juergen Hoeller
<add> * @author Rossen Stoyanchev
<ide> * @since 5.0
<del> * @see <a href="https://tools.ietf.org/html/rfc2183">RFC 2183</a>
<add> * @see <a href="https://tools.ietf.org/html/rfc6266">RFC 6266</a>
<ide> */
<ide> public final class ContentDisposition {
<ide>
<ide> private static final String INVALID_HEADER_FIELD_PARAMETER_FORMAT =
<ide> "Invalid header field parameter format (as defined in RFC 5987)";
<ide>
<add>
<ide> @Nullable
<ide> private final String type;
<ide>
<ide> public Charset getCharset() {
<ide>
<ide> /**
<ide> * Return the value of the {@literal size} parameter, or {@code null} if not defined.
<add> * @deprecated since 5.2.3 as per
<add> * <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
<add> * to be removed in a future release.
<ide> */
<add> @Deprecated
<ide> @Nullable
<ide> public Long getSize() {
<ide> return this.size;
<ide> }
<ide>
<ide> /**
<ide> * Return the value of the {@literal creation-date} parameter, or {@code null} if not defined.
<add> * @deprecated since 5.2.3 as per
<add> * <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
<add> * to be removed in a future release.
<ide> */
<add> @Deprecated
<ide> @Nullable
<ide> public ZonedDateTime getCreationDate() {
<ide> return this.creationDate;
<ide> }
<ide>
<ide> /**
<ide> * Return the value of the {@literal modification-date} parameter, or {@code null} if not defined.
<add> * @deprecated since 5.2.3 as per
<add> * <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
<add> * to be removed in a future release.
<ide> */
<add> @Deprecated
<ide> @Nullable
<ide> public ZonedDateTime getModificationDate() {
<ide> return this.modificationDate;
<ide> }
<ide>
<ide> /**
<ide> * Return the value of the {@literal read-date} parameter, or {@code null} if not defined.
<add> * @deprecated since 5.2.3 as per
<add> * <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
<add> * to be removed in a future release.
<ide> */
<add> @Deprecated
<ide> @Nullable
<ide> public ZonedDateTime getReadDate() {
<ide> return this.readDate;
<ide> public int hashCode() {
<ide> }
<ide>
<ide> /**
<del> * Return the header value for this content disposition as defined in RFC 2183.
<add> * Return the header value for this content disposition as defined in RFC 6266.
<ide> * @see #parse(String)
<ide> */
<ide> @Override
<ide> public interface Builder {
<ide>
<ide> /**
<ide> * Set the value of the {@literal size} parameter.
<add> * @deprecated since 5.2.3 as per
<add> * <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
<add> * to be removed in a future release.
<ide> */
<add> @Deprecated
<ide> Builder size(Long size);
<ide>
<ide> /**
<ide> * Set the value of the {@literal creation-date} parameter.
<add> * @deprecated since 5.2.3 as per
<add> * <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
<add> * to be removed in a future release.
<ide> */
<add> @Deprecated
<ide> Builder creationDate(ZonedDateTime creationDate);
<ide>
<ide> /**
<ide> * Set the value of the {@literal modification-date} parameter.
<add> * @deprecated since 5.2.3 as per
<add> * <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
<add> * to be removed in a future release.
<ide> */
<add> @Deprecated
<ide> Builder modificationDate(ZonedDateTime modificationDate);
<ide>
<ide> /**
<ide> * Set the value of the {@literal read-date} parameter.
<add> * @deprecated since 5.2.3 as per
<add> * <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
<add> * to be removed in a future release.
<ide> */
<add> @Deprecated
<ide> Builder readDate(ZonedDateTime readDate);
<ide>
<ide> /** | 1 |
Python | Python | print all different tensors on exception | 66e8656778392609e1fb769f1a0d0839af3cd76a | <ide><path>src/transformers/commands/pt_to_tf.py
<ide> def register_subcommand(parser: ArgumentParser):
<ide> train_parser.set_defaults(func=convert_command_factory)
<ide>
<ide> @staticmethod
<del> def compare_pt_tf_models(pt_model, pt_input, tf_model, tf_input):
<add> def find_pt_tf_differences(pt_model, pt_input, tf_model, tf_input):
<ide> """
<del> Compares the TensorFlow and PyTorch models, given their inputs, returning a tuple with the maximum observed
<del> difference and its source.
<add> Compares the TensorFlow and PyTorch models, given their inputs, returning a dictionary with all tensor
<add> differences.
<ide> """
<ide> pt_outputs = pt_model(**pt_input, output_hidden_states=True)
<ide> tf_outputs = tf_model(**tf_input, output_hidden_states=True)
<ide> def compare_pt_tf_models(pt_model, pt_input, tf_model, tf_input):
<ide> f" {tf_out_attrs})"
<ide> )
<ide>
<del> # 2. For each output attribute, ALL values must be the same
<del> def _compate_pt_tf_models(pt_out, tf_out, attr_name=""):
<del> max_difference = 0
<del> max_difference_source = ""
<add> # 2. For each output attribute, computes the difference
<add> def _find_pt_tf_differences(pt_out, tf_out, differences, attr_name=""):
<ide>
<ide> # If the current attribute is a tensor, it is a leaf and we make the comparison. Otherwise, we will dig in
<ide> # recursivelly, keeping the name of the attribute.
<del> if isinstance(pt_out, (torch.Tensor)):
<del> difference = np.max(np.abs(pt_out.detach().numpy() - tf_out.numpy()))
<del> if difference > max_difference:
<del> max_difference = difference
<del> max_difference_source = attr_name
<add> if isinstance(pt_out, torch.Tensor):
<add> tensor_difference = np.max(np.abs(pt_out.detach().numpy() - tf_out.numpy()))
<add> differences[attr_name] = tensor_difference
<ide> else:
<ide> root_name = attr_name
<ide> for i, pt_item in enumerate(pt_out):
<ide> def _compate_pt_tf_models(pt_out, tf_out, attr_name=""):
<ide> else:
<ide> branch_name = root_name + f"[{i}]"
<ide> tf_item = tf_out[i]
<del> difference, difference_source = _compate_pt_tf_models(pt_item, tf_item, branch_name)
<del> if difference > max_difference:
<del> max_difference = difference
<del> max_difference_source = difference_source
<add> differences = _find_pt_tf_differences(pt_item, tf_item, differences, branch_name)
<ide>
<del> return max_difference, max_difference_source
<add> return differences
<ide>
<del> return _compate_pt_tf_models(pt_outputs, tf_outputs)
<add> return _find_pt_tf_differences(pt_outputs, tf_outputs, {})
<ide>
<ide> def __init__(self, model_name: str, local_dir: str, no_pr: bool, new_weights: bool, *args):
<ide> self._logger = logging.get_logger("transformers-cli/pt_to_tf")
<ide> def run(self):
<ide> tf_input.update({"decoder_input_ids": tf.convert_to_tensor(decoder_input_ids)})
<ide>
<ide> # Confirms that cross loading PT weights into TF worked.
<del> crossload_diff, diff_source = self.compare_pt_tf_models(pt_model, pt_input, tf_from_pt_model, tf_input)
<del> if crossload_diff >= MAX_ERROR:
<add> crossload_differences = self.find_pt_tf_differences(pt_model, pt_input, tf_from_pt_model, tf_input)
<add> max_crossload_diff = max(crossload_differences.values())
<add> if max_crossload_diff > MAX_ERROR:
<ide> raise ValueError(
<del> "The cross-loaded TF model has different outputs, something went wrong! (max difference ="
<del> f" {crossload_diff:.3e}, observed in {diff_source})"
<add> "The cross-loaded TensorFlow model has different outputs, something went wrong! Exaustive list of"
<add> f" maximum tensor differences above the error threshold ({MAX_ERROR}):\n"
<add> + "\n".join(
<add> [f"{key}: {value:.3e}" for key, value in crossload_differences.items() if value > MAX_ERROR]
<add> )
<ide> )
<ide>
<ide> # Save the weights in a TF format (if needed) and confirms that the results are still good
<ide> def run(self):
<ide> tf_from_pt_model.save_weights(tf_weights_path)
<ide> del tf_from_pt_model # will no longer be used, and may have a large memory footprint
<ide> tf_model = tf_class.from_pretrained(self._local_dir)
<del> converted_diff, diff_source = self.compare_pt_tf_models(pt_model, pt_input, tf_model, tf_input)
<del> if converted_diff >= MAX_ERROR:
<add> conversion_differences = self.find_pt_tf_differences(pt_model, pt_input, tf_model, tf_input)
<add> max_conversion_diff = max(conversion_differences.values())
<add> if max_conversion_diff > MAX_ERROR:
<ide> raise ValueError(
<del> "The converted TF model has different outputs, something went wrong! (max difference ="
<del> f" {converted_diff:.3e}, observed in {diff_source})"
<add> "The converted TensorFlow model has different outputs, something went wrong! Exaustive list of maximum"
<add> f" tensor differences above the error threshold ({MAX_ERROR}):\n"
<add> + "\n".join(
<add> [f"{key}: {value:.3e}" for key, value in conversion_differences.items() if value > MAX_ERROR]
<add> )
<ide> )
<ide>
<ide> if not self._no_pr:
<ide> def run(self):
<ide> create_pr=True,
<ide> pr_commit_summary="Add TF weights",
<ide> pr_commit_description=(
<del> f"Validated by the `pt_to_tf` CLI. Max crossload output difference={crossload_diff:.3e};"
<del> f" Max converted output difference={converted_diff:.3e}."
<add> "Model converted by the `transformers`' `pt_to_tf` CLI -- all converted model outputs and"
<add> " hidden layers were validated against its Pytorch counterpart. Maximum crossload output"
<add> f" difference={max_crossload_diff:.3e}; Maximum converted output"
<add> f" difference={max_conversion_diff:.3e}."
<ide> ),
<ide> )
<ide> self._logger.warn(f"PR open in {hub_pr_url}") | 1 |
Text | Text | fix broken link | bd6d2ec604b5605fe8e92f8b295cc1703667d0bf | <ide><path>guides/source/i18n.md
<ide> Contributing to Rails I18n
<ide>
<ide> I18n support in Ruby on Rails was introduced in the release 2.2 and is still evolving. The project follows the good Ruby on Rails development tradition of evolving solutions in gems and real applications first, and only then cherry-picking the best-of-breed of most widely useful features for inclusion in the core.
<ide>
<del>Thus we encourage everybody to experiment with new ideas and features in gems or other libraries and make them available to the community. (Don't forget to announce your work on our [mailing list](http://groups.google.com/group/rails-i18n!))
<add>Thus we encourage everybody to experiment with new ideas and features in gems or other libraries and make them available to the community. (Don't forget to announce your work on our [mailing list](http://groups.google.com/group/rails-i18n)!)
<ide>
<ide> If you find your own locale (language) missing from our [example translations data](https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale) repository for Ruby on Rails, please [_fork_](https://github.com/guides/fork-a-project-and-submit-your-modifications) the repository, add your data and send a [pull request](https://github.com/guides/pull-requests).
<ide> | 1 |
Javascript | Javascript | add check for using process.binding crypto | acbe00792d3e73ded9d309002974a095e1433afe | <ide><path>tools/eslint-rules/crypto-check.js
<ide> const utils = require('./rules-utils.js');
<ide> const msg = 'Please add a hasCrypto check to allow this test to be skipped ' +
<ide> 'when Node is built "--without-ssl".';
<ide>
<add>const cryptoModules = ['crypto', 'http2'];
<add>const requireModules = cryptoModules.concat(['tls', 'https']);
<add>const bindingModules = cryptoModules.concat(['tls_wrap']);
<add>
<ide> module.exports = function(context) {
<ide> const missingCheckNodes = [];
<ide> const requireNodes = [];
<ide> var hasSkipCall = false;
<ide>
<ide> function testCryptoUsage(node) {
<del> if (utils.isRequired(node, ['crypto', 'tls', 'https', 'http2'])) {
<add> if (utils.isRequired(node, requireModules) ||
<add> utils.isBinding(node, bindingModules)) {
<ide> requireNodes.push(node);
<ide> }
<ide> }
<ide><path>tools/eslint-rules/rules-utils.js
<ide> module.exports.isRequired = function(node, modules) {
<ide> modules.includes(node.arguments[0].value);
<ide> };
<ide>
<add>/**
<add> * Returns true if any of the passed in modules are used in
<add> * binding calls.
<add> */
<add>module.exports.isBinding = function(node, modules) {
<add> if (node.callee.object) {
<add> return node.callee.object.name === 'process' &&
<add> node.callee.property.name === 'binding' &&
<add> modules.includes(node.arguments[0].value);
<add> }
<add>};
<add>
<ide> /**
<ide> * Returns true is the node accesses any property in the properties
<ide> * array on the 'common' object. | 2 |
Ruby | Ruby | fix syntax error and remove duplicated test | 507d23c421b189ac8386e0605c57ab3db831001e | <ide><path>activerecord/test/cases/relation/where_test.rb
<ide> def test_where_with_table_name_and_empty_hash
<ide> assert_equal 0, Post.where(:posts => {}).count
<ide> end
<ide>
<add> def test_where_with_table_name_and_empty_array
<add> assert_equal 0, Post.where(:id => []).count
<add> end
<add>
<ide> def test_where_with_empty_hash_and_no_foreign_key
<ide> assert_equal 0, Edge.where(:sink => {}).count
<ide> end
<ide> def test_where_with_blank_conditions
<ide> [[], {}, nil, ""].each do |blank|
<ide> assert_equal 4, Edge.where(blank).order("sink_id").to_a.size
<ide> end
<del> def test_where_with_table_name_and_empty_array
<del> assert_equal 0, Post.where(:id => []).count
<del> end
<del>
<del> def test_where_with_empty_hash_and_no_foreign_key
<del> assert_equal 0, Edge.where(:sink => {}).count
<ide> end
<ide> end
<ide> end | 1 |
Javascript | Javascript | fix lint errors | 174bac378d47435780747536d45faba1ce63cbe7 | <ide><path>src/task-bootstrap.js
<add>/* global snapshotResult */
<add>
<ide> if (typeof snapshotResult !== 'undefined') {
<ide> snapshotResult.setGlobals(global, process, global, {}, console, require)
<ide> }
<ide> const {userAgent} = process.env
<ide> const [compileCachePath, taskPath] = process.argv.slice(2)
<ide>
<ide> const CompileCache = require('./compile-cache')
<del>CompileCache.setCacheDirectory(compileCachePath);
<add>CompileCache.setCacheDirectory(compileCachePath)
<ide> CompileCache.install(`${process.resourcesPath}`, require)
<ide>
<ide> const setupGlobals = function () {
<ide><path>src/text-editor-component.js
<add>/* global ResizeObserver */
<add>
<ide> const etch = require('etch')
<ide> const {CompositeDisposable} = require('event-kit')
<ide> const {Point, Range} = require('text-buffer')
<ide><path>src/text-editor-element.js
<ide> const {Emitter} = require('atom')
<add>const Grim = require('grim')
<ide> const TextEditorComponent = require('./text-editor-component')
<ide> const dedent = require('dedent')
<ide>
<ide> class TextEditorElement extends HTMLElement {
<ide> switch (name) {
<ide> case 'mini':
<ide> this.getModel().update({mini: newValue != null})
<del> break;
<add> break
<ide> case 'placeholder-text':
<ide> this.getModel().update({placeholderText: newValue})
<del> break;
<add> break
<ide> case 'gutter-hidden':
<ide> this.getModel().update({isVisible: newValue != null})
<del> break;
<add> break
<ide> }
<ide> }
<ide> }
<ide> class TextEditorElement extends HTMLElement {
<ide> updateModelFromAttributes () {
<ide> const props = {
<ide> mini: this.hasAttribute('mini'),
<del> placeholderText: this.getAttribute('placeholder-text'),
<add> placeholderText: this.getAttribute('placeholder-text')
<ide> }
<ide> if (this.hasAttribute('gutter-hidden')) props.lineNumberGutterVisible = false
<ide> | 3 |
Go | Go | add regression test + go fmt | 48833c7b0784bc7055f29dd3448df3af93c462ec | <ide><path>server_test.go
<ide> func TestCreateRm(t *testing.T) {
<ide>
<ide> }
<ide>
<add>func TestCommit(t *testing.T) {
<add> runtime := mkRuntime(t)
<add> defer nuke(runtime)
<add>
<add> srv := &Server{runtime: runtime}
<add>
<add> config, _, _, err := ParseRun([]string{GetTestImage(runtime).ID, "/bin/cat"}, nil)
<add> if err != nil {
<add> t.Fatal(err)
<add> }
<add>
<add> id, err := srv.ContainerCreate(config)
<add> if err != nil {
<add> t.Fatal(err)
<add> }
<add>
<add> if _, err := srv.ContainerCommit(id, "testrepo", "testtag", "", "", config); err != nil {
<add> t.Fatal(err)
<add> }
<add>}
<add>
<ide> func TestCreateStartRestartStopStartKillRm(t *testing.T) {
<ide> runtime := mkRuntime(t)
<ide> defer nuke(runtime)
<ide><path>utils/utils.go
<ide> type JSONMessage struct {
<ide> Status string `json:"status,omitempty"`
<ide> Progress string `json:"progress,omitempty"`
<ide> Error string `json:"error,omitempty"`
<del> ID string `json:"id,omitempty"`
<del> Time int64 `json:"time,omitempty"`
<add> ID string `json:"id,omitempty"`
<add> Time int64 `json:"time,omitempty"`
<ide> }
<ide>
<del>func (jm *JSONMessage) Display(out io.Writer) (error) {
<add>func (jm *JSONMessage) Display(out io.Writer) error {
<ide> if jm.Time != 0 {
<ide> fmt.Fprintf(out, "[%s] ", time.Unix(jm.Time, 0))
<ide> }
<ide> func (jm *JSONMessage) Display(out io.Writer) (error) {
<ide> return nil
<ide> }
<ide>
<del>
<ide> type StreamFormatter struct {
<ide> json bool
<ide> used bool | 2 |
Javascript | Javascript | replace action for replacereducers | e6f6c7da7b39ed46273d05d150cf1f578973ac3c | <ide><path>src/combineReducers.js
<ide> function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, une
<ide> unexpectedKeyCache[key] = true
<ide> })
<ide>
<add> if (action && action.type === ActionTypes.REPLACE) return
<add>
<ide> if (unexpectedKeys.length > 0) {
<ide> return (
<ide> `Unexpected ${unexpectedKeys.length > 1 ? 'keys' : 'key'} ` +
<ide><path>src/createStore.js
<ide> export default function createStore(reducer, preloadedState, enhancer) {
<ide> }
<ide>
<ide> currentReducer = nextReducer
<del> dispatch({ type: ActionTypes.INIT })
<add> dispatch({ type: ActionTypes.REPLACE })
<ide> }
<ide>
<ide> /**
<ide><path>src/utils/actionTypes.js
<ide> * If the current state is undefined, you must return the initial state.
<ide> * Do not reference these action types directly in your code.
<ide> */
<del>var ActionTypes = {
<del> INIT: '@@redux/INIT'
<add>const ActionTypes = {
<add> INIT: '@@redux/INIT' + Math.random().toString(36).substring(7).split('').join('.'),
<add> REPLACE: '@@redux/REPLACE' + Math.random().toString(36).substring(7).split('').join('.')
<ide> }
<ide>
<ide> export default ActionTypes
<ide><path>test/createStore.spec.js
<ide> describe('createStore', () => {
<ide> expect(results).toEqual([ { foo: 0, bar: 0, fromRx: true }, { foo: 1, bar: 0, fromRx: true } ])
<ide> })
<ide> })
<add>
<add> it('does not log an error if parts of the current state will be ignored by a nextReducer using combineReducers', () => {
<add> const originalConsoleError = console.error
<add> console.error = jest.fn()
<add>
<add> const store = createStore(
<add> combineReducers({
<add> x: (s=0, a) => s,
<add> y: combineReducers({
<add> z: (s=0, a) => s,
<add> w: (s=0, a) => s,
<add> }),
<add> })
<add> )
<add>
<add> store.replaceReducer(
<add> combineReducers({
<add> y: combineReducers({
<add> z: (s=0, a) => s,
<add> }),
<add> })
<add> )
<add>
<add> expect(console.error.mock.calls.length).toBe(0)
<add> console.error = originalConsoleError
<add> })
<ide> }) | 4 |
Ruby | Ruby | pass relative paths into link exceptions | 07e00061a7b8b4c831f6d94e6ee4fbb9804e7723 | <ide><path>Library/Homebrew/keg.rb
<ide> def suggestion
<ide>
<ide> def to_s
<ide> s = []
<del> s << "Could not symlink #{src.relative_path_from(Pathname(keg))}"
<add> s << "Could not symlink #{src}"
<ide> s << "Target #{dst}" << suggestion
<ide> s << <<-EOS.undent
<ide> To force the link and overwrite all conflicting files:
<ide> def to_s
<ide>
<ide> class DirectoryNotWritableError < LinkError
<ide> def to_s; <<-EOS.undent
<del> Could not symlink #{src.relative_path_from(Pathname(keg))}
<add> Could not symlink #{src}
<ide> #{dst.dirname} is not writable.
<ide> EOS
<ide> end
<ide> def make_relative_symlink dst, src, mode
<ide> dst.make_relative_symlink(src)
<ide> rescue Errno::EEXIST
<ide> if dst.exist?
<del> raise ConflictError.new(self, src, dst)
<add> raise ConflictError.new(self, src.relative_path_from(path), dst)
<ide> elsif dst.symlink?
<ide> dst.unlink
<ide> retry
<ide> end
<ide> rescue Errno::EACCES
<del> raise DirectoryNotWritableError.new(self, src, dst)
<add> raise DirectoryNotWritableError.new(self, src.relative_path_from(path), dst)
<ide> rescue SystemCallError
<del> raise LinkError.new(self, src, dst)
<add> raise LinkError.new(self, src.relative_path_from(path), dst)
<ide> end
<ide>
<ide> protected | 1 |
Python | Python | use rsync instead of mv | 955c65ffea49bac9357794024cadb9ac5310eaca | <ide><path>pavement.py
<ide> def clean_docs(options):
<ide>
<ide>
<ide> @task
<del>@needs("clean_docs", "paver.doctools.html")
<add>@needs("paver.doctools.html")
<ide> def html(options):
<ide> destdir = path("Documentation")
<del> destdir.rmtree()
<ide> builtdocs = sphinx_builddir(options)
<del> builtdocs.move(destdir)
<add> sh("rsync -az %s/ %s" % (builtdocs, destdir))
<ide>
<ide>
<ide> @task | 1 |
Text | Text | put semver-minor on pre-load module fix 2.2.0 | 5d83401086e40fb51b2017d3b6edd7d83c6bd484 | <ide><path>CHANGELOG.md
<ide> See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and curren
<ide> * [[`1bbf8d0720`](https://github.com/nodejs/io.js/commit/1bbf8d0720)] - **lib**: speed up require(), phase 2 (Ben Noordhuis) [#1801](https://github.com/nodejs/io.js/pull/1801)
<ide> * [[`b14fd1a720`](https://github.com/nodejs/io.js/commit/b14fd1a720)] - **lib**: speed up require(), phase 1 (Ben Noordhuis) [#1801](https://github.com/nodejs/io.js/pull/1801)
<ide> * [[`5abd4ac079`](https://github.com/nodejs/io.js/commit/5abd4ac079)] - **lib**: simplify nextTick() usage (Brian White) [#1612](https://github.com/nodejs/io.js/pull/1612)
<del>* [[`5759722cfa`](https://github.com/nodejs/io.js/commit/5759722cfa)] - **src**: fix module search path for preload modules (Ali Ijaz Sheikh) [#1812](https://github.com/nodejs/io.js/pull/1812)
<add>* [[`5759722cfa`](https://github.com/nodejs/io.js/commit/5759722cfa)] - **(SEMVER-MINOR)** **src**: fix module search path for preload modules (Ali Ijaz Sheikh) [#1812](https://github.com/nodejs/io.js/pull/1812)
<ide> * [[`a65762cab6`](https://github.com/nodejs/io.js/commit/a65762cab6)] - **src**: remove old code (Brendan Ashworth) [#1819](https://github.com/nodejs/io.js/pull/1819)
<ide> * [[`93a44d5228`](https://github.com/nodejs/io.js/commit/93a44d5228)] - **src**: fix deferred events not working with -e (Ben Noordhuis) [#1793](https://github.com/nodejs/io.js/pull/1793)
<ide> * [[`8059393934`](https://github.com/nodejs/io.js/commit/8059393934)] - **test**: check error type from net.Server.listen() (Rich Trott) [#1821](https://github.com/nodejs/io.js/pull/1821) | 1 |
PHP | PHP | remove additional comma | d338d13eec3ae899250ef4685fbeb85a198f7d2d | <ide><path>src/Illuminate/View/Concerns/ManagesComponents.php
<ide> protected function componentData()
<ide> $this->componentData[count($this->componentStack)],
<ide> ['slot' => $defaultSlot],
<ide> $this->slots[count($this->componentStack)],
<del> ['__laravel_slots' => $slots],
<add> ['__laravel_slots' => $slots]
<ide> );
<ide> }
<ide> | 1 |
Go | Go | fix error in pushimage | 5690562fc855a7e813a7e3cfb3340f60bd626530 | <ide><path>registry.go
<ide> func pushImageRec(graph *Graph, stdout io.Writer, img *Image, registry string, t
<ide> if res.StatusCode != 200 {
<ide> errBody, err := ioutil.ReadAll(res.Body)
<ide> if err != nil {
<del> errBody = []byte(err.Error())
<add> return fmt.Errorf("HTTP code %d while uploading metadata and error when"+
<add> " trying to parse response body: %v", res.StatusCode, err)
<ide> }
<ide> var jsonBody map[string]string
<ide> if err := json.Unmarshal(errBody, &jsonBody); err != nil { | 1 |
Javascript | Javascript | use ticks consistently | dbd835f4f33d99395ef5951edb4deef1e2df49e0 | <ide><path>src/controllers/controller.bar.js
<ide> function computeMinSampleSize(scale, pixels) {
<ide> min = Math.min(min, Math.abs(pixels[i] - pixels[i - 1]));
<ide> }
<ide>
<del> for (i = 0, ilen = scale.getTicks().length; i < ilen; ++i) {
<add> for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {
<ide> curr = scale.getPixelForTick(i);
<ide> min = i > 0 ? Math.min(min, Math.abs(curr - prev)) : min;
<ide> prev = curr;
<ide><path>src/scales/scale.category.js
<ide> class CategoryScale extends Scale {
<ide> if (index < 0 || index > ticks.length - 1) {
<ide> return null;
<ide> }
<del> return this.getPixelForValue(index * me._numLabels / ticks.length + this.min);
<add> return me.getPixelForValue(index * me._numLabels / ticks.length + me.min);
<ide> }
<ide>
<ide> getValueForPixel(pixel) {
<ide><path>src/scales/scale.linear.js
<ide> class LinearScale extends LinearScaleBase {
<ide> }
<ide>
<ide> getPixelForTick(index) {
<del> var ticks = this._tickValues;
<add> const ticks = this.ticks;
<ide> if (index < 0 || index > ticks.length - 1) {
<ide> return null;
<ide> }
<del> return this.getPixelForValue(ticks[index]);
<add> return this.getPixelForValue(ticks[index].value);
<ide> }
<ide> }
<ide>
<ide><path>src/scales/scale.linearbase.js
<ide> class LinearScaleBase extends Scale {
<ide> return ticks;
<ide> }
<ide>
<del> generateTickLabels(ticks) {
<del> var me = this;
<del> me._tickValues = ticks.map(t => t.value);
<del> Scale.prototype.generateTickLabels.call(me, ticks);
<del> }
<del>
<ide> _configure() {
<ide> var me = this;
<del> var ticks = me.getTicks();
<add> var ticks = me.ticks;
<ide> var start = me.min;
<ide> var end = me.max;
<ide> var offset;
<ide><path>src/scales/scale.radialLinear.js
<ide> class RadialLinearScale extends LinearScaleBase {
<ide> if (gridLineOpts.display) {
<ide> me.ticks.forEach(function(tick, index) {
<ide> if (index !== 0) {
<del> offset = me.getDistanceFromCenterForValue(me._tickValues[index]);
<add> offset = me.getDistanceFromCenterForValue(me.ticks[index].value);
<ide> drawRadiusLine(me, gridLineOpts, offset, index);
<ide> }
<ide> });
<ide> class RadialLinearScale extends LinearScaleBase {
<ide> return;
<ide> }
<ide>
<del> offset = me.getDistanceFromCenterForValue(me._tickValues[index]);
<add> offset = me.getDistanceFromCenterForValue(me.ticks[index].value);
<ide>
<ide> if (tickOpts.showLabelBackdrop) {
<ide> width = ctx.measureText(tick.label).width;
<ide><path>src/scales/scale.time.js
<ide> class TimeScale extends Scale {
<ide> }
<ide>
<ide> getPixelForTick(index) {
<del> const ticks = this.getTicks();
<del> return index >= 0 && index < ticks.length ?
<del> this.getPixelForValue(ticks[index].value) :
<del> null;
<add> const ticks = this.ticks;
<add> if (index < 0 || index > ticks.length - 1) {
<add> return null;
<add> }
<add> return this.getPixelForValue(ticks[index].value);
<ide> }
<ide>
<ide> getValueForPixel(pixel) { | 6 |
Javascript | Javascript | fix challenge ga time completion | 154ae0e4893d44f21a21571d1d7f1cc6fdbd035f | <ide><path>client/commonFramework/show-completion.js
<ide> window.common = (function(global) {
<ide> } = global;
<ide>
<ide> common.showCompletion = function showCompletion() {
<del> var time = Math.floor(Date.now() - window.started);
<add> var time = Math.floor(Date.now() - common.started);
<ide>
<ide> ga(
<ide> 'send', | 1 |
Javascript | Javascript | eliminate jest log spew | 36bbd8fa31eceabf0fbf52b8daccc848e9c5830c | <ide><path>Libraries/Components/TextInput/__tests__/TextInput-test.js
<ide> describe('TextInput tests', () => {
<ide> TextInput.State.focusTextInput(textInputRef.current);
<ide> expect(textInputRef.current.isFocused()).toBe(true);
<ide> expect(TextInput.State.currentlyFocusedInput()).toBe(textInputRef.current);
<del> // This function is currently deprecated and will be removed in the future
<del> expect(TextInput.State.currentlyFocusedField()).toBe(
<del> ReactNative.findNodeHandle(textInputRef.current),
<del> );
<add>
<ide> TextInput.State.blurTextInput(textInputRef.current);
<ide> expect(textInputRef.current.isFocused()).toBe(false);
<ide> expect(TextInput.State.currentlyFocusedInput()).toBe(null);
<del> // This function is currently deprecated and will be removed in the future
<del> expect(TextInput.State.currentlyFocusedField()).toBe(null);
<ide> });
<ide>
<ide> it('should unfocus when other TextInput is focused', () => {
<ide> describe('TextInput tests', () => {
<ide> expect(textInputRe1.current.isFocused()).toBe(false);
<ide> expect(textInputRe2.current.isFocused()).toBe(false);
<ide>
<del> const inputTag1 = ReactNative.findNodeHandle(textInputRe1.current);
<del> const inputTag2 = ReactNative.findNodeHandle(textInputRe2.current);
<del>
<ide> TextInput.State.focusTextInput(textInputRe1.current);
<ide>
<ide> expect(textInputRe1.current.isFocused()).toBe(true);
<ide> expect(textInputRe2.current.isFocused()).toBe(false);
<ide> expect(TextInput.State.currentlyFocusedInput()).toBe(textInputRe1.current);
<del> // This function is currently deprecated and will be removed in the future
<del> expect(TextInput.State.currentlyFocusedField()).toBe(inputTag1);
<ide>
<ide> TextInput.State.focusTextInput(textInputRe2.current);
<ide>
<ide> expect(textInputRe1.current.isFocused()).toBe(false);
<ide> expect(textInputRe2.current.isFocused()).toBe(true);
<ide> expect(TextInput.State.currentlyFocusedInput()).toBe(textInputRe2.current);
<del> // This function is currently deprecated and will be removed in the future
<del> expect(TextInput.State.currentlyFocusedField()).toBe(inputTag2);
<ide> });
<ide>
<ide> it('should render as expected', () => {
<ide><path>Libraries/Core/Timers/__tests__/JSTimers-test.js
<ide> const JSTimers = require('../JSTimers');
<ide>
<ide> describe('JSTimers', function () {
<ide> beforeEach(function () {
<del> jest.spyOn(console, 'warn');
<add> jest.spyOn(console, 'warn').mockReturnValue(undefined);
<ide> global.setTimeout = JSTimers.setTimeout;
<ide> });
<ide>
<ide><path>Libraries/Image/__tests__/AssetUtils-test.js
<ide> describe('AssetUtils', () => {
<ide> });
<ide>
<ide> it('should return empty string and warn once if no cacheBreaker set (DEV)', () => {
<del> const mockWarn = jest.spyOn(console, 'warn');
<add> const mockWarn = jest.spyOn(console, 'warn').mockReturnValue(undefined);
<ide> global.__DEV__ = true;
<ide> expect(getUrlCacheBreaker()).toEqual('');
<ide> expect(getUrlCacheBreaker()).toEqual('');
<ide><path>Libraries/Lists/__tests__/VirtualizedList-test.js
<ide> describe('VirtualizedList', () => {
<ide> const layout = {width: 300, height: 600};
<ide> let data = Array(20)
<ide> .fill()
<del> .map((_, key) => ({key: String(key)}));
<add> .map((_, index) => ({key: `key-${index}`}));
<ide> const onEndReached = jest.fn();
<ide> const props = {
<ide> data,
<ide><path>Libraries/LogBox/__tests__/LogBox-test.js
<ide> function mockFilterResult(returnValues) {
<ide> }
<ide>
<ide> describe('LogBox', () => {
<del> const {error, warn} = console;
<del> let consoleError;
<del> let consoleWarn;
<add> const {error, log, warn} = console;
<ide>
<ide> beforeEach(() => {
<ide> jest.resetModules();
<del> console.error = consoleError = jest.fn();
<del> console.warn = consoleWarn = jest.fn();
<add> console.error = jest.fn();
<add> console.log = jest.fn();
<add> console.warn = jest.fn();
<ide> console.disableYellowBox = false;
<ide> });
<ide>
<ide> afterEach(() => {
<ide> LogBox.uninstall();
<ide> console.error = error;
<add> console.log = log;
<ide> console.warn = warn;
<ide> });
<ide>
<ide> describe('LogBox', () => {
<ide> });
<ide>
<ide> it('preserves decorations of console.error after installing/uninstalling', () => {
<add> const consoleError = console.error;
<add>
<ide> LogBox.install();
<ide>
<ide> const originalConsoleError = console.error;
<ide> describe('LogBox', () => {
<ide> });
<ide>
<ide> it('preserves decorations of console.warn after installing/uninstalling', () => {
<add> const consoleWarn = console.warn;
<add>
<ide> LogBox.install();
<ide>
<ide> const originalConsoleWarn = console.warn;
<ide><path>jest/mockNativeComponent.js
<ide>
<ide> const React = require('react');
<ide>
<add>let nativeTag = 1;
<add>
<ide> module.exports = viewName => {
<ide> const Component = class extends React.Component {
<add> _nativeTag = nativeTag++;
<add>
<ide> render() {
<ide> return React.createElement(viewName, this.props, this.props.children);
<ide> } | 6 |
Javascript | Javascript | fix modal dialog test for showing controls | 45a6b3010df2a551146ae534322dec3e1b3714b0 | <ide><path>test/unit/modal-dialog.test.js
<ide> QUnit.test('open() does not pause, close() does not play() with pauseOnOpen set
<ide> });
<ide>
<ide> QUnit.test('open() hides controls, close() shows controls', function(assert) {
<add> this.player.controls(true);
<ide> this.modal.open();
<ide>
<ide> assert.expect(2);
<ide> QUnit.test('open() hides controls, close() shows controls', function(assert) {
<ide> assert.ok(this.player.controls_, 'controls are no longer hidden');
<ide> });
<ide>
<add>QUnit.test('open() hides controls, close() does not show controls if previously hidden', function(assert) {
<add> this.player.controls(false);
<add> this.modal.open();
<add>
<add> assert.expect(2);
<add> assert.notOk(this.player.controls_, 'controls are hidden');
<add>
<add> this.modal.close();
<add> assert.notOk(this.player.controls_, 'controls are still hidden');
<add>});
<add>
<ide> QUnit.test('opened()', function(assert) {
<ide> const openSpy = sinon.spy();
<ide> const closeSpy = sinon.spy(); | 1 |
Javascript | Javascript | convert snapshot phase to depth-first traversal | 2a646f73e4f64000fcd1a483cec1c08614f20e9c | <ide><path>packages/react-reconciler/src/ReactFiberCommitWork.new.js
<ide> import {
<ide> Hydrating,
<ide> HydratingAndUpdate,
<ide> Passive,
<add> BeforeMutationMask,
<ide> MutationMask,
<del> PassiveMask,
<ide> LayoutMask,
<add> PassiveMask,
<ide> PassiveUnmountPendingDev,
<ide> } from './ReactFiberFlags';
<ide> import getComponentName from 'shared/getComponentName';
<ide> import {
<ide> commitHydratedSuspenseInstance,
<ide> clearContainer,
<ide> prepareScopeUpdate,
<add> prepareForCommit,
<add> beforeActiveInstanceBlur,
<ide> } from './ReactFiberHostConfig';
<ide> import {
<ide> captureCommitPhaseError,
<ide> import {
<ide> Passive as HookPassive,
<ide> } from './ReactHookEffectTags';
<ide> import {didWarnAboutReassigningProps} from './ReactFiberBeginWork.new';
<add>import {doesFiberContain} from './ReactFiberTreeReflection';
<ide>
<ide> let didWarnAboutUndefinedSnapshotBeforeUpdate: Set<mixed> | null = null;
<ide> if (__DEV__) {
<ide> function safelyCallDestroy(current: Fiber, destroy: () => void) {
<ide> }
<ide> }
<ide>
<del>function commitBeforeMutationLifeCycles(
<del> current: Fiber | null,
<del> finishedWork: Fiber,
<del>): void {
<del> switch (finishedWork.tag) {
<del> case FunctionComponent:
<del> case ForwardRef:
<del> case SimpleMemoComponent: {
<add>let focusedInstanceHandle: null | Fiber = null;
<add>let shouldFireAfterActiveInstanceBlur: boolean = false;
<add>
<add>export function commitBeforeMutationEffects(
<add> root: FiberRoot,
<add> firstChild: Fiber,
<add>) {
<add> focusedInstanceHandle = prepareForCommit(root.containerInfo);
<add>
<add> nextEffect = firstChild;
<add> commitBeforeMutationEffects_begin();
<add>
<add> // We no longer need to track the active instance fiber
<add> const shouldFire = shouldFireAfterActiveInstanceBlur;
<add> shouldFireAfterActiveInstanceBlur = false;
<add> focusedInstanceHandle = null;
<add>
<add> return shouldFire;
<add>}
<add>
<add>function commitBeforeMutationEffects_begin() {
<add> while (nextEffect !== null) {
<add> const fiber = nextEffect;
<add>
<add> // TODO: Should wrap this in flags check, too, as optimization
<add> const deletions = fiber.deletions;
<add> if (deletions !== null) {
<add> for (let i = 0; i < deletions.length; i++) {
<add> const deletion = deletions[i];
<add> commitBeforeMutationEffectsDeletion(deletion);
<add> }
<add> }
<add>
<add> const child = fiber.child;
<add> if (
<add> (fiber.subtreeFlags & BeforeMutationMask) !== NoFlags &&
<add> child !== null
<add> ) {
<add> ensureCorrectReturnPointer(child, fiber);
<add> nextEffect = child;
<add> } else {
<add> commitBeforeMutationEffects_complete();
<add> }
<add> }
<add>}
<add>
<add>function commitBeforeMutationEffects_complete() {
<add> while (nextEffect !== null) {
<add> const fiber = nextEffect;
<add> if (__DEV__) {
<add> setCurrentDebugFiberInDEV(fiber);
<add> invokeGuardedCallback(
<add> null,
<add> commitBeforeMutationEffectsOnFiber,
<add> null,
<add> fiber,
<add> );
<add> if (hasCaughtError()) {
<add> const error = clearCaughtError();
<add> captureCommitPhaseError(fiber, error);
<add> }
<add> resetCurrentDebugFiberInDEV();
<add> } else {
<add> try {
<add> commitBeforeMutationEffectsOnFiber(fiber);
<add> } catch (error) {
<add> captureCommitPhaseError(fiber, error);
<add> }
<add> }
<add>
<add> const sibling = fiber.sibling;
<add> if (sibling !== null) {
<add> ensureCorrectReturnPointer(sibling, fiber.return);
<add> nextEffect = sibling;
<ide> return;
<ide> }
<del> case ClassComponent: {
<del> if (finishedWork.flags & Snapshot) {
<add>
<add> nextEffect = fiber.return;
<add> }
<add>}
<add>
<add>function commitBeforeMutationEffectsOnFiber(finishedWork: Fiber) {
<add> const current = finishedWork.alternate;
<add> const flags = finishedWork.flags;
<add>
<add> if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {
<add> // Check to see if the focused element was inside of a hidden (Suspense) subtree.
<add> // TODO: Move this out of the hot path using a dedicated effect tag.
<add> if (
<add> finishedWork.tag === SuspenseComponent &&
<add> isSuspenseBoundaryBeingHidden(current, finishedWork) &&
<add> doesFiberContain(finishedWork, focusedInstanceHandle)
<add> ) {
<add> shouldFireAfterActiveInstanceBlur = true;
<add> beforeActiveInstanceBlur(finishedWork);
<add> }
<add> }
<add>
<add> if ((flags & Snapshot) !== NoFlags) {
<add> setCurrentDebugFiberInDEV(finishedWork);
<add>
<add> switch (finishedWork.tag) {
<add> case FunctionComponent:
<add> case ForwardRef:
<add> case SimpleMemoComponent: {
<add> break;
<add> }
<add> case ClassComponent: {
<ide> if (current !== null) {
<ide> const prevProps = current.memoizedProps;
<ide> const prevState = current.memoizedState;
<ide> function commitBeforeMutationLifeCycles(
<ide> }
<ide> instance.__reactInternalSnapshotBeforeUpdate = snapshot;
<ide> }
<add> break;
<ide> }
<del> return;
<del> }
<del> case HostRoot: {
<del> if (supportsMutation) {
<del> if (finishedWork.flags & Snapshot) {
<add> case HostRoot: {
<add> if (supportsMutation) {
<ide> const root = finishedWork.stateNode;
<ide> clearContainer(root.containerInfo);
<ide> }
<add> break;
<add> }
<add> case HostComponent:
<add> case HostText:
<add> case HostPortal:
<add> case IncompleteClassComponent:
<add> // Nothing to do for these component types
<add> break;
<add> default: {
<add> invariant(
<add> false,
<add> 'This unit of work tag should not have side-effects. This error is ' +
<add> 'likely caused by a bug in React. Please file an issue.',
<add> );
<ide> }
<del> return;
<ide> }
<del> case HostComponent:
<del> case HostText:
<del> case HostPortal:
<del> case IncompleteClassComponent:
<del> // Nothing to do for these component types
<del> return;
<add>
<add> resetCurrentDebugFiberInDEV();
<add> }
<add>}
<add>
<add>function commitBeforeMutationEffectsDeletion(deletion: Fiber) {
<add> // TODO (effects) It would be nice to avoid calling doesFiberContain()
<add> // Maybe we can repurpose one of the subtreeFlags positions for this instead?
<add> // Use it to store which part of the tree the focused instance is in?
<add> // This assumes we can safely determine that instance during the "render" phase.
<add> if (doesFiberContain(deletion, ((focusedInstanceHandle: any): Fiber))) {
<add> shouldFireAfterActiveInstanceBlur = true;
<add> beforeActiveInstanceBlur(deletion);
<ide> }
<del> invariant(
<del> false,
<del> 'This unit of work tag should not have side-effects. This error is ' +
<del> 'likely caused by a bug in React. Please file an issue.',
<del> );
<ide> }
<ide>
<ide> function commitHookEffectListUnmount(flags: HookFlags, finishedWork: Fiber) {
<ide> function ensureCorrectReturnPointer(fiber, expectedReturnFiber) {
<ide> }
<ide>
<ide> export {
<del> commitBeforeMutationLifeCycles,
<ide> commitResetTextContent,
<ide> commitPlacement,
<ide> commitDeletion,
<ide><path>packages/react-reconciler/src/ReactFiberFlags.js
<ide> export const MountPassiveDev = /* */ 0b10000000000000000000;
<ide> // don't contain effects, by checking subtreeFlags.
<ide>
<ide> export const BeforeMutationMask =
<add> // TODO: Remove Update flag from before mutation phase by re-landing Visiblity
<add> // flag logic (see #20043)
<add> Update |
<ide> Snapshot |
<ide> (enableCreateEventHandleAPI
<ide> ? // createEventHandle needs to visit deleted and hidden trees to
<ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.new.js
<ide> import * as Scheduler from 'scheduler';
<ide> import {__interactionsRef, __subscriberRef} from 'scheduler/tracing';
<ide>
<ide> import {
<del> prepareForCommit,
<ide> resetAfterCommit,
<ide> scheduleTimeout,
<ide> cancelTimeout,
<ide> noTimeout,
<ide> warnsIfNotActing,
<del> beforeActiveInstanceBlur,
<ide> afterActiveInstanceBlur,
<ide> clearContainer,
<ide> } from './ReactFiberHostConfig';
<ide> import {
<ide> NoFlags,
<ide> PerformedWork,
<ide> Placement,
<del> Deletion,
<ide> ChildDeletion,
<del> Snapshot,
<ide> Passive,
<ide> PassiveStatic,
<ide> Incomplete,
<ide> import {
<ide> createClassErrorUpdate,
<ide> } from './ReactFiberThrow.new';
<ide> import {
<del> commitBeforeMutationLifeCycles as commitBeforeMutationEffectOnFiber,
<add> commitBeforeMutationEffects,
<ide> commitLayoutEffects,
<ide> commitMutationEffects,
<ide> commitPassiveEffectDurations,
<del> isSuspenseBoundaryBeingHidden,
<ide> commitPassiveMountEffects,
<ide> commitPassiveUnmountEffects,
<ide> detachFiberAfterEffects,
<ide> import {onCommitRoot as onCommitRootTestSelector} from './ReactTestSelectors';
<ide>
<ide> // Used by `act`
<ide> import enqueueTask from 'shared/enqueueTask';
<del>import {doesFiberContain} from './ReactFiberTreeReflection';
<ide>
<ide> const ceil = Math.ceil;
<ide>
<ide> let currentEventPendingLanes: Lanes = NoLanes;
<ide> // We warn about state updates for unmounted components differently in this case.
<ide> let isFlushingPassiveEffects = false;
<ide>
<del>let focusedInstanceHandle: null | Fiber = null;
<del>let shouldFireAfterActiveInstanceBlur: boolean = false;
<del>
<ide> export function getWorkInProgressRoot(): FiberRoot | null {
<ide> return workInProgressRoot;
<ide> }
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> firstEffect = finishedWork.firstEffect;
<ide> }
<ide>
<add> // If there are pending passive effects, schedule a callback to process them.
<add> // Do this as early as possible, so it is queued before anything else that
<add> // might get scheduled in the commit phase. (See #16714.)
<add> // TODO: Delete all other places that schedule the passive effect callback
<add> // They're redundant.
<add> if (
<add> (finishedWork.subtreeFlags & Passive) !== NoFlags ||
<add> (finishedWork.flags & Passive) !== NoFlags
<add> ) {
<add> if (!rootDoesHavePassiveEffects) {
<add> rootDoesHavePassiveEffects = true;
<add> scheduleCallback(NormalSchedulerPriority, () => {
<add> flushPassiveEffects();
<add> return null;
<add> });
<add> }
<add> }
<add>
<ide> if (firstEffect !== null) {
<ide> let previousLanePriority;
<ide> if (decoupleUpdatePriorityFromScheduler) {
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> // The first phase a "before mutation" phase. We use this phase to read the
<ide> // state of the host tree right before we mutate it. This is where
<ide> // getSnapshotBeforeUpdate is called.
<del> focusedInstanceHandle = prepareForCommit(root.containerInfo);
<del> shouldFireAfterActiveInstanceBlur = false;
<del>
<del> nextEffect = firstEffect;
<del> do {
<del> if (__DEV__) {
<del> invokeGuardedCallback(null, commitBeforeMutationEffects, null);
<del> if (hasCaughtError()) {
<del> invariant(nextEffect !== null, 'Should be working on an effect.');
<del> const error = clearCaughtError();
<del> captureCommitPhaseError(nextEffect, error);
<del> nextEffect = nextEffect.nextEffect;
<del> }
<del> } else {
<del> try {
<del> commitBeforeMutationEffects();
<del> } catch (error) {
<del> invariant(nextEffect !== null, 'Should be working on an effect.');
<del> captureCommitPhaseError(nextEffect, error);
<del> nextEffect = nextEffect.nextEffect;
<del> }
<del> }
<del> } while (nextEffect !== null);
<del>
<del> // We no longer need to track the active instance fiber
<del> focusedInstanceHandle = null;
<add> const shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects(
<add> root,
<add> finishedWork,
<add> );
<ide>
<ide> if (enableProfilerTimer) {
<ide> // Mark the current commit time to be shared by all Profilers in this
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> return null;
<ide> }
<ide>
<del>function commitBeforeMutationEffects() {
<del> while (nextEffect !== null) {
<del> const current = nextEffect.alternate;
<del>
<del> if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {
<del> if ((nextEffect.flags & Deletion) !== NoFlags) {
<del> if (doesFiberContain(nextEffect, focusedInstanceHandle)) {
<del> shouldFireAfterActiveInstanceBlur = true;
<del> beforeActiveInstanceBlur(nextEffect);
<del> }
<del> } else {
<del> // TODO: Move this out of the hot path using a dedicated effect tag.
<del> if (
<del> nextEffect.tag === SuspenseComponent &&
<del> isSuspenseBoundaryBeingHidden(current, nextEffect) &&
<del> doesFiberContain(nextEffect, focusedInstanceHandle)
<del> ) {
<del> shouldFireAfterActiveInstanceBlur = true;
<del> beforeActiveInstanceBlur(nextEffect);
<del> }
<del> }
<del> }
<del>
<del> const flags = nextEffect.flags;
<del> if ((flags & Snapshot) !== NoFlags) {
<del> setCurrentDebugFiberInDEV(nextEffect);
<del>
<del> commitBeforeMutationEffectOnFiber(current, nextEffect);
<del>
<del> resetCurrentDebugFiberInDEV();
<del> }
<del> if ((flags & Passive) !== NoFlags) {
<del> // If there are passive effects, schedule a callback to flush at
<del> // the earliest opportunity.
<del> if (!rootDoesHavePassiveEffects) {
<del> rootDoesHavePassiveEffects = true;
<del> scheduleCallback(NormalSchedulerPriority, () => {
<del> flushPassiveEffects();
<del> return null;
<del> });
<del> }
<del> }
<del> nextEffect = nextEffect.nextEffect;
<del> }
<del>}
<del>
<ide> export function flushPassiveEffects(): boolean {
<ide> // Returns whether passive effects were flushed.
<ide> if (pendingPassiveEffectsRenderPriority !== NoSchedulerPriority) { | 3 |
Ruby | Ruby | add descriptive comment | 5b576af97efe7ff5375572ad325b18429e9a75a8 | <ide><path>actionview/lib/action_view/helpers/asset_url_helper.rb
<ide> def asset_path(source, options = {})
<ide> def public_asset_path(source, options = {})
<ide> path_to_asset(source, {public_folder: true}.merge!(options))
<ide> end
<del> alias_method :path_to_public_asset, :public_asset_path
<add> alias_method :path_to_public_asset, :public_asset_path # aliased to avoid conflicts with an font_path named route
<ide>
<ide> # Computes the full URL to an asset in the public directory. This
<ide> # will use +asset_path+ internally, so most of their behaviors
<ide> def javascript_path(source, options = {})
<ide> def public_javascript_path(source, options = {})
<ide> path_to_javascript(source, {public_folder: true}.merge!(options))
<ide> end
<del> alias_method :path_to_public_javascript, :public_javascript_path
<add> alias_method :path_to_public_javascript, :public_javascript_path # aliased to avoid conflicts with an font_path named route
<ide>
<ide> # Computes the full URL to a JavaScript asset in the public javascripts directory.
<ide> # This will use +javascript_path+ internally, so most of their behaviors will be the same.
<ide> def stylesheet_path(source, options = {})
<ide> def public_stylesheet_path(source, options)
<ide> path_to_stylesheet(source, {public_folder: true}.merge!(options))
<ide> end
<del> alias_method :path_to_public_stylesheet, :public_stylesheet_path
<add> alias_method :path_to_public_stylesheet, :public_stylesheet_path # aliased to avoid conflicts with an font_path named route
<ide>
<ide> # Computes the full URL to a stylesheet asset in the public stylesheets directory.
<ide> # This will use +stylesheet_path+ internally, so most of their behaviors will be the same.
<ide> def image_path(source, options = {})
<ide> def public_image_path(source, options)
<ide> path_to_image(source, {public_folder: true}.merge!(options))
<ide> end
<del> alias_method :path_to_public_image, :public_image_path
<add> alias_method :path_to_public_image, :public_image_path # aliased to avoid conflicts with an font_path named route
<ide>
<ide> # Computes the full URL to an image asset.
<ide> # This will use +image_path+ internally, so most of their behaviors will be the same.
<ide> def video_path(source, options = {})
<ide> def public_video_path(source, options)
<ide> path_to_video(source, {public_folder: true}.merge!(options))
<ide> end
<del> alias_method :path_to_public_video, :public_video_path
<add> alias_method :path_to_public_video, :public_video_path # aliased to avoid conflicts with an font_path named route
<ide>
<ide> # Computes the full URL to a video asset in the public videos directory.
<ide> # This will use +video_path+ internally, so most of their behaviors will be the same.
<ide> def audio_path(source, options = {})
<ide> def public_audio_path(source, options = {})
<ide> path_to_audio(source, {public_folder: true}.merge!(options))
<ide> end
<del> alias_method :path_to_public_audio, :public_audio_path
<add> alias_method :path_to_public_audio, :public_audio_path # aliased to avoid conflicts with an font_path named route
<ide>
<ide> # Computes the full URL to an audio asset in the public audios directory.
<ide> # This will use +audio_path+ internally, so most of their behaviors will be the same.
<ide> def font_path(source, options = {})
<ide> def public_font_path(source, options = {})
<ide> path_to_font(source, {public_folder: true}.merge!(options))
<ide> end
<del> alias_method :path_to_public_font, :public_font_path
<add> alias_method :path_to_public_font, :public_font_path # aliased to avoid conflicts with an font_path named route
<ide>
<ide> # Computes the full URL to a font asset.
<ide> # This will use +font_path+ internally, so most of their behaviors will be the same. | 1 |
Javascript | Javascript | support min/max values in validateinteger() | 4fc7cd9bc1093160ec0e40b626169134194a51e9 | <ide><path>lib/internal/validators.js
<ide> const {
<ide> isArrayBufferView
<ide> } = require('internal/util/types');
<ide> const { signals } = internalBinding('constants').os;
<add>const { MAX_SAFE_INTEGER, MIN_SAFE_INTEGER } = Number;
<ide>
<ide> function isInt32(value) {
<ide> return value === (value | 0);
<ide> function parseMode(value, name, def) {
<ide> throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc);
<ide> }
<ide>
<del>const validateInteger = hideStackFrames((value, name) => {
<del> if (typeof value !== 'number')
<del> throw new ERR_INVALID_ARG_TYPE(name, 'number', value);
<del> if (!Number.isSafeInteger(value))
<del> throw new ERR_OUT_OF_RANGE(name, 'an integer', value);
<del>});
<add>const validateInteger = hideStackFrames(
<add> (value, name, min = MIN_SAFE_INTEGER, max = MAX_SAFE_INTEGER) => {
<add> if (typeof value !== 'number')
<add> throw new ERR_INVALID_ARG_TYPE(name, 'number', value);
<add> if (!Number.isInteger(value))
<add> throw new ERR_OUT_OF_RANGE(name, 'an integer', value);
<add> if (value < min || value > max)
<add> throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);
<add> }
<add>);
<ide>
<ide> const validateInt32 = hideStackFrames(
<ide> (value, name, min = -2147483648, max = 2147483647) => { | 1 |
Python | Python | update spacy.load() and fix path checks | 7670c745b6370fafd29ccedcdcba875156ccd576 | <ide><path>spacy/__init__.py
<ide> # coding: utf8
<ide> from __future__ import unicode_literals
<ide>
<del>from pathlib import Path
<del>
<del>from .util import set_lang_class, get_lang_class, parse_package_meta
<add>from . import util
<ide> from .deprecated import resolve_model_name
<ide> from .cli import info
<ide>
<ide> from . import en, de, zh, es, it, hu, fr, pt, nl, sv, fi, bn, he
<ide>
<ide>
<del>set_lang_class(en.English.lang, en.English)
<del>set_lang_class(de.German.lang, de.German)
<del>set_lang_class(es.Spanish.lang, es.Spanish)
<del>set_lang_class(pt.Portuguese.lang, pt.Portuguese)
<del>set_lang_class(fr.French.lang, fr.French)
<del>set_lang_class(it.Italian.lang, it.Italian)
<del>set_lang_class(hu.Hungarian.lang, hu.Hungarian)
<del>set_lang_class(zh.Chinese.lang, zh.Chinese)
<del>set_lang_class(nl.Dutch.lang, nl.Dutch)
<del>set_lang_class(sv.Swedish.lang, sv.Swedish)
<del>set_lang_class(fi.Finnish.lang, fi.Finnish)
<del>set_lang_class(bn.Bengali.lang, bn.Bengali)
<del>set_lang_class(he.Hebrew.lang, he.Hebrew)
<add>_languages = (en.English, de.German, es.Spanish, pt.Portuguese, fr.French,
<add> it.Italian, hu.Hungarian, zh.Chinese, nl.Dutch, sv.Swedish,
<add> fi.Finnish, bn.Bengali, he.Hebrew)
<add>
<add>
<add>for _lang in _languages:
<add> util.set_lang_class(_lang.lang, _lang)
<ide>
<ide>
<ide> def load(name, **overrides):
<del> data_path = overrides.get('path', util.get_data_path())
<del> model_name = resolve_model_name(name)
<del> meta = parse_package_meta(data_path, model_name, require=False)
<add> if overrides.get('path') in (None, False, True):
<add> data_path = util.get_data_path()
<add> model_name = resolve_model_name(name)
<add> model_path = data_path / model_name
<add> if not model_path.exists():
<add> model_path = None
<add> util.print_msg(
<add> "Only loading the '{}' tokenizer.".format(name),
<add> title="Warning: no model found for '{}'".format(name))
<add> else:
<add> model_path = util.ensure_path(overrides['path'])
<add> data_path = model_path.parent
<add> meta = util.parse_package_meta(data_path, model_name, require=False)
<ide> lang = meta['lang'] if meta and 'lang' in meta else name
<del> cls = get_lang_class(lang)
<add> cls = util.get_lang_class(lang)
<ide> overrides['meta'] = meta
<del> model_path = Path(data_path / model_name)
<del> if model_path.exists():
<del> overrides['path'] = model_path
<del>
<add> overrides['path'] = model_path
<ide> return cls(**overrides) | 1 |
Ruby | Ruby | fix relation respond_to? and method_missing | 5fa497abf5b885187130e58aefcb1c3228295e3c | <ide><path>activerecord/lib/active_record/relation.rb
<ide> def conditions(conditions)
<ide> end
<ide>
<ide> def respond_to?(method)
<del> if @relation.respond_to?(method) || Array.instance_methods.include?(method.to_s)
<del> true
<del> else
<del> super
<del> end
<add> @relation.respond_to?(method) || Array.method_defined?(method) || super
<ide> end
<ide>
<ide> private
<ide> def method_missing(method, *args, &block)
<ide> if @relation.respond_to?(method)
<ide> @relation.send(method, *args, &block)
<del> elsif Array.instance_methods.include?(method.to_s)
<add> elsif Array.method_defined?(method)
<ide> to_a.send(method, *args, &block)
<add> else
<add> super
<ide> end
<ide> end
<ide> end | 1 |
Ruby | Ruby | remove another `blank?` call | e35225e938820544f7e5b29475c2f8cc4da5cb1a | <ide><path>actionpack/lib/action_dispatch/http/mime_type.rb
<ide> def ==(mime_type)
<ide> end
<ide>
<ide> def =~(mime_type)
<del> return false if mime_type.blank?
<add> return false unless mime_type
<ide> regexp = Regexp.new(Regexp.quote(mime_type.to_s))
<ide> (@synonyms + [ self ]).any? do |synonym|
<ide> synonym.to_s =~ regexp | 1 |
Python | Python | fix typo in fill_diagonal docstring | e7c15600e2c5e2b66a0e26f8511145c588166271 | <ide><path>numpy/lib/index_tricks.py
<ide> def __getitem__(self, item):
<ide> def fill_diagonal(a, val, wrap=False):
<ide> """Fill the main diagonal of the given array of any dimensionality.
<ide>
<del> For an array `a` with ``a.ndim > 2``, the diagonal is the list of
<del> locations with indices ``a[i, i, ..., i]`` all identical. This function
<add> For an array `a` with ``a.ndim >= 2``, the diagonal is the list of
<add> locations with indices ``a[i, ..., i]`` all identical. This function
<ide> modifies the input array in-place, it does not return a value.
<ide>
<ide> Parameters | 1 |
Text | Text | add links to faq and list of redux users | b43d6b5924bbe6bb81df5488917b09b45438cda0 | <ide><path>README.md
<ide> If you enjoyed my course, consider supporting Egghead by [buying a subscription]
<ide> * [Basics](http://redux.js.org/docs/basics/index.html)
<ide> * [Advanced](http://redux.js.org/docs/advanced/index.html)
<ide> * [Recipes](http://redux.js.org/docs/recipes/index.html)
<add>* [FAQ](http://redux.js.org/docs/FAQ.html)
<ide> * [Troubleshooting](http://redux.js.org/docs/Troubleshooting.html)
<ide> * [Glossary](http://redux.js.org/docs/Glossary.html)
<ide> * [API Reference](http://redux.js.org/docs/api/index.html)
<ide> Meet some of the outstanding companies that made it possible:
<ide> * [Webflow](https://github.com/webflow)
<ide> * [Ximedes](https://www.ximedes.com/)
<ide>
<del>[See the full list of Redux patrons.](PATRONS.md)
<add>[See the full list of Redux patrons.](PATRONS.md), as well as the always-growing list of [people and companies that use Redux](https://github.com/reactjs/redux/issues/310).
<ide>
<ide> ### License
<ide> | 1 |
Java | Java | use monoprocessor instead of fluxidentityprocessor | 7cf1ccc41540752a16e370b5dd353b94108ebf22 | <ide><path>spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java
<ide> import org.apache.commons.logging.Log;
<ide> import org.apache.commons.logging.LogFactory;
<ide> import org.reactivestreams.Publisher;
<del>import reactor.core.publisher.FluxIdentityProcessor;
<ide> import reactor.core.publisher.Mono;
<ide> import reactor.core.publisher.MonoProcessor;
<del>import reactor.core.publisher.Processors;
<ide> import reactor.core.scheduler.Scheduler;
<ide> import reactor.core.scheduler.Schedulers;
<ide> import reactor.netty.Connection;
<ide> public Publisher<Void> apply(NettyInbound inbound, NettyOutbound outbound) {
<ide> logger.debug("Connected to " + conn.address());
<ide> }
<ide> });
<del> FluxIdentityProcessor<Void> completion = Processors.more().multicastNoBackpressure();
<add> MonoProcessor<Void> completion = MonoProcessor.create();
<ide> TcpConnection<P> connection = new ReactorNettyTcpConnection<>(inbound, outbound, codec, completion);
<ide> scheduler.schedule(() -> this.connectionHandler.afterConnected(connection));
<ide>
<ide><path>spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpConnection.java
<ide> package org.springframework.messaging.tcp.reactor;
<ide>
<ide> import io.netty.buffer.ByteBuf;
<del>import reactor.core.publisher.FluxIdentityProcessor;
<ide> import reactor.core.publisher.Mono;
<add>import reactor.core.publisher.MonoProcessor;
<ide> import reactor.netty.NettyInbound;
<ide> import reactor.netty.NettyOutbound;
<ide>
<ide>
<ide> private final ReactorNettyCodec<P> codec;
<ide>
<del> private final FluxIdentityProcessor<Void> closeProcessor;
<add> private final MonoProcessor<Void> closeProcessor;
<ide>
<ide>
<ide> public ReactorNettyTcpConnection(NettyInbound inbound, NettyOutbound outbound,
<del> ReactorNettyCodec<P> codec, FluxIdentityProcessor<Void> closeProcessor) {
<add> ReactorNettyCodec<P> codec, MonoProcessor<Void> closeProcessor) {
<ide>
<ide> this.inbound = inbound;
<ide> this.outbound = outbound; | 2 |
Go | Go | do some cleanup on .dockerignore paths | c0f0f5c9887032c606750b645001829d9f14f47c | <ide><path>api/client/commands.go
<ide> func (cli *DockerCli) CmdBuild(args ...string) error {
<ide> return fmt.Errorf("Error reading .dockerignore: '%s'", err)
<ide> }
<ide> for _, pattern := range strings.Split(string(ignore), "\n") {
<add> pattern = strings.TrimSpace(pattern)
<add> if pattern == "" {
<add> continue
<add> }
<add> pattern = filepath.Clean(pattern)
<ide> ok, err := filepath.Match(pattern, "Dockerfile")
<ide> if err != nil {
<ide> return fmt.Errorf("Bad .dockerignore pattern: '%s', error: %s", pattern, err)
<ide><path>integration-cli/docker_cli_build_test.go
<ide> func TestBuildDockerignore(t *testing.T) {
<ide> logDone("build - test .dockerignore")
<ide> }
<ide>
<add>func TestBuildDockerignoreCleanPaths(t *testing.T) {
<add> name := "testbuilddockerignorecleanpaths"
<add> defer deleteImages(name)
<add> dockerfile := `
<add> FROM busybox
<add> ADD . /tmp/
<add> RUN (! ls /tmp/foo) && (! ls /tmp/foo2) && (! ls /tmp/dir1/foo)`
<add> ctx, err := fakeContext(dockerfile, map[string]string{
<add> "foo": "foo",
<add> "foo2": "foo2",
<add> "dir1/foo": "foo in dir1",
<add> ".dockerignore": "./foo\ndir1//foo\n./dir1/../foo2",
<add> })
<add> if err != nil {
<add> t.Fatal(err)
<add> }
<add> defer ctx.Close()
<add> if _, err := buildImageFromContext(name, ctx, true); err != nil {
<add> t.Fatal(err)
<add> }
<add> logDone("build - test .dockerignore with clean paths")
<add>}
<add>
<ide> func TestBuildDockerignoringDockerfile(t *testing.T) {
<ide> name := "testbuilddockerignoredockerfile"
<ide> defer deleteImages(name)
<ide> func TestBuildDockerignoringDockerfile(t *testing.T) {
<ide> "Dockerfile": "FROM scratch",
<ide> ".dockerignore": "Dockerfile\n",
<ide> })
<del> defer ctx.Close()
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<add> defer ctx.Close()
<ide> if _, err = buildImageFromContext(name, ctx, true); err == nil {
<ide> t.Fatalf("Didn't get expected error from ignoring Dockerfile")
<ide> }
<add>
<add> // now try it with ./Dockerfile
<add> ctx.Add(".dockerignore", "./Dockerfile\n")
<add> if _, err = buildImageFromContext(name, ctx, true); err == nil {
<add> t.Fatalf("Didn't get expected error from ignoring ./Dockerfile")
<add> }
<add>
<ide> logDone("build - test .dockerignore of Dockerfile")
<ide> }
<ide> | 2 |
Ruby | Ruby | add config.to_prepare back and add tests for it | d3d487479a6d4a5ba6977fb0075e7937eb19718a | <ide><path>railties/lib/rails/application/finisher.rb
<ide> module Finisher
<ide> end
<ide> end
<ide>
<add> initializer :add_to_prepare_blocks do
<add> config.to_prepare_blocks.each do |block|
<add> ActionDispatch::Callbacks.to_prepare(&block)
<add> end
<add> end
<add>
<ide> initializer :add_builtin_route do |app|
<ide> if Rails.env.development?
<ide> app.routes_reloader.paths << File.join(RAILTIES_PATH, 'builtin', 'routes.rb')
<ide> module Finisher
<ide> app
<ide> end
<ide>
<del> # Fires the user-supplied after_initialize block (config#after_initialize)
<add> # Fires the user-supplied after_initialize block (config.after_initialize)
<ide> initializer :after_initialize do
<ide> config.after_initialize_blocks.each do |block|
<ide> block.call(self)
<ide><path>railties/lib/rails/configuration.rb
<ide> def after_initialize(&blk)
<ide> after_initialize_blocks << blk if blk
<ide> end
<ide>
<add> def to_prepare_blocks
<add> @@to_prepare_blocks ||= []
<add> end
<add>
<add> def to_prepare(&blk)
<add> to_prepare_blocks << blk if blk
<add> end
<add>
<ide> def respond_to?(name)
<ide> super || name.to_s =~ config_key_regexp
<ide> end
<ide><path>railties/test/application/configuration_test.rb
<ide> def copy_app
<ide> FileUtils.cp_r(app_path, new_app)
<ide> end
<ide>
<add> def app
<add> @app ||= Rails.application
<add> end
<add>
<ide> def setup
<ide> FileUtils.rm_rf(new_app) if File.directory?(new_app)
<ide> build_app
<ide> def setup
<ide> require "#{app_path}/config/application"
<ide> end
<ide> end
<add>
<add> test "config.to_prepare is forwarded to ActionDispatch" do
<add> $prepared = false
<add>
<add> add_to_config <<-RUBY
<add> config.to_prepare do
<add> $prepared = true
<add> end
<add> RUBY
<add>
<add> assert !$prepared
<add>
<add> require "#{app_path}/config/environment"
<add> require 'rack/test'
<add> extend Rack::Test::Methods
<add>
<add> get "/"
<add> assert $prepared
<add> end
<ide> end
<ide> end | 3 |
Javascript | Javascript | ignore some of the specs on ie | 040aa11ceb510d8f8ec8349a3ca99d9db874daf0 | <ide><path>docs/component-spec/annotationsSpec.js
<ide> describe('Docs Annotations', function() {
<ide> body.html('');
<ide> });
<ide>
<add> var normalizeHtml = function(html) {
<add> return html.toLowerCase().replace(/\s*$/, '');
<add> };
<add>
<ide> describe('popover directive', function() {
<ide>
<ide> var $scope, element;
<ide> describe('Docs Annotations', function() {
<ide> $scope.$apply();
<ide> element.triggerHandler('click');
<ide> expect(popoverElement.title()).toBe('#title_text');
<del> expect(popoverElement.content()).toBe('<h1>heading</h1>\n');
<add> expect(normalizeHtml(popoverElement.content())).toMatch('<h1>heading</h1>');
<ide> }));
<ide>
<ide> });
<ide>
<ide>
<ide> describe('foldout directive', function() {
<ide>
<add> // Do not run this suite on Internet Explorer.
<add> if (msie < 10) return;
<add>
<ide> var $scope, parent, element, url;
<ide> beforeEach(function() {
<ide> module(function($provide, $animateProvider) {
<ide><path>docs/component-spec/mocks.js
<add>// Copy/pasted from src/Angular.js, so that we can disable specific tests on IE.
<add>var msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1], 10);
<add>
<ide> var createMockWindow = function() {
<ide> var mockWindow = {};
<ide> var setTimeoutQueue = [];
<ide><path>docs/component-spec/versionJumpSpec.js
<ide> describe('DocsApp', function() {
<ide>
<add> // Do not run this suite on Internet Explorer.
<add> if (msie < 10) return;
<add>
<ide> beforeEach(module('docsApp'));
<ide>
<ide> describe('DocsVersionsCtrl', function() {
<ide><path>karma-docs.conf.js
<ide> module.exports = function(config) {
<ide> 'build/docs/js/docs.js',
<ide> 'build/docs/docs-data.js',
<ide>
<add> 'docs/component-spec/mocks.js',
<ide> 'docs/component-spec/*.js'
<ide> ],
<ide> | 4 |
Text | Text | add @martync for thanks! | 999056cde1c6355d5ca036f109b35b41cb9d47cc | <ide><path>docs/topics/credits.md
<ide> The following people have helped make REST framework great.
<ide> * Ricky Rosario - [rlr]
<ide> * Veronica Lynn - [kolvia]
<ide> * Dan Stephenson - [etos]
<add>* Martin Clement - [martync]
<ide>
<ide> Many thanks to everyone who's contributed to the project.
<ide>
<ide> You can also contact [@_tomchristie][twitter] directly on twitter.
<ide> [rlr]: https://github.com/rlr
<ide> [kolvia]: https://github.com/kolvia
<ide> [etos]: https://github.com/etos
<add>[martync]: https://github.com/martync | 1 |
Text | Text | fix broken refs to url.parse() in http docs | 010ac70892d98b547b07075ee84f5e1afa6b0c74 | <ide><path>doc/api/http.md
<ide> There are a few special headers that should be noted.
<ide> [`socket.setTimeout()`]: net.html#net_socket_settimeout_timeout_callback
<ide> [`stream.setEncoding()`]: stream.html#stream_stream_setencoding_encoding
<ide> [`TypeError`]: errors.html#errors_class_typeerror
<del>[`url.parse()`]: url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost
<add>[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
<ide> [constructor options]: #http_new_agent_options
<ide> [Readable Stream]: stream.html#stream_class_stream_readable
<ide> [Writable Stream]: stream.html#stream_class_stream_writable
<ide><path>doc/api/https.md
<ide> var req = https.request(options, (res) => {
<ide> [`SSL_METHODS`]: https://www.openssl.org/docs/ssl/ssl.html#DEALING-WITH-PROTOCOL-METHODS
<ide> [`tls.connect()`]: tls.html#tls_tls_connect_options_callback
<ide> [`tls.createServer()`]: tls.html#tls_tls_createserver_options_secureconnectionlistener
<del>[`url.parse()`]: url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost
<add>[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost | 2 |
Ruby | Ruby | add cask methods | 05daa0574732a7884bd158b2c3e14bd0709367da | <ide><path>Library/Homebrew/tap.rb
<ide> def initialize(user, repo)
<ide> def clear_cache
<ide> @remote = nil
<ide> @formula_dir = nil
<add> @cask_dir = nil
<ide> @formula_files = nil
<ide> @alias_dir = nil
<ide> @alias_files = nil
<ide> def formula_dir
<ide> @formula_dir ||= [path/"Formula", path/"HomebrewFormula", path].detect(&:directory?)
<ide> end
<ide>
<add> # path to the directory of all casks for caskroom/cask {Tap}.
<add> def cask_dir
<add> @cask_dir ||= [path/"Casks", path].detect(&:directory?)
<add> end
<add>
<ide> # an array of all {Formula} files of this {Tap}.
<ide> def formula_files
<ide> @formula_files ||= if formula_dir
<ide> def formula_files
<ide> def formula_file?(file)
<ide> file = Pathname.new(file) unless file.is_a? Pathname
<ide> file = file.expand_path(path)
<del> file.extname == ".rb" && file.parent == formula_dir
<add> file.extname == ".rb" && (file.parent == formula_dir || file.parent == cask_dir)
<ide> end
<ide>
<ide> # an array of all {Formula} names of this {Tap}.
<ide> def formula_dir
<ide> end
<ide> end
<ide>
<add> # @private
<add> def cask_dir
<add> @cask_dir ||= begin
<add> self.class.ensure_installed!
<add> super
<add> end
<add> end
<add>
<ide> # @private
<ide> def alias_dir
<ide> @alias_dir ||= begin | 1 |
Text | Text | add plugin socket related debug docs | 6b8ae528655f65403c4d75d4bd9ce576cd26ff82 | <ide><path>docs/extend/index.md
<ide> follows:
<ide> $ docker-runc exec -t f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 sh
<ide> ```
<ide>
<add>#### Using curl to debug plugin socket issues.
<add>
<add>To verify if the plugin API socket that the docker daemon communicates with
<add>is responsive, use curl. In this example, we will make API calls from the
<add>docker host to volume and network plugins using curl 7.47.0 to ensure that
<add>the plugin is listening on the said socket. For a well functioning plugin,
<add>these basic requests should work. Note that plugin sockets are available on the host under `/var/run/docker/plugins/<pluginID>`
<add>
<add>
<add>```bash
<add>curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/e8a37ba56fc879c991f7d7921901723c64df6b42b87e6a0b055771ecf8477a6d/plugin.sock http:/VolumeDriver.List
<add>
<add>{"Mountpoint":"","Err":"","Volumes":[{"Name":"myvol1","Mountpoint":"/data/myvol1"},{"Name":"myvol2","Mountpoint":"/data/myvol2"}],"Volume":null}
<add>```
<add>
<add>```bash
<add>curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/45e00a7ce6185d6e365904c8bcf62eb724b1fe307e0d4e7ecc9f6c1eb7bcdb70/plugin.sock http:/NetworkDriver.GetCapabilities
<add>
<add>{"Scope":"local"}
<add>```
<add>When using curl 7.5 and above, the URL should be of the form
<add>`http://hostname/APICall`, where `hostname` is the valid hostname where the
<add>plugin is installed and `APICall` is the call to the plugin API.
<add>
<add>For example, `http://localhost/VolumeDriver.List` | 1 |
Ruby | Ruby | fix undefined method error on invalid input | 7787dde7b763ee789f5253f5f213d5890403945a | <ide><path>Library/Homebrew/dev-cmd/pr-publish.rb
<ide> def pr_publish
<ide> arg = "#{CoreTap.instance.default_remote}/pull/#{arg}" if arg.to_i.positive?
<ide> url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX
<ide> _, user, repo, issue = *url_match
<del> tap = Tap.fetch(user, repo) if repo.match?(HOMEBREW_OFFICIAL_REPO_PREFIXES_REGEX)
<ide> odie "Not a GitHub pull request: #{arg}" unless issue
<add> tap = Tap.fetch(user, repo) if repo.match?(HOMEBREW_OFFICIAL_REPO_PREFIXES_REGEX)
<ide> ohai "Dispatching #{tap} pull request ##{issue}"
<ide> GitHub.dispatch_event(user, repo, "Publish ##{issue}", pull_request: issue)
<ide> end | 1 |
Text | Text | add deprecation notice | c111e133ae58f0d3a6a0e464abc047879edd66bf | <ide><path>doc/api/deprecations.md
<ide> Type: End-of-Life
<ide>
<ide> The `--with-lttng` compile time option is removed.
<ide>
<add><a id="DEP0102"></a>
<add>### DEP0102: Using `noAssert` in Buffer#(read|write) operations.
<add>
<add>Type: End-of-Life
<add>
<add>Using the `noAssert` argument has no functionality anymore. All input is going
<add>to be verified, no matter if it is set to true or not. Skipping the verification
<add>could lead to hard to find errors and crashes.
<add>
<ide> [`--pending-deprecation`]: cli.html#cli_pending_deprecation
<ide> [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
<ide> [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array | 1 |
Ruby | Ruby | remove json test | 2f919089ef381758f4db236dff4c4e6410259a7e | <ide><path>Library/Homebrew/test/json_test.rb
<del>require "testing_env"
<del>require "json"
<del>
<del>class JsonSmokeTest < Homebrew::TestCase
<del> def test_encode
<del> hash = { "foo" => ["bar", "baz"] }
<del> json = '{"foo":["bar","baz"]}'
<del> assert_equal json, JSON.generate(hash)
<del> end
<del>
<del> def test_decode
<del> hash = { "foo" => ["bar", "baz"], "qux" => 1 }
<del> json = '{"foo":["bar","baz"],"qux":1}'
<del> assert_equal hash, JSON.parse(json)
<del> end
<del>
<del> def test_decode_failure
<del> assert_raises(JSON::ParserError) { JSON.parse("nope") }
<del> end
<del>end | 1 |
PHP | PHP | use json for mysql json now that 5.7 is out | cccdad418159a856c72bec61c3ad16d754d5f35e | <ide><path>src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
<ide> protected function typeEnum(Fluent $column)
<ide> */
<ide> protected function typeJson(Fluent $column)
<ide> {
<del> return 'text';
<add> return 'json';
<ide> }
<ide>
<ide> /**
<ide> protected function typeJson(Fluent $column)
<ide> */
<ide> protected function typeJsonb(Fluent $column)
<ide> {
<del> return 'text';
<add> return 'json';
<ide> }
<ide>
<ide> /** | 1 |
Javascript | Javascript | check compilance with spec | 23068ad97973cacd84bb7724586cf26e6cfcdd12 | <ide><path>test/cases/parsing/harmony-spec/export-cycle-a.js
<add>function fun() {
<add> return true;
<add>};
<add>
<add>import { callFun } from "./export-cycle-b";
<add>
<add>export default callFun();
<add>
<add>export { fun };
<ide><path>test/cases/parsing/harmony-spec/export-cycle-b.js
<add>import { fun } from "./export-cycle-a";
<add>
<add>export function callFun() {
<add> return fun();
<add>}
<ide><path>test/cases/parsing/harmony-spec/index.js
<add>import { value, add } from "./live";
<add>import { getLog } from "./order-tracker";
<add>import "./order-c";
<add>import cycleValue from "./export-cycle-a";
<add>
<add>it("should establish live binding of values", function() {
<add> value.should.be.eql(0);
<add> add(2);
<add> value.should.be.eql(2);
<add>});
<add>
<add>it("should execute modules in the correct order", function() {
<add> getLog().should.be.eql(["a", "b", "c"]);
<add>});
<add>
<add>it("should bind exports before the module executes", function() {
<add> cycleValue.should.be.eql(true);
<add>});
<ide>\ No newline at end of file
<ide><path>test/cases/parsing/harmony-spec/live.js
<add>export var value = 0;
<add>export function add(x) {
<add> value += x;
<add>};
<ide><path>test/cases/parsing/harmony-spec/order-a.js
<add>import { log } from "./order-tracker";
<add>log("a");
<ide><path>test/cases/parsing/harmony-spec/order-b.js
<add>import { log } from "./order-tracker";
<add>log("b");
<ide><path>test/cases/parsing/harmony-spec/order-c.js
<add>import { log } from "./order-tracker";
<add>import "./order-a";
<add>log("c");
<add>import "./order-b";
<ide><path>test/cases/parsing/harmony-spec/order-tracker.js
<add>var data = [];
<add>export function log(x) {
<add> data.push(x);
<add>};
<add>export function getLog() {
<add> return data;
<add>}; | 8 |
PHP | PHP | replace 'dynamic' keyword with 'mixed' | 3c45bc8e19c15475f11e78bee69af2e92494f1a8 | <ide><path>src/Illuminate/Cache/RedisStore.php
<ide> public function flush()
<ide> /**
<ide> * Begin executing a new tags operation.
<ide> *
<del> * @param array|dynamic $names
<add> * @param array|mixed $names
<ide> * @return \Illuminate\Cache\RedisTaggedCache
<ide> */
<ide> public function tags($names)
<ide><path>src/Illuminate/Cache/TaggableStore.php
<ide> public function section($name)
<ide> /**
<ide> * Begin executing a new tags operation.
<ide> *
<del> * @param array|dynamic $names
<add> * @param array|mixed $names
<ide> * @return \Illuminate\Cache\TaggedCache
<ide> */
<ide> public function tags($names)
<ide><path>src/Illuminate/Console/Application.php
<ide> public function resolve($command)
<ide> /**
<ide> * Resolve an array of commands through the application.
<ide> *
<del> * @param array|dynamic $commands
<add> * @param array|mixed $commands
<ide> * @return void
<ide> */
<ide> public function resolveCommands($commands)
<ide><path>src/Illuminate/Cookie/CookieJar.php
<ide> public function queued($key, $default = null)
<ide> /**
<ide> * Queue a cookie to send with the next response.
<ide> *
<del> * @param dynamic
<add> * @param mixed
<ide> * @return void
<ide> */
<ide> public function queue()
<ide><path>src/Illuminate/Database/Eloquent/Builder.php
<ide> protected function getHasRelationQuery($relation)
<ide> /**
<ide> * Set the relationships that should be eager loaded.
<ide> *
<del> * @param dynamic $relations
<add> * @param mixed $relations
<ide> * @return $this
<ide> */
<ide> public function with($relations)
<ide><path>src/Illuminate/Database/Query/Builder.php
<ide> public function rememberForever($key = null)
<ide> /**
<ide> * Indicate that the results, if cached, should use the given cache tags.
<ide> *
<del> * @param array|dynamic $cacheTags
<add> * @param array|mixed $cacheTags
<ide> * @return $this
<ide> */
<ide> public function cacheTags($cacheTags)
<ide><path>src/Illuminate/Foundation/Application.php
<ide> public function startExceptionHandling()
<ide> /**
<ide> * Get or check the current application environment.
<ide> *
<del> * @param dynamic
<add> * @param mixed
<ide> * @return string
<ide> */
<ide> public function environment()
<ide><path>src/Illuminate/Http/RedirectResponse.php
<ide> public function onlyInput()
<ide> /**
<ide> * Flash an array of input to the session.
<ide> *
<del> * @param dynamic string
<add> * @param mixed string
<ide> * @return \Illuminate\Http\RedirectResponse
<ide> */
<ide> public function exceptInput()
<ide><path>src/Illuminate/Http/Request.php
<ide> public function segments()
<ide> /**
<ide> * Determine if the current request URI matches a pattern.
<ide> *
<del> * @param dynamic string
<add> * @param mixed string
<ide> * @return bool
<ide> */
<ide> public function is()
<ide> public function flash($filter = null, $keys = array())
<ide> /**
<ide> * Flash only some of the input to the session.
<ide> *
<del> * @param dynamic string
<add> * @param mixed string
<ide> * @return void
<ide> */
<ide> public function flashOnly($keys)
<ide> public function flashOnly($keys)
<ide> /**
<ide> * Flash only some of the input to the session.
<ide> *
<del> * @param dynamic string
<add> * @param mixed string
<ide> * @return void
<ide> */
<ide> public function flashExcept($keys)
<ide><path>src/Illuminate/Log/Writer.php
<ide> protected function fireLogEvent($level, $message, array $context = array())
<ide> /**
<ide> * Dynamically pass log calls into the writer.
<ide> *
<del> * @param dynamic (level, param, param)
<add> * @param mixed (level, param, param)
<ide> * @return mixed
<ide> */
<ide> public function write()
<ide><path>src/Illuminate/Remote/RemoteManager.php
<ide> public function __construct($app)
<ide> /**
<ide> * Get a remote connection instance.
<ide> *
<del> * @param string|array|dynamic $name
<add> * @param string|array|mixed $name
<ide> * @return \Illuminate\Remote\ConnectionInterface
<ide> */
<ide> public function into($name)
<ide><path>src/Illuminate/Routing/Router.php
<ide> public function currentRouteName()
<ide> /**
<ide> * Alias for the "currentRouteNamed" method.
<ide> *
<del> * @param dynamic string
<add> * @param mixed string
<ide> * @return bool
<ide> */
<ide> public function is()
<ide> public function currentRouteAction()
<ide> /**
<ide> * Alias for the "currentRouteUses" method.
<ide> *
<del> * @param dynamic string
<add> * @param mixed string
<ide> * @return bool
<ide> */
<ide> public function uses()
<ide><path>src/Illuminate/Session/Store.php
<ide> public function reflash()
<ide> /**
<ide> * Reflash a subset of the current flash data.
<ide> *
<del> * @param array|dynamic $keys
<add> * @param array|mixed $keys
<ide> * @return void
<ide> */
<ide> public function keep($keys = null)
<ide><path>src/Illuminate/Support/Facades/Facade.php
<ide> public static function swap($instance)
<ide> /**
<ide> * Initiate a mock expectation on the facade.
<ide> *
<del> * @param dynamic
<add> * @param mixed
<ide> * @return \Mockery\Expectation
<ide> */
<ide> public static function shouldReceive()
<ide><path>src/Illuminate/Support/helpers.php
<ide> function data_get($target, $key, $default = null)
<ide> /**
<ide> * Dump the passed variables and end the script.
<ide> *
<del> * @param dynamic mixed
<add> * @param mixed
<ide> * @return void
<ide> */
<ide> function dd() | 15 |
Python | Python | add transition note to all lib/poly functions | 3687b5b5baf499cb7ac718b728386077fa8a3cfa | <ide><path>numpy/lib/polynomial.py
<ide> def poly(seq_of_zeros):
<ide> """
<ide> Find the coefficients of a polynomial with the given sequence of roots.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> Returns the coefficients of the polynomial whose leading coefficient
<ide> is one for the given sequence of zeros (multiple roots must be included
<ide> in the sequence as many times as their multiplicity; see Examples).
<ide> def roots(p):
<ide> """
<ide> Return the roots of a polynomial with coefficients given in p.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> The values in the rank-1 array `p` are coefficients of a polynomial.
<ide> If the length of `p` is n+1 then the polynomial is described by::
<ide>
<ide> def polyint(p, m=1, k=None):
<ide> """
<ide> Return an antiderivative (indefinite integral) of a polynomial.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> The returned order `m` antiderivative `P` of polynomial `p` satisfies
<ide> :math:`\\frac{d^m}{dx^m}P(x) = p(x)` and is defined up to `m - 1`
<ide> integration constants `k`. The constants determine the low-order
<ide> def polyder(p, m=1):
<ide> """
<ide> Return the derivative of the specified order of a polynomial.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> Parameters
<ide> ----------
<ide> p : poly1d or sequence
<ide> def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False):
<ide> """
<ide> Least squares polynomial fit.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> Fit a polynomial ``p(x) = p[0] * x**deg + ... + p[deg]`` of degree `deg`
<ide> to points `(x, y)`. Returns a vector of coefficients `p` that minimises
<ide> the squared error in the order `deg`, `deg-1`, ... `0`.
<ide> def polyval(p, x):
<ide> """
<ide> Evaluate a polynomial at specific values.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> If `p` is of length N, this function returns the value:
<ide>
<ide> ``p[0]*x**(N-1) + p[1]*x**(N-2) + ... + p[N-2]*x + p[N-1]``
<ide> def polyadd(a1, a2):
<ide> """
<ide> Find the sum of two polynomials.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> Returns the polynomial resulting from the sum of two input polynomials.
<ide> Each input must be either a poly1d object or a 1D sequence of polynomial
<ide> coefficients, from highest to lowest degree.
<ide> def polysub(a1, a2):
<ide> """
<ide> Difference (subtraction) of two polynomials.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> Given two polynomials `a1` and `a2`, returns ``a1 - a2``.
<ide> `a1` and `a2` can be either array_like sequences of the polynomials'
<ide> coefficients (including coefficients equal to zero), or `poly1d` objects.
<ide> def polymul(a1, a2):
<ide> """
<ide> Find the product of two polynomials.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> Finds the polynomial resulting from the multiplication of the two input
<ide> polynomials. Each input must be either a poly1d object or a 1D sequence
<ide> of polynomial coefficients, from highest to lowest degree.
<ide> def polydiv(u, v):
<ide> """
<ide> Returns the quotient and remainder of polynomial division.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> The input arrays are the coefficients (including any coefficients
<ide> equal to zero) of the "numerator" (dividend) and "denominator"
<ide> (divisor) polynomials, respectively.
<ide> class poly1d:
<ide> """
<ide> A one-dimensional polynomial class.
<ide>
<add> .. note::
<add> This forms part of the old polynomial API. Since version 1.4, the
<add> new polynomial API defined in `numpy.polynomial` is preferred.
<add> A summary of the differences can be found in the
<add> :doc:`transition guide </reference/routines.polynomials>`.
<add>
<ide> A convenience class, used to encapsulate "natural" operations on
<ide> polynomials so that said operations may take on their customary
<ide> form in code (see Examples). | 1 |
Text | Text | fix broken link in chart/readme.md | bbfaafeb552b48560960ab4aba84723b7ccbf386 | <ide><path>chart/README.md
<ide> to port-forward the Airflow UI to http://localhost:8080/ to cofirm Airflow is wo
<ide>
<ide> ## Contributing
<ide>
<del>Check out [our contributing guide!](CONTRIBUTING.md)
<add>Check out [our contributing guide!](../CONTRIBUTING.rst) | 1 |
Python | Python | set version to 2.1.5.dev0 | c6cb78275888228cc647a950d9adfbf545a60ad6 | <ide><path>spacy/about.py
<ide> # fmt: off
<ide>
<ide> __title__ = "spacy"
<del>__version__ = "2.1.4"
<add>__version__ = "2.1.5.dev0"
<ide> __summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython"
<ide> __uri__ = "https://spacy.io"
<ide> __author__ = "Explosion AI" | 1 |
Text | Text | use proper jamstack casing | cfa00c9fcd7032db1b3cabbd9629167baa305b5a | <ide><path>docs/deployment.md
<ide> description: Deploy your Next.js app to production with Vercel and other hosting
<ide>
<ide> ## Vercel (Recommended)
<ide>
<del>The easiest way to deploy Next.js to production is to use the **[Vercel platform](https://vercel.com)** from the creators of Next.js. [Vercel](https://vercel.com) is an all-in-one platform with Global CDN supporting static & JAMstack deployment and Serverless Functions.
<add>The easiest way to deploy Next.js to production is to use the **[Vercel platform](https://vercel.com)** from the creators of Next.js. [Vercel](https://vercel.com) is an all-in-one platform with Global CDN supporting static & Jamstack deployment and Serverless Functions.
<ide>
<ide> ### Getting started
<ide> | 1 |
Javascript | Javascript | change var to let | 1d2c8b4c81225720f8c2e477e42ad636984d38c3 | <ide><path>test/tick-processor/test-tick-processor-unknown.js
<ide> const base = require('./tick-processor-base.js');
<ide> base.runTest({
<ide> pattern: /LazyCompile.*\[eval]:1|.*% UNKNOWN/,
<ide> code: `function f() {
<del> for (var i = 0; i < 1000000; i++) {
<add> for (let i = 0; i < 1000000; i++) {
<ide> i++;
<ide> }
<ide> setImmediate(function() { f(); }); | 1 |
Ruby | Ruby | simplify prefix test | 5c1805434173002c5da18a91a1cd3158661a5424 | <ide><path>Library/Homebrew/test/test_formula.rb
<ide> class FormulaTests < Test::Unit::TestCase
<ide>
<ide> def test_prefix
<ide> f = TestBall.new
<del> assert_equal File.expand_path(f.prefix), (HOMEBREW_CELLAR+f.name+'0.1').to_s
<add> assert_equal HOMEBREW_CELLAR/f.name/'0.1', f.prefix
<ide> assert_kind_of Pathname, f.prefix
<ide> end
<ide> | 1 |
Javascript | Javascript | remove redundant error messages | 3594223c2e0c92cfb7c1c0a352246387659d2475 | <ide><path>test/addons-napi/test_typedarray/test.js
<ide> arrayTypes.forEach((currentType) => {
<ide>
<ide> assert.ok(theArray instanceof currentType,
<ide> 'Type of new array should match that of the template');
<del> assert.notStrictEqual(theArray,
<del> template,
<del> 'the new array should not be a copy of the template');
<del> assert.strictEqual(theArray.buffer,
<del> buffer,
<del> 'Buffer for array should match the one passed in');
<add> assert.notStrictEqual(theArray, template);
<add> assert.strictEqual(theArray.buffer, buffer);
<ide> }); | 1 |
Ruby | Ruby | avoid extra allocation in string#from and #to | 52498ccafd718975dc7ad8df2bf7f4a9614a239d | <ide><path>activesupport/lib/active_support/core_ext/string/access.rb
<ide> def at(position)
<ide> # str.from(0).to(-1) # => "hello"
<ide> # str.from(1).to(-2) # => "ell"
<ide> def from(position)
<del> self[position..-1]
<add> self[position, length]
<ide> end
<ide>
<ide> # Returns a substring from the beginning of the string to the given position.
<ide> def from(position)
<ide> # str.from(0).to(-1) # => "hello"
<ide> # str.from(1).to(-2) # => "ell"
<ide> def to(position)
<del> self[0..position]
<add> position = [position + length, -1].max if position < 0
<add> self[0, position + 1]
<ide> end
<ide>
<ide> # Returns the first character. If a limit is supplied, returns a substring | 1 |
PHP | PHP | add a small optimization for reverse routing | 7ce2f4526e894d31881f4a5533f6b26a6439a510 | <ide><path>src/Routing/Router.php
<ide> protected static function _match($url) {
<ide>
<ide> // No quick win, iterate and hope for the best.
<ide> foreach (static::$_pathScopes as $key => $collection) {
<add> $params = $collection->params();
<add> // No point in checking the routes if the scope params are wrong.
<add> if (array_intersect_key($url, $params) !== $params) {
<add> continue;
<add> }
<ide> $match = $collection->match($url, static::$_requestContext);
<ide> if ($match !== false) {
<ide> return $match; | 1 |
Javascript | Javascript | fix typo in fs.writefile | 68af59ef6b97f7f20860a4aff5ea7379f6e80fea | <ide><path>src/node.js
<ide> var fsModule = createInternalModule("fs", function (exports) {
<ide> if (callback) callback(writeErr);
<ide> });
<ide> } else {
<del> if (written === _data.length) {
<add> if (written === data.length) {
<ide> exports.close(fd, callback);
<ide> } else {
<ide> writeAll(fd, data.slice(written), encoding, callback); | 1 |
Go | Go | fix events test flakiness | abbf2aa6ddbf8159a5fceb4df25d7f85aeffe70e | <ide><path>integration-cli/docker_cli_authz_unix_test.go
<ide> func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) {
<ide> c.Assert(s.d.waitRun(containerID), checker.IsNil)
<ide>
<ide> events := map[string]chan bool{
<del> "create": make(chan bool),
<del> "start": make(chan bool),
<add> "create": make(chan bool, 1),
<add> "start": make(chan bool, 1),
<ide> }
<ide>
<ide> matcher := matchEventLine(containerID, "container", events)
<ide> func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) {
<ide> for event, eventChannel := range events {
<ide>
<ide> select {
<del> case <-time.After(5 * time.Second):
<add> case <-time.After(30 * time.Second):
<ide> // Fail the test
<ide> observer.CheckEventError(c, containerID, event, matcher)
<ide> c.FailNow()
<ide><path>integration-cli/docker_cli_build_unix_test.go
<ide> func (s *DockerSuite) TestBuildCancellationKillsSleep(c *check.C) {
<ide> }
<ide>
<ide> testActions := map[string]chan bool{
<del> "start": make(chan bool),
<del> "die": make(chan bool),
<add> "start": make(chan bool, 1),
<add> "die": make(chan bool, 1),
<ide> }
<ide>
<ide> matcher := matchEventLine(buildID, "container", testActions)
<ide><path>integration-cli/docker_cli_events_unix_test.go
<ide> func (s *DockerSuite) TestEventsStreaming(c *check.C) {
<ide> containerID := strings.TrimSpace(out)
<ide>
<ide> testActions := map[string]chan bool{
<del> "create": make(chan bool),
<del> "start": make(chan bool),
<del> "die": make(chan bool),
<del> "destroy": make(chan bool),
<add> "create": make(chan bool, 1),
<add> "start": make(chan bool, 1),
<add> "die": make(chan bool, 1),
<add> "destroy": make(chan bool, 1),
<ide> }
<ide>
<ide> matcher := matchEventLine(containerID, "container", testActions)
<ide> func (s *DockerSuite) TestEventsImageUntagDelete(c *check.C) {
<ide> c.Assert(deleteImages(name), checker.IsNil)
<ide>
<ide> testActions := map[string]chan bool{
<del> "untag": make(chan bool),
<del> "delete": make(chan bool),
<add> "untag": make(chan bool, 1),
<add> "delete": make(chan bool, 1),
<ide> }
<ide>
<ide> matcher := matchEventLine(imageID, "image", testActions) | 3 |
Text | Text | fix typo in hans example call | 0dbddba6d2c5b2c6fc08866358c1994a00d6a1ff | <ide><path>examples/README.md
<ide> export HANS_DIR=path-to-hans
<ide> export MODEL_TYPE=type-of-the-model-e.g.-bert-roberta-xlnet-etc
<ide> export MODEL_PATH=path-to-the-model-directory-that-is-trained-on-NLI-e.g.-by-using-run_glue.py
<ide>
<del>python examples/test_hans.py \
<add>python examples/hans/test_hans.py \
<ide> --task_name hans \
<ide> --model_type $MODEL_TYPE \
<ide> --do_eval \
<ide> --do_lower_case \
<ide> --data_dir $HANS_DIR \
<ide> --model_name_or_path $MODEL_PATH \
<ide> --max_seq_length 128 \
<del> -output_dir $MODEL_PATH \
<add> --output_dir $MODEL_PATH \
<ide> ```
<ide>
<ide> This will create the hans_predictions.txt file in MODEL_PATH, which can then be evaluated using hans/evaluate_heur_output.py from the HANS dataset. | 1 |
Java | Java | drop @webservlet annotation | 7de2650a7070af4db25ef9b5d87528a679302120 | <ide><path>spring-web/src/main/java/org/springframework/http/server/reactive/JettyHttpHandlerAdapter.java
<ide> /*
<del> * Copyright 2002-2017 the original author or authors.
<add> * Copyright 2002-2018 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> import java.nio.ByteBuffer;
<ide> import javax.servlet.AsyncContext;
<ide> import javax.servlet.ServletResponse;
<del>import javax.servlet.annotation.WebServlet;
<ide> import javax.servlet.http.HttpServletResponse;
<ide>
<ide> import org.eclipse.jetty.server.HttpOutput;
<ide> *
<ide> * @author Violeta Georgieva
<ide> * @since 5.0
<add> * @see org.springframework.web.server.adapter.AbstractReactiveWebInitializer
<ide> */
<del>@WebServlet(asyncSupported = true)
<ide> public class JettyHttpHandlerAdapter extends ServletHttpHandlerAdapter {
<ide>
<ide> public JettyHttpHandlerAdapter(HttpHandler httpHandler) {
<ide><path>spring-web/src/main/java/org/springframework/http/server/reactive/ServletHttpHandlerAdapter.java
<ide> import javax.servlet.ServletRegistration;
<ide> import javax.servlet.ServletRequest;
<ide> import javax.servlet.ServletResponse;
<del>import javax.servlet.annotation.WebServlet;
<ide> import javax.servlet.http.HttpServlet;
<ide> import javax.servlet.http.HttpServletRequest;
<ide> import javax.servlet.http.HttpServletResponse;
<ide> * @author Arjen Poutsma
<ide> * @author Rossen Stoyanchev
<ide> * @since 5.0
<add> * @see org.springframework.web.server.adapter.AbstractReactiveWebInitializer
<ide> */
<del>@WebServlet(asyncSupported = true)
<ide> @SuppressWarnings("serial")
<ide> public class ServletHttpHandlerAdapter implements Servlet {
<ide>
<ide><path>spring-web/src/main/java/org/springframework/http/server/reactive/TomcatHttpHandlerAdapter.java
<ide> import javax.servlet.AsyncContext;
<ide> import javax.servlet.ServletRequest;
<ide> import javax.servlet.ServletResponse;
<del>import javax.servlet.annotation.WebServlet;
<ide> import javax.servlet.http.HttpServletRequest;
<ide> import javax.servlet.http.HttpServletResponse;
<ide>
<ide> *
<ide> * @author Violeta Georgieva
<ide> * @since 5.0
<add> * @see org.springframework.web.server.adapter.AbstractReactiveWebInitializer
<ide> */
<del>@WebServlet(asyncSupported = true)
<ide> public class TomcatHttpHandlerAdapter extends ServletHttpHandlerAdapter {
<ide>
<ide>
<ide><path>spring-web/src/test/java/org/springframework/http/server/reactive/bootstrap/JettyHttpServer.java
<ide> protected void initServer() throws Exception {
<ide>
<ide> ServletHttpHandlerAdapter servlet = createServletAdapter();
<ide> ServletHolder servletHolder = new ServletHolder(servlet);
<add> servletHolder.setAsyncSupported(true);
<ide>
<ide> this.contextHandler = new ServletContextHandler(this.jettyServer, "", false, false);
<ide> this.contextHandler.addServlet(servletHolder, "/");
<ide><path>spring-web/src/test/java/org/springframework/http/server/reactive/bootstrap/TomcatHttpServer.java
<ide> protected void initServer() throws Exception {
<ide>
<ide> File base = new File(System.getProperty("java.io.tmpdir"));
<ide> Context rootContext = tomcatServer.addContext(this.contextPath, base.getAbsolutePath());
<del> Tomcat.addServlet(rootContext, "httpHandlerServlet", servlet);
<add> Tomcat.addServlet(rootContext, "httpHandlerServlet", servlet).setAsyncSupported(true);
<ide> rootContext.addServletMappingDecoded(this.servletMapping, "httpHandlerServlet");
<ide> if (wsListener != null) {
<ide> rootContext.addApplicationListener(wsListener.getName()); | 5 |
Text | Text | fix some pissing a’s and the’s | 25367167277c71ef884549a7c83733f2bea8eedf | <ide><path>docs/EmbeddedApp.md
<ide> React.AppRegistry.registerComponent('SimpleApp', () => SimpleApp);
<ide>
<ide> ## Add Container View To Your App
<ide>
<del>You should now add container view for React Native component. It can be any `UIView` in your app.
<add>You should now add a container view for the React Native component. It can be any `UIView` in your app.
<ide>
<ide> 
<ide> | 1 |
Javascript | Javascript | increase max session duration | d855b74095c616c061d67ae9bd57299ed84dbeae | <ide><path>protractor-travis-conf.js
<ide> function capabilitiesForSauceLabs(capabilities) {
<ide> 'browserName': capabilities.browserName,
<ide> 'platform': capabilities.platform,
<ide> 'version': capabilities.version,
<del> 'elementScrollBehavior': 1
<add> 'elementScrollBehavior': 1,
<add> // Allow e2e test sessions to run for a maximum of 35 minutes, instead of the default 30 minutes.
<add> 'maxDuration': 2100
<ide> };
<ide> } | 1 |
Python | Python | prepare changes for a future release | 303d955298dac5cd8a4fe2d92195350e332db516 | <ide><path>docs/conf.py
<ide> # built documents.
<ide> #
<ide> # The short X.Y version.
<del>version = '3.5.1'
<add>version = '3.5.2-dev'
<ide>
<ide> # The full version, including alpha/beta/rc tags.
<del>release = '3.5.1'
<add>release = '3.5.2-dev'
<ide>
<ide> # The language for content autogenerated by Sphinx. Refer to documentation
<ide> # for a list of supported languages.
<ide><path>libcloud/__init__.py
<ide>
<ide> __all__ = ["__version__", "enable_debug"]
<ide>
<del>__version__ = "3.5.1"
<add>__version__ = "3.5.2-dev"
<ide>
<ide>
<ide> def enable_debug(fo): | 2 |
Javascript | Javascript | add new list examples to uiexplorer | 05c36b463b2125150b44b4aa34fe739f48813665 | <ide><path>Examples/UIExplorer/js/UIExplorerExampleList.js
<ide> */
<ide> 'use strict';
<ide>
<del>const ListView = require('ListView');
<ide> const Platform = require('Platform');
<ide> const React = require('react');
<add>const SectionList = require('SectionList');
<ide> const StyleSheet = require('StyleSheet');
<ide> const Text = require('Text');
<ide> const TextInput = require('TextInput');
<ide> import type {
<ide> StyleObj,
<ide> } from 'StyleSheetTypes';
<ide>
<del>const ds = new ListView.DataSource({
<del> rowHasChanged: (r1, r2) => r1 !== r2,
<del> sectionHeaderHasChanged: (h1, h2) => h1 !== h2,
<del>});
<del>
<ide> type Props = {
<ide> onNavigate: Function,
<ide> list: {
<ide> type Props = {
<ide> style?: ?StyleObj,
<ide> };
<ide>
<add>class RowComponent extends React.PureComponent {
<add> props: {
<add> item: Object,
<add> onNavigate: Function,
<add> onPress?: Function,
<add> };
<add> _onPress = () => {
<add> if (this.props.onPress) {
<add> this.props.onPress();
<add> return;
<add> }
<add> this.props.onNavigate(UIExplorerActions.ExampleAction(this.props.item.key));
<add> };
<add> render() {
<add> const {item} = this.props;
<add> return (
<add> <View>
<add> <TouchableHighlight onPress={this._onPress}>
<add> <View style={styles.row}>
<add> <Text style={styles.rowTitleText}>
<add> {item.module.title}
<add> </Text>
<add> <Text style={styles.rowDetailText}>
<add> {item.module.description}
<add> </Text>
<add> </View>
<add> </TouchableHighlight>
<add> <View style={styles.separator} />
<add> </View>
<add> );
<add> }
<add>}
<add>
<add>const renderSectionHeader = ({section}) =>
<add> <Text style={styles.sectionHeader}>
<add> {section.title}
<add> </Text>;
<add>
<ide> class UIExplorerExampleList extends React.Component {
<ide> props: Props
<ide>
<del> render(): ?React.Element<any> {
<add> render() {
<ide> const filterText = this.props.persister.state.filter;
<ide> const filterRegex = new RegExp(String(filterText), 'i');
<del> const filter = (example) => filterRegex.test(example.module.title) && (!Platform.isTVOS || example.supportsTVOS);
<del>
<del> const dataSource = ds.cloneWithRowsAndSections({
<del> components: this.props.list.ComponentExamples.filter(filter),
<del> apis: this.props.list.APIExamples.filter(filter),
<del> });
<add> const filter = (example) =>
<add> this.props.disableSearch ||
<add> filterRegex.test(example.module.title) &&
<add> (!Platform.isTVOS || example.supportsTVOS);
<add>
<add> const sections = [
<add> {
<add> data: this.props.list.ComponentExamples.filter(filter),
<add> title: 'COMPONENTS',
<add> key: 'c',
<add> },
<add> {
<add> data: this.props.list.APIExamples.filter(filter),
<add> title: 'APIS',
<add> key: 'a',
<add> },
<add> ];
<ide> return (
<ide> <View style={[styles.listContainer, this.props.style]}>
<ide> {this._renderTitleRow()}
<ide> {this._renderTextInput()}
<del> <ListView
<add> <SectionList
<ide> style={styles.list}
<del> dataSource={dataSource}
<del> renderRow={this._renderExampleRow.bind(this)}
<del> renderSectionHeader={this._renderSectionHeader}
<add> sections={sections}
<add> renderItem={this._renderItem}
<ide> enableEmptySections={true}
<add> itemShouldUpdate={this._itemShouldUpdate}
<ide> keyboardShouldPersistTaps="handled"
<ide> automaticallyAdjustContentInsets={false}
<ide> keyboardDismissMode="on-drag"
<add> legacyImplementation={false}
<add> renderSectionHeader={renderSectionHeader}
<ide> />
<ide> </View>
<ide> );
<ide> }
<ide>
<add> _itemShouldUpdate(curr, prev) {
<add> return curr.item !== prev.item;
<add> }
<add>
<add> _renderItem = ({item}) => <RowComponent item={item} onNavigate={this.props.onNavigate} />;
<add>
<ide> _renderTitleRow(): ?React.Element<any> {
<ide> if (!this.props.displayTitleRow) {
<ide> return null;
<ide> }
<del> return this._renderRow(
<del> 'UIExplorer',
<del> 'React Native Examples',
<del> 'home_key',
<del> () => {
<del> this.props.onNavigate(
<del> UIExplorerActions.ExampleListWithFilter('')
<del> );
<del> }
<add> return (
<add> <RowComponent
<add> item={{module: {
<add> title: 'UIExplorer',
<add> description: 'React Native Examples',
<add> }}}
<add> onNavigate={this.props.onNavigate}
<add> onPress={() => {
<add> this.props.onNavigate(
<add> UIExplorerActions.ExampleListWithFilter('')
<add> );
<add> }}
<add> />
<ide> );
<ide> }
<ide>
<ide> class UIExplorerExampleList extends React.Component {
<ide> );
<ide> }
<ide>
<del> _renderSectionHeader(data: any, section: string): ?React.Element<any> {
<del> return (
<del> <Text style={styles.sectionHeader}>
<del> {section.toUpperCase()}
<del> </Text>
<del> );
<del> }
<del>
<del> _renderExampleRow(example: {key: string, module: Object}): ?React.Element<any> {
<del> return this._renderRow(
<del> example.module.title,
<del> example.module.description,
<del> example.key,
<del> () => this._handleRowPress(example.key)
<del> );
<del> }
<del>
<del> _renderRow(title: string, description: string, key: ?string, handler: ?Function): ?React.Element<any> {
<del> return (
<del> <View key={key || title}>
<del> <TouchableHighlight onPress={handler}>
<del> <View style={styles.row}>
<del> <Text style={styles.rowTitleText}>
<del> {title}
<del> </Text>
<del> <Text style={styles.rowDetailText}>
<del> {description}
<del> </Text>
<del> </View>
<del> </TouchableHighlight>
<del> <View style={styles.separator} />
<del> </View>
<del> );
<del> }
<del>
<ide> _handleRowPress(exampleKey: string): void {
<ide> this.props.onNavigate(UIExplorerActions.ExampleAction(exampleKey));
<ide> }
<ide><path>Examples/UIExplorer/js/UIExplorerList.android.js
<ide> const ComponentExamples: Array<UIExplorerExample> = [
<ide> key: 'ButtonExample',
<ide> module: require('./ButtonExample'),
<ide> },
<add> {
<add> key: 'FlatListExample',
<add> module: require('./FlatListExample'),
<add> },
<ide> {
<ide> key: 'ImageExample',
<ide> module: require('./ImageExample'),
<ide> const ComponentExamples: Array<UIExplorerExample> = [
<ide> key: 'ModalExample',
<ide> module: require('./ModalExample'),
<ide> },
<add> {
<add> key: 'MultiColumnExample',
<add> module: require('./MultiColumnExample'),
<add> },
<ide> {
<ide> key: 'PickerExample',
<ide> module: require('./PickerExample'),
<ide> const ComponentExamples: Array<UIExplorerExample> = [
<ide> key: 'ScrollViewSimpleExample',
<ide> module: require('./ScrollViewSimpleExample'),
<ide> },
<add> {
<add> key: 'SectionListExample',
<add> module: require('./SectionListExample'),
<add> },
<ide> {
<ide> key: 'SliderExample',
<ide> module: require('./SliderExample'),
<ide><path>Examples/UIExplorer/js/UIExplorerList.ios.js
<ide> const ComponentExamples: Array<UIExplorerExample> = [
<ide> module: require('./DatePickerIOSExample'),
<ide> supportsTVOS: false,
<ide> },
<add> {
<add> key: 'FlatListExample',
<add> module: require('./FlatListExample'),
<add> supportsTVOS: true,
<add> },
<ide> {
<ide> key: 'ImageExample',
<ide> module: require('./ImageExample'),
<ide> const ComponentExamples: Array<UIExplorerExample> = [
<ide> module: require('./ModalExample'),
<ide> supportsTVOS: true,
<ide> },
<add> {
<add> key: 'MultiColumnExample',
<add> module: require('./MultiColumnExample'),
<add> supportsTVOS: true,
<add> },
<ide> {
<ide> key: 'NavigatorExample',
<ide> module: require('./Navigator/NavigatorExample'),
<ide> const ComponentExamples: Array<UIExplorerExample> = [
<ide> module: require('./ScrollViewExample'),
<ide> supportsTVOS: true,
<ide> },
<add> {
<add> key: 'SectionListExample',
<add> module: require('./SectionListExample'),
<add> supportsTVOS: true,
<add> },
<ide> {
<ide> key: 'SegmentedControlIOSExample',
<ide> module: require('./SegmentedControlIOSExample'), | 3 |
PHP | PHP | auth command less noisy | af21db5a47b856306243bd8045d5de0d990ad868 | <ide><path>src/Illuminate/Auth/Console/MakeAuthCommand.php
<ide> public function fire()
<ide> $this->exportViews();
<ide>
<ide> if (! $this->option('views')) {
<del> $this->info('Installed HomeController.');
<del>
<ide> file_put_contents(
<ide> app_path('Http/Controllers/HomeController.php'),
<ide> $this->compileControllerStub()
<ide> );
<ide>
<del> $this->info('Updated Routes File.');
<del>
<ide> file_put_contents(
<ide> base_path('routes/web.php'),
<ide> file_get_contents(__DIR__.'/stubs/make/routes.stub'),
<ide> FILE_APPEND
<ide> );
<ide> }
<ide>
<del> $this->comment('Authentication scaffolding generated successfully!');
<add> $this->info('Authentication scaffolding generated successfully.');
<ide> }
<ide>
<ide> /**
<ide> protected function createDirectories()
<ide> protected function exportViews()
<ide> {
<ide> foreach ($this->views as $key => $value) {
<del> $path = base_path('resources/views/'.$value);
<del>
<del> $this->line('<info>Created View:</info> '.$path);
<del>
<del> copy(__DIR__.'/stubs/make/views/'.$key, $path);
<add> copy(
<add> __DIR__.'/stubs/make/views/'.$key,
<add> base_path('resources/views/'.$value)
<add> );
<ide> }
<ide> }
<ide> | 1 |
Javascript | Javascript | use webpack instead of compiler in test | bd10fca49a258d7b8fb9a0415067717bb0fe8a1c | <ide><path>test/Compiler-caching.test.js
<ide> var path = require("path");
<ide> var fs = require("fs");
<ide>
<ide> var NodeEnvironmentPlugin = require("../lib/node/NodeEnvironmentPlugin");
<del>var Compiler = require("../lib/Compiler");
<add>var webpack = require("../");
<ide> var WebpackOptionsApply = require("../lib/WebpackOptionsApply");
<ide> var WebpackOptionsDefaulter = require("../lib/WebpackOptionsDefaulter");
<ide>
<ide> describe("Compiler (caching)", function() {
<ide> writeFile: [],
<ide> };
<ide>
<del> var c = new Compiler();
<del> new NodeEnvironmentPlugin().apply(c);
<del> c.options = new WebpackOptionsApply().process(options, c);
<add> var c = webpack(options);
<ide> var files = {};
<ide> c.outputFileSystem = {
<ide> join: path.join.bind(path),
<ide><path>test/Compiler.test.js
<ide> var should = require("should");
<ide> var path = require("path");
<ide>
<ide> var NodeEnvironmentPlugin = require("../lib/node/NodeEnvironmentPlugin");
<del>var Compiler = require("../lib/Compiler");
<add>var webpack = require("../");
<ide> var WebpackOptionsApply = require("../lib/WebpackOptionsApply");
<ide> var WebpackOptionsDefaulter = require("../lib/WebpackOptionsDefaulter");
<ide>
<ide> describe("Compiler", function() {
<ide> writeFile: [],
<ide> };
<ide>
<del> var c = new Compiler();
<del> new NodeEnvironmentPlugin().apply(c);
<del> c.options = new WebpackOptionsApply().process(options, c);
<add> var c = webpack(options);
<ide> var files = {};
<ide> c.outputFileSystem = {
<ide> join: path.join.bind(path), | 2 |
PHP | PHP | add model.aftersavecommit event | 5025c805965eb8e6531947cef8b021f7bdbfbfcf | <ide><path>src/ORM/Table.php
<ide> public function save(EntityInterface $entity, $options = [])
<ide> $success = $connection->transactional(function () use ($entity, $options) {
<ide> return $this->_processSave($entity, $options);
<ide> });
<add> if ($success) {
<add> $this->dispatchEvent('Model.afterSaveCommit', compact('entity', 'options'));
<add> $entity->isNew(false);
<add> $entity->source($this->registryAlias());
<add> }
<ide> } else {
<ide> $success = $this->_processSave($entity, $options);
<ide> }
<ide> protected function _processSave($entity, $options)
<ide> if ($success || !$options['atomic']) {
<ide> $entity->clean();
<ide> $this->dispatchEvent('Model.afterSave', compact('entity', 'options'));
<del> $entity->isNew(false);
<del> $entity->source($this->registryAlias());
<add> if (!$options['atomic']) {
<add> $entity->isNew(false);
<add> $entity->source($this->registryAlias());
<add> }
<ide> $success = true;
<ide> }
<ide> }
<ide> public function implementedEvents()
<ide> 'Model.beforeFind' => 'beforeFind',
<ide> 'Model.beforeSave' => 'beforeSave',
<ide> 'Model.afterSave' => 'afterSave',
<add> 'Model.afterSaveCommit' => 'afterSaveCommit',
<ide> 'Model.beforeDelete' => 'beforeDelete',
<ide> 'Model.afterDelete' => 'afterDelete',
<ide> 'Model.beforeRules' => 'beforeRules', | 1 |
Text | Text | move julianduque to emeritus | 2f97e973ff540d2ae7de77482c631c06cc99c313 | <ide><path>README.md
<ide> For information about the governance of the Node.js project, see
<ide> **João Reis** <reis@janeasystems.com>
<ide> * [joyeecheung](https://github.com/joyeecheung) -
<ide> **Joyee Cheung** <joyeec9h3@gmail.com> (she/her)
<del>* [julianduque](https://github.com/julianduque) -
<del>**Julian Duque** <julianduquej@gmail.com> (he/him)
<ide> * [JungMinu](https://github.com/JungMinu) -
<ide> **Minwoo Jung** <nodecorelab@gmail.com> (he/him)
<ide> * [kfarnung](https://github.com/kfarnung) -
<ide> For information about the governance of the Node.js project, see
<ide> **Yuval Brik** <yuval@brik.org.il>
<ide> * [joshgav](https://github.com/joshgav) -
<ide> **Josh Gavant** <josh.gavant@outlook.com>
<add>* [julianduque](https://github.com/julianduque) -
<add>**Julian Duque** <julianduquej@gmail.com> (he/him)
<ide> * [kunalspathak](https://github.com/kunalspathak) -
<ide> **Kunal Pathak** <kunal.pathak@microsoft.com>
<ide> * [lucamaraschi](https://github.com/lucamaraschi) - | 1 |
Ruby | Ruby | fix rubocop offenses | 1b732ec7b2952b47c0c80e6cde3f3b61f2cbb669 | <ide><path>Library/Homebrew/PATH.rb
<ide> def to_str
<ide>
<ide> sig { params(other: T.untyped).returns(T::Boolean) }
<ide> def ==(other)
<del> if other.respond_to?(:to_ary) && to_ary == other.to_ary ||
<del> other.respond_to?(:to_str) && to_str == other.to_str
<del> true
<del> else
<add> (other.respond_to?(:to_ary) && to_ary == other.to_ary) ||
<add> (other.respond_to?(:to_str) && to_str == other.to_str) ||
<ide> false
<del> end
<ide> end
<ide>
<ide> sig { returns(T::Boolean) }
<ide><path>Library/Homebrew/build.rb
<ide> def expand_reqs
<ide> def expand_deps
<ide> formula.recursive_dependencies do |dependent, dep|
<ide> build = effective_build_options_for(dependent)
<del> if dep.prune_from_option?(build) || dep.prune_if_build_and_not_dependent?(dependent, formula) || dep.test?
<add> if dep.prune_from_option?(build) ||
<add> dep.prune_if_build_and_not_dependent?(dependent, formula) ||
<add> (dep.test? && !dep.build?)
<ide> Dependency.prune
<ide> elsif dep.build?
<ide> Dependency.keep_but_prune_recursive_deps
<ide><path>Library/Homebrew/cask/cmd/audit.rb
<ide> def run
<ide> options[:quarantine] = true if options[:quarantine].nil?
<ide>
<ide> casks = args.named.flat_map do |name|
<del> if File.exist?(name) && name.count("/") != 1
<del> name
<del> else
<del> Tap.fetch(name).cask_files
<del> end
<add> next name if File.exist?(name)
<add> next Tap.fetch(name).cask_files if name.count("/") == 1
<add>
<add> name
<ide> end
<ide> casks = casks.map { |c| CaskLoader.load(c, config: Config.from_args(args)) }
<ide> casks = Cask.to_a if casks.empty?
<ide><path>Library/Homebrew/cleaner.rb
<ide> def executable_path?(path)
<ide> path.text_executable? || path.executable?
<ide> end
<ide>
<add> # Both these files are completely unnecessary to package and cause
<add> # pointless conflicts with other formulae. They are removed by Debian,
<add> # Arch & MacPorts amongst other packagers as well. The files are
<add> # created as part of installing any Perl module.
<add> PERL_BASENAMES = Set.new(%w[perllocal.pod .packlist]).freeze
<add>
<ide> # Clean a top-level (bin, sbin, lib) directory, recursively, by fixing file
<ide> # permissions and removing .la files, unless the files (or parent
<ide> # directories) are protected by skip_clean.
<ide> def clean_dir(d)
<ide>
<ide> next if path.directory?
<ide>
<del> files_to_skip = %w[perllocal.pod .packlist]
<del> if path.extname == ".la" || (!path.symlink? && files_to_skip.include?(path.basename.to_s))
<del> # Both the `perllocal.pod` & `.packlist` files are completely unnecessary
<del> # to package & causes pointless conflict with other formulae. They are
<del> # removed by Debian, Arch & MacPorts amongst other packagers as well.
<del> # The files are created as part of installing any Perl module.
<add> if path.extname == ".la" || PERL_BASENAMES.include?(path.basename.to_s)
<ide> path.unlink
<ide> elsif path.symlink?
<ide> # Skip it.
<ide><path>Library/Homebrew/dev-cmd/bottle.rb
<ide> def merge(args:)
<ide> if key == "cellar"
<ide> # Prioritize HOMEBREW_CELLAR over :any over :any_skip_relocation
<ide> cellars = [first, second]
<del> if cellars.include?(HOMEBREW_CELLAR)
<del> HOMEBREW_CELLAR
<del> elsif first.start_with?("/")
<del> first
<del> elsif second.start_with?("/")
<del> second
<del> elsif cellars.include?("any")
<del> "any"
<del> elsif cellars.include?("any_skip_relocation")
<del> "any_skip_relocation"
<del> else # rubocop:disable Lint/DuplicateBranch
<del> second
<del> end
<del> else
<del> second
<add> next HOMEBREW_CELLAR if cellars.include?(HOMEBREW_CELLAR)
<add> next first if first.start_with?("/")
<add> next second if second.start_with?("/")
<add> next "any" if cellars.include?("any")
<add> next "any_skip_relocation" if cellars.include?("any_skip_relocation")
<ide> end
<add>
<add> second
<ide> end
<ide> end
<ide>
<ide><path>Library/Homebrew/download_strategy.rb
<ide> def self.detect_from_url(url)
<ide> when %r{^https?://(.+?\.)?googlecode\.com/svn},
<ide> %r{^https?://svn\.},
<ide> %r{^svn://},
<del> %r{^https?://(.+?\.)?sourceforge\.net/svnroot/},
<ide> %r{^svn\+http://},
<del> %r{^http://svn\.apache\.org/repos/}
<add> %r{^http://svn\.apache\.org/repos/},
<add> %r{^https?://(.+?\.)?sourceforge\.net/svnroot/}
<ide> SubversionDownloadStrategy
<ide> when %r{^cvs://}
<ide> CVSDownloadStrategy
<ide><path>Library/Homebrew/formula.rb
<ide> def outdated_kegs(fetch_head: false)
<ide> end
<ide>
<ide> if current_version ||
<del> (latest_head_version && !head_version_outdated?(latest_head_version, fetch_head: fetch_head))
<add> ((head_version = latest_head_version) && !head_version_outdated?(head_version, fetch_head: fetch_head))
<ide> []
<ide> else
<ide> all_kegs += old_installed_formulae.flat_map(&:installed_kegs)
<ide><path>Library/Homebrew/formula_installer.rb
<ide> def expand_requirements
<ide> if req.prune_from_option?(build) ||
<ide> req.satisfied?(env: env, cc: cc, build_bottle: @build_bottle, bottle_arch: bottle_arch) ||
<ide> ((req.build? || req.test?) && !keep_build_test) ||
<del> (formula_deps_map.key?(dependent.name) && formula_deps_map[dependent.name].build?)
<add> formula_deps_map[dependent.name]&.build?
<ide> Requirement.prune
<ide> else
<ide> unsatisfied_reqs[dependent] << req
<ide> def expand_dependencies(deps)
<ide> keep_build_test ||= dep.test? && include_test? && include_test_formulae.include?(dependent.full_name)
<ide> keep_build_test ||= dep.build? && !install_bottle_for?(dependent, build) && !dependent.latest_version_installed?
<ide>
<del> if dep.prune_from_option?(build) ||
<del> ((dep.build? || dep.test?) && !keep_build_test)
<add> if dep.prune_from_option?(build) || ((dep.build? || dep.test?) && !keep_build_test)
<ide> Dependency.prune
<ide> elsif dep.satisfied?(inherited_options[dep.name])
<ide> Dependency.skip
<ide><path>Library/Homebrew/keg.rb
<ide> def link(**options)
<ide> %r{^guile/},
<ide> *SHARE_PATHS
<ide> :mkpath
<del> else :link
<add> else
<add> :link
<ide> end
<ide> end
<ide>
<ide> link_dir("lib", **options) do |relative_path|
<ide> case relative_path.to_s
<del> when "charset.alias" then :skip_file
<add> when "charset.alias"
<add> :skip_file
<ide> when "pkgconfig", # pkg-config database gets explicitly created
<ide> "cmake", # cmake database gets explicitly created
<ide> "dtrace", # lib/language folders also get explicitly created
<ide> def link(**options)
<ide> "php",
<ide> /^python[23]\.\d/,
<ide> /^R/,
<del> /^ruby/,
<add> /^ruby/
<ide> :mkpath
<del> # Everything else is symlinked to the cellar
<del> else :link
<add> else
<add> # Everything else is symlinked to the cellar
<add> :link
<ide> end
<ide> end
<ide>
<ide><path>Library/Homebrew/os/mac/xcode.rb
<ide> def detect_version_from_clang_version
<ide> # installed CLT version. This is useful as they are packaged
<ide> # simultaneously so workarounds need to apply to both based on their
<ide> # comparable version.
<del> # rubocop:disable Lint/DuplicateBranch
<del> latest_stable = "12.0"
<ide> case (DevelopmentTools.clang_version.to_f * 10).to_i
<del> when 120 then latest_stable
<del> when 110 then "11.5"
<del> when 100 then "10.3"
<del> when 91 then "9.4"
<del> when 90 then "9.2"
<del> when 81 then "8.3"
<del> when 80 then "8.0"
<del> when 73 then "7.3"
<del> when 70 then "7.0"
<del> when 61 then "6.1"
<del> when 60 then "6.0"
<ide> when 0 then "dunno"
<del> else latest_stable
<add> when 60 then "6.0"
<add> when 61 then "6.1"
<add> when 70 then "7.0"
<add> when 73 then "7.3"
<add> when 80 then "8.0"
<add> when 81 then "8.3"
<add> when 90 then "9.2"
<add> when 91 then "9.4"
<add> when 100 then "10.3"
<add> when 110 then "11.5"
<add> else "12.0"
<ide> end
<del> # rubocop:enable Lint/DuplicateBranch
<ide> end
<ide>
<ide> def default_prefix?
<ide> def update_instructions
<ide>
<ide> # Bump these when the new version is distributed through Software Update
<ide> # and our CI systems have been updated.
<del> # rubocop:disable Lint/DuplicateBranch
<ide> sig { returns(String) }
<ide> def latest_clang_version
<ide> case MacOS.version
<del> when "11.0" then "1200.0.32.27"
<del> when "10.15" then "1200.0.32.27"
<add> when "11.0", "10.15" then "1200.0.32.27"
<ide> when "10.14" then "1100.0.33.17"
<ide> when "10.13" then "1000.10.44.2"
<ide> when "10.12" then "900.0.39.2"
<ide> def latest_clang_version
<ide> else "600.0.57"
<ide> end
<ide> end
<del> # rubocop:enable Lint/DuplicateBranch
<ide>
<ide> # Bump these if things are badly broken (e.g. no SDK for this macOS)
<ide> # without this. Generally this will be the first stable CLT release on
<ide><path>Library/Homebrew/rubocops/homepage.rb
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> problem "The homepage should start with http or https (URL is #{homepage})."
<ide> end
<ide>
<del> # rubocop:disable Lint/DuplicateBranch
<ide> case homepage
<del> # Check for http:// GitHub homepage URLs, https:// is preferred.
<del> # Note: only check homepages that are repo pages, not *.github.com hosts
<del> when %r{^http://github.com/}
<del> problem "Please use https:// for #{homepage}"
<del>
<del> # Savannah has full SSL/TLS support but no auto-redirect.
<del> # Doesn't apply to the download URLs, only the homepage.
<del> when %r{^http://savannah.nongnu.org/}
<del> problem "Please use https:// for #{homepage}"
<del>
<ide> # Freedesktop is complicated to handle - It has SSL/TLS, but only on certain subdomains.
<ide> # To enable https Freedesktop change the URL from http://project.freedesktop.org/wiki to
<ide> # https://wiki.freedesktop.org/project_name.
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> when %r{^https?://code\.google\.com/p/[^/]+[^/]$}
<ide> problem "#{homepage} should end with a slash"
<ide>
<del> # People will run into mixed content sometimes, but we should enforce and then add
<del> # exemptions as they are discovered. Treat mixed content on homepages as a bug.
<del> # Justify each exemptions with a code comment so we can keep track here.
<del>
<del> when %r{^http://[^/]*\.github\.io/},
<del> %r{^http://[^/]*\.sourceforge\.io/}
<del> problem "Please use https:// for #{homepage}"
<del>
<ide> when %r{^http://([^/]*)\.(sf|sourceforge)\.net(/|$)}
<ide> problem "#{homepage} should be `https://#{Regexp.last_match(1)}.sourceforge.io/`"
<ide>
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> offending_node(parameters(homepage_node).first)
<ide> problem "GitHub homepages (`#{homepage}`) should not end with .git"
<ide>
<del> # There's an auto-redirect here, but this mistake is incredibly common too.
<del> # Only applies to the homepage and subdomains for now, not the FTP URLs.
<del> when %r{^http://((?:build|cloud|developer|download|extensions|git|
<del> glade|help|library|live|nagios|news|people|
<del> projects|rt|static|wiki|www)\.)?gnome\.org}x
<del> problem "Please use https:// for #{homepage}"
<del>
<add> # People will run into mixed content sometimes, but we should enforce and then add
<add> # exemptions as they are discovered. Treat mixed content on homepages as a bug.
<add> # Justify each exemptions with a code comment so we can keep track here.
<add> #
<ide> # Compact the above into this list as we're able to remove detailed notations, etc over time.
<del> when %r{^http://[^/]*\.apache\.org},
<add> when
<add> # Check for http:// GitHub homepage URLs, https:// is preferred.
<add> # Note: only check homepages that are repo pages, not *.github.com hosts
<add> %r{^http://github.com/},
<add> %r{^http://[^/]*\.github\.io/},
<add>
<add> # Savannah has full SSL/TLS support but no auto-redirect.
<add> # Doesn't apply to the download URLs, only the homepage.
<add> %r{^http://savannah.nongnu.org/},
<add>
<add> %r{^http://[^/]*\.sourceforge\.io/},
<add> # There's an auto-redirect here, but this mistake is incredibly common too.
<add> # Only applies to the homepage and subdomains for now, not the FTP URLs.
<add> %r{^http://((?:build|cloud|developer|download|extensions|git|
<add> glade|help|library|live|nagios|news|people|
<add> projects|rt|static|wiki|www)\.)?gnome\.org}x,
<add> %r{^http://[^/]*\.apache\.org},
<ide> %r{^http://packages\.debian\.org},
<ide> %r{^http://wiki\.freedesktop\.org/},
<ide> %r{^http://((?:www)\.)?gnupg\.org/},
<ide> def audit_formula(_node, _class_node, _parent_class_node, body_node)
<ide> %r{^http://(?:[^/]*\.)?archive\.org}
<ide> problem "Please use https:// for #{homepage}"
<ide> end
<del> # rubocop:enable Lint/DuplicateBranch
<ide> end
<ide>
<ide> def autocorrect(node)
<ide><path>Library/Homebrew/version.rb
<ide> def <=>(other)
<ide> l += 1
<ide> r += 1
<ide> next
<del> elsif a.numeric? == b.numeric?
<del> return a <=> b
<del> elsif a.numeric?
<add> elsif a.numeric? && !b.numeric?
<ide> return 1 if a > NULL_TOKEN
<ide>
<ide> l += 1
<del> elsif b.numeric?
<add> elsif !a.numeric? && b.numeric?
<ide> return -1 if b > NULL_TOKEN
<ide>
<ide> r += 1
<add> else
<add> return a <=> b
<ide> end
<ide> end
<ide> | 12 |
Text | Text | update focus selector for input | 7b8fcea94ee2285cd40d16fbbb69d755051c81ed | <ide><path>guide/english/css/forms/index.md
<ide> In the below given example,only input type corresponding to first name will be s
<ide> <input type="submit" value="submit">
<ide> </form>
<ide> ```
<add>## Style input element with css
<add>
<add>### :focus selector
<add>The `:focus` selector is applied when the element accepts user inputs.
<add>
<add>```css
<add>input:focus {
<add> background-color: #FFFF66;
<add>}
<add>```
<add>
<ide>
<ide>
<ide> | 1 |
Python | Python | fix argument order | 1789c7daf1b8013006b0aef6cb1b8f80573031c5 | <ide><path>src/transformers/modeling_tf_transfo_xl.py
<ide> def init_mems(self, bsz):
<ide> else:
<ide> return None
<ide>
<del> def _update_mems(self, hids, mems, qlen, mlen):
<add> def _update_mems(self, hids, mems, mlen, qlen):
<ide> # does not deal with None
<ide> if mems is None:
<ide> return None | 1 |
Go | Go | limit push and pull to v2 official registry | 88fdcfef02cdc8b4fcff10cded6a89a42a360ec1 | <ide><path>graph/pull.go
<ide> func (s *TagStore) CmdPull(job *engine.Job) engine.Status {
<ide> logName += ":" + tag
<ide> }
<ide>
<del> if len(repoInfo.Index.Mirrors) == 0 && (repoInfo.Index.Official || endpoint.Version == registry.APIVersion2) {
<add> if len(repoInfo.Index.Mirrors) == 0 && ((repoInfo.Official && repoInfo.Index.Official) || endpoint.Version == registry.APIVersion2) {
<ide> j := job.Eng.Job("trust_update_base")
<ide> if err = j.Run(); err != nil {
<ide> log.Errorf("error updating trust base graph: %s", err)
<ide><path>graph/push.go
<ide> func (s *TagStore) CmdPush(job *engine.Job) engine.Status {
<ide> return job.Error(err2)
<ide> }
<ide>
<del> if repoInfo.Index.Official || endpoint.Version == registry.APIVersion2 {
<add> if endpoint.Version == registry.APIVersion2 {
<ide> err := s.pushV2Repository(r, job.Eng, job.Stdout, repoInfo, tag, sf)
<ide> if err == nil {
<ide> return engine.StatusOK | 2 |
Python | Python | reapply patches to legacy merge layer | 7095aca51b92cdc621a5c97e7b150b31ee2f207e | <ide><path>keras/legacy/layers.py
<ide> def compute_mask(self, inputs, mask=None):
<ide>
<ide> assert hasattr(mask, '__len__') and len(mask) == len(inputs)
<ide>
<del> if self.mode in ['sum', 'mul', 'ave']:
<add> if self.mode in ['sum', 'mul', 'ave', 'max']:
<ide> masks = [K.expand_dims(m, 0) for m in mask if m is not None]
<ide> return K.all(K.concatenate(masks, axis=0), axis=0, keepdims=False)
<ide> elif self.mode == 'concat':
<ide> def get_config(self):
<ide>
<ide> @classmethod
<ide> def from_config(cls, config):
<add> config = config.copy()
<ide> mode_type = config.pop('mode_type')
<ide> if mode_type == 'function':
<ide> mode = globals()[config['mode']]
<ide> def merge(inputs, mode='sum', concat_axis=-1,
<ide> ```
<ide> # Arguments
<ide> mode: String or lambda/function. If string, must be one
<del> of: 'sum', 'mul', 'concat', 'ave', 'cos', 'dot'.
<add> of: 'sum', 'mul', 'concat', 'ave', 'cos', 'dot', 'max'.
<ide> If lambda/function, it should take as input a list of tensors
<ide> and return a single tensor.
<ide> concat_axis: Integer, axis to use in mode `concat`. | 1 |
Javascript | Javascript | use `isstream` helper to check for streamness | 34e28a248cf3a9e03ad1d94e430dfc376bc29b67 | <ide><path>packages/ember-metal/lib/streams/stream.js
<ide> import {
<ide> getTailPath
<ide> } from "ember-metal/path_cache";
<ide> import Ember from "ember-metal/core";
<add>import {
<add> isStream
<add>} from 'ember-metal/streams/utils';
<ide>
<ide> /**
<ide> @module ember-metal
<ide> Dependency.prototype.removeFrom = function(stream) {
<ide> };
<ide>
<ide> Dependency.prototype.replace = function(stream, callback, context) {
<del> if (!stream.isStream) {
<add> if (!isStream(stream)) {
<ide> this.stream = null;
<ide> this.callback = null;
<ide> this.context = null;
<ide> Stream.prototype = {
<ide> },
<ide>
<ide> addDependency(stream, callback, context) {
<del> if (!stream || !stream.isStream) {
<add> if (!isStream(stream)) {
<ide> return null;
<ide> }
<ide>
<ide> Stream.prototype = {
<ide> };
<ide>
<ide> Stream.wrap = function(value, Kind, param) {
<del> if (value.isStream) {
<add> if (isStream(value)) {
<ide> return value;
<ide> } else {
<ide> return new Kind(value, param); | 1 |
Python | Python | remove unnecessary branch | e311b02e704891b2f31a1e2c8fe2df77a032b09b | <ide><path>divide_and_conquer/inversions.py
<ide> Given an array-like data structure A[1..n], how many pairs
<ide> (i, j) for all 1 <= i < j <= n such that A[i] > A[j]? These pairs are
<ide> called inversions. Counting the number of such inversions in an array-like
<del>object is the important. Among other things, counting inversions can help
<del>us determine how close a given array is to being sorted
<del>
<add>object is the important. Among other things, counting inversions can help
<add>us determine how close a given array is to being sorted.
<ide> In this implementation, I provide two algorithms, a divide-and-conquer
<ide> algorithm which runs in nlogn and the brute-force n^2 algorithm.
<del>
<ide> """
<ide>
<ide>
<ide> def count_inversions_bf(arr):
<ide> """
<ide> Counts the number of inversions using a a naive brute-force algorithm
<del>
<ide> Parameters
<ide> ----------
<ide> arr: arr: array-like, the list containing the items for which the number
<ide> of inversions is desired. The elements of `arr` must be comparable.
<del>
<ide> Returns
<ide> -------
<ide> num_inversions: The total number of inversions in `arr`
<del>
<ide> Examples
<ide> ---------
<del>
<ide> >>> count_inversions_bf([1, 4, 2, 4, 1])
<ide> 4
<ide> >>> count_inversions_bf([1, 1, 2, 4, 4])
<ide> def count_inversions_bf(arr):
<ide> def count_inversions_recursive(arr):
<ide> """
<ide> Counts the number of inversions using a divide-and-conquer algorithm
<del>
<ide> Parameters
<ide> -----------
<ide> arr: array-like, the list containing the items for which the number
<ide> of inversions is desired. The elements of `arr` must be comparable.
<del>
<ide> Returns
<ide> -------
<ide> C: a sorted copy of `arr`.
<ide> num_inversions: int, the total number of inversions in 'arr'
<del>
<ide> Examples
<ide> --------
<del>
<ide> >>> count_inversions_recursive([1, 4, 2, 4, 1])
<ide> ([1, 1, 2, 4, 4], 4)
<ide> >>> count_inversions_recursive([1, 1, 2, 4, 4])
<ide> def count_inversions_recursive(arr):
<ide> """
<ide> if len(arr) <= 1:
<ide> return arr, 0
<del> else:
<del> mid = len(arr) // 2
<del> P = arr[0:mid]
<del> Q = arr[mid:]
<add> mid = len(arr) // 2
<add> P = arr[0:mid]
<add> Q = arr[mid:]
<ide>
<del> A, inversion_p = count_inversions_recursive(P)
<del> B, inversions_q = count_inversions_recursive(Q)
<del> C, cross_inversions = _count_cross_inversions(A, B)
<add> A, inversion_p = count_inversions_recursive(P)
<add> B, inversions_q = count_inversions_recursive(Q)
<add> C, cross_inversions = _count_cross_inversions(A, B)
<ide>
<del> num_inversions = inversion_p + inversions_q + cross_inversions
<del> return C, num_inversions
<add> num_inversions = inversion_p + inversions_q + cross_inversions
<add> return C, num_inversions
<ide>
<ide>
<ide> def _count_cross_inversions(P, Q):
<ide> """
<ide> Counts the inversions across two sorted arrays.
<ide> And combine the two arrays into one sorted array
<del>
<ide> For all 1<= i<=len(P) and for all 1 <= j <= len(Q),
<ide> if P[i] > Q[j], then (i, j) is a cross inversion
<del>
<ide> Parameters
<ide> ----------
<ide> P: array-like, sorted in non-decreasing order
<ide> Q: array-like, sorted in non-decreasing order
<del>
<ide> Returns
<ide> ------
<ide> R: array-like, a sorted array of the elements of `P` and `Q`
<ide> num_inversion: int, the number of inversions across `P` and `Q`
<del>
<ide> Examples
<ide> --------
<del>
<ide> >>> _count_cross_inversions([1, 2, 3], [0, 2, 5])
<ide> ([0, 1, 2, 2, 3, 5], 4)
<ide> >>> _count_cross_inversions([1, 2, 3], [3, 4, 5]) | 1 |
Text | Text | fix minor typo | 180c6de6a69645225ae0017f0b5030d0c411dacf | <ide><path>docs/source/parallelism.md
<ide> a0 | b0 | c0
<ide> a1 | b1 | c1
<ide> a2 | b2 | c2
<ide> ```
<del>Layer La has weights a0, at and a2.
<add>Layer La has weights a0, a1 and a2.
<ide>
<ide> If we have 3 GPUs, the Sharded DDP (= Zero-DP) splits the model onto 3 GPUs like so:
<ide> | 1 |
PHP | PHP | change controller->filters to protected | c4eb6c94160d589be9a38aa3426f21a313f98877 | <ide><path>laravel/routing/controller.php
<ide> protected static function hidden($method)
<ide> * @param string $name
<ide> * @return array
<ide> */
<del> public function filters($name)
<add> protected function filters($name)
<ide> {
<ide> return (array) $this->$name;
<ide> } | 1 |
Text | Text | add ayase-252 to triagers | 5318e53fd89db5ba90036d040cb0558060813f18 | <ide><path>README.md
<ide> maintaining the Node.js project.
<ide>
<ide> ### Triagers
<ide>
<add>* [Ayase-252](https://github.com/Ayase-252) -
<add>**Qingyu Deng** <i@ayase-lab.com>
<ide> * [marsonya](https://github.com/marsonya) -
<ide> **Akhil Marsonya** <akhil.marsonya27@gmail.com> (he/him)
<ide> * [PoojaDurgad](https://github.com/PoojaDurgad) - | 1 |
Go | Go | add back compat for volume drivers `get` and `ls` | f6c20d9b22ec9913f67b6c2ebdb5ef07c87b8cd7 | <ide><path>integration-cli/docker_cli_volume_driver_compat_unix_test.go
<add>// +build !windows
<add>
<add>package main
<add>
<add>import (
<add> "encoding/json"
<add> "fmt"
<add> "io"
<add> "io/ioutil"
<add> "net/http"
<add> "net/http/httptest"
<add> "os"
<add> "path/filepath"
<add> "strings"
<add>
<add> "github.com/docker/docker/pkg/integration/checker"
<add>
<add> "github.com/go-check/check"
<add>)
<add>
<add>func init() {
<add> check.Suite(&DockerExternalVolumeSuiteCompatV1_1{
<add> ds: &DockerSuite{},
<add> })
<add>}
<add>
<add>type DockerExternalVolumeSuiteCompatV1_1 struct {
<add> server *httptest.Server
<add> ds *DockerSuite
<add> d *Daemon
<add> ec *eventCounter
<add>}
<add>
<add>func (s *DockerExternalVolumeSuiteCompatV1_1) SetUpTest(c *check.C) {
<add> s.d = NewDaemon(c)
<add> s.ec = &eventCounter{}
<add>}
<add>
<add>func (s *DockerExternalVolumeSuiteCompatV1_1) TearDownTest(c *check.C) {
<add> s.d.Stop()
<add> s.ds.TearDownTest(c)
<add>}
<add>
<add>func (s *DockerExternalVolumeSuiteCompatV1_1) SetUpSuite(c *check.C) {
<add> mux := http.NewServeMux()
<add> s.server = httptest.NewServer(mux)
<add>
<add> type pluginRequest struct {
<add> Name string
<add> }
<add>
<add> type pluginResp struct {
<add> Mountpoint string `json:",omitempty"`
<add> Err string `json:",omitempty"`
<add> }
<add>
<add> type vol struct {
<add> Name string
<add> Mountpoint string
<add> }
<add> var volList []vol
<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> }
<add> }
<add>
<add> mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
<add> s.ec.activations++
<add> send(w, `{"Implements": ["VolumeDriver"]}`)
<add> })
<add>
<add> mux.HandleFunc("/VolumeDriver.Create", func(w http.ResponseWriter, r *http.Request) {
<add> s.ec.creations++
<add> pr, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<add> }
<add> volList = append(volList, vol{Name: pr.Name})
<add> send(w, nil)
<add> })
<add>
<add> mux.HandleFunc("/VolumeDriver.Remove", func(w http.ResponseWriter, r *http.Request) {
<add> s.ec.removals++
<add> pr, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<add> }
<add>
<add> if err := os.RemoveAll(hostVolumePath(pr.Name)); err != nil {
<add> send(w, &pluginResp{Err: err.Error()})
<add> return
<add> }
<add>
<add> for i, v := range volList {
<add> if v.Name == pr.Name {
<add> if err := os.RemoveAll(hostVolumePath(v.Name)); err != nil {
<add> send(w, fmt.Sprintf(`{"Err": "%v"}`, err))
<add> return
<add> }
<add> volList = append(volList[:i], volList[i+1:]...)
<add> break
<add> }
<add> }
<add> send(w, nil)
<add> })
<add>
<add> mux.HandleFunc("/VolumeDriver.Path", func(w http.ResponseWriter, r *http.Request) {
<add> s.ec.paths++
<add>
<add> pr, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<add> }
<add> p := hostVolumePath(pr.Name)
<add> send(w, &pluginResp{Mountpoint: p})
<add> })
<add>
<add> mux.HandleFunc("/VolumeDriver.Mount", func(w http.ResponseWriter, r *http.Request) {
<add> s.ec.mounts++
<add>
<add> pr, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<add> }
<add>
<add> p := hostVolumePath(pr.Name)
<add> if err := os.MkdirAll(p, 0755); err != nil {
<add> send(w, &pluginResp{Err: err.Error()})
<add> return
<add> }
<add>
<add> if err := ioutil.WriteFile(filepath.Join(p, "test"), []byte(s.server.URL), 0644); err != nil {
<add> send(w, err)
<add> return
<add> }
<add>
<add> send(w, &pluginResp{Mountpoint: p})
<add> })
<add>
<add> mux.HandleFunc("/VolumeDriver.Unmount", func(w http.ResponseWriter, r *http.Request) {
<add> s.ec.unmounts++
<add>
<add> _, err := read(r.Body)
<add> if err != nil {
<add> send(w, err)
<add> return
<add> }
<add>
<add> send(w, nil)
<add> })
<add>
<add> err := os.MkdirAll("/etc/docker/plugins", 0755)
<add> c.Assert(err, checker.IsNil)
<add>
<add> err = ioutil.WriteFile("/etc/docker/plugins/test-external-volume-driver.spec", []byte(s.server.URL), 0644)
<add> c.Assert(err, checker.IsNil)
<add>}
<add>
<add>func (s *DockerExternalVolumeSuiteCompatV1_1) TearDownSuite(c *check.C) {
<add> s.server.Close()
<add>
<add> err := os.RemoveAll("/etc/docker/plugins")
<add> c.Assert(err, checker.IsNil)
<add>}
<add>
<add>func (s *DockerExternalVolumeSuiteCompatV1_1) TestExternalVolumeDriverCompatV1_1(c *check.C) {
<add> err := s.d.StartWithBusybox()
<add> c.Assert(err, checker.IsNil)
<add>
<add> out, err := s.d.Cmd("run", "--name=test", "-v", "foo:/bar", "--volume-driver", "test-external-volume-driver", "busybox", "sh", "-c", "echo hello > /bar/hello")
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<add> out, err = s.d.Cmd("rm", "test")
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<add>
<add> out, err = s.d.Cmd("run", "--name=test2", "-v", "foo:/bar", "busybox", "cat", "/bar/hello")
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<add> c.Assert(strings.TrimSpace(out), checker.Equals, "hello")
<add>
<add> err = s.d.Restart()
<add> c.Assert(err, checker.IsNil)
<add>
<add> out, err = s.d.Cmd("start", "-a", "test2")
<add> c.Assert(strings.TrimSpace(out), checker.Equals, "hello")
<add>
<add> out, err = s.d.Cmd("rm", "test2")
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<add>
<add> out, err = s.d.Cmd("volume", "inspect", "foo")
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<add>
<add> out, err = s.d.Cmd("volume", "rm", "foo")
<add> c.Assert(err, checker.IsNil, check.Commentf(out))
<add>}
<ide><path>pkg/plugins/client.go
<ide> package plugins
<ide> import (
<ide> "bytes"
<ide> "encoding/json"
<del> "fmt"
<ide> "io"
<ide> "io/ioutil"
<ide> "net/http"
<ide> func (c *Client) callWithRetry(serviceMethod string, data io.Reader, retry bool)
<ide> if resp.StatusCode != http.StatusOK {
<ide> b, err := ioutil.ReadAll(resp.Body)
<ide> if err != nil {
<del> return nil, fmt.Errorf("%s: %s", serviceMethod, err)
<add> return nil, &statusError{resp.StatusCode, serviceMethod, err.Error()}
<ide> }
<ide>
<ide> // Plugins' Response(s) should have an Err field indicating what went
<ide> func (c *Client) callWithRetry(serviceMethod string, data io.Reader, retry bool)
<ide> remoteErr := responseErr{}
<ide> if err := json.Unmarshal(b, &remoteErr); err == nil {
<ide> if remoteErr.Err != "" {
<del> return nil, fmt.Errorf("%s: %s", serviceMethod, remoteErr.Err)
<add> return nil, &statusError{resp.StatusCode, serviceMethod, remoteErr.Err}
<ide> }
<ide> }
<ide> // old way...
<del> return nil, fmt.Errorf("%s: %s", serviceMethod, string(b))
<add> return nil, &statusError{resp.StatusCode, serviceMethod, string(b)}
<ide> }
<ide> return resp.Body, nil
<ide> }
<ide><path>pkg/plugins/errors.go
<add>package plugins
<add>
<add>import (
<add> "fmt"
<add> "net/http"
<add>)
<add>
<add>type statusError struct {
<add> status int
<add> method string
<add> err string
<add>}
<add>
<add>// Error returns a formated string for this error type
<add>func (e *statusError) Error() string {
<add> return fmt.Sprintf("%s: %v", e.method, e.err)
<add>}
<add>
<add>// IsNotFound indicates if the passed in error is from an http.StatusNotFound from the plugin
<add>func IsNotFound(err error) bool {
<add> return isStatusError(err, http.StatusNotFound)
<add>}
<add>
<add>func isStatusError(err error, status int) bool {
<add> if err == nil {
<add> return false
<add> }
<add> e, ok := err.(*statusError)
<add> if !ok {
<add> return false
<add> }
<add> return e.status == status
<add>}
<ide><path>volume/drivers/adapter.go
<ide> package volumedrivers
<ide>
<del>import "github.com/docker/docker/volume"
<add>import (
<add> "github.com/docker/docker/pkg/plugins"
<add> "github.com/docker/docker/volume"
<add>)
<ide>
<ide> type volumeDriverAdapter struct {
<ide> name string
<ide> func (a *volumeDriverAdapter) List() ([]volume.Volume, error) {
<ide> func (a *volumeDriverAdapter) Get(name string) (volume.Volume, error) {
<ide> v, err := a.proxy.Get(name)
<ide> if err != nil {
<del> return nil, err
<add> // TODO: remove this hack. Allows back compat with volume drivers that don't support this call
<add> if !plugins.IsNotFound(err) {
<add> return nil, err
<add> }
<add> return a.Create(name, nil)
<ide> }
<ide>
<ide> return &volumeAdapter{
<ide><path>volume/store/store.go
<ide> import (
<ide> func New() *VolumeStore {
<ide> return &VolumeStore{
<ide> locks: &locker.Locker{},
<del> names: make(map[string]string),
<add> names: make(map[string]volume.Volume),
<ide> refs: make(map[string][]string),
<ide> }
<ide> }
<ide>
<del>func (s *VolumeStore) getNamed(name string) (string, bool) {
<add>func (s *VolumeStore) getNamed(name string) (volume.Volume, bool) {
<ide> s.globalLock.Lock()
<del> driverName, exists := s.names[name]
<add> v, exists := s.names[name]
<ide> s.globalLock.Unlock()
<del> return driverName, exists
<add> return v, exists
<ide> }
<ide>
<del>func (s *VolumeStore) setNamed(name, driver, ref string) {
<add>func (s *VolumeStore) setNamed(v volume.Volume, ref string) {
<ide> s.globalLock.Lock()
<del> s.names[name] = driver
<add> s.names[v.Name()] = v
<ide> if len(ref) > 0 {
<del> s.refs[name] = append(s.refs[name], ref)
<add> s.refs[v.Name()] = append(s.refs[v.Name()], ref)
<ide> }
<ide> s.globalLock.Unlock()
<ide> }
<ide> type VolumeStore struct {
<ide> globalLock sync.Mutex
<ide> // names stores the volume name -> driver name relationship.
<ide> // This is used for making lookups faster so we don't have to probe all drivers
<del> names map[string]string
<add> names map[string]volume.Volume
<ide> // refs stores the volume name and the list of things referencing it
<ide> refs map[string][]string
<ide> }
<ide> func (s *VolumeStore) List() ([]volume.Volume, []string, error) {
<ide> name := normaliseVolumeName(v.Name())
<ide>
<ide> s.locks.Lock(name)
<del> driverName, exists := s.getNamed(name)
<add> storedV, exists := s.getNamed(name)
<ide> if !exists {
<del> s.setNamed(name, v.DriverName(), "")
<add> s.setNamed(v, "")
<ide> }
<del> if exists && driverName != v.DriverName() {
<del> logrus.Warnf("Volume name %s already exists for driver %s, not including volume returned by %s", v.Name(), driverName, v.DriverName())
<add> if exists && storedV.DriverName() != v.DriverName() {
<add> logrus.Warnf("Volume name %s already exists for driver %s, not including volume returned by %s", v.Name(), storedV.DriverName(), v.DriverName())
<ide> s.locks.Unlock(v.Name())
<ide> continue
<ide> }
<ide> func (s *VolumeStore) list() ([]volume.Volume, []string, error) {
<ide> )
<ide>
<ide> type vols struct {
<del> vols []volume.Volume
<del> err error
<add> vols []volume.Volume
<add> err error
<add> driverName string
<ide> }
<ide> chVols := make(chan vols, len(drivers))
<ide>
<ide> for _, vd := range drivers {
<ide> go func(d volume.Driver) {
<ide> vs, err := d.List()
<ide> if err != nil {
<del> chVols <- vols{err: &OpErr{Err: err, Name: d.Name(), Op: "list"}}
<add> chVols <- vols{driverName: d.Name(), err: &OpErr{Err: err, Name: d.Name(), Op: "list"}}
<ide> return
<ide> }
<ide> chVols <- vols{vols: vs}
<ide> }(vd)
<ide> }
<ide>
<add> badDrivers := make(map[string]struct{})
<ide> for i := 0; i < len(drivers); i++ {
<ide> vs := <-chVols
<ide>
<ide> if vs.err != nil {
<ide> warnings = append(warnings, vs.err.Error())
<add> badDrivers[vs.driverName] = struct{}{}
<ide> logrus.Warn(vs.err)
<del> continue
<ide> }
<ide> ls = append(ls, vs.vols...)
<ide> }
<add>
<add> if len(badDrivers) > 0 {
<add> for _, v := range s.names {
<add> if _, exists := badDrivers[v.DriverName()]; exists {
<add> ls = append(ls, v)
<add> }
<add> }
<add> }
<ide> return ls, warnings, nil
<ide> }
<ide>
<ide> func (s *VolumeStore) CreateWithRef(name, driverName, ref string, opts map[strin
<ide> return nil, &OpErr{Err: err, Name: name, Op: "create"}
<ide> }
<ide>
<del> s.setNamed(name, v.DriverName(), ref)
<add> s.setNamed(v, ref)
<ide> return v, nil
<ide> }
<ide>
<ide> func (s *VolumeStore) Create(name, driverName string, opts map[string]string) (v
<ide> if err != nil {
<ide> return nil, &OpErr{Err: err, Name: name, Op: "create"}
<ide> }
<del> s.setNamed(name, v.DriverName(), "")
<add> s.setNamed(v, "")
<ide> return v, nil
<ide> }
<ide>
<ide> func (s *VolumeStore) create(name, driverName string, opts map[string]string) (v
<ide> return nil, &OpErr{Err: errInvalidName, Name: name, Op: "create"}
<ide> }
<ide>
<del> vdName, exists := s.getNamed(name)
<del> if exists {
<del> if vdName != driverName && driverName != "" && driverName != volume.DefaultDriverName {
<add> if v, exists := s.getNamed(name); exists {
<add> if v.DriverName() != driverName && driverName != "" && driverName != volume.DefaultDriverName {
<ide> return nil, errNameConflict
<ide> }
<del> driverName = vdName
<add> return v, nil
<ide> }
<ide>
<ide> logrus.Debugf("Registering new volume reference: driver %s, name %s", driverName, name)
<ide> func (s *VolumeStore) GetWithRef(name, driverName, ref string) (volume.Volume, e
<ide> return nil, &OpErr{Err: err, Name: name, Op: "get"}
<ide> }
<ide>
<del> s.setNamed(name, v.DriverName(), ref)
<add> s.setNamed(v, ref)
<ide> return v, nil
<ide> }
<ide>
<ide> func (s *VolumeStore) Get(name string) (volume.Volume, error) {
<ide> if err != nil {
<ide> return nil, &OpErr{Err: err, Name: name, Op: "get"}
<ide> }
<add> s.setNamed(v, "")
<ide> return v, nil
<ide> }
<ide>
<ide> func (s *VolumeStore) Get(name string) (volume.Volume, error) {
<ide> // it is expected that callers of this function hold any neccessary locks
<ide> func (s *VolumeStore) getVolume(name string) (volume.Volume, error) {
<ide> logrus.Debugf("Getting volume reference for name: %s", name)
<del> if vdName, exists := s.names[name]; exists {
<del> vd, err := volumedrivers.GetDriver(vdName)
<add> if v, exists := s.names[name]; exists {
<add> vd, err := volumedrivers.GetDriver(v.DriverName())
<ide> if err != nil {
<ide> return nil, err
<ide> } | 5 |
Javascript | Javascript | fix failing example in ember.select docs | 833e2367dce711d0b78aa754137f05c438f6dab0 | <ide><path>packages/ember-handlebars/lib/controls/select.js
<ide> var indexOf = Ember.EnumerableUtils.indexOf, indexesOf = Ember.EnumerableUtils.i
<ide> Example:
<ide>
<ide> ``` javascript
<del> App.Names = ["Yehuda", "Tom"];
<add> App.names = ["Yehuda", "Tom"];
<ide> ```
<ide>
<ide> ``` handlebars
<del> {{view Ember.Select contentBinding="App.Names"}}
<add> {{view Ember.Select contentBinding="App.names"}}
<ide> ```
<ide>
<ide> Would result in the following HTML:
<ide> var indexOf = Ember.EnumerableUtils.indexOf, indexesOf = Ember.EnumerableUtils.i
<ide> `value` property directly or as a binding:
<ide>
<ide> ``` javascript
<del> App.Names = Ember.Object.create({
<add> App.names = Ember.Object.create({
<ide> selected: 'Tom',
<ide> content: ["Yehuda", "Tom"]
<ide> });
<ide> ```
<ide>
<ide> ``` handlebars
<ide> {{view Ember.Select
<del> contentBinding="App.controller.content"
<del> valueBinding="App.controller.selected"
<add> contentBinding="App.names.content"
<add> valueBinding="App.names.selected"
<ide> }}
<ide> ```
<ide>
<ide> var indexOf = Ember.EnumerableUtils.indexOf, indexesOf = Ember.EnumerableUtils.i
<ide> ```
<ide>
<ide> A user interacting with the rendered `<select>` to choose "Yehuda" would update
<del> the value of `App.controller.selected` to "Yehuda".
<add> the value of `App.names.selected` to "Yehuda".
<ide>
<ide> ### `content` as an Array of Objects
<ide> An Ember.Select can also take an array of JavaScript or Ember objects
<ide> var indexOf = Ember.EnumerableUtils.indexOf, indexesOf = Ember.EnumerableUtils.i
<ide> element's text. Both paths must reference each object itself as 'content':
<ide>
<ide> ``` javascript
<del> App.Programmers = [
<add> App.programmers = [
<ide> Ember.Object.create({firstName: "Yehuda", id: 1}),
<ide> Ember.Object.create({firstName: "Tom", id: 2})
<ide> ];
<ide> ```
<ide>
<ide> ``` handlebars
<ide> {{view Ember.Select
<del> contentBinding="App.Programmers"
<add> contentBinding="App.programmers"
<ide> optionValuePath="content.id"
<ide> optionLabelPath="content.firstName"}}
<ide> ```
<ide> var indexOf = Ember.EnumerableUtils.indexOf, indexesOf = Ember.EnumerableUtils.i
<ide> `valueBinding` option:
<ide>
<ide> ``` javascript
<del> App.Programmers = [
<add> App.programmers = [
<ide> Ember.Object.create({firstName: "Yehuda", id: 1}),
<ide> Ember.Object.create({firstName: "Tom", id: 2})
<ide> ];
<ide> var indexOf = Ember.EnumerableUtils.indexOf, indexesOf = Ember.EnumerableUtils.i
<ide>
<ide> ``` handlebars
<ide> {{view Ember.Select
<del> contentBinding="App.controller.content"
<add> contentBinding="App.programmers"
<ide> optionValuePath="content.id"
<ide> optionLabelPath="content.firstName"
<ide> valueBinding="App.currentProgrammer.id"}} | 1 |
PHP | PHP | use the getattributes method on insert | 61bdc1f845a1c91ddc1cfadb720052e815b493cc | <ide><path>src/Illuminate/Database/Eloquent/Model.php
<ide> protected function performInsert(Builder $query)
<ide> // If the model has an incrementing key, we can use the "insertGetId" method on
<ide> // the query builder, which will give us back the final inserted ID for this
<ide> // table from the database. Not all tables have to be incrementing though.
<del> $attributes = $this->attributes;
<add> $attributes = $this->getAttributes();
<ide>
<ide> if ($this->getIncrementing()) {
<ide> $this->insertAndSetId($query, $attributes); | 1 |
Javascript | Javascript | use consistent jsdoc types | 1e8b296c58b77d3b7b46d45c7ef3e44981c5c3e7 | <ide><path>lib/fs.js
<ide> function readvSync(fd, buffers, position) {
<ide> /**
<ide> * Writes `buffer` to the specified `fd` (file descriptor).
<ide> * @param {number} fd
<del> * @param {Buffer | TypedArray | DataView | string | Object} buffer
<add> * @param {Buffer | TypedArray | DataView | string | object} buffer
<ide> * @param {number} [offset]
<ide> * @param {number} [length]
<ide> * @param {number} [position]
<ide> ObjectDefineProperty(write, internalUtil.customPromisifyArgs,
<ide> * Synchronously writes `buffer` to the
<ide> * specified `fd` (file descriptor).
<ide> * @param {number} fd
<del> * @param {Buffer | TypedArray | DataView | string | Object} buffer
<add> * @param {Buffer | TypedArray | DataView | string | object} buffer
<ide> * @param {number} [offset]
<ide> * @param {number} [length]
<ide> * @param {number} [position]
<ide> function writeAll(fd, isUserFd, buffer, offset, length, signal, callback) {
<ide> /**
<ide> * Asynchronously writes data to the file.
<ide> * @param {string | Buffer | URL | number} path
<del> * @param {string | Buffer | TypedArray | DataView | Object} data
<add> * @param {string | Buffer | TypedArray | DataView | object} data
<ide> * @param {{
<ide> * encoding?: string | null;
<ide> * mode?: number;
<ide> function writeFile(path, data, options, callback) {
<ide> /**
<ide> * Synchronously writes data to the file.
<ide> * @param {string | Buffer | URL | number} path
<del> * @param {string | Buffer | TypedArray | DataView | Object} data
<add> * @param {string | Buffer | TypedArray | DataView | object} data
<ide> * @param {{
<ide> * encoding?: string | null;
<ide> * mode?: number;
<ide> function copyFileSync(src, dest, mode) {
<ide> * symlink. The contents of directories will be copied recursively.
<ide> * @param {string | URL} src
<ide> * @param {string | URL} dest
<del> * @param {Object} [options]
<add> * @param {object} [options]
<ide> * @param {() => any} callback
<ide> * @returns {void}
<ide> */
<ide> function cp(src, dest, options, callback) {
<ide> * symlink. The contents of directories will be copied recursively.
<ide> * @param {string | URL} src
<ide> * @param {string | URL} dest
<del> * @param {Object} [options]
<add> * @param {object} [options]
<ide> * @returns {void}
<ide> */
<ide> function cpSync(src, dest, options) {
<ide><path>lib/http.js
<ide> function createServer(opts, requestListener) {
<ide> }
<ide>
<ide> /**
<del> * @typedef {Object} HTTPRequestOptions
<add> * @typedef {object} HTTPRequestOptions
<ide> * @property {httpAgent.Agent | boolean} [agent]
<ide> * @property {string} [auth]
<ide> * @property {Function} [createConnection]
<ide> * @property {number} [defaultPort]
<ide> * @property {number} [family]
<del> * @property {Object} [headers]
<add> * @property {object} [headers]
<ide> * @property {number} [hints]
<ide> * @property {string} [host]
<ide> * @property {string} [hostname]
<ide><path>lib/internal/errors.js
<ide> const captureLargerStackTrace = hideStackFrames(
<ide> * The goal is to migrate them to ERR_* errors later when compatibility is
<ide> * not a concern.
<ide> *
<del> * @param {Object} ctx
<add> * @param {object} ctx
<ide> * @returns {Error}
<ide> */
<ide> const uvException = hideStackFrames(function uvException(ctx) {
<ide><path>lib/internal/modules/esm/loader.js
<ide> class ESMLoader {
<ide> /**
<ide> * Prior to ESM loading. These are called once before any modules are started.
<ide> * @private
<del> * @property {function[]} globalPreloaders First-in-first-out list of
<add> * @property {Function[]} globalPreloaders First-in-first-out list of
<ide> * preload hooks.
<ide> */
<ide> #globalPreloaders = [];
<ide>
<ide> /**
<ide> * Phase 2 of 2 in ESM loading.
<ide> * @private
<del> * @property {function[]} loaders First-in-first-out list of loader hooks.
<add> * @property {Function[]} loaders First-in-first-out list of loader hooks.
<ide> */
<ide> #loaders = [
<ide> defaultLoad,
<ide> class ESMLoader {
<ide> /**
<ide> * Phase 1 of 2 in ESM loading.
<ide> * @private
<del> * @property {function[]} resolvers First-in-first-out list of resolver hooks
<add> * @property {Function[]} resolvers First-in-first-out list of resolver hooks
<ide> */
<ide> #resolvers = [
<ide> defaultResolve,
<ide> class ESMLoader {
<ide> * The internals of this WILL change when chaining is implemented,
<ide> * depending on the resolution/consensus from #36954
<ide> * @param {string} url The URL/path of the module to be loaded
<del> * @param {Object} context Metadata about the module
<del> * @returns {Object}
<add> * @param {object} context Metadata about the module
<add> * @returns {object}
<ide> */
<ide> async load(url, context = {}) {
<ide> const defaultLoader = this.#loaders[0];
<ide><path>lib/internal/source_map/source_map.js
<ide> class SourceMap {
<ide> }
<ide>
<ide> /**
<del> * @return {Object} raw source map v3 payload.
<add> * @return {object} raw source map v3 payload.
<ide> */
<ide> get payload() {
<ide> return cloneSourceMapV3(this.#payload);
<ide><path>lib/internal/util/inspect.js
<ide> function getUserOptions(ctx, isCrossContext) {
<ide> * in the best way possible given the different types.
<ide> *
<ide> * @param {any} value The value to print out.
<del> * @param {Object} opts Optional options object that alters the output.
<add> * @param {object} opts Optional options object that alters the output.
<ide> */
<ide> /* Legacy: value, showHidden, depth, colors */
<ide> function inspect(value, opts) {
<ide><path>lib/v8.js
<ide> class DefaultSerializer extends Serializer {
<ide> /**
<ide> * Used to write some kind of host object, i.e. an
<ide> * object that is created by native C++ bindings.
<del> * @param {Object} abView
<add> * @param {object} abView
<ide> * @returns {void}
<ide> */
<ide> _writeHostObject(abView) {
<ide><path>test/async-hooks/hook-checks.js
<ide> const assert = require('assert');
<ide> *
<ide> * @name checkInvocations
<ide> * @function
<del> * @param {Object} activity including timestamps for each life time event,
<add> * @param {object} activity including timestamps for each life time event,
<ide> * i.e. init, before ...
<del> * @param {Object} hooks the expected life time event invocations with a count
<add> * @param {object} hooks the expected life time event invocations with a count
<ide> * indicating how often they should have been invoked,
<ide> * i.e. `{ init: 1, before: 2, after: 2 }`
<del> * @param {String} stage the name of the stage in the test at which we are
<add> * @param {string} stage the name of the stage in the test at which we are
<ide> * checking the invocations
<ide> */
<ide> exports.checkInvocations = function checkInvocations(activity, hooks, stage) {
<ide><path>tools/eslint-rules/require-common-first.js
<ide> module.exports = function(context) {
<ide>
<ide> /**
<ide> * Function to check if the path is a module and return its name.
<del> * @param {String} str The path to check
<del> * @returns {String} module name
<add> * @param {string} str The path to check
<add> * @returns {string} module name
<ide> */
<ide> function getModuleName(str) {
<ide> if (str === '../common/index.mjs') {
<ide> module.exports = function(context) {
<ide> * Function to check if a node has an argument that is a module and
<ide> * return its name.
<ide> * @param {ASTNode} node The node to check
<del> * @returns {undefined|String} module name or undefined
<add> * @returns {undefined | string} module name or undefined
<ide> */
<ide> function getModuleNameFromCall(node) {
<ide> // Node has arguments and first argument is string
<ide><path>tools/eslint-rules/required-modules.js
<ide> module.exports = function(context) {
<ide>
<ide> /**
<ide> * Function to check if the path is a required module and return its name.
<del> * @param {String} str The path to check
<del> * @returns {undefined|String} required module name or undefined
<add> * @param {string} str The path to check
<add> * @returns {undefined | string} required module name or undefined
<ide> */
<ide> function getRequiredModuleName(str) {
<ide> const match = requiredModules.find(([, test]) => {
<ide> module.exports = function(context) {
<ide> * Function to check if a node has an argument that is a required module and
<ide> * return its name.
<ide> * @param {ASTNode} node The node to check
<del> * @returns {undefined|String} required module name or undefined
<add> * @returns {undefined | string} required module name or undefined
<ide> */
<ide> function getRequiredModuleNameFromCall(node) {
<ide> // Node has arguments and first argument is string | 10 |
Ruby | Ruby | handle array option in `type_to_sql` | 9ec2d4a39b0e4ee3cbae6f2ed93fb8a86c2d6936 | <ide><path>activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
<ide> class SchemaCreation < AbstractAdapter::SchemaCreation
<ide> private
<ide>
<ide> def visit_ColumnDefinition(o)
<del> o.sql_type = type_to_sql(o.type, o.limit, o.precision, o.scale)
<del> o.sql_type << '[]' if o.array
<add> o.sql_type = type_to_sql(o.type, o.limit, o.precision, o.scale, o.array)
<ide> super
<ide> end
<ide> end
<ide> def change_column(table_name, column_name, type, options = {})
<ide> clear_cache!
<ide> quoted_table_name = quote_table_name(table_name)
<ide> quoted_column_name = quote_column_name(column_name)
<del> sql_type = type_to_sql(type, options[:limit], options[:precision], options[:scale])
<del> sql_type << "[]" if options[:array]
<add> sql_type = type_to_sql(type, options[:limit], options[:precision], options[:scale], options[:array])
<ide> sql = "ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quoted_column_name} TYPE #{sql_type}"
<ide> if options[:using]
<ide> sql << " USING #{options[:using]}"
<ide> elsif options[:cast_as]
<del> cast_as_type = type_to_sql(options[:cast_as], options[:limit], options[:precision], options[:scale])
<del> cast_as_type << "[]" if options[:array]
<add> cast_as_type = type_to_sql(options[:cast_as], options[:limit], options[:precision], options[:scale], options[:array])
<ide> sql << " USING CAST(#{quoted_column_name} AS #{cast_as_type})"
<ide> end
<ide> execute sql
<ide> def index_name_length
<ide> end
<ide>
<ide> # Maps logical Rails types to PostgreSQL-specific data types.
<del> def type_to_sql(type, limit = nil, precision = nil, scale = nil)
<del> case type.to_s
<add> def type_to_sql(type, limit = nil, precision = nil, scale = nil, array = nil)
<add> sql = case type.to_s
<ide> when 'binary'
<ide> # PostgreSQL doesn't support limits on binary (bytea) columns.
<ide> # The hard limit is 1Gb, because of a 32-bit size field, and TOAST.
<ide> def type_to_sql(type, limit = nil, precision = nil, scale = nil)
<ide> else raise(ActiveRecordError, "The limit on text can be at most 1GB - 1byte.")
<ide> end
<ide> when 'integer'
<del> return 'integer' unless limit
<del>
<ide> case limit
<del> when 1, 2; 'smallint'
<del> when 3, 4; 'integer'
<del> when 5..8; 'bigint'
<del> else raise(ActiveRecordError, "No integer type has byte size #{limit}. Use a numeric with precision 0 instead.")
<add> when 1, 2; 'smallint'
<add> when nil, 3, 4; 'integer'
<add> when 5..8; 'bigint'
<add> else raise(ActiveRecordError, "No integer type has byte size #{limit}. Use a numeric with precision 0 instead.")
<ide> end
<ide> when 'datetime'
<del> return super unless precision
<del>
<ide> case precision
<del> when 0..6; "timestamp(#{precision})"
<del> else raise(ActiveRecordError, "No timestamp type has precision of #{precision}. The allowed range of precision is from 0 to 6")
<add> when nil; super(type, limit, precision, scale)
<add> when 0..6; "timestamp(#{precision})"
<add> else raise(ActiveRecordError, "No timestamp type has precision of #{precision}. The allowed range of precision is from 0 to 6")
<ide> end
<ide> else
<del> super
<add> super(type, limit, precision, scale)
<ide> end
<add>
<add> sql << '[]' if array && type != :primary_key
<add> sql
<ide> end
<ide>
<ide> # PostgreSQL requires the ORDER BY columns in the select list for distinct queries, and | 1 |
Ruby | Ruby | remove dependency on `@cache_control` ivar | d05d7e23d19b0f22328ad5ec3c87883c96fc4365 | <ide><path>actionpack/lib/action_dispatch/http/cache.rb
<ide> def prepare_cache_control!
<ide>
<ide> def handle_conditional_get!
<ide> if etag? || last_modified? || !@cache_control.empty?
<del> set_conditional_cache_control!
<add> set_conditional_cache_control!(@cache_control)
<ide> end
<ide> end
<ide>
<ide> def handle_conditional_get!
<ide> PRIVATE = "private".freeze
<ide> MUST_REVALIDATE = "must-revalidate".freeze
<ide>
<del> def set_conditional_cache_control!
<add> def set_conditional_cache_control!(cache_control)
<ide> control = {}
<ide> cc_headers = cache_control_headers
<ide> if extras = cc_headers.delete(:extras)
<del> @cache_control[:extras] ||= []
<del> @cache_control[:extras] += extras
<del> @cache_control[:extras].uniq!
<add> cache_control[:extras] ||= []
<add> cache_control[:extras] += extras
<add> cache_control[:extras].uniq!
<ide> end
<ide>
<ide> control.merge! cc_headers
<del> control.merge! @cache_control
<add> control.merge! cache_control
<ide>
<ide> if control.empty?
<ide> set_header CACHE_CONTROL, DEFAULT_CACHE_CONTROL | 1 |
PHP | PHP | remove unused variable | 2d852a6800931b6a7952314904aee52c6a7c4608 | <ide><path>src/Database/ValueBinder.php
<ide> public function attachTo($statement)
<ide> if (empty($bindings)) {
<ide> return;
<ide> }
<del> $params = $types = [];
<add>
<ide> foreach ($bindings as $b) {
<ide> $statement->bindValue($b['placeholder'], $b['value'], $b['type']);
<ide> } | 1 |
Javascript | Javascript | remove unused argument from call to jest method | 5bdd4c8c60ed6c12c5af7ffb73660c8f91bf955a | <ide><path>packages/react/src/__tests__/ReactChildren-test.js
<ide> describe('ReactChildren', () => {
<ide> });
<ide>
<ide> function assertCalls() {
<del> expect(callback).toHaveBeenCalledTimes(2, 0);
<add> expect(callback).toHaveBeenCalledTimes(2);
<ide> expect(callback).toHaveBeenCalledWith('a', 0);
<ide> expect(callback).toHaveBeenCalledWith(13, 1);
<ide> callback.mockClear(); | 1 |
Java | Java | use pathremainingmatchinfo in requestpredicates | b897f96e0ff61ec8965ebd51bbad0d5b798e5e7f | <ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java
<ide> import org.springframework.web.util.UriUtils;
<ide> import org.springframework.web.util.patterns.PathPattern;
<ide> import org.springframework.web.util.patterns.PathPatternParser;
<del>import org.springframework.web.util.patterns.PathRemainingMatchInfo;
<ide>
<ide> /**
<ide> * Implementations of {@link RequestPredicate} that implement various useful
<ide> public boolean test(ServerRequest request) {
<ide> boolean match = this.pattern.matches(path);
<ide> traceMatch("Pattern", this.pattern.getPatternString(), path, match);
<ide> if (match) {
<del> mergeTemplateVariables(request);
<add> mergeTemplateVariables(request, this.pattern.matchAndExtract(request.path()));
<ide> return true;
<ide> }
<ide> else {
<ide> public boolean test(ServerRequest request) {
<ide>
<ide> @Override
<ide> public Optional<ServerRequest> nest(ServerRequest request) {
<del> PathRemainingMatchInfo info = this.pattern.getPathRemaining(request.path());
<del> String remainingPath = (info == null ? null : info.getPathRemaining());
<del> return Optional.ofNullable(remainingPath)
<del> .map(path -> !path.startsWith("/") ? "/" + path : path)
<del> .map(path -> {
<del> // TODO: re-enable when SPR-15419 has been fixed.
<del> // mergeTemplateVariables(request);
<add> return Optional.ofNullable(this.pattern.getPathRemaining(request.path()))
<add> .map(info -> {
<add> mergeTemplateVariables(request, info.getMatchingVariables());
<add> String path = info.getPathRemaining();
<add> if (!path.startsWith("/")) {
<add> path = "/" + path;
<add> }
<ide> return new SubPathServerRequestWrapper(request, path);
<ide> });
<ide> }
<ide>
<del> private void mergeTemplateVariables(ServerRequest request) {
<del> Map<String, String> newVariables = this.pattern.matchAndExtract(request.path());
<del> if (!newVariables.isEmpty()) {
<add> private void mergeTemplateVariables(ServerRequest request, Map<String, String> variables) {
<add> if (!variables.isEmpty()) {
<ide> Map<String, String> oldVariables = request.pathVariables();
<del> Map<String, String> variables = new LinkedHashMap<>(oldVariables);
<del> variables.putAll(newVariables);
<add> Map<String, String> mergedVariables = new LinkedHashMap<>(oldVariables);
<add> mergedVariables.putAll(variables);
<ide> request.attributes().put(RouterFunctions.URI_TEMPLATE_VARIABLES_ATTRIBUTE,
<del> Collections.unmodifiableMap(variables));
<add> Collections.unmodifiableMap(mergedVariables));
<ide> }
<ide> }
<ide>
<ide><path>spring-webflux/src/test/java/org/springframework/web/reactive/function/server/NestedRouteIntegrationTests.java
<ide>
<ide> package org.springframework.web.reactive.function.server;
<ide>
<del>import org.junit.Ignore;
<ide> import org.junit.Test;
<ide> import reactor.core.publisher.Flux;
<ide> import reactor.core.publisher.Mono;
<ide> public void baz() throws Exception {
<ide> }
<ide>
<ide> @Test
<del> @Ignore("SPR-15419")
<ide> public void variables() throws Exception {
<ide> ResponseEntity<String> result =
<ide> restTemplate.getForEntity("http://localhost:" + port + "/1/2/3", String.class); | 2 |
Text | Text | fix typo in remote.md | 2243480e99ee70c39887da55fa3257c29843dd0c | <ide><path>libnetwork/docs/remote.md
<ide> When the proxy is asked to create a network, the remote process shall receive a
<ide> * `Options` value is the arbitrary map given to the proxy by LibNetwork.
<ide> * `IPv4Data` and `IPv6Data` are the ip-addressing data configured by the user and managed by IPAM driver. The network driver is expected to honor the ip-addressing data supplied by IPAM driver. The data include,
<ide> * `AddressSpace` : A unique string represents an isolated space for IP Addressing
<del>* `Pool` : A range of IP Addresses represted in CIDR format address/mask. Since, the IPAM driver is responsible for allocating container ip-addresses, the network driver can make use of this information for the network plumbing purposes.
<add>* `Pool` : A range of IP Addresses represented in CIDR format address/mask. Since, the IPAM driver is responsible for allocating container ip-addresses, the network driver can make use of this information for the network plumbing purposes.
<ide> * `Gateway` : Optionally, the IPAM driver may provide a Gateway for the subnet represented by the Pool. The network driver can make use of this information for the network plumbing purposes.
<ide> * `AuxAddresses` : A list of pre-allocated ip-addresses with an associated identifier as provided by the user to assist network driver if it requires specific ip-addresses for its operation.
<ide>
<ide> The response indicating success is empty:
<ide>
<ide> * Node Discovery
<ide>
<del>Similar to the DiscoverNew call, Node Discovery is represented by a `DiscoveryType` value of `1` and the corresponding `DiscoveryData` will carry Node discovery data to be delted.
<add>Similar to the DiscoverNew call, Node Discovery is represented by a `DiscoveryType` value of `1` and the corresponding `DiscoveryData` will carry Node discovery data to be deleted.
<ide>
<ide> {
<ide> "DiscoveryType": int, | 1 |
Javascript | Javascript | address early review comments and lint | 7783079af7deeca4e7923b4ad37b0156e62f3ed2 | <ide><path>client/src/components/Footer/index.js
<ide> import React from 'react';
<add>import PropTypes from 'prop-types';
<ide> import { Grid, Row, Col } from '@freecodecamp/react-bootstrap';
<ide>
<ide> import Link from '../helpers/Link';
<ide> const ColHeader = ({ children, ...other }) => (
<ide> );
<ide> ColHeader.propTypes = propTypes;
<ide>
<del>const linkPropTypes = {
<del> children: PropTypes.any,
<del> external: PropTypes.bool,
<del> to: PropTypes.string.isRequired
<del>};
<del>
<ide> function Footer() {
<ide> return (
<ide> <footer className='footer'>
<ide> function Footer() {
<ide> <Link to='https://gitter.im/FreeCodeCamp/home'>Gitter</Link>
<ide> <Link to='https://github.com/freeCodeCamp/'>GitHub</Link>
<ide> <Link to='/support'>Support</Link>
<del> <Link to='/code-of-conduct'>
<del> Code of Conduct
<del> </Link>
<add> <Link to='/code-of-conduct'>Code of Conduct</Link>
<ide> <Link to='/privacy-policy'>Privacy Policy</Link>
<del> <Link to='/terms-of-service'>
<del> Terms of Service
<del> </Link>
<add> <Link to='/terms-of-service'>Terms of Service</Link>
<ide> </Col>
<ide> <Col lg={3} sm={2} xs={12}>
<ide> <ColHeader>Our Learning Resources</ColHeader>
<ide><path>client/src/components/Supporters.js
<ide> function Supporters({ isDonating, activeDonations }) {
<ide> </FullWidthRow>
<ide> {isDonating ? null : (
<ide> <FullWidthRow>
<del> <Button
<del> bsSize='lg'
<del> bsStyle='primary'
<del> href='/donate'
<del> target='_blank'
<del> >
<add> <Button bsSize='lg' bsStyle='primary' href='/donate' target='_blank'>
<ide> Click here to become a Supporter
<ide> </Button>
<ide> </FullWidthRow>
<ide><path>client/src/components/helpers/Link.js
<ide> import React from 'react';
<add>import PropTypes from 'prop-types';
<ide> import { Link as GatsbyLink } from 'gatsby';
<ide>
<add>const propTypes = {
<add> children: PropTypes.any,
<add> external: PropTypes.bool,
<add> to: PropTypes.string.isRequired
<add>};
<add>
<ide> const Link = ({ children, to, external, ...other }) => {
<del> if (!external && (/^\/(?!\/)/).test(to)) {
<add> if (!external && /^\/(?!\/)/.test(to)) {
<ide> return (
<ide> <GatsbyLink to={to} {...other}>
<ide> {children}
<ide> const Link = ({ children, to, external, ...other }) => {
<ide> </a>
<ide> );
<ide> };
<add>Link.propTypes = propTypes;
<ide>
<ide> export default Link;
<ide><path>client/src/pages/about.js
<ide> const AboutPage = () => {
<ide> <Fragment>
<ide> <Helmet title='About the freeCodeCamp community | freeCodeCamp.org' />
<ide> <Spacer />
<del> <Grid className='container'>
<add> <Grid>
<ide> <Row>
<ide> <Col
<ide> className='questions'
<ide> const AboutPage = () => {
<ide> sm={10}
<ide> smOffset={1}
<ide> xs={12}
<del> >
<add> >
<ide> <h2 className='text-center'>Frequently Asked Questions</h2>
<ide> <hr />
<ide> <h4>What is freeCodeCamp?</h4>
<ide> const AboutPage = () => {
<ide> </p>
<ide> <h4>How can you help me learn to code?</h4>
<ide> <p>
<del> You'll learn to code by completing coding challenges and
<del> building projects. You'll also earn verified certifications
<del> along the way. We also encourage you to join a study group in
<del> your city so you can code in-person with other people.
<add> You'll learn to code by completing coding challenges and building
<add> projects. You'll also earn verified certifications along the way.
<add> We also encourage you to join a study group in your city so you
<add> can code in-person with other people.
<ide> </p>
<ide> <h4>Is freeCodeCamp really free?</h4>
<ide> <p>Yes. Every aspect of freeCodeCamp is 100% free.</p>
<del> <h4>
<del> Can freeCodeCamp help me get a job as a software developer?
<del> </h4>
<add> <h4>Can freeCodeCamp help me get a job as a software developer?</h4>
<ide> <p>
<ide> Yes. Every year, thousands of people who join the freeCodeCamp
<ide> community get their first software developer job. If you're
<ide> curious, you can{' '}
<del> <Link
<del> external={true}
<del> to='https://www.linkedin.com/school/4831032/alumni/'
<del> >
<add> <Link to='https://www.linkedin.com/school/4831032/alumni/'>
<ide> browse our alumni network on LinkedIn here
<ide> </Link>
<ide> .
<ide> const AboutPage = () => {
<ide> <p>
<ide> If you add up all the people who use our learning platform, read
<ide> our{' '}
<del> <Link
<del> external={true}
<del> to='https://medium.freecodecamp.org'
<del> >
<add> <Link to='https://medium.freecodecamp.org'>
<ide> Medium publication
<ide> </Link>
<ide> , watch our{' '}
<del> <Link
<del> external={true}
<del> to='https://youtube.com/freecodecamp'
<del> >
<del> YouTube channel
<del> </Link>
<add> <Link to='https://youtube.com/freecodecamp'>YouTube channel</Link>
<ide> , and post on <Link to='/forum'>our forum</Link>, each month we
<ide> help millions of people learn about coding and technology.
<ide> </p>
<ide> <h4>Is freeCodeCamp a nonprofit?</h4>
<ide> <p>
<ide> Yes, we are a 501(c)(3){' '}
<del> <Link to='/donate'>donor-supported public charity</Link>. You
<del> can{' '}
<del> <Link
<del> external={true}
<del> to='https://s3.amazonaws.com/freecodecamp/Free+Code+Camp+Inc+IRS+Determination+Letter.pdf'
<del> >
<add> <Link to='/donate'>donor-supported public charity</Link>. You can{' '}
<add> <Link to='https://s3.amazonaws.com/freecodecamp/Free+Code+Camp+Inc+IRS+Determination+Letter.pdf'>
<ide> download our IRS Determination Letter here
<ide> </Link>
<ide> .
<ide> const AboutPage = () => {
<ide> </p>
<ide> <h4>Is freeCodeCamp a replacement for a 4-year degree?</h4>
<ide> <p>
<del> No. Please don’t drop out of college just to pursue
<del> freeCodeCamp. You can pursue both concurrently. Even though you
<del> don’t need a 4-year degree to work as a software developer, it
<del> still helps a lot.
<add> No. Please don’t drop out of college just to pursue freeCodeCamp.
<add> You can pursue both concurrently. Even though you don’t need a
<add> 4-year degree to work as a software developer, it still helps a
<add> lot.
<ide> </p>
<ide> <h4>Should I complete all of the coding challenges in order?</h4>
<ide> <p>
<ide> const AboutPage = () => {
<ide> <h4>Do I have to use CodePen for the front end projects?</h4>
<ide> <p>
<ide> As long as your code is publicly viewable somewhere on the
<del> internet, and you have a live demo, you can use whatever tools
<del> you want.
<add> internet, and you have a live demo, you can use whatever tools you
<add> want.
<ide> </p>
<ide> <h4>How did freeCodeCamp get started?</h4>
<ide> <p>
<del> <Link
<del> external={true}
<del> to='https://www.twitter.com/ossia'
<del> >
<del> Quincy
<del> </Link>{' '}
<del> started the freeCodeCamp community in 2014. He is now just one
<del> of thousands of active contributors.
<add> <Link to='https://www.twitter.com/ossia'>Quincy</Link> started the
<add> freeCodeCamp community in 2014. He is now just one of thousands of
<add> active contributors.
<ide> </p>
<ide> <h4>
<ide> I'm a teacher. Is freeCodeCamp an appropriate resource for my
<ide> className?
<ide> </h4>
<ide> <p>
<del> Yes. Many high school, college, and adult ed programs
<del> incorporate freeCodeCamp into their coursework. We're open
<del> source, so no license or special permission from us is
<del> necessary. We're even building special tools for teachers.
<add> Yes. Many high school, college, and adult ed programs incorporate
<add> freeCodeCamp into their coursework. We're open source, so no
<add> license or special permission from us is necessary. We're even
<add> building special tools for teachers.
<ide> </p>
<ide> <h4>
<ide> Can I live-stream myself working on freeCodeCamp challenges and
<ide> projects? Can I blog about how I solved them?
<ide> </h4>
<ide> <p>
<del> Yes. We welcome this. Also, don't be shy about "spoiling"
<del> projects or challenges. The solutions to all of these challenges
<del> are already all over the internet.
<add> Yes. We welcome this. Also, don't be shy about "spoiling" projects
<add> or challenges. The solutions to all of these challenges are
<add> already all over the internet.
<ide> </p>
<ide> <h4>
<del> Can I create apps or tools based around the freeCodeCamp
<del> community and platform?
<add> Can I create apps or tools based around the freeCodeCamp community
<add> and platform?
<ide> </h4>
<ide> <p>
<ide> Yes. freeCodeCamp is open source (BSD-3 license), and most
<ide> non-sensitive freeCodeCamp data is publicly available. But you
<ide> must make it clear that you don't represent freeCodeCamp itself,
<del> and that your project is not officially endorsed by
<del> freeCodeCamp.
<add> and that your project is not officially endorsed by freeCodeCamp.
<ide> </p>
<ide> <h4>Does freeCodeCamp have a mobile app?</h4>
<ide> <p>
<ide> You can learn on the go by listening to the{' '}
<del> <Link
<del> external={true}
<del> to='https://podcast.freecodecamp.org'
<del> >
<add> <Link to='https://podcast.freecodecamp.org'>
<ide> freeCodeCamp Podcast
<ide> </Link>{' '}
<ide> or watching{' '}
<del> <Link
<del> external={true}
<del> to='https://youtube.com/freecodecamp'
<del> >
<add> <Link to='https://youtube.com/freecodecamp'>
<ide> freeCodeCamp's YouTube channel
<ide> </Link>
<del> . And if you want a mobile app designed specifically for
<del> learning to code, we recommend Grasshopper. It's free and
<del> designed by a freeCodeCamp contributor and her team. You can
<del> download it on{' '}
<del> <Link
<del> external={true}
<del> to='https://itunes.apple.com/us/app/id1354133284'
<del> >
<del> iOS
<del> </Link>{' '}
<add> . And if you want a mobile app designed specifically for learning
<add> to code, we recommend Grasshopper. It's free and designed by a
<add> freeCodeCamp contributor and her team. You can download it on{' '}
<add> <Link to='https://itunes.apple.com/us/app/id1354133284'>iOS</Link>{' '}
<ide> or{' '}
<del> <Link
<del> external={true}
<del> to='https://play.google.com/store/apps/details?id=com.area120.grasshopper&hl=en'
<del> >
<add> <Link to='https://play.google.com/store/apps/details?id=com.area120.grasshopper&hl=en'>
<ide> Android
<ide> </Link>
<ide> .
<ide> </p>
<ide> <h4>Can I get a job at freeCodeCamp?</h4>
<ide> <p>
<ide> We're a small donor-supported nonprofit. We've hired several
<del> prominent contributors from within the freeCodeCamp community,
<del> but you're much more likely to get a job at{' '}
<del> <Link
<del> external={true}
<del> to='https://www.linkedin.com/school/free-code-camp/alumni/'
<del> >
<add> prominent contributors from within the freeCodeCamp community, but
<add> you're much more likely to get a job at{' '}
<add> <Link to='https://www.linkedin.com/school/free-code-camp/alumni/'>
<ide> one of the hundreds of companies
<ide> </Link>{' '}
<ide> where freeCodeCamp alumni work.
<ide> const AboutPage = () => {
<ide> sm={10}
<ide> smOffset={1}
<ide> xs={12}
<del> >
<add> >
<ide> <h2 className='text-center'>Helpful Links</h2>
<ide> <hr />
<ide> <Table>
<ide> const AboutPage = () => {
<ide> <FontAwesomeIcon icon={faYoutube} />
<ide> </td>
<ide> <td>
<del> <Link
<del> external={true}
<del> to='https://youtube.com/freecodecamp'
<del> >
<add> <Link to='https://youtube.com/freecodecamp'>
<ide> Our YouTube channel
<ide> </Link>
<ide> </td>
<ide> const AboutPage = () => {
<ide> <FontAwesomeIcon icon={faGithub} />
<ide> </td>
<ide> <td>
<del> <Link
<del> external={true}
<del> to='https://github.com/freecodecamp/'
<del> >
<add> <Link to='https://github.com/freecodecamp/'>
<ide> Our GitHub organization
<ide> </Link>
<ide> </td>
<ide> const AboutPage = () => {
<ide> <FontAwesomeIcon icon={faLinkedin} />
<ide> </td>
<ide> <td>
<del> <Link
<del> external={true}
<del> to='https://www.linkedin.com/edu/school?id=166029'
<del> >
<add> <Link to='https://www.linkedin.com/edu/school?id=166029'>
<ide> Our LinkedIn university page
<ide> </Link>
<ide> </td>
<ide> const AboutPage = () => {
<ide> <FontAwesomeIcon icon={faMedium} />
<ide> </td>
<ide> <td>
<del> <Link
<del> external={true}
<del> to='https://medium.freecodecamp.org'
<del> >
<add> <Link to='https://medium.freecodecamp.org'>
<ide> Our Medium publication
<ide> </Link>
<ide> </td>
<ide> const AboutPage = () => {
<ide> <FontAwesomeIcon icon={faTwitter} />
<ide> </td>
<ide> <td>
<del> <Link
<del> external={true}
<del> to='https://twitter.com/freecodecamp'
<del> >
<add> <Link to='https://twitter.com/freecodecamp'>
<ide> Our Twitter feed
<ide> </Link>
<ide> </td>
<ide> const AboutPage = () => {
<ide> <FontAwesomeIcon icon={faFacebook} />
<ide> </td>
<ide> <td>
<del> <Link
<del> external={true}
<del> to='https://facebook.com/freecodecamp'
<del> >
<add> <Link to='https://facebook.com/freecodecamp'>
<ide> Our Facebook page
<ide> </Link>
<ide> </td>
<ide> const AboutPage = () => {
<ide> <FontAwesomeIcon icon={faLock} />
<ide> </td>
<ide> <td>
<del> <Link to='/privacy-policy'>
<del> Our privacy policy
<del> </Link>
<add> <Link to='/privacy-policy'>Our privacy policy</Link>
<ide> </td>
<ide> </tr>
<ide> <tr>
<ide> <td className='text-center'>
<ide> <FontAwesomeIcon icon={faBalanceScale} />
<ide> </td>
<ide> <td>
<del> <Link to='/code-of-conduct'>
<del> Our code of conduct
<del> </Link>
<add> <Link to='/code-of-conduct'>Our code of conduct</Link>
<ide> </td>
<ide> </tr>
<ide> <tr>
<ide> const AboutPage = () => {
<ide> <FontAwesomeIcon icon={faBook} />
<ide> </td>
<ide> <td>
<del> <Link to='/terms-of-service'>
<del> Our terms of service
<del> </Link>
<add> <Link to='/terms-of-service'>Our terms of service</Link>
<ide> </td>
<ide> </tr>
<ide> </tbody>
<ide><path>client/src/pages/code-of-conduct.js
<ide> const CodeOfConductPage = () => {
<ide> <Fragment>
<ide> <Helmet title='Code of Conduct | freeCodeCamp.org' />
<ide> <Spacer />
<del> <Grid className='container'>
<add> <Grid>
<ide> <Row>
<del> <Col
<del> md={6}
<del> mdOffset={3}
<del> sm={10}
<del> smOffset={1}
<del> xs={12}
<del> >
<add> <Col md={6} mdOffset={3} sm={10} smOffset={1} xs={12}>
<ide> <h2 className='text-center'>Code of Conduct</h2>
<ide> <hr />
<ide> <p>
<ide> const CodeOfConductPage = () => {
<ide> conduct.
<ide> </p>
<ide> <p>In short: Be nice. No harassment, trolling, or spamming.</p>
<del> <ul style={{ 'margin-top': '0', 'margin-bottom': '10px' }} >
<add> <ul style={{ 'margin-top': '0', 'margin-bottom': '10px' }}>
<ide> <li>
<del> <strong>Harassment</strong> includes sexual language and imagery,
<del> deliberate intimidation, stalking, name-calling, unwelcome
<del> attention, libel, and any malicious hacking or social
<add> <strong>Harassment</strong> includes sexual language and
<add> imagery, deliberate intimidation, stalking, name-calling,
<add> unwelcome attention, libel, and any malicious hacking or social
<ide> engineering. freeCodeCamp should be a harassment-free experience
<ide> for everyone, regardless of gender, gender identity and
<ide> expression, age, sexual orientation, disability, physical
<ide> appearance, body size, race, national origin, or religion (or
<ide> lack thereof).
<ide> </li>
<ide> <li>
<del> <strong>Trolling</strong> includes posting inflammatory comments to
<del> provoke an emotional response or disrupt discussions.
<add> <strong>Trolling</strong> includes posting inflammatory comments
<add> to provoke an emotional response or disrupt discussions.
<ide> </li>
<ide> <li>
<ide> <strong>Spamming</strong> includes posting off-topic messages to
<ide> const CodeOfConductPage = () => {
<ide> <Link to='https://gitter.im/freecodecamp/admin'>
<ide> admin chat room
<ide> </Link>{' '}
<del> - preferably with a screen shot of the offense. The
<del> moderator team will take any action we deem appropriate, up to and
<del> including banning the offender from freeCodeCamp.
<add> - preferably with a screen shot of the offense. The moderator team
<add> will take any action we deem appropriate, up to and including
<add> banning the offender from freeCodeCamp.
<ide> </p>
<ide> <p>
<ide> Also, no bots are allowed in the freeCodeCamp community without
<ide> prior written permission from{' '}
<del> <Link to='https://gitter.im/quincylarson'>
<del> Quincy Larson
<del> </Link>
<del> .
<add> <Link to='https://gitter.im/quincylarson'>Quincy Larson</Link>.
<ide> </p>
<ide> </Col>
<ide> </Row>
<ide><path>client/src/pages/learn.js
<ide> const IndexPage = ({
<ide> <p>
<ide> And yes - all of this is 100% free, thanks to the thousands of campers
<ide> who{' '}
<del> <a
<del> href='/donate'
<del> rel='noopener noreferrer'
<del> target='_blank'
<del> >
<add> <a href='/donate' rel='noopener noreferrer' target='_blank'>
<ide> donate
<ide> </a>{' '}
<ide> to our nonprofit.
<ide><path>client/src/pages/privacy-policy.js
<ide> const PrivacyPolicyPage = () => {
<ide> <Fragment>
<ide> <Helmet title='Privacy Policy | freeCodeCamp.org' />
<ide> <Spacer />
<del> <Grid className='container'>
<add> <Grid>
<ide> <Row>
<ide> <Col
<ide> className='questions'
<ide> const PrivacyPolicyPage = () => {
<ide> sm={10}
<ide> smOffset={1}
<ide> xs={12}
<del> >
<del> <h2 className='text-center'>freeCodeCamp.org Privacy Policy: Questions and Answers</h2>
<add> >
<add> <h2 className='text-center'>
<add> freeCodeCamp.org Privacy Policy: Questions and Answers
<add> </h2>
<ide> <hr />
<ide> <p>
<ide> We take your privacy seriously. And we give you full control over
<ide> const PrivacyPolicyPage = () => {
<ide> decision-making.
<ide> </p>
<ide> <h4>Who has access to my personal data?</h4>
<del> <p>
<add> <p>
<ide> Even though freeCodeCamp has thousands of volunteers, none of
<ide> those people have access to your private data.
<del> </p>
<del> <p>
<del> freeCodeCamp has a few full-time staff, some of whom work
<del> directly on our databases. They have the ability to view your
<del> private data, but only do so when providing you with technical
<del> support.
<del> </p>
<del> <p>
<del> As for the personal data that you choose to share on your
<del> developer portfolio, anyone on the internet can see it by
<del> navigating to your developer portfolio's public URL. Again,
<del> we've given you full control over what parts of your developer
<del> profile are public.
<del> </p>
<del> <h4>What is freeCodeCamp's Donor Privacy Policy?</h4>
<del> <p>
<del> freeCodeCamp will not share our donors' names or personal
<del> information with anyone outside of our nonprofit organization's
<del> team. Donors may choose to display that they are donating to
<del> freeCodeCamp on their freeCodeCamp profile. Otherwise, donor
<del> information will only be used to process donations and send
<del> email confirmations. This policy applies to any written, verbal,
<del> or electronic communication.
<del> </p>
<del> <h4>Can any other organizations access my data?</h4>
<del> <p>
<del> We don't sell your data to anyone. In order to provide service
<del> to you, your data does pass through some other services. All of
<del> these companies are based in the United States.
<del> </p>
<del> <p>
<del> We use Amazon Web Services, Azure, and mLab for our servers and
<del> databases. You can read the privacy policy for{' '}
<del> <Link to='https://aws.amazon.com/privacy/'>
<del> Amazon Web Services
<del> </Link>
<del> ,{' '}
<del> <Link to='https://privacy.microsoft.com/en-us/privacystatement'>
<del> Microsoft Azure
<del> </Link>
<del> , and <Link to='https://mlab.com/company/legal/privacy/'>mLab</Link>
<del> .
<del> </p>
<del> <p>
<del> We use Stripe and PayPal to process donations. You can read the
<del> privacy policy for{' '}
<del> <Link to='https://stripe.com/us/privacy'>Stripe</Link> and for{' '}
<del> <Link to='https://www.paypal.com/us/webapps/mpp/ua/privacy-full'>
<del> PayPal
<del> </Link>
<del> .
<del> </p>
<del> <p>
<del> We use the CloudFlare and Netlify Content Delivery Networks so
<del> that freeCodeCamp is fast in all parts of the world. You can
<del> read the privacy policy for{' '}
<del> <Link to='https://www.cloudflare.com/privacypolicy/'>
<del> CloudFlare
<del> </Link>{' '}
<del> and <Link to='https://www.netlify.com/privacy/'>Netlify</Link>{' '}
<del> online.
<del> </p>
<del> <p>
<del> We use Auth0 to sign you into freeCodeCamp. You can read{' '}
<del> <Link to='https://auth0.com/privacy'>
<del> the privacy policy for Auth0 online
<del> </Link>
<del> .
<del> </p>
<del> <p>
<del> We use Google Analytics to help us understand the demographics
<del> of our community and how people are using freeCodeCamp. You can
<del> opt out of Google Analytics on freeCodeCamp by{' '}
<del> <Link to='https://tools.google.com/dlpage/gaoptout'>
<del> installing this browser plugin
<del> </Link>
<del> . You can read{' '}
<del> <Link to='https://www.google.com/analytics/terms/'>
<del> the privacy policy for Google Analytics online
<del> </Link>
<del> .
<del> </p>
<del> <p>
<del> For your convenience, we give you the option to sign in using
<del> GitHub, Google, or Facebook if you don't want to use your email
<del> address to sign in. If you choose to use one of these sign in
<del> options, some of your freeCodeCamp data will be shared with
<del> these companies. You can read{' '}
<del> <Link to='https://help.github.com/articles/github-privacy-statement/'>
<del> the privacy policy for GitHub
<del> </Link>{' '}
<del> and for <Link to='https://policies.google.com/privacy'>Google</Link>{' '}
<del> and for{' '}
<del> <Link to='https://www.facebook.com/policy.php'>Facebook</Link>.
<del> </p>
<del> <h4>I have questions about my privacy on freeCodeCamp.</h4>
<del> <p>
<del> We're happy to answer them. Email us at{' '}
<del> <a href='mailto:privacy@freecodecamp.org'>
<del> privacy@freecodecamp.org
<del> </a>
<del> .
<del> </p>
<del> <h4>How can I find out about changes?</h4>
<del> <p>
<del> This version of freeCodeCamp’s privacy questions and answers
<del> took effect May 25, 2018.
<del> </p>
<del> <p>
<del> freeCodeCamp will announce the next version by email. In the
<del> meantime, freeCodeCamp may update its contact information in
<del> these questions and answers by updating this page
<del> (https://www.freecodecamp.org/privacy-policy).
<del> </p>
<del> <p>
<del> freeCodeCamp may change how it announces changes in a future
<del> version of these questions and answers.
<del> </p>
<del> <h4>
<del> That's all, folks. Know your privacy rights, and stay safe out
<del> there!
<del> </h4>
<add> </p>
<add> <p>
<add> freeCodeCamp has a few full-time staff, some of whom work directly
<add> on our databases. They have the ability to view your private data,
<add> but only do so when providing you with technical support.
<add> </p>
<add> <p>
<add> As for the personal data that you choose to share on your
<add> developer portfolio, anyone on the internet can see it by
<add> navigating to your developer portfolio's public URL. Again, we've
<add> given you full control over what parts of your developer profile
<add> are public.
<add> </p>
<add> <h4>What is freeCodeCamp's Donor Privacy Policy?</h4>
<add> <p>
<add> freeCodeCamp will not share our donors' names or personal
<add> information with anyone outside of our nonprofit organization's
<add> team. Donors may choose to display that they are donating to
<add> freeCodeCamp on their freeCodeCamp profile. Otherwise, donor
<add> information will only be used to process donations and send email
<add> confirmations. This policy applies to any written, verbal, or
<add> electronic communication.
<add> </p>
<add> <h4>Can any other organizations access my data?</h4>
<add> <p>
<add> We don't sell your data to anyone. In order to provide service to
<add> you, your data does pass through some other services. All of these
<add> companies are based in the United States.
<add> </p>
<add> <p>
<add> We use Amazon Web Services, Azure, and mLab for our servers and
<add> databases. You can read the privacy policy for{' '}
<add> <Link to='https://aws.amazon.com/privacy/'>
<add> Amazon Web Services
<add> </Link>
<add> ,{' '}
<add> <Link to='https://privacy.microsoft.com/en-us/privacystatement'>
<add> Microsoft Azure
<add> </Link>
<add> , and{' '}
<add> <Link to='https://mlab.com/company/legal/privacy/'>mLab</Link>.
<add> </p>
<add> <p>
<add> We use Stripe and PayPal to process donations. You can read the
<add> privacy policy for{' '}
<add> <Link to='https://stripe.com/us/privacy'>Stripe</Link> and for{' '}
<add> <Link to='https://www.paypal.com/us/webapps/mpp/ua/privacy-full'>
<add> PayPal
<add> </Link>
<add> .
<add> </p>
<add> <p>
<add> We use the CloudFlare and Netlify Content Delivery Networks so
<add> that freeCodeCamp is fast in all parts of the world. You can read
<add> the privacy policy for{' '}
<add> <Link to='https://www.cloudflare.com/privacypolicy/'>
<add> CloudFlare
<add> </Link>{' '}
<add> and <Link to='https://www.netlify.com/privacy/'>Netlify</Link>{' '}
<add> online.
<add> </p>
<add> <p>
<add> We use Auth0 to sign you into freeCodeCamp. You can read{' '}
<add> <Link to='https://auth0.com/privacy'>
<add> the privacy policy for Auth0 online
<add> </Link>
<add> .
<add> </p>
<add> <p>
<add> We use Google Analytics to help us understand the demographics of
<add> our community and how people are using freeCodeCamp. You can opt
<add> out of Google Analytics on freeCodeCamp by{' '}
<add> <Link to='https://tools.google.com/dlpage/gaoptout'>
<add> installing this browser plugin
<add> </Link>
<add> . You can read{' '}
<add> <Link to='https://www.google.com/analytics/terms/'>
<add> the privacy policy for Google Analytics online
<add> </Link>
<add> .
<add> </p>
<add> <p>
<add> For your convenience, we give you the option to sign in using
<add> GitHub, Google, or Facebook if you don't want to use your email
<add> address to sign in. If you choose to use one of these sign in
<add> options, some of your freeCodeCamp data will be shared with these
<add> companies. You can read{' '}
<add> <Link to='https://help.github.com/articles/github-privacy-statement/'>
<add> the privacy policy for GitHub
<add> </Link>{' '}
<add> and for{' '}
<add> <Link to='https://policies.google.com/privacy'>Google</Link> and
<add> for <Link to='https://www.facebook.com/policy.php'>Facebook</Link>
<add> .
<add> </p>
<add> <h4>I have questions about my privacy on freeCodeCamp.</h4>
<add> <p>
<add> We're happy to answer them. Email us at{' '}
<add> <a href='mailto:privacy@freecodecamp.org'>
<add> privacy@freecodecamp.org
<add> </a>
<add> .
<add> </p>
<add> <h4>How can I find out about changes?</h4>
<add> <p>
<add> This version of freeCodeCamp’s privacy questions and answers took
<add> effect May 25, 2018.
<add> </p>
<add> <p>
<add> freeCodeCamp will announce the next version by email. In the
<add> meantime, freeCodeCamp may update its contact information in these
<add> questions and answers by updating this page
<add> (https://www.freecodecamp.org/privacy-policy).
<add> </p>
<add> <p>
<add> freeCodeCamp may change how it announces changes in a future
<add> version of these questions and answers.
<add> </p>
<add> <h4>
<add> That's all, folks. Know your privacy rights, and stay safe out
<add> there!
<add> </h4>
<ide> </Col>
<ide> </Row>
<ide> </Grid>
<ide><path>client/src/pages/sponsors.js
<ide> import './sponsors.css';
<ide> const SponsorsPage = () => {
<ide> return (
<ide> <Fragment>
<del> <Helmet
<del> title='Sponsors who help freeCodeCamp through financial and in-kind sponsorship | freeCodeCamp.org'
<del> />
<add> <Helmet title='Sponsors who help freeCodeCamp through financial and in-kind sponsorship | freeCodeCamp.org' />
<ide> <Spacer />
<del> <Grid className='container'>
<add> <Grid>
<ide> <Row className='text-center'>
<ide> <Col md={8} mdOffset={2} sm={10} smOffset={1} xs={12}>
<ide> <h2>Financial Sponsors</h2>
<ide> const SponsorsPage = () => {
<ide> </h3>
<ide> <hr />
<ide> <Row className='sponsor-logos'>
<del> <Link
<del> external={true}
<del> to='https://www.class-central.com'
<del> >
<add> <Link to='https://www.class-central.com'>
<ide> <img
<ide> alt="Class Central's logo"
<ide> className='img-responsive sponsor-logo'
<ide> src='https://s3.amazonaws.com/freecodecamp/class-central-logo.jpg'
<ide> />
<ide> </Link>
<del> <Link
<del> external={true}
<del> to='https://www.tsugicloud.org'
<del> >
<add> <Link to='https://www.tsugicloud.org'>
<ide> <img
<ide> alt="TsugiCloud's logo"
<ide> className='img-responsive sponsor-logo'
<ide> const SponsorsPage = () => {
<ide> <h3>These companies donate their services to freeCodeCamp.org</h3>
<ide> <hr />
<ide> <Row className='sponsor-logos'>
<del> <Link
<del> external={true}
<del> to='https://netlify.com'
<del> >
<add> <Link to='https://netlify.com'>
<ide> <img
<ide> alt="Netlify's logo"
<ide> className='img-responsive sponsor-logo'
<ide> src='https://s3.amazonaws.com/freecodecamp/netlify-logo.jpg'
<ide> />
<ide> </Link>
<del> <Link
<del> external={true}
<del> to='https://www.mlab.com/'
<del> >
<add> <Link to='https://www.mlab.com/'>
<ide> <img
<ide> alt="mLab's logo"
<ide> className='img-responsive sponsor-logo'
<ide> src='https://s3.amazonaws.com/freecodecamp/mLab-logo.png'
<ide> />
<ide> </Link>
<del> <Link
<del> external={true}
<del> to='https://auth0.com'
<del> >
<add> <Link to='https://auth0.com'>
<ide> <img
<ide> alt="Auth0's logo"
<ide> className='img-responsive sponsor-logo'
<ide> const SponsorsPage = () => {
<ide> </Link>
<ide> </Row>
<ide> <Row className='sponsor-logos'>
<del> <Link
<del> external={true}
<del> to='https://www.discourse.org/'
<del> >
<add> <Link to='https://www.discourse.org/'>
<ide> <img
<ide> alt="Discourse's logo"
<ide> className='img-responsive sponsor-logo'
<ide> src='https://s3.amazonaws.com/freecodecamp/discourse-logo.png'
<ide> />
<ide> </Link>
<del> <Link
<del> external={true}
<del> to='https://algolia.com'
<del> >
<add> <Link to='https://algolia.com'>
<ide> <img
<ide> alt="Algolia's logo"
<ide> className='img-responsive sponsor-logo'
<ide> src='https://s3.amazonaws.com/freecodecamp/algolia-logo.jpg'
<ide> />
<ide> </Link>
<del> <Link
<del> external={true}
<del> to='https://cloudflare.com'
<del> >
<add> <Link to='https://cloudflare.com'>
<ide> <img
<ide> alt="Cloudflare's logo"
<ide> className='img-responsive sponsor-logo'
<ide><path>client/src/pages/support.js
<ide> const SupportPage = () => {
<ide> <Fragment>
<ide> <Helmet title='Support | freeCodeCamp.org' />
<ide> <Spacer />
<del> <Grid className='container'>
<add> <Grid>
<ide> <Row>
<ide> <Col
<ide> className='questions'
<ide> const SupportPage = () => {
<ide> sm={10}
<ide> smOffset={1}
<ide> xs={12}
<del> >
<add> >
<ide> <h2 className='text-center'>Common Technical Support Questions</h2>
<ide> <hr />
<ide> <h4 id='faq_progress'>
<ide> const SupportPage = () => {
<ide> </h4>
<ide> <p>
<ide> You have created a duplicate account.{' '}
<del> <Link to='/settings'>
<del> Sign out of your account
<del> </Link>{' '}
<del> and try signing in using a different service (Google, GitHub,
<del> Facebook) that you may have used to in the past. Or try signing in
<del> using an email address you may have used on freeCodeCamp in the
<del> past.
<add> <Link to='/settings'>Sign out of your account</Link> and try
<add> signing in using a different service (Google, GitHub, Facebook)
<add> that you may have used to in the past. Or try signing in using an
<add> email address you may have used on freeCodeCamp in the past.
<ide> </p>
<ide> <h4 id='faq_donation'>
<ide> I set up a monthly donation, but I need to update or cancel the
<ide> const SupportPage = () => {
<ide> freeCodeCamp. Thanks for your patience.
<ide> </p>
<ide> <h4>
<del> When I go to{' '}
<del> <Link to='/learn'>
<del> Learning Curriculum
<del> </Link>{' '}
<del> the challenges are completely blank.
<add> When I go to <Link to='/learn'>Learning Curriculum</Link> the
<add> challenges are completely blank.
<ide> </h4>
<ide> <p>
<ide> Do a hard refresh of the website by pressing control+shift+r in
<ide> Windows or command+shift+r on Mac/Linux. If that doesn't work, you
<ide> may need to clear your cookies. Here is{' '}
<del> <Link to='/forum/t/205075'>
<add> <Link external={true} to='/forum/t/205075'>
<ide> how to clear specific cookies
<ide> </Link>
<ide> .
<ide> const SupportPage = () => {
<ide> </h4>
<ide> <p>
<ide> This is caused by an infinite loop in your code editor.{' '}
<del> <Link to='/forum/t/19550'>
<add> <Link external={true} to='/forum/t/19550'>
<ide> Here's how to fix this
<ide> </Link>
<ide> .
<ide><path>client/src/pages/terms-of-service.js
<ide> const TermsOfServicePage = () => {
<ide> <Fragment>
<ide> <Helmet title='Terms of Service | freeCodeCamp.org' />
<ide> <Spacer />
<del> <Grid className='container'>
<add> <Grid>
<ide> <Row>
<ide> <Col
<ide> className='questions'
<ide> const TermsOfServicePage = () => {
<ide> sm={10}
<ide> smOffset={1}
<ide> xs={12}
<del> >
<add> >
<ide> <h2 className='text-center'>freeCodeCamp's Terms of Service</h2>
<ide> <hr />
<ide> <p>
<ide> const TermsOfServicePage = () => {
<ide> </p>
<ide> <p>
<ide> You may not strain infrastructure of the website with an
<del> unreasonable volume of requests, or requests designed to impose
<del> an unreasonable load on information systems underlying the
<del> website.
<add> unreasonable volume of requests, or requests designed to impose an
<add> unreasonable load on information systems underlying the website.
<ide> </p>
<ide> <p>
<del> You may not encourage or help anyone in violation of these
<del> terms.
<add> You may not encourage or help anyone in violation of these terms.
<ide> </p>
<ide> <p>You may not impersonate others through the website.</p>
<ide> <h4 id='content-standards'>Content Standards</h4>
<ide> const TermsOfServicePage = () => {
<ide> </p>
<ide> <p>
<ide> You may not submit content to the website that violates the law,
<del> infringes anyone’s intellectual property rights, violates
<del> anyone’s privacy, or breaches agreements you have with others.
<add> infringes anyone’s intellectual property rights, violates anyone’s
<add> privacy, or breaches agreements you have with others.
<ide> </p>
<ide> <p>
<ide> You may not submit content to the website containing malicious
<ide> const TermsOfServicePage = () => {
<ide> identifier.
<ide> </p>
<ide> <p>
<del> You may not use the website to disclose information that you
<del> don’t have the right to disclose, like others’ confidential
<del> information.
<add> You may not use the website to disclose information that you don’t
<add> have the right to disclose, like others’ confidential information.
<ide> </p>
<ide> <h4 id='enforcement'>Enforcement</h4>
<ide> <p>
<ide> const TermsOfServicePage = () => {
<ide> </p>
<ide> <p>
<ide> The company reserves the right to change, redact, and delete
<del> content on the website for any reason. If you believe someone
<del> has submitted content to the website in violation of these
<del> terms, please contact us immediately.
<add> content on the website for any reason. If you believe someone has
<add> submitted content to the website in violation of these terms,
<add> please contact us immediately.
<ide> </p>
<ide> <h4 id='your-account'>Your Account</h4>
<ide> <p>
<ide> const TermsOfServicePage = () => {
<ide> To create an account, you must provide some information about
<ide> yourself. If you create an account, you agree to provide, at a
<ide> minimum, a valid e-mail address, and to keep that address
<del> up-to-date. You may close your account at any time by logging
<del> into your account and clicking the button on your account
<del> settings page.
<add> up-to-date. You may close your account at any time by logging into
<add> your account and clicking the button on your account settings
<add> page.
<ide> </p>
<ide> <p>
<ide> You agree to be responsible for all action taken using your
<del> account, whether authorized by you or not, until you either
<del> close your account or notify the company that your account has
<del> been compromised. You agree to notify the company immediately if
<del> you suspect your account has been compromised. You agree to
<del> select a secure password for your account, and keep it secret.
<add> account, whether authorized by you or not, until you either close
<add> your account or notify the company that your account has been
<add> compromised. You agree to notify the company immediately if you
<add> suspect your account has been compromised. You agree to select a
<add> secure password for your account, and keep it secret.
<ide> </p>
<ide> <p>
<ide> The company may restrict, suspend, or close your account on the
<ide> const TermsOfServicePage = () => {
<ide> Nothing in these terms gives the company any ownership rights in
<ide> intellectual property that you share with the website, such as
<ide> your account information or other content you submit to the
<del> website. Nothing in these terms gives you any ownership rights
<del> in the company’s intellectual property, either.
<add> website. Nothing in these terms gives you any ownership rights in
<add> the company’s intellectual property, either.
<ide> </p>
<ide> <p>
<ide> Between you and the company, you remain solely responsible for
<del> content you submit to the website. You agree not to wrongly
<del> imply that content you submit to the website is sponsored or
<del> approved by the company. These terms do not obligate the company
<del> to store, maintain, or provide copies of content you submit.
<add> content you submit to the website. You agree not to wrongly imply
<add> that content you submit to the website is sponsored or approved by
<add> the company. These terms do not obligate the company to store,
<add> maintain, or provide copies of content you submit.
<ide> </p>
<ide> <p>
<ide> Content you submit to the website belongs to you, and you decide
<ide> what permission to give others for it. But at a minimum, you
<ide> license the company to provide content that you submit to the
<del> website to other users of the website. That special license
<del> allows the company to copy, publish, and analyze content you
<del> submit to the website.
<add> website to other users of the website. That special license allows
<add> the company to copy, publish, and analyze content you submit to
<add> the website.
<ide> </p>
<ide> <p>
<ide> When content you submit is removed from the website, whether by
<del> you or by the company, the company’s special license ends when
<del> the last copy disappears from the company’s backups, caches, and
<del> other systems. Other licenses you apply to content you submit
<del> may continue after your content is removed. Those licenses may
<del> give others, or the company itself, the right to share your
<del> content through the website again.
<add> you or by the company, the company’s special license ends when the
<add> last copy disappears from the company’s backups, caches, and other
<add> systems. Other licenses you apply to content you submit may
<add> continue after your content is removed. Those licenses may give
<add> others, or the company itself, the right to share your content
<add> through the website again.
<ide> </p>
<ide> <p>
<ide> Others who receive content you submit to the website may violate
<ide> const TermsOfServicePage = () => {
<ide> <h4 id='your-responsibility'>Your Responsibility</h4>
<ide> <p>
<ide> You agree to indemnify the company from legal claims by others
<del> related to your breach of these terms, or breach of these terms
<del> by others using your account on the website. Both you and the
<del> company agree to notify the other side of any legal claims for
<del> which you might have to indemnify the company as soon as
<del> possible. If the company fails to notify you of a legal claim
<del> promptly, you won’t have to indemnify the company for damages
<del> that you could have defended against or mitigated with prompt
<del> notice. You agree to allow the company to control investigation,
<del> defense, and settlement of legal claims for which you would have
<del> to indemnify the company, and to cooperate with those efforts.
<del> The company agrees not to agree to any settlement that admits
<del> fault for you or imposes obligations on you without your prior
<del> agreement.
<add> related to your breach of these terms, or breach of these terms by
<add> others using your account on the website. Both you and the company
<add> agree to notify the other side of any legal claims for which you
<add> might have to indemnify the company as soon as possible. If the
<add> company fails to notify you of a legal claim promptly, you won’t
<add> have to indemnify the company for damages that you could have
<add> defended against or mitigated with prompt notice. You agree to
<add> allow the company to control investigation, defense, and
<add> settlement of legal claims for which you would have to indemnify
<add> the company, and to cooperate with those efforts. The company
<add> agrees not to agree to any settlement that admits fault for you or
<add> imposes obligations on you without your prior agreement.
<ide> </p>
<ide> <h4 id='disclaimers'>Disclaimers</h4>
<ide> <p>
<ide> const TermsOfServicePage = () => {
<ide> The website may hyperlink to and integrate websites and services
<ide> run by others. The company does not make any warranty about
<ide> services run by others, or content they may provide. Use of
<del> services run by others may be governed by other terms between
<del> you and the one running service.
<add> services run by others may be governed by other terms between you
<add> and the one running service.
<ide> </p>
<ide> <h4 id='limits-on-liability'>Limits on Liability</h4>
<ide> <p>
<ide> The company will not be liable to you for breach-of-contract
<del> damages company personnel could not have reasonably foreseen
<del> when you agreed to these terms.
<add> damages company personnel could not have reasonably foreseen when
<add> you agreed to these terms.
<ide> </p>
<ide> <p>
<del> As far as the law allows, the company’s total liability to you
<del> for claims of any kind that are related to the website or
<del> content on the website will be limited to $50.
<add> As far as the law allows, the company’s total liability to you for
<add> claims of any kind that are related to the website or content on
<add> the website will be limited to $50.
<ide> </p>
<ide> <h4 id='feedback'>Feedback</h4>
<ide> <p>
<ide> const TermsOfServicePage = () => {
<ide> </p>
<ide> <p>
<ide> You agree that the company will be free to act on feedback and
<del> suggestions you provide, and that the company won’t have to
<del> notify you that your feedback was used, get your permission to
<del> use it, or pay you. You agree not to submit feedback or
<del> suggestions that you believe might be confidential or
<del> proprietary, to you or others.
<add> suggestions you provide, and that the company won’t have to notify
<add> you that your feedback was used, get your permission to use it, or
<add> pay you. You agree not to submit feedback or suggestions that you
<add> believe might be confidential or proprietary, to you or others.
<ide> </p>
<ide> <h4 id='termination'>Termination</h4>
<ide> <p>
<ide> Either you or the company may end the agreement written out in
<del> these terms at any time. When our agreement ends, your
<del> permission to use the website also ends.
<add> these terms at any time. When our agreement ends, your permission
<add> to use the website also ends.
<ide> </p>
<ide> <p>
<ide> The following provisions survive the end of our agreement: Your
<ide> const TermsOfServicePage = () => {
<ide> </p>
<ide> <p>
<ide> You and the company agree to seek injunctions related to these
<del> terms only in state or federal court in San Francisco,
<del> California. Neither you nor the company will object to
<del> jurisdiction, forum, or venue in those courts.
<add> terms only in state or federal court in San Francisco, California.
<add> Neither you nor the company will object to jurisdiction, forum, or
<add> venue in those courts.
<ide> </p>
<ide> <p>
<del> Other than to seek an injunction or for claims under the
<del> Computer Fraud and Abuse Act, you and the company will resolve
<del> any Dispute by binding American Arbitration Association
<del> arbitration. Arbitration will follow the AAA’s Commercial
<del> Arbitration Rules and Supplementary Procedures for Consumer
<del> Related Disputes. Arbitration will happen in San Francisco,
<del> California. You will settle any dispute as an individual, and
<del> not as part of a class action or other representative
<del> proceeding, whether as the plaintiff or a class member. No
<del> arbitrator will consolidate any dispute with any other
<del> arbitration without the company’s permission.
<add> Other than to seek an injunction or for claims under the Computer
<add> Fraud and Abuse Act, you and the company will resolve any Dispute
<add> by binding American Arbitration Association arbitration.
<add> Arbitration will follow the AAA’s Commercial Arbitration Rules and
<add> Supplementary Procedures for Consumer Related Disputes.
<add> Arbitration will happen in San Francisco, California. You will
<add> settle any dispute as an individual, and not as part of a class
<add> action or other representative proceeding, whether as the
<add> plaintiff or a class member. No arbitrator will consolidate any
<add> dispute with any other arbitration without the company’s
<add> permission.
<ide> </p>
<ide> <p>
<ide> Any arbitration award will include costs of the arbitration,
<ide> reasonable attorneys’ fees, and reasonable costs for witnesses.
<del> You or the company may enter arbitration awards in any court
<del> with jurisdiction.
<add> You or the company may enter arbitration awards in any court with
<add> jurisdiction.
<ide> </p>
<ide> <h4 id='general-terms'>General Terms</h4>
<ide> <p>
<ide> If a provision of these terms is unenforceable as written, but
<del> could be changed to make it enforceable, that provision should
<del> be modified to the minimum extent necessary to make it
<del> enforceable. Otherwise, that provision should be removed.
<add> could be changed to make it enforceable, that provision should be
<add> modified to the minimum extent necessary to make it enforceable.
<add> Otherwise, that provision should be removed.
<ide> </p>
<ide> <p>
<ide> You may not assign your agreement with the company. The company
<ide> may assign your agreement to any affiliate of the company, any
<ide> other company that obtains control of the company, or any other
<ide> company that buys assets of the company related to the website.
<del> Any attempted assignment against these terms has no legal
<del> effect.
<add> Any attempted assignment against these terms has no legal effect.
<ide> </p>
<ide> <p>
<del> Neither the exercise of any right under this Agreement, nor
<del> waiver of any breach of this Agreement, waives any other breach
<del> of this Agreement.
<add> Neither the exercise of any right under this Agreement, nor waiver
<add> of any breach of this Agreement, waives any other breach of this
<add> Agreement.
<ide> </p>
<ide> <p>
<del> These terms embody all the terms of agreement between you and
<del> the company about use of the website. These terms entirely
<del> replace any other agreements about your use of the website,
<del> written or not.
<add> These terms embody all the terms of agreement between you and the
<add> company about use of the website. These terms entirely replace any
<add> other agreements about your use of the website, written or not.
<ide> </p>
<ide> <h4 id='contact'>Contact</h4>
<ide> <p>
<ide> const TermsOfServicePage = () => {
<ide> </p>
<ide> <p>
<ide> The company may notify you under these terms using the e-mail
<del> address you provide for your account on the website, or by
<del> posting a message to the homepage of the website or your account
<del> page.
<add> address you provide for your account on the website, or by posting
<add> a message to the homepage of the website or your account page.
<ide> </p>
<ide> <h4 id='changes'>Changes</h4>
<ide> <p>
<ide> The company last updated these terms on May 25, 2018, and may
<del> update these terms again. The company will post all updates to
<del> the website. For updates that contain substantial changes, the
<del> company agrees to e-mail you, if you’ve created an account and
<del> provided a valid e-mail address. The company may also announce
<del> updates with special messages or alerts on the website.
<add> update these terms again. The company will post all updates to the
<add> website. For updates that contain substantial changes, the company
<add> agrees to e-mail you, if you’ve created an account and provided a
<add> valid e-mail address. The company may also announce updates with
<add> special messages or alerts on the website.
<ide> </p>
<ide> <p>
<del> Once you get notice of an update to these terms, you must agree
<del> to the new terms in order to keep using the website.
<add> Once you get notice of an update to these terms, you must agree to
<add> the new terms in order to keep using the website.
<ide> </p>
<ide> </Col>
<ide> </Row> | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.