hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
6878fce44120efa5406f5fa3c3e7d231285086ec
diff --git a/src/Connection.php b/src/Connection.php index <HASH>..<HASH> 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -248,7 +248,7 @@ class Connection extends \Doctrine\DBAL\Connection private function resetTransactionNestingLevel() { if(!$this->selfReflectionNestingLevelProperty instanceof \ReflectionProperty) { - $reflection = new \ReflectionClass(parent::class); + $reflection = new \ReflectionClass('Doctrine\DBAL\Connection'); $this->selfReflectionNestingLevelProperty = $reflection->getProperty("_transactionNestingLevel"); $this->selfReflectionNestingLevelProperty->setAccessible(true); }
referencing class with ::class does not work with php <I>
facile-it_doctrine-mysql-come-back
train
php
29d317b1674a08fc36a4e2ad35e183cdce8f1e39
diff --git a/sphinx_gallery/tests/test_gen_gallery.py b/sphinx_gallery/tests/test_gen_gallery.py index <HASH>..<HASH> 100644 --- a/sphinx_gallery/tests/test_gen_gallery.py +++ b/sphinx_gallery/tests/test_gen_gallery.py @@ -8,6 +8,7 @@ Test Sphinx-Gallery from __future__ import (division, absolute_import, print_function, unicode_literals) import codecs +from contextlib import contextmanager import os import sys import re @@ -71,15 +72,22 @@ class SphinxAppWrapper(object): def create_sphinx_app(self): # Avoid warnings about re-registration, see: # https://github.com/sphinx-doc/sphinx/issues/5038 + with self.create_sphinx_app_context() as app: + pass + return app + + @contextmanager + def create_sphinx_app_context(self): with docutils_namespace(): app = Sphinx(self.srcdir, self.confdir, self.outdir, self.doctreedir, self.buildername, **self.kwargs) - sphinx_compatibility._app = app - return app + sphinx_compatibility._app = app + yield app def build_sphinx_app(self, *args, **kwargs): - app = self.create_sphinx_app() - app.build(*args, **kwargs) + with self.create_sphinx_app_context() as app: + # building should be done in the same docutils_namespace context + app.build(*args, **kwargs) return app
FIX: Fix for latest sphinx-dev (#<I>)
sphinx-gallery_sphinx-gallery
train
py
e947eb08c24420b227a92b3a5182f88c558a25d9
diff --git a/cmsplugin_filer_link/migrations_django/0001_initial.py b/cmsplugin_filer_link/migrations_django/0001_initial.py index <HASH>..<HASH> 100644 --- a/cmsplugin_filer_link/migrations_django/0001_initial.py +++ b/cmsplugin_filer_link/migrations_django/0001_initial.py @@ -10,7 +10,7 @@ from cmsplugin_filer_link.models import LINK_STYLES class Migration(migrations.Migration): dependencies = [ - ('cms', '0004_auto_20141015_0046'), + ('cms', '0003_auto_20140926_2347'), ('filer', '0001_initial'), ]
fixes migration dependency to django-cms
divio_cmsplugin-filer
train
py
99b736aafd023fac600fce15e1ba9eaad6f57799
diff --git a/money-api/platform/src/main/java/javax/money/package-info.java b/money-api/platform/src/main/java/javax/money/package-info.java index <HASH>..<HASH> 100644 --- a/money-api/platform/src/main/java/javax/money/package-info.java +++ b/money-api/platform/src/main/java/javax/money/package-info.java @@ -1,4 +1,11 @@ -/** - * Defines the core/platform API and contains the reference implementations. +/* + * CREDIT SUISSE IS WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE + * CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS AGREEMENT. + * PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY + * DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THE + * AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY IT, SELECT THE "DECLINE" + * BUTTON AT THE BOTTOM OF THIS PAGE. Specification: JSR-354 Money and Currency + * API ("Specification") Copyright (c) 2012-2013, Credit Suisse All rights + * reserved. */ -package javax.money; \ No newline at end of file +package javax.money;
Update package-info.java Updated header comment
JavaMoney_jsr354-api
train
java
9f89d67406e2b980627af1a17adb3fb87385741a
diff --git a/smtp.php b/smtp.php index <HASH>..<HASH> 100644 --- a/smtp.php +++ b/smtp.php @@ -140,8 +140,9 @@ class SMTP extends Magic { * Transmit message * @return bool * @param $message string + * @param $log bool **/ - function send($message) { + function send($message,$log=TRUE) { if ($this->scheme=='ssl' && !extension_loaded('openssl')) return FALSE; $fw=Base::instance();
Support log disabling (Issue #<I>)
bcosca_fatfree-core
train
php
8f2d8755cfee27bda636074b3a30eebb8e975768
diff --git a/lib/wimp.js b/lib/wimp.js index <HASH>..<HASH> 100644 --- a/lib/wimp.js +++ b/lib/wimp.js @@ -61,7 +61,6 @@ WiMP.prototype.login = function(un, pw, fn){ 'username': un, 'password': pw }; - console.log(e); self.agent .post(self.apiLocation + 'login/username?token=' + this.apiToken) .type('form')
Don't log username and password in console
datagutt_WiMP-api
train
js
30a7fa7d9d26ffa3d242285f801b86ca8bfd949a
diff --git a/src/main/java/org/jdbdt/ColumnFillerException.java b/src/main/java/org/jdbdt/ColumnFillerException.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jdbdt/ColumnFillerException.java +++ b/src/main/java/org/jdbdt/ColumnFillerException.java @@ -5,7 +5,7 @@ package org.jdbdt; * evaluating a column filler. * * @see ColumnFiller - * @see DataSetBuilder + * @see DataSetBuilder#generate(int) * * @since 0.2 */
ColumnFillerException: adjusted Javadoc
JDBDT_jdbdt
train
java
e4f5386cd7811dab592424482f7dc1720f65c0ae
diff --git a/tests/test_NURBS_Curve2D.py b/tests/test_NURBS_Curve2D.py index <HASH>..<HASH> 100644 --- a/tests/test_NURBS_Curve2D.py +++ b/tests/test_NURBS_Curve2D.py @@ -13,6 +13,7 @@ GEOMDL_DELTA = 0.001 @pytest.fixture def nurbs_curve(): + """ Creates a 4th order 2D NURBS Curve instance """ # Create a curve instance curve = NURBS.Curve() @@ -31,6 +32,7 @@ def nurbs_curve(): @pytest.fixture def nurbs_curve2(): + """ Creates a 5th order 2D NURBS Curve instance """ # Create a curve instance curve = NURBS.Curve()
Updated docstrings of the fixtures
orbingol_NURBS-Python
train
py
c1054f0174ae9b6730f8c909f2b89563054c84a1
diff --git a/rah_bitly.php b/rah_bitly.php index <HASH>..<HASH> 100644 --- a/rah_bitly.php +++ b/rah_bitly.php @@ -211,8 +211,6 @@ class rah_bitly { "ID='".doSlash($r['ID'])."'" ); - $_POST['custom_'.$this->field] = $uri; - $js = '$(document).ready(function(){'. '$(\'input[name="custom_'.$this->field.'"]\').val("'.escape_js($uri).'");'. @@ -221,10 +219,6 @@ class rah_bitly { if($app_mode == 'async') { send_script_response($js); } - - else { - echo script_js($js); - } } /**
Fixed script inject. Injecting script isn't needed on non-ajax responses. As of Textpattern <I>, the results are loaded from the database on a page reload. HTTP POST values are not used.
gocom_rah_bitly
train
php
4d4da31142a332d311dacfc92363f546053f8c87
diff --git a/src/OrientatedItemFactory.php b/src/OrientatedItemFactory.php index <HASH>..<HASH> 100644 --- a/src/OrientatedItemFactory.php +++ b/src/OrientatedItemFactory.php @@ -186,7 +186,6 @@ class OrientatedItemFactory implements LoggerAwareInterface } //remove any that simply don't fit - $orientationsDimensions = array_unique($orientationsDimensions, SORT_REGULAR); $orientationsDimensions = array_filter($orientationsDimensions, static function (array $i) use ($widthLeft, $lengthLeft, $depthLeft) { return $i[0] <= $widthLeft && $i[1] <= $lengthLeft && $i[2] <= $depthLeft; });
Remove unique orientation check, it's actually counterproductive
dvdoug_BoxPacker
train
php
8b0af0ba929dc8d0e230e6df16b11f36bf9ff476
diff --git a/pyqode/core/managers/file.py b/pyqode/core/managers/file.py index <HASH>..<HASH> 100644 --- a/pyqode/core/managers/file.py +++ b/pyqode/core/managers/file.py @@ -238,7 +238,8 @@ class FileManager(Manager): encoding = cached_encoding enable_modes = os.path.getsize(path) < self._limit for m in self.editor.modes: - m.enabled = enable_modes + if m.enabled: + m.enabled = enable_modes if not enable_modes: self.editor.modes.clear() # open file and get its content
Prevent enabling a mode that has been disabled when opening a file
pyQode_pyqode.core
train
py
847c123ca5ce47f1c27e8553d845b33689191ad4
diff --git a/actionpack/lib/action_view/helpers/sanitize_helper.rb b/actionpack/lib/action_view/helpers/sanitize_helper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/sanitize_helper.rb +++ b/actionpack/lib/action_view/helpers/sanitize_helper.rb @@ -7,6 +7,7 @@ module ActionView # The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements. # These helper methods extend Action View making them callable within your template files. module SanitizeHelper + extend ActiveSupport::Concern # This +sanitize+ helper will html encode all tags and strip all attributes that # aren't specifically allowed. # diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -10,6 +10,9 @@ module ActionView # your views. These helper methods extend Action View making them callable # within your template files. module TextHelper + extend ActiveSupport::Concern + + include SanitizeHelper # The preferred method of outputting text in your views is to use the # <%= "text" %> eRuby syntax. The regular _puts_ and _print_ methods # do not operate as expected in an eRuby code block. If you absolutely must
Concernify SanitizeHelper and TextHelper so including TextHelper correctly include SanitizeHelper and extends its ClassMethods
rails_rails
train
rb,rb
3f246e23791455ff482c5089e87f1c6b2173abe2
diff --git a/container/lxd/container_test.go b/container/lxd/container_test.go index <HASH>..<HASH> 100644 --- a/container/lxd/container_test.go +++ b/container/lxd/container_test.go @@ -470,7 +470,7 @@ func (s *managerSuite) TestSpecApplyConstraints(c *gc.C) { exp := map[string]string{ lxd.AutoStartKey: "true", - "limits.memory": "2046MB", + "limits.memory": "2046MiB", "limits.cpu": "4", } c.Check(spec.Config, gc.DeepEquals, exp)
Fix LXD container test for memory constraints.
juju_juju
train
go
d54a91daca8a2fd4fd70a7cfb33ff24d11d83241
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/fileCommands.js b/bundles/org.eclipse.orion.client.core/web/orion/fileCommands.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/fileCommands.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/fileCommands.js @@ -435,7 +435,7 @@ define(["require", "dojo", "orion/util", "orion/commands", "orion/widgets/NewIte errorHandler); } }; - if (parameters.name && parameters.name.value) { + if (parameters && parameters.name && parameters.name.value) { createFunction(parameters.name.value); } else { getNewItemName(item, domId, "New File", createFunction); @@ -465,7 +465,7 @@ define(["require", "dojo", "orion/util", "orion/commands", "orion/widgets/NewIte errorHandler); } }; - if (parameters.name && parameters.name.value) { + if (parameters && parameters.name && parameters.name.value) { createFunction(parameters.name.value); } else { getNewItemName(item, domId, "New Folder", createFunction);
Bug <I> - New File/Folder commands don't work from More... menu
eclipse_orion.client
train
js
2fbd4bf2577039f741308ea11d443a2bdadd4dac
diff --git a/django_admin_bootstrapped/static/admin/js/jquery.sortable.js b/django_admin_bootstrapped/static/admin/js/jquery.sortable.js index <HASH>..<HASH> 100644 --- a/django_admin_bootstrapped/static/admin/js/jquery.sortable.js +++ b/django_admin_bootstrapped/static/admin/js/jquery.sortable.js @@ -25,7 +25,7 @@ $.fn.sortable = function(options) { var placeholder; if (/^tbody$/i.test(this.tagName)) - placeholder = $("<tr class='sortable-placeholder'>").append($('<td colspan="100%"')); + placeholder = $("<tr class='sortable-placeholder'>").append($('<td colspan="100%">')); else placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">').html("&nbsp;"); @@ -89,4 +89,4 @@ $.fn.sortable = function(options) { }); }); }; -})(jQuery); \ No newline at end of file +})(jQuery);
Update jquery.sortable.js Fix syntax error that happens when trying to make tabular inline sortable
django-admin-bootstrapped_django-admin-bootstrapped
train
js
d7c950e145f3654872cfb421df72f8f9b3e24c14
diff --git a/events/events.go b/events/events.go index <HASH>..<HASH> 100644 --- a/events/events.go +++ b/events/events.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/containerd/typeurl" "github.com/gogo/protobuf/types" ) @@ -15,6 +16,36 @@ type Envelope struct { Event *types.Any } +// Field returns the value for the given fieldpath as a string, if defined. +// If the value is not defined, the second value will be false. +func (e *Envelope) Field(fieldpath []string) (string, bool) { + if len(fieldpath) == 0 { + return "", false + } + + switch fieldpath[0] { + // unhandled: timestamp + case "namespace": + return string(e.Namespace), len(e.Namespace) > 0 + case "topic": + return string(e.Topic), len(e.Topic) > 0 + case "event": + decoded, err := typeurl.UnmarshalAny(e.Event) + if err != nil { + return "", false + } + + adaptor, ok := decoded.(interface { + Field([]string) (string, bool) + }) + if !ok { + return "", false + } + return adaptor.Field(fieldpath[1:]) + } + return "", false +} + // Event is a generic interface for any type of event type Event interface{}
events: define fieldpath implement for envelope
containerd_containerd
train
go
1aa46da7bead828fd3ca257064197f0241ab36c6
diff --git a/dist/jcanvas.js b/dist/jcanvas.js index <HASH>..<HASH> 100644 --- a/dist/jcanvas.js +++ b/dist/jcanvas.js @@ -1476,6 +1476,13 @@ $.fn.drawLayers = function drawLayers(args) { $canvas.clearCanvas(); } + // If a completion callback was provided, save it to the canvas data + // store so that the function can be passed to drawLayers() again + // after any image layers have loaded + if (params.complete) { + data.drawLayersComplete = params.complete; + } + // Cache the layers array layers = data.layers; @@ -1512,6 +1519,11 @@ $.fn.drawLayers = function drawLayers(args) { // Store the latest lastIndex = l; + // Run completion callback (if provided) once all layers have drawn + if (params.complete) { + params.complete.call($canvases[e]); + } + // Get first layer that intersects with event coordinates layer = _getIntersectingLayer(data); @@ -3958,10 +3970,13 @@ $.fn.drawImage = function drawImage(args) { layer._masks = data.transforms.masks.slice(0); if (params._next) { // Draw successive layers + var complete = data.drawLayersComplete; + delete data.drawLayersComplete; $canvas.drawLayers({ clear: false, resetFire: true, - index: params._next + index: params._next, + complete: complete }); } }
Allow drawLayers to accept 'complete' callback This callback will run when all layers have finished drawing, taking into account the asynchronous drawing of any image layers.
caleb531_jcanvas
train
js
4b7cb99e430c6593237c0b306844d17a278dee9c
diff --git a/src/main/java/com/nesscomputing/jackson/NessObjectMapperProvider.java b/src/main/java/com/nesscomputing/jackson/NessObjectMapperProvider.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/nesscomputing/jackson/NessObjectMapperProvider.java +++ b/src/main/java/com/nesscomputing/jackson/NessObjectMapperProvider.java @@ -58,6 +58,9 @@ class NessObjectMapperProvider implements Provider<ObjectMapper> // Don't write out nulls by default -- if you really want them, you can change it with setOptions later. featureMap.put(SerializationFeature.WRITE_NULL_MAP_VALUES, false); + + // No need to flush after every value, which cuts throughput by ~30% + featureMap.put(SerializationFeature.FLUSH_AFTER_WRITE_VALUE, false); } @Inject(optional=true)
Disable flush-after-every-object Improves throughput by approximately <I>%
opentable_otj-jackson
train
java
7ed1b652678e705db52ba44e03a2151cee94ca95
diff --git a/openpnm/utils/misc.py b/openpnm/utils/misc.py index <HASH>..<HASH> 100644 --- a/openpnm/utils/misc.py +++ b/openpnm/utils/misc.py @@ -379,6 +379,20 @@ def models_to_table(obj, params=True): return "\n".join(lines) +def catch_ModuleNotFound(function): + """ + A decorator that wraps the passed in function and catches + ModuleNotFound exception. + """ + @functools.wraps(function) + def wrapper(*args, **kwargs): + try: + return function(*args, **kwargs) + except ModuleNotFoundError: + pass + return wrapper + + def ignore_warnings(warning=RuntimeWarning): r""" Decorator for catching warnings. Useful in pore-scale models where nans
Add decorator to catch ModuleNotFound exception, useful for pestc/pyamg/pypardiso testing
PMEAL_OpenPNM
train
py
9756375041f117cf25664856d3fb8932af795742
diff --git a/marrow/schema/validation/__init__.py b/marrow/schema/validation/__init__.py index <HASH>..<HASH> 100644 --- a/marrow/schema/validation/__init__.py +++ b/marrow/schema/validation/__init__.py @@ -1,3 +1,9 @@ # encoding: utf-8 from .exc import Concern + +from .base import Validator, Callback, In, Contains, Length, Range, Pattern, Instance, Subclass, Equal +from .base import Always, always, Never, never, Unique, unique +from .base import AlwaysTruthy, truthy, Truthy, AlwaysFalsy, falsy, Falsy +from .base import AlwaysRequired, required, Required, AlwaysMissing, missing, Missing +from .base import ValidatedAttribute
Added imports for base objects.
marrow_schema
train
py
a6db09232c6aa4e7179ab3c60ae7fa3cde3b2903
diff --git a/crosscat/utils/sample_utils.py b/crosscat/utils/sample_utils.py index <HASH>..<HASH> 100644 --- a/crosscat/utils/sample_utils.py +++ b/crosscat/utils/sample_utils.py @@ -356,7 +356,7 @@ def get_component_model_constructor(modeltype): return component_model_constructor def create_component_model(column_metadata, column_hypers, suffstats): - suffstats = copy.deepcopy(suffstats) + suffstats = copy.copy(suffstats) count = suffstats.pop('N', 0) modeltype = column_metadata['modeltype'] component_model_constructor = get_component_model_constructor(modeltype)
Copy is much cheaper than deep copy. And the deep copy doesn't seem to be needed here.
probcomp_crosscat
train
py
f6972a57f9d80375a0a94ac40a7eff9861398cb5
diff --git a/GuardHelpers.php b/GuardHelpers.php index <HASH>..<HASH> 100644 --- a/GuardHelpers.php +++ b/GuardHelpers.php @@ -41,11 +41,11 @@ trait GuardHelpers } /** - * Determine if the current user is already authenticated without triggering side effects. + * Determine if the guard has the current user without triggering side effects. * * @return bool */ - public function alreadyAuthenticated() + public function hasUser() { return ! is_null($this->user); }
Rename GuardHelpers::alreadyAuthenticated() to GuardHelpers::hasUser()
illuminate_auth
train
php
a8f1955342ea5ac71da37ab099d9c038c746d226
diff --git a/APIJet/Router.php b/APIJet/Router.php index <HASH>..<HASH> 100644 --- a/APIJet/Router.php +++ b/APIJet/Router.php @@ -14,7 +14,7 @@ class Router return Config::getByName('Router'); } - private function getRoutes() + private static function getRoutes() { return self::getConfig()['routes']; }
Missing static in getRoutes in Router
APIJet_APIJet
train
php
a74c882d4f63fabe7856e5d90b93c2af81c89a5b
diff --git a/src/Autowhatever.js b/src/Autowhatever.js index <HASH>..<HASH> 100644 --- a/src/Autowhatever.js +++ b/src/Autowhatever.js @@ -37,6 +37,7 @@ export default class Autowhatever extends Component { renderItemData: PropTypes.object, // Arbitrary data that will be passed to renderItem() renderSectionTitle: PropTypes.func, // This function gets a section and renders its title. getSectionItems: PropTypes.func, // This function gets a section and returns its items, which will be passed into `renderItem` for rendering. + containerProps: PropTypes.object, // Arbitrary container props inputProps: PropTypes.object, // Arbitrary input props itemProps: PropTypes.oneOfType([ // Arbitrary item props PropTypes.object, @@ -65,6 +66,7 @@ export default class Autowhatever extends Component { getSectionItems: () => { throw new Error('`getSectionItems` must be provided'); }, + containerProps: emptyObject, inputProps: emptyObject, itemProps: emptyObject, highlightedSectionIndex: null, @@ -314,7 +316,8 @@ export default class Autowhatever extends Component { `react-autowhatever-${id}-container`, 'container', isOpen && 'containerOpen' - ) + ), + ...this.props.containerProps }; const inputComponent = renderInputComponent({ type: 'text',
Add containerProps property for arbitrary props on the container (#<I>)
moroshko_react-autowhatever
train
js
b3e53c264a6c2d116a10f7625031765a7a465781
diff --git a/lib/teamlab.rb b/lib/teamlab.rb index <HASH>..<HASH> 100644 --- a/lib/teamlab.rb +++ b/lib/teamlab.rb @@ -49,21 +49,4 @@ module Teamlab def self.mail @mail ||= Teamlab::Mail.new end -end - -#SERVER = 'https://nctautotest-rubyapitest6.teamlab.info' -#USERNAME = '[email protected]' -#PASSWORD = '123456' -# -#Teamlab.configure do |config| -# config.server = SERVER -# config.username = USERNAME -# config.password = PASSWORD -#end -# -# -#b = Teamlab.crm.delete_user_field('contact', 21301) -##a = Teamlab.crm.create_task('CRM_TASK', DateTime.commercial(2015).to_s, '557dfd28-f423-43dd-91ce-51b9f4c4f8e0', ) -##b = Teamlab.crm.create_invoice( {number: '2', contactId: 3101556, consigneeId: 3101556, templateType: 1, issueDate: '2014-04-10T06:30:00.0000000-07:00', dueDate: '2014-05-10T06:30:00.0000000-07:00', -## currency: 'USD', terms: 'test', entityId: 424, language: 'en-US'} ) -#p 1 \ No newline at end of file +end \ No newline at end of file
teamlab.rb edited online with Bitbucket
ONLYOFFICE_onlyoffice_api_gem
train
rb
d2bad398ebf905d433a9ae5d2d12fbb1a9a2b847
diff --git a/src/resources/views/admin/_form.blade.php b/src/resources/views/admin/_form.blade.php index <HASH>..<HASH> 100644 --- a/src/resources/views/admin/_form.blade.php +++ b/src/resources/views/admin/_form.blade.php @@ -29,7 +29,9 @@ <td> <div class="d-flex align-items-start justify-content-between"> <a href="{{ Storage::url($model->path) }}" target="_blank" rel="noopener noreferrer">{{ Storage::url($model->path) }}</a> - <button class="btn btn-secondary btn-xs text-nowrap" type="button" onclick="copyToClipboard('{{ Storage::url($model->path) }}')"><span class="fa fa-clipboard" aria-hidden="true"></span> @lang('Copy')</button> + <button class="btn btn-secondary btn-xs text-nowrap" type="button" onclick="copyToClipboard('{{ Storage::url($model->path) }}')"> + @lang('Copy') + </button> </div> </td> </tr>
Update _form.blade.php
TypiCMS_Files
train
php
554970125a32a27420d5ee7b12b5a6db09fe060e
diff --git a/environment/src/main/java/jetbrains/exodus/gc/GarbageCollector.java b/environment/src/main/java/jetbrains/exodus/gc/GarbageCollector.java index <HASH>..<HASH> 100644 --- a/environment/src/main/java/jetbrains/exodus/gc/GarbageCollector.java +++ b/environment/src/main/java/jetbrains/exodus/gc/GarbageCollector.java @@ -276,7 +276,13 @@ public final class GarbageCollector { final LongSet cleanedFiles = new PackedLongHashSet(); final ReadWriteTransaction txn; try { - txn = useRegularTxn ? (ReadWriteTransaction) env.beginTransaction() : env.beginGCTransaction(); + final TransactionBase tx = useRegularTxn ? env.beginTransaction() : env.beginGCTransaction(); + // tx can be read-only, so we should manually finish it (see XD-667) + if (tx.isReadonly()) { + tx.abort(); + return false; + } + txn = (ReadWriteTransaction) tx; } catch (TransactionAcquireTimeoutException ignore) { return false; }
#XD-<I> fixed
JetBrains_xodus
train
java
c05b39b1aaa12f82ad7feb77a6117b09b078ac16
diff --git a/parsl/dataflow/dflow.py b/parsl/dataflow/dflow.py index <HASH>..<HASH> 100644 --- a/parsl/dataflow/dflow.py +++ b/parsl/dataflow/dflow.py @@ -81,9 +81,6 @@ class DataFlowKernel(object): logger.debug("Starting DataFlowKernel with config\n{}".format(config)) - if sys.version_info < (3, 6): - logger.warning("Support for python versions < 3.6 is deprecated and will be removed after parsl 0.10") - logger.info("Parsl version: {}".format(get_version())) self.checkpoint_lock = threading.Lock()
Remove python <<I> deprecation warning in favour of setup.py install time check (#<I>)
Parsl_parsl
train
py
f96c8ae9bf54e4356ab5f0bdcf34cc24e5ab9365
diff --git a/frame.go b/frame.go index <HASH>..<HASH> 100644 --- a/frame.go +++ b/frame.go @@ -67,8 +67,9 @@ func getStringForType(typ MessageType) string { func parseFrame(m string, typ MessageType, hof headerOrFooterMarker) (brand string, err error) { - // strip whitespace - re := regexp.MustCompile("[>\\s]+") + // replace blocks of characters in the set [>\n\r\t ] with a single space, so that Go + // can easily parse each piece + re := regexp.MustCompile("[>\n\r\t ]+") s := strings.TrimSpace(re.ReplaceAllString(m, " ")) sffx := getStringForType(typ)
Tweaked regex, more descriptive comment
keybase_saltpack
train
go
b18d775504bab03dc02c720c2a6bbae039542a70
diff --git a/Build/Gruntfile.js b/Build/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Build/Gruntfile.js +++ b/Build/Gruntfile.js @@ -538,7 +538,7 @@ module.exports = function(grunt) { grunt.registerTask('js', ['uglify', 'removesourcemap']); grunt.registerTask('image', ['imagemin']); grunt.registerTask('lint', ['stylelint']); - grunt.registerTask('build', ['update', 'lint', 'css', 'js', 'image', 'webfont']); + grunt.registerTask('build', ['update', 'lint', 'webfont', 'css', 'js', 'image']); grunt.registerTask('default', ['build']); };
[TASK] Change build order (#<I>) This patche changes the build order to ensure the creation of the minified css for the webfont. Fixes #<I>
benjaminkott_bootstrap_package
train
js
643e919404812cab49f9b9ec01faa1f09097f1c3
diff --git a/Core/Router/Router.php b/Core/Router/Router.php index <HASH>..<HASH> 100644 --- a/Core/Router/Router.php +++ b/Core/Router/Router.php @@ -233,7 +233,6 @@ class Router extends \AltoRouter implements \ArrayAccess foreach ($this->match['params'] as $key => $val) { if (in_array($key, $this->parameter_to_target)) { $this->match['target'][$key] = $val; - unset($this->match['params'][$key]); } } }
Stops removing parameter when they are to be used as target
tekkla_core-router
train
php
12b37e91cd7c539b60b517c47e06394fe145a52b
diff --git a/tests/dummy/app/components/contrib-manager/component.js b/tests/dummy/app/components/contrib-manager/component.js index <HASH>..<HASH> 100644 --- a/tests/dummy/app/components/contrib-manager/component.js +++ b/tests/dummy/app/components/contrib-manager/component.js @@ -11,8 +11,8 @@ export default Ember.Component.extend({ permissionChanges: {}, bibliographicChanges: {}, actions: { - addContributor(userId, permission, isBibliographic) { - this.sendAction('addContributor', userId, permission, isBibliographic); + addContributor(userId, permission, isBibliographic, sendEmail) { + this.sendAction('addContributor', userId, permission, isBibliographic, sendEmail); }, removeContributor(contrib) { this.sendAction('removeContributor', contrib);
Also pass along sendEmail in the tests compononet addContributor for good measure
CenterForOpenScience_ember-osf
train
js
1be73069cdf27134c8e660899a757af9a599670b
diff --git a/source/Net/Bazzline/Component/DataType/Integer.php b/source/Net/Bazzline/Component/DataType/Integer.php index <HASH>..<HASH> 100644 --- a/source/Net/Bazzline/Component/DataType/Integer.php +++ b/source/Net/Bazzline/Component/DataType/Integer.php @@ -15,14 +15,24 @@ namespace Net\Bazzline\Component\DataType; */ class Integer extends Numeric { + /** + * @return bool + * @author stev leibelt <[email protected]> + * @since 2013-08-03 + */ public function isOdd() { - + return !$this->isEven(); } + /** + * @return bool + * @author stev leibelt <[email protected]> + * @since 2013-08-03 + */ public function isEven() { - + return (($this->value % 2) == 0); } /**
Added "isEvent" and "isOdd"
stevleibelt_php_component_data_type
train
php
6a8e5a41fc781ca4e6a5c6d6f32804c160eb3c81
diff --git a/lib/heroku_san/stage.rb b/lib/heroku_san/stage.rb index <HASH>..<HASH> 100644 --- a/lib/heroku_san/stage.rb +++ b/lib/heroku_san/stage.rb @@ -143,7 +143,7 @@ module HerokuSan end def sh_heroku(*command) - cmd = (command + ['--app', app]) + cmd = (command + ['--app', app]).compact show_command = cmd.join(' ') $stderr.puts show_command if @debug ok = system "heroku", *cmd
Fix for <I> compatibility
jqr_heroku_san
train
rb
0d1218b2be6640211defd88623f60f468b33b77d
diff --git a/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/AsciidoctorInvoker.java b/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/AsciidoctorInvoker.java index <HASH>..<HASH> 100644 --- a/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/AsciidoctorInvoker.java +++ b/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/AsciidoctorInvoker.java @@ -78,7 +78,7 @@ public class AsciidoctorInvoker { timings.callMethod(JRubyRuntimeContext.get(asciidoctor).getCurrentContext(), "print_report"); } - if (!"".equals(output.trim())) { + if (output != null && !"".equals(output.trim())) { System.out.println(output); } }
Rendering output may be null when written to file
asciidoctor_asciidoctorj
train
java
bddf2c8d1fe0579b9a21e294108a8b12ef2f13a4
diff --git a/src/main/java/org/webjars/WebJarAssetLocator.java b/src/main/java/org/webjars/WebJarAssetLocator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/webjars/WebJarAssetLocator.java +++ b/src/main/java/org/webjars/WebJarAssetLocator.java @@ -16,7 +16,7 @@ import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; /** - * Locate WebJar assets + * Locate WebJar assets. The class is thread safe. */ public class WebJarAssetLocator {
I thought it should be mentioned that the class is designed to be thread safe.
webjars_webjars-locator
train
java
2ef88f7c73b7ec0d4cdfa160ac7353dc36fa30ba
diff --git a/lib/solargraph/yard_map.rb b/lib/solargraph/yard_map.rb index <HASH>..<HASH> 100755 --- a/lib/solargraph/yard_map.rb +++ b/lib/solargraph/yard_map.rb @@ -197,7 +197,8 @@ module Solargraph end } if ns.kind_of?(YARD::CodeObjects::ClassObject) and namespace != 'Object' - if ns.superclass.kind_of?(YARD::CodeObjects::Proxy) + #if ns.superclass.kind_of?(YARD::CodeObjects::Proxy) + unless ns.nil? meths += get_instance_methods(ns.superclass.to_s) end end
Always include superclass methods in YardMap#get_instance_methods.
castwide_solargraph
train
rb
e56d1d9182bc87913e8544325106d4ca9dc1efa8
diff --git a/scapy/sendrecv.py b/scapy/sendrecv.py index <HASH>..<HASH> 100644 --- a/scapy/sendrecv.py +++ b/scapy/sendrecv.py @@ -67,7 +67,7 @@ def sndrcv(pks, pkt, timeout = None, inter = 0, verbose=None, chainCC=0, retry=0 while retry >= 0: found=0 - if timeout < 0: + if timeout is not None and timeout < 0: timeout = None rdpipe,wrpipe = os.pipe()
[sendrecv.py] Fix comparison of default timeout. Comparison of the default timeout None with 0 results in an error, un-orderable types.
phaethon_kamene
train
py
147afebebb08f468da6421e72a86ffaa03670627
diff --git a/qunit/qunit.js b/qunit/qunit.js index <HASH>..<HASH> 100644 --- a/qunit/qunit.js +++ b/qunit/qunit.js @@ -107,6 +107,16 @@ var QUnit = { config.assertions = []; config.expected = expected; + + var tests = id("qunit-tests"); + if (tests) { + var b = document.createElement("strong"); + b.innerHTML = "Running " + name; + var li = document.createElement("li"); + li.appendChild( b ); + li.id = "current-test-output"; + tests.appendChild( li ) + } try { if ( !config.pollution ) { @@ -212,11 +222,12 @@ var QUnit = { } }); - var li = document.createElement("li"); + var li = id("current-test-output"); + li.id = ""; li.className = bad ? "fail" : "pass"; + li.removeChild( li.firstChild ); li.appendChild( b ); li.appendChild( ol ); - tests.appendChild( li ); if ( bad ) { var toolbar = id("qunit-testrunner-toolbar");
Improve async testing by creating the result element before running the test, updating it later. If the test fails, its clear which test is the culprit.
JamesMGreene_qunit-assert-html
train
js
2166505012d3d2eaa5fb881d677d8f4fded82c35
diff --git a/tests/MetableTest.php b/tests/MetableTest.php index <HASH>..<HASH> 100644 --- a/tests/MetableTest.php +++ b/tests/MetableTest.php @@ -205,7 +205,9 @@ class MetableTest extends TestCase $user->save(); // re retrieve user to make sure meta is saved - $user = User::find( $user->getKey() ); + $user = User::with( ['metas'] )->find( $user->getKey() ); + + $this->assertTrue( $user->relationLoaded( 'metas' ), 'Metas relation should be loaded' ); $this->assertEquals( 'baz', $user->getMeta( 'foo' ), 'Meta method getMeta did not return correct value' ); $this->assertEquals( 'bar', $user->getMeta( 'bas' ), 'Meta method getMeta did not return correct value' );
Added test for eager loading metas relation
kodeine_laravel-meta
train
php
8c80cc173809143c1ada0c0a5639d7c0c5417b7c
diff --git a/lib/editor/htmlarea/htmlarea.php b/lib/editor/htmlarea/htmlarea.php index <HASH>..<HASH> 100644 --- a/lib/editor/htmlarea/htmlarea.php +++ b/lib/editor/htmlarea/htmlarea.php @@ -808,13 +808,10 @@ HTMLArea.prototype.generate = function () { // width = Math.max(parseInt(width), 598); width = String(width); - if (width.match(/^\d+$/)) { // is this a pure int? if so, let it be in px - width=width+"px"; - } - - if (!HTMLArea.is_ie) { + if (width.match(/^\d+$/)) { // is this a pure int? if so, let it be in px, and remove 2px height -= 2; - width -= 2; + width -= 2; + width=width+"px"; } iframe.style.width = width;
htmlarea: fix in FF - MDL-<I> The previous fix for IE left some problems in the FF side of things because we were trying additions/substractions on width once its had turned to a string of value + unit. Do the math before we attach 'px' to it...
moodle_moodle
train
php
ad22cc55f773aec77e901a813730620bcb989139
diff --git a/lib/bullet/rack.rb b/lib/bullet/rack.rb index <HASH>..<HASH> 100644 --- a/lib/bullet/rack.rb +++ b/lib/bullet/rack.rb @@ -53,7 +53,11 @@ module Bullet end def response_body(response) - rails? ? response.body.first : response.first + if rails? + Array === response.body ? response.body.first : response.body + else + response.first + end end private
response body could be an array or a string
flyerhzm_bullet
train
rb
c8600a4a7eb1301cdccd3f2b67f257911f3a8060
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -122,9 +122,13 @@ nativeBindings.nativeGl.onconstruct = (gl, canvas) => { if (!hidden) { const visible = canvas.ownerDocument.documentElement.contains(canvas); if (visible && !hidden) { - nativeWindow.show(windowHandle); + if (!nativeWindow.isVisible(windowHandle)) { + nativeWindow.show(windowHandle); + } } else { - nativeWindow.hide(windowHandle); + if (nativeWindow.isVisible(windowHandle)) { + nativeWindow.hide(windowHandle); + } } } });
Only show/hide the window if it's hidden/visible
exokitxr_exokit
train
js
cf1f533fff954f4be8f640838ff8d22c6e7f7202
diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index <HASH>..<HASH> 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -190,10 +190,22 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { */ private String smSessionId; - private SyncPointState smResumedSyncPoint; + /** + * Represents the state of stream management resumption. + * <p> + * Unlike other sync points, this sync point is marked volatile because it is also read by the reader thread. + * </p> + */ + private volatile SyncPointState smResumedSyncPoint; private Failed smResumptionFailed; - private boolean smEnabledSyncPoint; + /** + * Represents the state of stream magement. + * <p> + * This boolean is marked volatile as it is read by various threads, including the reader thread via {@link #isSmEnabled()}. + * </p> + */ + private volatile boolean smEnabledSyncPoint; /** * The client's preferred maximum resumption time in seconds.
[tcp] Mark SM sync points as volatile
igniterealtime_Smack
train
java
ab38b396be0cc42ff555022d55b89a2137da9779
diff --git a/src/create.js b/src/create.js index <HASH>..<HASH> 100644 --- a/src/create.js +++ b/src/create.js @@ -1,4 +1,4 @@ -import {spawn} from 'redux-saga/effects'; +import {all, spawn} from 'redux-saga/effects'; import {onSubmitActions} from './common'; import formSubmitSaga from './form-submit-saga'; @@ -11,10 +11,10 @@ const factory = SubmissionError => ({ return formSubmitSaga(SubmissionError); } return function* formSubmitSagaComposed () { - yield [ + yield all([ spawn(root), spawn(formSubmitSaga(SubmissionError)) - ]; + ]); }; }
Updated to use new method of spawning multiple sagas
colinbate_redux-form-submit-saga
train
js
5e444988e1d41427171273241c6a88955fbf1601
diff --git a/broadlink/__init__.py b/broadlink/__init__.py index <HASH>..<HASH> 100644 --- a/broadlink/__init__.py +++ b/broadlink/__init__.py @@ -53,7 +53,7 @@ def gendevice(devtype, host, mac, name=None, cloud=None): 0x610e, # RM4 Mini 0x610f, # RM4c 0x62bc, # RM4 Mini - 0x62be # RM4c + 0x62be # RM4c Mini ], a1: [0x2714], # A1 mp1: [0x4EB5, # MP1
Fix 0x<I>be device name (#<I>)
mjg59_python-broadlink
train
py
7a12036b7c75a8cb73abfc13b4e9a7c6750807bd
diff --git a/src/cc/layer_view.js b/src/cc/layer_view.js index <HASH>..<HASH> 100644 --- a/src/cc/layer_view.js +++ b/src/cc/layer_view.js @@ -71,7 +71,7 @@ base.exportTo('cc', function() { this.analysisEl_.textContent = ''; var layer = selection.layer; - if (layer.args && layer.args.pictures) { + if (layer && layer.args && layer.args.pictures) { this.analysisEl_.appendChild( this.createPictureBtn_(layer.args.pictures)); }
Correctly handle selection.layer being undefined
catapult-project_catapult
train
js
d4e0bc7914be17dbd3f40b20709bbb76daaff654
diff --git a/python_modules/libraries/dagstermill/setup.py b/python_modules/libraries/dagstermill/setup.py index <HASH>..<HASH> 100644 --- a/python_modules/libraries/dagstermill/setup.py +++ b/python_modules/libraries/dagstermill/setup.py @@ -15,6 +15,7 @@ if __name__ == "__main__": setup( name="dagstermill", version=get_version(), + description="run notebooks using the Dagster tools", author="Elementl", author_email="[email protected]", license="Apache-2.0",
a Description rather than the UNKNOWN (#<I>)
dagster-io_dagster
train
py
4c72d696dc658573988fb97f7a0e304f8f06cdcb
diff --git a/cloudplatform/service/device-api/src/main/java/org/eclipse/hono/service/device/api/Device.java b/cloudplatform/service/device-api/src/main/java/org/eclipse/hono/service/device/api/Device.java index <HASH>..<HASH> 100644 --- a/cloudplatform/service/device-api/src/main/java/org/eclipse/hono/service/device/api/Device.java +++ b/cloudplatform/service/device-api/src/main/java/org/eclipse/hono/service/device/api/Device.java @@ -46,8 +46,6 @@ public class Device { private List<LinkObject> objectLinks = new LinkedList<>(); - private String rootPath; - private Map<String, Object> properties = new HashMap<>(); // Constructors @@ -70,7 +68,6 @@ public class Device { this.properties = properties; } - // Getters and setters @@ -162,14 +159,6 @@ public class Device { this.objectLinks = objectLinks; } - public String getRootPath() { - return rootPath; - } - - public void setRootPath(String rootPath) { - this.rootPath = rootPath; - } - public Map<String, Object> getProperties() { return properties; }
Root path should be used on the properties level.
rhiot_rhiot
train
java
cab6762b1200d29d653627214e6f64ad7cf76993
diff --git a/user/index.php b/user/index.php index <HASH>..<HASH> 100644 --- a/user/index.php +++ b/user/index.php @@ -870,7 +870,12 @@ helpbutton("participantswithselectedusers", get_string("withselectedusers")); choose_from_menu ($displaylist, "formaction", "", get_string("withselectedusers"), "if(checksubmit(this.form))this.form.submit();", ""); echo '<input type="hidden" name="id" value="'.$course->id.'" />'; - echo '<input type="submit" value="' . get_string('ok') . '" />'; + echo '<div id="noscriptparticipantsform" style="display: inline;">'; + echo '<input type="submit" value="'.get_string('ok').'" /></div>'; + echo '<script type="text/javascript">'. + "\n//<![CDATA[\n". + 'document.getElementById("noscriptparticipantsform").style.display = "none";'. + "\n//]]>\n".'</script>'; echo '</div>'; echo '</div>'; echo '</form>';
MDL-<I> Participants page OK button hidden if javascript is enabled, merged from <I>
moodle_moodle
train
php
e5ee5ffa044adea192a2f6be5625f160c3f2d716
diff --git a/lib/Stripe/Plan.php b/lib/Stripe/Plan.php index <HASH>..<HASH> 100644 --- a/lib/Stripe/Plan.php +++ b/lib/Stripe/Plan.php @@ -5,7 +5,7 @@ class Stripe_Plan extends Stripe_ApiResource public static function constructFrom($values, $apiKey=null) { $class = get_class(); - return self::_scopedConstructFrom($class, $values, $apiKey); + return self::scopedConstructFrom($class, $values, $apiKey); } public static function retrieve($id, $apiKey=null)
Change self::_scopedConstructFrom to self::scopedConstructFrom
stripe_stripe-php
train
php
064d6e685151f7bf4180139ee301480b61a44ef7
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,7 +42,7 @@ master_doc = 'index' # General information about the project. project = 'KryPy' -copyright = '2013, André Gaul' +copyright = u'2013, André Gaul' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the
fix utf-8 mojibake in doc with python2
andrenarchy_krypy
train
py
84fef48ab56be16a0bbcdd23b4c1cdfc88c040de
diff --git a/status.js b/status.js index <HASH>..<HASH> 100644 --- a/status.js +++ b/status.js @@ -351,7 +351,8 @@ exports.console = function(){ // exports.start = function(){ running = true - looper = setInterval(render, interval) + render() + looper = setInterval(render, settings.interval) } exports.stop = function(){
Added a render to start, and fixed the interval ref
derrickpelletier_node-status
train
js
51ea82b1205f3c3075e4f8e5cae80513e793a6bd
diff --git a/src/Digbang/Security/Entities/User.php b/src/Digbang/Security/Entities/User.php index <HASH>..<HASH> 100644 --- a/src/Digbang/Security/Entities/User.php +++ b/src/Digbang/Security/Entities/User.php @@ -68,6 +68,10 @@ class User extends SentryUser { $newPermissions[$permission] = -1; } + else + { + unset($newPermissions[$permission]); + } } $this->permissions = $newPermissions;
Unset a user permission that's already granted by a group permission
digbang_security
train
php
c298abfddbdf83a12ab6c826dbb3562fb358e963
diff --git a/foyer/tests/test_performance.py b/foyer/tests/test_performance.py index <HASH>..<HASH> 100644 --- a/foyer/tests/test_performance.py +++ b/foyer/tests/test_performance.py @@ -23,7 +23,7 @@ def test_surface(): @pytest.mark.skipif(not has_mbuild, reason="mbuild is not installed") [email protected](60) [email protected](45) def test_polymer(): peg100 = mb.load(get_fn('peg100.mol2')) forcefield = Forcefield(name='oplsaa')
Drop a timeout time to its previous value
mosdef-hub_foyer
train
py
c97f1f4868c134da5b9300153f5202c00a58743f
diff --git a/src/conbo/view/View.js b/src/conbo/view/View.js index <HASH>..<HASH> 100644 --- a/src/conbo/view/View.js +++ b/src/conbo/view/View.js @@ -39,9 +39,9 @@ conbo.View = conbo.Glimpse.extend if (!!template && conbo.isString(template)) { this.$el.html(template); - this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.TEMPLATE_LOADED)); } + this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.TEMPLATE_LOADED)); this.render(); this.bindView(); }
TEMPLATE_LOADED now dispatched even if there's no template
mesmotronic_conbo
train
js
4640c7e6f8499eeebee287e2fee0ac8ec8126d80
diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index <HASH>..<HASH> 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -57,7 +57,7 @@ class CrudViewHelper extends Helper * @param string $field The field to process. * @param Entity $data The entity data. * @param array $options Processing options. - * @return string|null|array|bool|integer + * @return string|null|array|bool|int */ public function process($field, Entity $data, array $options = []) {
fix: switch from integer to int as return type
FriendsOfCake_crud-view
train
php
1cbb10b520c22f0ef5728cfeb4d0a06e4e628a13
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -160,6 +160,7 @@ head = specimen.slice(0, idx - 1) tail = specimen.slice(idx) specimen = head.concat(tail) + idx -= 1 continue } char = specimen[idx]
fix bug where next letter after escaped letter would be skipped for formatting
nkcmr_phpdate
train
js
394decb5798c6a2d1a7f965e984c22cf0ea0ef51
diff --git a/DependencyInjection/ChillMainExtension.php b/DependencyInjection/ChillMainExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/ChillMainExtension.php +++ b/DependencyInjection/ChillMainExtension.php @@ -43,14 +43,15 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface $container->prependExtensionConfig('assetic', array('bundles' => array('ChillMainBundle'))); - //add installation_name to globals + //add installation_name and date_format to globals $chillMainConfig = $container->getExtensionConfig($this->getAlias()); $config = $this->processConfiguration(new Configuration(), $chillMainConfig); $twigConfig = array( 'globals' => array( 'installation' => array( 'name' => $config['installation_name'] - ) + ), + 'date_format' => 'd-M-Y' ) ); $container->prependExtensionConfig('twig', $twigConfig);
add date_format to globals in twig
Chill-project_Main
train
php
5aca1d299968461bae7fb1d7d0e9de6f7cce395a
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -37,3 +37,12 @@ test('convertEventCoords', function(t) { t.equal(coords.x, 600); t.equal(coords.y, 100); }); + +test('degreesToRadians / radiansToDegrees', function(t) { + t.plan(4); + + t.equal(cutils.degreesToRadians(58), 1.0122909661567112); + t.equal(cutils.degreesToRadians(555), 9.68657734856853); + t.equal(cutils.degreesToRadians(8), 0.13962634015954636); + t.equal(cutils.radiansToDegrees(cutils.degreesToRadians(8)), 8); +});
Add tests for `degreesToRadians` and `radiansToDegrees`
tillarnold_canvas-utils
train
js
f1fc7406ff6daae405a132cb3b18cede85a26a88
diff --git a/spam_lists/structures.py b/spam_lists/structures.py index <HASH>..<HASH> 100644 --- a/spam_lists/structures.py +++ b/spam_lists/structures.py @@ -46,7 +46,7 @@ class CachedFactoryMixin(object): return cls(*args, **kwargs) -class Hostname(name.Name): +class Hostname(CachedFactoryMixin, name.Name): ''' A class of objects representing hostname values. The instances are used as values tested by clients of
Add CachedFactoryMixin to base classes of Hostname
piotr-rusin_spam-lists
train
py
254cb94963c981a2529c921e9c1e400c56bd16fc
diff --git a/lib/japr/pipeline.rb b/lib/japr/pipeline.rb index <HASH>..<HASH> 100644 --- a/lib/japr/pipeline.rb +++ b/lib/japr/pipeline.rb @@ -55,10 +55,6 @@ module JAPR config = DEFAULTS.merge(config) staging_path = File.join(source, config['staging_path']) FileUtils.rm_rf(staging_path) - rescue Exception => e - puts "Failed to remove staged assets: #{e.message}" - # Re-raise the exception - raise e end # Add prefix to output
Remove unnecessary rescue, as FileUtils.rm_rf never raises exceptions.
matthodan_jekyll-asset-pipeline
train
rb
507576692ec2ee29b7bc27586d4e5a8bbbcee103
diff --git a/skflow/estimators/base.py b/skflow/estimators/base.py index <HASH>..<HASH> 100644 --- a/skflow/estimators/base.py +++ b/skflow/estimators/base.py @@ -425,7 +425,7 @@ class TensorFlowEstimator(BaseEstimator): if not os.path.exists(saver_filename): raise ValueError("Restore folder doesn't contain saver defintion.") with open(saver_filename) as fsaver: - saver_def = tf.python.training.saver.saver_pb2.SaverDef() + saver_def = tf.train.SaverDef() text_format.Merge(fsaver.read(), saver_def) self._saver = tf.train.Saver(saver_def=saver_def)
Use the public TensorFlow API to access SaverDef The current code accesses SaverDef using an obsolete private API. This change makes skflow compatible with TensorFlow <I> and up.
tensorflow_skflow
train
py
6bae0464ca51e24380f7fc3c22dd674e78e60086
diff --git a/interact.js b/interact.js index <HASH>..<HASH> 100644 --- a/interact.js +++ b/interact.js @@ -1365,7 +1365,7 @@ } } - if (checkRestrict(target) && restrictStatus.restricted) { + if (checkRestrict(target) && !(phase === 'start' && options.restrict.elementRect) && restrictStatus.restricted) { page.x += restrictStatus.dx; page.y += restrictStatus.dy; client.x += restrictStatus.dx;
Fix inacurate restriction when starting near edge ... while elementRect is set
taye_interact.js
train
js
eef56546b4a4392fa46d3ada8f1c94242ffa9a90
diff --git a/archunit/src/test/java/com/tngtech/archunit/core/importer/ClassFileImporterGenericClassesTest.java b/archunit/src/test/java/com/tngtech/archunit/core/importer/ClassFileImporterGenericClassesTest.java index <HASH>..<HASH> 100644 --- a/archunit/src/test/java/com/tngtech/archunit/core/importer/ClassFileImporterGenericClassesTest.java +++ b/archunit/src/test/java/com/tngtech/archunit/core/importer/ClassFileImporterGenericClassesTest.java @@ -335,20 +335,6 @@ public class ClassFileImporterGenericClassesTest { } @Test - public void imports_type_variable_bound_by_other_type_variable() { - @SuppressWarnings("unused") - class ClassWithTypeParameterWithTypeVariableBound<U extends T, T extends String, V extends T> { - } - - JavaClasses classes = new ClassFileImporter().importClasses(ClassWithTypeParameterWithTypeVariableBound.class); - - JavaClass javaClass = classes.get(ClassWithTypeParameterWithTypeVariableBound.class); - - assertThatType(javaClass) - .hasTypeParameter("U").withBoundsMatching(typeVariable("T")); - } - - @Test public void references_type_variable_bound() { @SuppressWarnings("unused") class ClassWithTypeParameterWithTypeVariableBound<U extends T, T extends String, V extends T> {
remove redundant `imports_type_variable_bound_by_other_type_variable` This test is superseded by `references_type_variable_bound`, which tests almost the same and a tiny bit more. Since those tests are so similar I think it is more confusing than beneficial to keep them both.
TNG_ArchUnit
train
java
aa62a88718acc6388d718ff3395c792215aeefdf
diff --git a/extensions/tags/src/Access/DiscussionPolicy.php b/extensions/tags/src/Access/DiscussionPolicy.php index <HASH>..<HASH> 100755 --- a/extensions/tags/src/Access/DiscussionPolicy.php +++ b/extensions/tags/src/Access/DiscussionPolicy.php @@ -62,10 +62,8 @@ class DiscussionPolicy extends AbstractPolicy { // Wrap all discussion permission checks with some logic pertaining to // the discussion's tags. If the discussion has a tag that has been - // restricted, and the user has this permission for that tag, then they - // are allowed. If the discussion only has tags that have been - // restricted, then the user *must* have permission for at least one of - // them. + // restricted, the user must have the permission for that tag. If all of + // the discussion's tags are restricted, then ignore global permissions. $tags = $discussion->tags; if (count($tags)) { @@ -73,8 +71,8 @@ class DiscussionPolicy extends AbstractPolicy foreach ($tags as $tag) { if ($tag->is_restricted) { - if ($actor->hasPermission('tag'.$tag->id.'.discussion.'.$ability)) { - return true; + if (! $actor->hasPermission('tag'.$tag->id.'.discussion.'.$ability)) { + return false; } } else { $restricted = false; @@ -82,7 +80,7 @@ class DiscussionPolicy extends AbstractPolicy } if ($restricted) { - return false; + return true; } } }
Change tag permission logic Require a user to have permission for *all* of the restricted tags a discussion has, rather than just one. See <URL>
flarum_core
train
php
6cee128bfd4930ae143e14865a6116adee9865b5
diff --git a/src/main/java/com/tumblr/jumblr/types/Note.java b/src/main/java/com/tumblr/jumblr/types/Note.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/tumblr/jumblr/types/Note.java +++ b/src/main/java/com/tumblr/jumblr/types/Note.java @@ -7,6 +7,8 @@ public class Note { private String blog_url; private String type; private Long post_id; + private String reply_text; + private String added_text; /** * Get the timestamp of this note
Add missing Note fields: reply_text and added_text for GSON deserialization.
tumblr_jumblr
train
java
b52aabb2d1d9cac2d7932ffb439a5232982f365a
diff --git a/Neos.Flow/Classes/Core/Booting/Scripts.php b/Neos.Flow/Classes/Core/Booting/Scripts.php index <HASH>..<HASH> 100644 --- a/Neos.Flow/Classes/Core/Booting/Scripts.php +++ b/Neos.Flow/Classes/Core/Booting/Scripts.php @@ -855,7 +855,7 @@ class Scripts return; } - if (strcmp(PHP_BINARY, $configuredPhpBinaryPathAndFilename) !== 0) { + if (strcasecmp(PHP_BINARY, $configuredPhpBinaryPathAndFilename) !== 0) { throw new FlowException(sprintf('You are running the Flow CLI with a PHP binary different from the one Flow is configured to use internally. ' . 'Flow has been run with "%s", while the PHP version Flow is configured to use for subrequests is "%s". Make sure to configure Flow to ' . 'use the same PHP binary by setting the "Neos.Flow.core.phpBinaryPathAndFilename" configuration option to "%s". Flush the ' .
BUGFIX: Make php binary setting check case-insensitive
neos_flow-development-collection
train
php
0d31808033272cee5126f4546f70626a3e28f59d
diff --git a/lib/salt/page.rb b/lib/salt/page.rb index <HASH>..<HASH> 100644 --- a/lib/salt/page.rb +++ b/lib/salt/page.rb @@ -33,13 +33,18 @@ module Salt File.join(parent_path, File.dirname(@path).gsub(site.source_paths[:pages], '')) end - def write(site, path, context = {}) + def write(site, path, context = false) directory_path = output_path(site, path) full_path = File.join(directory_path, output_file) @url = full_path.gsub(site.output_paths[:site], '').gsub(/index\.html$/, '') - contents = render(site, @contents, {this: self}.merge(context)) + contents = if context + render(site, @contents, {this: self}.merge(context)) + else + @contents + end + FileUtils.mkdir_p(directory_path) unless Dir.exist?(directory_path) File.open(full_path, 'w') do |file|
Make the context option, so we can write out raw files based on the contents.
waferbaby_dimples
train
rb
abc680f079b005c65000d5e3f2dcfc7dd618f197
diff --git a/Models/Objects/ObjectInterface.php b/Models/Objects/ObjectInterface.php index <HASH>..<HASH> 100644 --- a/Models/Objects/ObjectInterface.php +++ b/Models/Objects/ObjectInterface.php @@ -40,7 +40,7 @@ interface ObjectInterface /** * @abstract Return List Of Objects with required filters * - * @param array $filter Filters for Object List. + * @param string $filter Filters for Object List. * @param array $params Search parameters for result List. * $params["max"] Maximum Number of results * $params["offset"] List Start Offset
Migrate to Splash Php Core V2
SplashSync_Php-Core
train
php
7d39990497f0ee34c252ca746850f75bab18ff5e
diff --git a/helpers/path.go b/helpers/path.go index <HASH>..<HASH> 100644 --- a/helpers/path.go +++ b/helpers/path.go @@ -415,7 +415,7 @@ func prettifyPath(in string, b filepathPathBridge) string { if len(in) < 2 { return b.Separator() } - return b.Join(b.Clean(in), "index.html") + return b.Join(in, "index.html") } name, ext := fileAndExt(in, b) if name == "index" {
helpers: Don't clean the path before Join Join will call Clean anyway.
gohugoio_hugo
train
go
3cd71454919431e1d262af8f2a689d457a2edc60
diff --git a/src/S3/S3ClientTrait.php b/src/S3/S3ClientTrait.php index <HASH>..<HASH> 100644 --- a/src/S3/S3ClientTrait.php +++ b/src/S3/S3ClientTrait.php @@ -216,7 +216,7 @@ trait S3ClientTrait return $handler($command) ->then(static function (ResultInterface $result) { - return $result['@metadata']['headers']['x-amz-bucket-region']; + return (isset($result['@metadata']['headers']['x-amz-bucket-region'])) ? $result['@metadata']['headers']['x-amz-bucket-region'] : null; }, function (AwsException $e) { $response = $e->getResponse(); if ($response === null) {
Fix for NOTICE with S3 compatible services that don't send the correct headers
Interfacelab_ilab-aws-media-cloud-sdk
train
php
30908a7be0d3afebdda5ddc0b33c401ab8f84b29
diff --git a/lib/rollbar/scrubbers/params.rb b/lib/rollbar/scrubbers/params.rb index <HASH>..<HASH> 100644 --- a/lib/rollbar/scrubbers/params.rb +++ b/lib/rollbar/scrubbers/params.rb @@ -54,7 +54,7 @@ module Rollbar params.to_hash.inject({}) do |result, (key, value)| if fields_regex && fields_regex =~ Rollbar::Encoding.encode(key).to_s - result[key] = Rollbar::Scrubbers.scrub_value(value) + result[key] = scrub_value(value) elsif value.is_a?(Hash) result[key] = scrub(value, options) elsif value.is_a?(Array) @@ -62,7 +62,7 @@ module Rollbar elsif skip_value?(value) result[key] = "Skipped value of class '#{value.class.name}'" elsif scrub_all - result[key] = Rollbar::Scrubbers.scrub_value(value) + result[key] = scrub_value(value) else result[key] = rollbar_filtered_param_value(value) end @@ -77,6 +77,10 @@ module Rollbar end end + def scrub_value(value) + Rollbar::Scrubbers.scrub_value(value) + end + def rollbar_filtered_param_value(value) if ATTACHMENT_CLASSES.include?(value.class.name) begin
Extract method to scrub a single value for simplicity
rollbar_rollbar-gem
train
rb
25881fe30e415051702319814abcc30d8e7f988f
diff --git a/pkg/kubelet/server/server.go b/pkg/kubelet/server/server.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/server/server.go +++ b/pkg/kubelet/server/server.go @@ -164,7 +164,7 @@ type AuthInterface interface { } // HostInterface contains all the kubelet methods required by the server. -// For testablitiy. +// For testability. type HostInterface interface { GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) GetContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error)
fix nits in kubelet server
kubernetes_kubernetes
train
go
ae47aca401413e5b1be5f8edb7d74b368de6ccec
diff --git a/lib/mapi.js b/lib/mapi.js index <HASH>..<HASH> 100644 --- a/lib/mapi.js +++ b/lib/mapi.js @@ -96,7 +96,7 @@ function translateError(err, res) { return new restify.InvalidArgumentError('Bad request'); //XXX This should be logged on a given logger. - console.error('Unknown MAPI error:', err, res); + console.error('sdc-clients/mapi.js: Unknown MAPI error:', err, res); return new restify.InternalError('An unknown error occurred'); }
be more specific where this error is coming from
joyent_node-sdc-clients
train
js
9d134b36ad60a22ce48d33406b3042e5ae6b58b2
diff --git a/metpy/calc/thermo.py b/metpy/calc/thermo.py index <HASH>..<HASH> 100644 --- a/metpy/calc/thermo.py +++ b/metpy/calc/thermo.py @@ -135,7 +135,7 @@ def moist_lapse(pressure, temperature): def dt(t, p): t = units.Quantity(t, temperature.units) p = units.Quantity(p, pressure.units) - rs = mixing_ratio(saturation_vapor_pressure(t), p) + rs = saturation_mixing_ratio(p, t) frac = ((Rd * t + Lv * rs) / (Cp_d + (Lv * Lv * rs * epsilon / (Rd * t * t)))).to('kelvin') return frac / p @@ -425,7 +425,7 @@ def saturation_mixing_ratio(tot_press, temperature): Survey. 73. ''' - return 0.622 * saturation_vapor_pressure(temperature) / tot_press + return mixing_ratio(saturation_vapor_pressure(temperature), tot_press) @exporter.export @@ -447,6 +447,10 @@ def equivalent_potential_temperature(pressure, temperature): array_like The corresponding equivalent potential temperature of the parcel + Notes + ----- + .. math:: \Theta_e = \Theta e^\frac{L_v r_s}{C_{pd} T} + References ---------- .. [5] Hobbs, Peter V. and Wallace, John M., 1977: Atmospheric Science, an Introductory
Better implementation for sat mixing ratio Changed the implementation for saturation mixing ratio, added a formula in the notes section of the doc string to equiv pot temp, and included sat mixing ratio in moist lapse function
Unidata_MetPy
train
py
767440431f38026e0afa7f31a8b447cef759078a
diff --git a/Service/OS/iOSNotification.php b/Service/OS/iOSNotification.php index <HASH>..<HASH> 100644 --- a/Service/OS/iOSNotification.php +++ b/Service/OS/iOSNotification.php @@ -102,7 +102,7 @@ class iOSNotification implements OSNotificationServiceInterface protected function createPayload($token, $message) { $jsonBody = json_encode($message, JSON_FORCE_OBJECT); - $token = preg_replace("/^0-9A-Fa-f]/", "", $token); + $token = preg_replace("/[^0-9A-Fa-f]/", "", $token); $payload = chr(0) . pack("n", 32) . pack("H*", $token) . pack("n", strlen($jsonBody)) . $jsonBody; return $payload;
fixed ios payload filtering
richsage_RMSPushNotificationsBundle
train
php
dbe009775be72282cd1c804ed89a1927b91bf0b6
diff --git a/lib/packetgen/types/fields.rb b/lib/packetgen/types/fields.rb index <HASH>..<HASH> 100644 --- a/lib/packetgen/types/fields.rb +++ b/lib/packetgen/types/fields.rb @@ -356,7 +356,9 @@ module PacketGen @fields = {} @optional_fields = {} - self.class.class_eval { @field_defs }.each do |field, ary| + field_defs = self.class.class_eval { @field_defs } + self.class.fields.each do |field| + ary = field_defs[field] type, default, builder, optional, enum, field_options = ary default = default.to_proc.call(self) if default.is_a?(Proc) @fields[field] = if builder
Fix Types::Fields#initialize. Ensure fields are created in ordered field. This will avoid crashes when a field definition depends on a previous one.
sdaubert_packetgen
train
rb
d2e32121b085c64ed0f4d0a6b1eea4fea1d57c89
diff --git a/lib/datalib.php b/lib/datalib.php index <HASH>..<HASH> 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -216,7 +216,7 @@ function search_users($courseid, $groupid, $searchtext, $sort='', array $excepti * parameters (using named placeholders). */ function users_search_sql($search, $u = 'u', $searchanywhere = true, array $extrafields = array(), - array $exclude = array(), array $includeonly = array()) { + array $exclude = null, array $includeonly = null) { global $DB, $CFG; $params = array(); $tests = array(); diff --git a/user/selector/lib.php b/user/selector/lib.php index <HASH>..<HASH> 100644 --- a/user/selector/lib.php +++ b/user/selector/lib.php @@ -434,7 +434,7 @@ abstract class user_selector_base { * this uses ? style placeholders. */ protected function search_sql($search, $u) { - return users_search_sql($search, 'u', $this->searchanywhere, $this->extrafields, + return users_search_sql($search, $u, $this->searchanywhere, $this->extrafields, $this->exclude, $this->validatinguserids); }
MDL-<I> user selector: fix regressions sam caused.
moodle_moodle
train
php,php
72078dc664a34575773234a1b127f260ae99a7a5
diff --git a/www/javascript/tiny_mce/plugins/swat/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/swat/editor_plugin_src.js index <HASH>..<HASH> 100644 --- a/www/javascript/tiny_mce/plugins/swat/editor_plugin_src.js +++ b/www/javascript/tiny_mce/plugins/swat/editor_plugin_src.js @@ -519,7 +519,7 @@ this.uploadAltEntry.value = ''; this.uploadCaptionEntry.value = ''; - if (this.imageData.length) { + if (typeof this.imageData != 'undefined' && this.imageData.length) { this.selectUploadImage(0); this.selectNotebookPage(0); }
Fix JavaScript warning. svn commit r<I>
silverorange_swat
train
js
f9c49eb04898c358c3c28fe3d4ddc90d864edcf1
diff --git a/boyle/dicom/sets.py b/boyle/dicom/sets.py index <HASH>..<HASH> 100644 --- a/boyle/dicom/sets.py +++ b/boyle/dicom/sets.py @@ -139,7 +139,7 @@ class DicomGenericSet(DicomFileSet): Path or paths to folders to be searched for Dicom files :param read_metadata: bool - If True, will either make a list of DicomFiles, or + If True, will make a list of DicomFiles, otherwise will store a simple DICOM header (namedtuples) with the fields specified in header_fields.
Docstring correction in dicom/sets.py
Neurita_boyle
train
py
b7d832015a9db9631093226db5d6049bc50aa45c
diff --git a/src/gulpglob.js b/src/gulpglob.js index <HASH>..<HASH> 100644 --- a/src/gulpglob.js +++ b/src/gulpglob.js @@ -108,7 +108,7 @@ const GulpGlob = PolytonFactory(SimpleGulpGlob, [ // eslint-disable-line new-cap return Promise.all(this.map(el => { return el.list(); })).then( - lists => [[], ...lists].reduce((array, list) => array.concat(list))); + lists => lists.reduce((array, list) => array.concat(list)), []); }, dest (dir) { return new GulpGlob(...this.map(gg => gg._destArgs(dir)));
use init arg for array reduce method
jlenoble_gulpglob
train
js
20e649a41880a679d721283f1919d22de60ed736
diff --git a/presto-main/src/main/java/com/facebook/presto/execution/SqlTaskExecution.java b/presto-main/src/main/java/com/facebook/presto/execution/SqlTaskExecution.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/execution/SqlTaskExecution.java +++ b/presto-main/src/main/java/com/facebook/presto/execution/SqlTaskExecution.java @@ -187,6 +187,13 @@ public class SqlTaskExecution if (!taskStateMachine.getState().isDone()) { taskHandle = taskExecutor.addTask(taskId); taskStateMachine.addStateChangeListener(new RemoveTaskHandleWhenDone(taskExecutor, taskHandle)); + taskStateMachine.addStateChangeListener(state -> { + if (state.isDone()) { + for (DriverFactory factory : driverFactories) { + factory.close(); + } + } + }); } else { taskHandle = null;
Fix theoretical memory tracking leak DriverFactory is not guaranteed to be closed. It's only closed when all splits have been received and drivers created for them. However, several OperatorFactories rely on close() being called. For example, LookupJoinOperatorFactory will "leak" memory in the memory tracking system, if close() is not called.
prestodb_presto
train
java
d6fa204761857c608c939aa8553e6cfb9b74b8de
diff --git a/test/unique-css.js b/test/unique-css.js index <HASH>..<HASH> 100644 --- a/test/unique-css.js +++ b/test/unique-css.js @@ -156,3 +156,10 @@ test( '@keyframes a {0% {} 100% {}} @keyframes b {0% {} 100% {}}', '@keyframes a {0% {} 100% {}} @keyframes b {0% {} 100% {}}' ); + +test( + 'keyframe selectors with different prefixes', + css, + '@-webkit-keyframes a {0% {} 100% {}} @-webkit-keyframes a {0% {} 100% {}}', + '@keyframes a {0% {} 100% {}} @-webkit-keyframes a {0% {} 100% {}}' +);
Add tests for Issue #<I>
ChristianMurphy_postcss-combine-duplicated-selectors
train
js
70d748bf6443aad18ce38e2e2544b18964c82008
diff --git a/blacklist.js b/blacklist.js index <HASH>..<HASH> 100644 --- a/blacklist.js +++ b/blacklist.js @@ -22,7 +22,6 @@ var webBlacklist = [ var iosBlacklist = [ 'node_modules/react-tools/src/browser/ui/React.js', 'node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js', - 'node_modules/react-tools/src/browser/ReactTextComponent.js', // 'node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js', '.web.js', '.android.js',
[React Native] Update core modules for React <I>
facebook_metro
train
js
f2a8a597bed50c66f7d1fe187e75fc44d1d28973
diff --git a/lib/will_paginate/view_helpers.rb b/lib/will_paginate/view_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/will_paginate/view_helpers.rb +++ b/lib/will_paginate/view_helpers.rb @@ -141,8 +141,15 @@ module WillPaginate # blocks of pagination links sharing the same ID (which is invalid HTML). def paginated_section(*args, &block) pagination = will_paginate(*args).to_s - content = pagination + capture(&block) + pagination - concat content, block.binding + + unless ActionView::Base.respond_to? :erb_variable + concat pagination + yield + concat pagination + else + content = pagination + capture(&block) + pagination + concat(content, block.binding) + end end # Renders a helpful message with numbers of displayed vs. total entries.
change concat calls in #paginated_section because of Rails <I> deprecation. this is a cherry-pick of <I>f<I>e7bd<I>f<I>b<I>e<I>a7a<I>c2c5
mislav_will_paginate
train
rb
47bd8c58bff30b769d3fd67ee868018bf6c3bc70
diff --git a/webapps/client/scripts/process/data.js b/webapps/client/scripts/process/data.js index <HASH>..<HASH> 100644 --- a/webapps/client/scripts/process/data.js +++ b/webapps/client/scripts/process/data.js @@ -45,11 +45,14 @@ define([ }; if (options.data) { - reqParams.data = JSON.stringify(options.data); + if (reqParams.type.toUpperCase() !== 'GET') { + reqParams.data = JSON.stringify(options.data); + } + else { + reqParams.data = options.data; + } } - // console.info('request parameters', reqParams); - deferred.notify('request:start'); $.ajax(reqParams) @@ -69,6 +72,7 @@ define([ CamLegacyProcessData.prototype.list = function(where) { where = where || {}; return this.query({ + data: where, path: '/process-definition' }); };
fix(process service): avoid serializing to JSON on GET requests
camunda_camunda-bpm-platform
train
js
c254c3bfbfd0faa67dbc1ea41b2171ea96c504ae
diff --git a/indra/cx_assembler.py b/indra/cx_assembler.py index <HASH>..<HASH> 100644 --- a/indra/cx_assembler.py +++ b/indra/cx_assembler.py @@ -99,10 +99,19 @@ class CxAssembler(): 'n': 'pmid', 'v': stmt.evidence[0].pmid} self.cx['edgeAttributes'].append(edge_attribute) + self.id_counter += 1 return edge_id def print_cx(self): - full_cx = [self.cx] + full_cx = self.cx.copy() + full_cx['metaData'] = [{'idCounter': self.id_counter, 'name': 'nodes'}, + {'idCounter': self.id_counter, 'name': 'edges'}] + full_cx['numberVerification'] = [{'longNumber': 281474976710655}] + if not full_cx['nodeAttributes']: + full_cx.pop('nodeAttributes', None) + if not full_cx['edgeAttributes']: + full_cx.pop('edgeAttributes', None) + full_cx = [{k: v} for k, v in full_cx.iteritems()] json_str = json.dumps(full_cx) return json_str
Add additional metadata needed for NDEx upload
sorgerlab_indra
train
py
80ed29fdc5afda222d38d97055d268b3336f77a3
diff --git a/src/ClientFactory.php b/src/ClientFactory.php index <HASH>..<HASH> 100644 --- a/src/ClientFactory.php +++ b/src/ClientFactory.php @@ -60,6 +60,15 @@ class ClientFactory $stack->push(Middleware::mapRequest($middleware)); $this->api = json_decode(file_get_contents(__DIR__.'/../res/badgekit.json'), true); + foreach ($this->api as &$actions) { + usort($actions, function ($a, $b) { + if (count($a['parameters']) == count($b['parameters'])) { + return 0; + } + + return ($a['parameters'] < $b['parameters']) ? 1 : -1; + }); + } $client = new Client(['base_uri' => $this->base_uri, 'handler' => $stack]);
sort actions by number of parameters after decoding. when searching for action by named parameters, this checks the most specific one first.
caxy_badgekit-client
train
php
199a6e592dda7f67689d6cb9993b2b0d870d877b
diff --git a/gerrit_test.go b/gerrit_test.go index <HASH>..<HASH> 100644 --- a/gerrit_test.go +++ b/gerrit_test.go @@ -107,6 +107,9 @@ func TestNewClient_Services(t *testing.T) { t.Errorf("An error occured. Expected nil. Got %+v.", err) } + if c.Authentication == nil { + t.Error("No AuthenticationService found.") + } if c.Access == nil { t.Error("No AccessService found.") }
Added unit test to check Auth service
andygrunwald_go-gerrit
train
go
6ca47dec901daffa3e0d06b3ba10c86a34035f6e
diff --git a/pypot/server/httpserver.py b/pypot/server/httpserver.py index <HASH>..<HASH> 100644 --- a/pypot/server/httpserver.py +++ b/pypot/server/httpserver.py @@ -822,11 +822,20 @@ class CallPrimitiveMethodHandler(PoppyRequestHandler): """ def post(self, primitive_name, method_name): - data = json.loads(self.request.body.decode()) - response = self.restful_robot.call_primitive_method(primitive_name, method_name, data) - self.write_json({ - '{}:{}'.format(primitive_name, method_name): response - }) + try: + data = json.loads(self.request.body.decode()) + response = self.restful_robot.call_primitive_method(primitive_name, method_name, data) + self.write_json({ + '{}:{}'.format(primitive_name, method_name): response + }) + except AttributeError as e: + self.set_status(404) + self.write_json({ + "error": "Primitive '{}' does not exist".format(primitive_name), + "tip": "You can find the list of the primitives with /primitives/list.json", + "details": "{}".format(e.args[0]) + }) + # endregion
feat(REST API): Added error handling when calling a primitive method with arguments
poppy-project_pypot
train
py
53746ef3bd9a142cb2d42e47ec8aed3621815293
diff --git a/command/agent/rpc_client.go b/command/agent/rpc_client.go index <HASH>..<HASH> 100644 --- a/command/agent/rpc_client.go +++ b/command/agent/rpc_client.go @@ -139,14 +139,14 @@ func (c *RPCClient) ForceLeave(node string) error { } // Join is used to instruct the agent to attempt a join -func (c *RPCClient) Join(addrs []string, ignoreOld bool) (int, error) { +func (c *RPCClient) Join(addrs []string, replay bool) (int, error) { header := requestHeader{ Command: joinCommand, Seq: c.getSeq(), } req := joinRequest{ Existing: addrs, - Replay: !ignoreOld, + Replay: replay, } var resp joinResponse diff --git a/command/join.go b/command/join.go index <HASH>..<HASH> 100644 --- a/command/join.go +++ b/command/join.go @@ -54,7 +54,7 @@ func (c *JoinCommand) Run(args []string) int { } defer client.Close() - n, err := client.Join(addrs, !replayEvents) + n, err := client.Join(addrs, replayEvents) if err != nil { c.Ui.Error(fmt.Sprintf("Error joining the cluster: %s", err)) return 1
agent: RPC client should use map to the same semantics as the agent
hashicorp_serf
train
go,go
f95e5f5dfda15be4751540a5a557906862c9b7d5
diff --git a/search/tests/mock_search_engine.py b/search/tests/mock_search_engine.py index <HASH>..<HASH> 100644 --- a/search/tests/mock_search_engine.py +++ b/search/tests/mock_search_engine.py @@ -318,7 +318,7 @@ class MockSearchEngine(SearchEngine): super(MockSearchEngine, self).__init__(index) MockSearchEngine.load_index(self.index_name) - def index(self, sources): # pylint: disable=arguments-differ + def index(self, sources, **kwargs): """ Add/update documents to the index. """ diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def is_requirement(line): setup( name='edx-search', - version='2.0.0', + version='2.0.1', description='Search and index routines for index access', author='edX', author_email='[email protected]',
Allow kwargs for the mock search engine indexing. (#<I>) * Allow kwargs for the mock search engine indexing. * Update version
edx_edx-search
train
py,py
9e12c478a880de9a8a5450947f6670d340395794
diff --git a/src/com/jfoenix/skins/JFXToggleButtonSkin.java b/src/com/jfoenix/skins/JFXToggleButtonSkin.java index <HASH>..<HASH> 100644 --- a/src/com/jfoenix/skins/JFXToggleButtonSkin.java +++ b/src/com/jfoenix/skins/JFXToggleButtonSkin.java @@ -115,7 +115,7 @@ public class JFXToggleButtonSkin extends ToggleButtonSkin { circleContainer.setTranslateX((line.getLayoutBounds().getWidth()/2) - circleRadius); line.setStroke(((JFXToggleButton) getSkinnable()).getToggleLineColor()); circle.setFill(((JFXToggleButton) getSkinnable()).getToggleColor()); - transition.playFrom(Duration.millis(100)); +// transition.playFrom(Duration.millis(100)); } }
fixed JFXToggleButton styled with css does not work properly
jfoenixadmin_JFoenix
train
java
82350c7b5f7107a11a5c2127600567de20d6afc7
diff --git a/ratcave/mesh.py b/ratcave/mesh.py index <HASH>..<HASH> 100644 --- a/ratcave/mesh.py +++ b/ratcave/mesh.py @@ -184,8 +184,13 @@ class Mesh(EmptyMesh, mixins.Picklable): texture.uniforms.send_to(shader) # Send Model and Normal Matrix to shader. - shader.uniform_matrixf('model_matrix', self.model_matrix_global.T.ravel()) - shader.uniform_matrixf('normal_matrix', self.normal_matrix_global.T.ravel()) + try: + shader.uniform_matrixf('model_matrix', self.model_matrix_global.T.ravel(), loc=self.modelmat_loc) + shader.uniform_matrixf('normal_matrix', self.normal_matrix_global.T.ravel(), loc=self.normalmat_loc) + except AttributeError: + self.modelmat_loc = shader.get_uniform_location('model_matrix') + self.normalmat_loc = shader.get_uniform_location('normal_matrix') + pass # Set Point Size, if drawing a point cloud if self.drawstyle == 'point':
used same pre-selection of uniform loc for mesh model matrix and normal matrix. Temporary until a better shader-uniform model is found, but should work well for single-shader implementations
ratcave_ratcave
train
py
32e87a8d3361cf9e7390af210359cfbe36f787ce
diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -31,12 +31,12 @@ use Webmozart\Assert\Assert; class Kernel extends HttpKernel { - public const VERSION = '1.1.11-DEV'; + public const VERSION = '1.1.11'; public const VERSION_ID = '10111'; public const MAJOR_VERSION = '1'; public const MINOR_VERSION = '1'; public const RELEASE_VERSION = '11'; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; /** * {@inheritdoc}
Change application's version to <I>
Sylius_Sylius
train
php
a4576759df7a6566982110d0734a97ae229854c6
diff --git a/test/unit/renderer/dataframe.test.js b/test/unit/renderer/dataframe.test.js index <HASH>..<HASH> 100644 --- a/test/unit/renderer/dataframe.test.js +++ b/test/unit/renderer/dataframe.test.js @@ -8,10 +8,15 @@ describe('src/renderer/Dataframe', () => { const dataframe = new Dataframe({ center: { x: 0, y: 0 }, scale: 1, - geom: [ + geom: new Float32Array([ 0, 0, + 0, 0, + 0, 0, + + 1, 1, + 1, 1, 1, 1 - ], + ]), properties: { id: [1, 2] },
Fix unit test with points as triangles
CartoDB_carto-vl
train
js
265dd4acbde65ef09cf4747029819b7c47e5f4ed
diff --git a/lib/logue/logger.rb b/lib/logue/logger.rb index <HASH>..<HASH> 100755 --- a/lib/logue/logger.rb +++ b/lib/logue/logger.rb @@ -88,6 +88,10 @@ class Logue::Logger level >= WARN end + def quiet= b + level = b ? WARN : DEBUG + end + # Assigns output to a file with the given name. Returns the file; the client is responsible for # closing it. def outfile= f diff --git a/lib/logue/version.rb b/lib/logue/version.rb index <HASH>..<HASH> 100755 --- a/lib/logue/version.rb +++ b/lib/logue/version.rb @@ -2,5 +2,5 @@ # -*- ruby -*- module Logue - VERSION = '1.0.10' + VERSION = '1.0.11' end
Restore quiet= method, for level at warning or at debug.
jpace_logue
train
rb,rb
1f9d7791cd0aea5e1573b074df36242d1967c361
diff --git a/NavigationSample/Scripts/navigation.mvc.js b/NavigationSample/Scripts/navigation.mvc.js index <HASH>..<HASH> 100644 --- a/NavigationSample/Scripts/navigation.mvc.js +++ b/NavigationSample/Scripts/navigation.mvc.js @@ -69,7 +69,6 @@ var link = win.location.pathname + win.location.search; var links = [link]; - var history = win.history.length; function refreshAjax(newLink, addHistory, target, title) { var req = new win.XMLHttpRequest(); req.onreadystatechange = onReady(req, addHistory, title); @@ -137,12 +136,12 @@ } cache[newLink + '&' + link] = backResp; if (addHistory && link !== newLink) { + var historyLength = win.history.length; win.history.pushState(resp.Title, resp.Title, newLink); - var back = history - win.history.length + 1; - if (back > 0) + var back = historyLength - win.history.length + 1; + if (back > 0 && links.length > 1) links = links.slice(0, links.length - back); links.push(newLink); - history = win.history.length; } win.document.title = resp.Title; link = newLink;
No need to store history on load, can just get it before a new history is added. A -> B then back to A then forward to C links = [A,C] because B is cleared out on back BUT A -> B then back to A then F5. The history will be 2 (forward to B) but there will only be one link in array, A. This time forward to C mustn't clear out A (B's not in array). Never clear array is only 1 element in it
grahammendick_navigation
train
js
6a6e176eca128abefd3d6af7b8f7b43736164ae9
diff --git a/lib/strings/wrap.rb b/lib/strings/wrap.rb index <HASH>..<HASH> 100644 --- a/lib/strings/wrap.rb +++ b/lib/strings/wrap.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: true +# frozen_string_literals: true require 'unicode/display_width' require 'unicode_utils/each_grapheme' @@ -54,21 +54,18 @@ module Strings char_length = 0 # visible char length text_length = display_width(cleared_para) total_length = 0 - ansi = '' - matched = nil + ansi = [] + ansi_matched = false UnicodeUtils.each_grapheme(cleared_para) do |char| - if char == CSI # found ansi - ansi << char && next - end - - if ansi.length > 0 + # we found ansi let's consume + if char == CSI || ansi.length > 0 ansi << char - if Strings::ANSI.ansi?(ansi) # we found ansi let's consume - matched = ansi - elsif matched - ansi_stack << [matched[0...-1], line_length + word_length] - matched = nil - ansi = '' + if Strings::ANSI.ansi?(ansi.join) + ansi_matched = true + elsif ansi_matched + ansi_stack << [ansi[0...-1].join, line_length + word_length] + ansi_matched = false + ansi = [] end next if ansi.length > 0 end
Change how ansi codes are consumed
piotrmurach_strings
train
rb