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
c483e58ded846bb59f0d8af650534ae0ecbef4ef
diff --git a/comparators/water-feature-by-new-user.js b/comparators/water-feature-by-new-user.js index <HASH>..<HASH> 100644 --- a/comparators/water-feature-by-new-user.js +++ b/comparators/water-feature-by-new-user.js @@ -33,7 +33,7 @@ function waterFeatureByNewUser(newVersion, oldVersion, callback) { // What is the number of changesets of a user to be considered a new user? var MINIMUM_CHANGESET_COUNT = 10; - if (newVersion.properties['osm:version'] !== 1) return callback(null, {}); + if (!newVersion || newVersion.properties['osm:version'] !== 1) return callback(null, {}); if (isWaterFeature(newVersion)) { var user = newVersion.properties['osm:user'];
Handle case when newVersion of the feature is null
mapbox_osm-compare
train
js
997c55e760d9b8c5e752af74733f61c8d63ea39a
diff --git a/lib/ascii_binder/engine.rb b/lib/ascii_binder/engine.rb index <HASH>..<HASH> 100644 --- a/lib/ascii_binder/engine.rb +++ b/lib/ascii_binder/engine.rb @@ -451,7 +451,8 @@ module AsciiBinder branch_config.distro.id, "product-title=#{branch_config.distro_name}", "product-version=#{branch_config.name}", - "product-author=#{branch_config.distro_author}" + "product-author=#{branch_config.distro_author}", + "repo_path=#{topic.repo_path}" ]) doc = Asciidoctor.load topic_adoc, :header_footer => false, :safe => :unsafe, :attributes => page_attrs @@ -502,6 +503,7 @@ module AsciiBinder :images_path => "../../#{dir_depth}#{branch_config.dir}/#{IMAGE_DIRNAME}/", :site_home_path => "../../#{dir_depth}index.html", :template_path => template_dir, + :repo_path => topic.repo_path, } full_file_text = page(page_args) File.write(preview_path,full_file_text)
Add repo_path passed into renderers Repo path is the relative path to the adoc file in the repo from the repo root. repo_path entity now available during AsciiDoctor Rendering repo_path variable available in template rendering
redhataccess_ascii_binder
train
rb
841c6c31015955ff92cffd937f19f2c78ce27e8d
diff --git a/lib/server/index.js b/lib/server/index.js index <HASH>..<HASH> 100644 --- a/lib/server/index.js +++ b/lib/server/index.js @@ -133,8 +133,6 @@ function createServer (options, scripts, context) { app = context.app = connect(); context.connect = connect; - utils.addMiddleware(app, middleware); - app.use(function (req, res, next) { snippetUtils.isOldIe(req); return next(); @@ -148,6 +146,8 @@ function createServer (options, scripts, context) { app.use(snippetUtils.getSnippetMiddleware(options.snippet, options.snippetOptions)); + utils.addMiddleware(app, middleware); + utils.addBaseDir(app, server.baseDir, index); if (server.routes) {
feat(server): allow to inject browser-sync client.js in custom middlewares
BrowserSync_browser-sync
train
js
a62f175ddee7aafe47605a9766b079b9779e26f4
diff --git a/handlers/file_handler.go b/handlers/file_handler.go index <HASH>..<HASH> 100644 --- a/handlers/file_handler.go +++ b/handlers/file_handler.go @@ -79,9 +79,23 @@ func (self *FileHandler) GetFilePath() string { // and set it to the underlying stream handler. // Return non-nil error if error happens. func (self *FileHandler) Open() error { - file, err := os.OpenFile( - self.filepath, os.O_WRONLY|os.O_CREATE|self.mode, 0666) - if err != nil { + var file *os.File + var err error + for { + file, err = os.OpenFile( + self.filepath, os.O_WRONLY|os.O_CREATE|self.mode, 0666) + if err == nil { + break + } + // try to create all the parent directories for specified log file + // if it doesn't exist + if os.IsNotExist(err) { + err2 := os.MkdirAll(filepath.Dir(self.filepath), 0755) + if err2 != nil { + return err + } + continue + } return err } stream := &FileStream{
add feature: file handler would create dir for log file if it doesn't exist
hhkbp2_go-logging
train
go
c69f1a3c0c716146da3b7543551521cba48f889d
diff --git a/src/js/cropper.js b/src/js/cropper.js index <HASH>..<HASH> 100644 --- a/src/js/cropper.js +++ b/src/js/cropper.js @@ -11,7 +11,7 @@ import * as utils from './utilities'; const CLASS_HIDDEN = 'cropper-hidden'; const REGEXP_DATA_URL = /^data:/; -const REGEXP_DATA_URL_JPEG = /^data:image\/jpeg.*;base64,/; +const REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/; class Cropper { constructor(element, options) { diff --git a/src/js/utilities.js b/src/js/utilities.js index <HASH>..<HASH> 100644 --- a/src/js/utilities.js +++ b/src/js/utilities.js @@ -1,6 +1,6 @@ import $ from 'jquery'; -const REGEXP_DATA_URL_HEAD = /^data:([^;]+);base64,/; +const REGEXP_DATA_URL_HEAD = /^data:.*,/; const REGEXP_USERAGENT = /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i; const navigator = typeof window !== 'undefined' ? window.navigator : null; const IS_SAFARI_OR_UIWEBVIEW = navigator && REGEXP_USERAGENT.test(navigator.userAgent);
Improved RegExps for DataURL processing
fengyuanchen_cropper
train
js,js
504dbfa675a9e8665222da0eb7879d2337b64f8f
diff --git a/junit_conversor/__init__.py b/junit_conversor/__init__.py index <HASH>..<HASH> 100644 --- a/junit_conversor/__init__.py +++ b/junit_conversor/__init__.py @@ -41,7 +41,7 @@ def _convert(origin, destination): testcase = ET.SubElement(testsuite, "testcase", name=file_name) for error in errors: - ET.SubElement(testcase, "error", file=error['file'], line=error['line'], col=error['col'], + ET.SubElement(testcase, "failure", file=error['file'], line=error['line'], col=error['col'], message=error['detail'], type="flake8 %s" % error['code']) \ .text = "{}:{} {}".format(error['line'], error['col'], error['detail'])
Flake8 errores are now showed as failures
initios_flake8-junit-report
train
py
85f41579db58385cf98b673f4f4e23af3629d6cd
diff --git a/sos/plugins/openvswitch.py b/sos/plugins/openvswitch.py index <HASH>..<HASH> 100644 --- a/sos/plugins/openvswitch.py +++ b/sos/plugins/openvswitch.py @@ -57,7 +57,9 @@ class OpenVSwitch(Plugin): # Capture coverage stats" "ovs-appctl coverage/show", # Capture cached routes - "ovs-appctl ovs/route/show" + "ovs-appctl ovs/route/show", + # Capture tnl arp table" + "ovs-appctl tnl/arp/show" ]) # Gather additional output for each OVS bridge on the host.
[openvswitch] Capture tunnel arp cache Provide tnl cached ARP table.
sosreport_sos
train
py
7f3513edb79497d58f97c5f7d12927fc4f8490ca
diff --git a/jieba/__init__.py b/jieba/__init__.py index <HASH>..<HASH> 100644 --- a/jieba/__init__.py +++ b/jieba/__init__.py @@ -84,7 +84,8 @@ def initialize(*args): if os.path.exists(cache_file) and os.path.getmtime(cache_file)>os.path.getmtime(abs_path): logger.debug("loading model from cache %s" % cache_file) try: - trie,FREQ,total,min_freq = marshal.load(open(cache_file,'rb')) + with open(cache_file, 'rb') as cf: + trie,FREQ,total,min_freq = marshal.load(cf) load_from_cache_fail = False except: load_from_cache_fail = True
close cache file to avoid warning message.
fxsjy_jieba
train
py
e597982dff27112268b7fc62749de13d54bede36
diff --git a/detox/src/devices/Device.test.js b/detox/src/devices/Device.test.js index <HASH>..<HASH> 100644 --- a/detox/src/devices/Device.test.js +++ b/detox/src/devices/Device.test.js @@ -365,7 +365,7 @@ describe('Device', () => { device = validDevice(); await device.setLocation(30, 30); - expect(device.deviceDriver.setLocation).toHaveBeenCalledWith(device._deviceId, 30, 30); + expect(device.deviceDriver.setLocation).toHaveBeenCalledWith(device._deviceId, '30', '30'); }); it(`setURLBlacklist() should pass to device driver`, async () => {
fix device setLocation unit-test
wix_Detox
train
js
7f8fc24df294c2be53f912436ec9cda35af542b4
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,8 +10,8 @@ end ProfitBricks.configure do |config| config.url = 'https://api.profitbricks.com/rest/' - config.username = '' - config.password = '' + config.username = ENV['PROFITBRICKS_USERNAME'] + config.password = ENV['PROFITBRICKS_PASSWORD'] config.debug = false config.timeout = 60 config.interval = 5
Updated spec helper to retrieve credentials from environment variables.
profitbricks_profitbricks-sdk-ruby
train
rb
7d6352fec4981c2d641ba670d878f41b674c430e
diff --git a/src/Serializer/AbstractItemNormalizer.php b/src/Serializer/AbstractItemNormalizer.php index <HASH>..<HASH> 100644 --- a/src/Serializer/AbstractItemNormalizer.php +++ b/src/Serializer/AbstractItemNormalizer.php @@ -43,6 +43,7 @@ abstract class AbstractItemNormalizer extends AbstractObjectNormalizer protected $iriConverter; protected $resourceClassResolver; protected $propertyAccessor; + protected $localCache = []; public function __construct(PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, IriConverterInterface $iriConverter, ResourceClassResolverInterface $resourceClassResolver, PropertyAccessorInterface $propertyAccessor = null, NameConverterInterface $nameConverter = null, ClassMetadataFactoryInterface $classMetadataFactory = null) { @@ -99,7 +100,7 @@ abstract class AbstractItemNormalizer extends AbstractObjectNormalizer */ public function supportsDenormalization($data, $type, $format = null) { - return $this->resourceClassResolver->isResourceClass($type); + return $this->localCache[$type] ?? $this->localCache[$type] = $this->resourceClassResolver->isResourceClass($type); } /**
In memory cache for supportsDenormalization types
api-platform_core
train
php
40ddff92b9a142457e62ec2b125de1d004ee99d4
diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -1628,10 +1628,10 @@ abstract class Model implements ArrayAccess, ArrayableInterface, JsonableInterfa // If the key is in the "fillable" array, we can of course assume tha it is // a fillable attribute. Otherwise, we will check the guarded array when // we need to determine if the attribute is black-listed on the model. - if (in_array($key, $this->fillable)) return true; - if ($this->isGuarded($key)) return false; + if (in_array($key, $this->fillable)) return true; + return empty($this->fillable) and ! starts_with($key, '_'); }
Make "guarded" take precendence over "fillable" in case key is in both by accident. Fixes #<I>.
laravel_framework
train
php
b29678e621d3a965529737a43c3895f65a99ba20
diff --git a/logger.go b/logger.go index <HASH>..<HASH> 100644 --- a/logger.go +++ b/logger.go @@ -5,33 +5,37 @@ import ( ) // Logger is nats server.Logger compatible logging wrapper for logrus -type Logger struct{} +type Logger struct { + log *log.Entry +} // Noticef logs at info level func (l Logger) Noticef(format string, v ...interface{}) { - log.Infof(format, v...) + l.log.Infof(format, v...) } // Fatalf logs at fatal level func (l Logger) Fatalf(format string, v ...interface{}) { - log.Fatalf(format, v...) + l.log.Fatalf(format, v...) } // Errorf logs at error lovel func (l Logger) Errorf(format string, v ...interface{}) { - log.Errorf(format, v...) + l.log.Errorf(format, v...) } // Debugf logs at debug level func (l Logger) Debugf(format string, v ...interface{}) { - log.Debugf(format, v...) + l.log.Debugf(format, v...) } // Tracef logs at debug level func (l Logger) Tracef(format string, v ...interface{}) { - log.Debugf(format, v...) + l.log.Debugf(format, v...) } func newLogger() Logger { - return Logger{} + return Logger{ + log: log.WithFields(log.Fields{"component": "broker"}), + } }
(#<I>) Federation Broker This adds: * A working federation broker thats compatible with the ruby one * A basic connector, missing a bunch of things to be like mcollective but enough for this need * Various tweaks and cleanups to the schemas and such
choria-io_go-choria
train
go
8593801130f2df94a50863b5db535c272b00efe1
diff --git a/lib/devise.rb b/lib/devise.rb index <HASH>..<HASH> 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -313,11 +313,17 @@ module Devise end def get - @name.constantize + # TODO: Remove AS::Dependencies usage when dropping support to Rails < 7. + if ActiveSupport::Dependencies.respond_to?(:constantize) + ActiveSupport::Dependencies.constantize(@name) + else + @name.constantize + end end end def self.ref(arg) + # TODO: Remove AS::Dependencies usage when dropping support to Rails < 7. if ActiveSupport::Dependencies.respond_to?(:reference) ActiveSupport::Dependencies.reference(arg) end
Keep the constantize behavior consistent for versions prior to Rails 7 Use `AS::Dependencies` as before if we still can, otherwise use the new direct `constantize` call for Rails 7+. Leave a TODO to help remind us this can be removed once we drop support to Rails versions prior to 7 in the future.
plataformatec_devise
train
rb
9d2120b562c639ba42a7baf2c1788cb7fca03953
diff --git a/src/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php b/src/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php @@ -74,7 +74,7 @@ class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase $builder = $this->getMock( 'Symfony\Component\DependencyInjection\ContainerBuilder', - array('hasDefinition', 'findTaggedServiceIds', 'getDefinition') + array('hasDefinition', 'findTaggedServiceIds', 'getDefinition', 'findDefinition') ); $builder->expects($this->any()) ->method('hasDefinition')
fix RegisterListenersPass test With #<I> being merged, the test needs to be adapted to reflect the <I> specific changes.
symfony_symfony
train
php
78eebee7a0fb52c2180b1a4ec328d7b093701ef8
diff --git a/Kwc/Chained/Abstract/Component.php b/Kwc/Chained/Abstract/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Chained/Abstract/Component.php +++ b/Kwc/Chained/Abstract/Component.php @@ -277,4 +277,10 @@ abstract class Kwc_Chained_Abstract_Component extends Kwc_Abstract } return $ret; } + + protected function _getBemClass($class, $nonBemFallback = null) + { + $componentClass = Kwc_Abstract::getSetting($this->getData()->componentClass, 'masterComponentClass'); + return self::getBemClass($componentClass, $class, $nonBemFallback); + } }
fix _getBemClass for Chained components generate same class as masterComponentClass does
koala-framework_koala-framework
train
php
6fd52f5249df87b2f12847c28e69256e80e89985
diff --git a/lib/graphql/input_object_type.rb b/lib/graphql/input_object_type.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/input_object_type.rb +++ b/lib/graphql/input_object_type.rb @@ -51,6 +51,11 @@ module GraphQL @arguments = other.arguments.dup end + def name=(name) + GraphQL::NameValidator.validate!(name) + @name = name + end + def kind GraphQL::TypeKinds::INPUT_OBJECT end diff --git a/spec/graphql/input_object_type_spec.rb b/spec/graphql/input_object_type_spec.rb index <HASH>..<HASH> 100644 --- a/spec/graphql/input_object_type_spec.rb +++ b/spec/graphql/input_object_type_spec.rb @@ -218,6 +218,19 @@ describe GraphQL::InputObjectType do assert_equal(expected, actual) end end + + describe 'with invalid name' do + it 'raises the correct error' do + assert_raises(GraphQL::InvalidNameError) do + InvalidInputTest = GraphQL::InputObjectType.define do + name "Some::Invalid Name" + end + + # Force evaluation + InvalidInputTest.name + end + end + end end end
Validate input_object_type's name We add validation for the input_object_type's name following the object_type's implementation. At this point we're wondering if this validation should be applied on all types and be moved to the GraphQL::BaseType parent class. Fix #<I> for input type
rmosolgo_graphql-ruby
train
rb,rb
4250e1694e282efb94d58aecc1f57050a2867e07
diff --git a/src/mg/Ding/Bean/Factory/Driver/BeanYamlDriver.php b/src/mg/Ding/Bean/Factory/Driver/BeanYamlDriver.php index <HASH>..<HASH> 100644 --- a/src/mg/Ding/Bean/Factory/Driver/BeanYamlDriver.php +++ b/src/mg/Ding/Bean/Factory/Driver/BeanYamlDriver.php @@ -445,6 +445,7 @@ class BeanYamlDriver public function getAspects() { + $aspects = array(); if (!$this->_yamlFiles) { $this->_load(); }
fixed returning nothing when no aspects were declared in yaml driver
marcelog_Ding
train
php
cf4936028ccc10af8cd0661321e6c53b682be8ee
diff --git a/src/vue-testing-library.js b/src/vue-testing-library.js index <HASH>..<HASH> 100644 --- a/src/vue-testing-library.js +++ b/src/vue-testing-library.js @@ -73,7 +73,6 @@ function render (TestComponent, { wrapper.setProps(_) return wait() }, - updateState: _ => wrapper.setData(_), ...getQueriesForElement(wrapper.element.parentNode) } }
Remove updateState - v-model now supported through update
testing-library_vue-testing-library
train
js
0245bcd365edd018c6e31ad8474a3f97955e61ac
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index <HASH>..<HASH> 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -69,7 +69,7 @@ def determine_sender(mail, action='reply'): for alias in acc_addresses: if realname is not None: break - regex = re.compile(re.escape(alias)) + regex = re.compile(re.escape(alias), flags=re.IGNORECASE) for seen_name, seen_address in candidate_addresses: if regex.match(seen_address): logging.debug("match!: '%s' '%s'" % (seen_address, alias))
reply code: add IGNORECASE to the regex... ...to match also emails that have another case than configured in ~/.config/alot/config
pazz_alot
train
py
fb04aad17bcb882107bc3727e270036c0753ac64
diff --git a/lib/gcloud/search/index.rb b/lib/gcloud/search/index.rb index <HASH>..<HASH> 100644 --- a/lib/gcloud/search/index.rb +++ b/lib/gcloud/search/index.rb @@ -66,7 +66,7 @@ module Gcloud ensure_connection! resp = connection.create_doc index_id, document.to_hash if resp.success? - document.raw = JSON.parse resp.body + document.raw.merge! JSON.parse(resp.body) return document end fail ApiError.from_response(resp) diff --git a/test/gcloud/search/index_test.rb b/test/gcloud/search/index_test.rb index <HASH>..<HASH> 100644 --- a/test/gcloud/search/index_test.rb +++ b/test/gcloud/search/index_test.rb @@ -231,7 +231,11 @@ describe Gcloud::Search::Index, :mock_search do new_doc = index.save document new_doc.doc_id.wont_be :nil? new_doc.rank.wont_be :nil? - # new_doc.must_equal document + # The object passed in is also updated + document.doc_id.wont_be :nil? + document.rank.wont_be :nil? + # The object passed in is the same as the object returned + new_doc.must_equal document end it "removes a document from the index" do
Merge after create Instead of replacing all document data, merge what was returned. The Search API is only returning the docId, so index either needs to get the document to get rank and all the fields, or merge the docId into the values already on the document object. This is a compromise to keep the total number of API calls as low as possible.
googleapis_google-cloud-ruby
train
rb,rb
bd4e0a682ebde1ac5cef51d9ac24e282e4c05115
diff --git a/go/libkb/globals.go b/go/libkb/globals.go index <HASH>..<HASH> 100644 --- a/go/libkb/globals.go +++ b/go/libkb/globals.go @@ -187,6 +187,7 @@ func (g *GlobalContext) Init() *GlobalContext { g.RateLimits = NewRateLimits(g) g.upakLoader = NewUncachedUPAKLoader(g) g.fullSelfer = NewUncachedFullSelf(g) + g.Syncer = NullChatSyncer{} return g }
fix logsend crasher (#<I>)
keybase_client
train
go
83920f043367ef5ade8d8336e16f28b1b7d1d791
diff --git a/test/long_test.py b/test/long_test.py index <HASH>..<HASH> 100755 --- a/test/long_test.py +++ b/test/long_test.py @@ -75,6 +75,7 @@ def parse_arguments(args): op['duration'] = StringFlag("--duration", "30s") # RSI op['checkout'] = BoolFlag(no_checkout_arg, invert = True) # Tim says that means that checkout is True by default op['make'] = BoolFlag("--no-make", invert = True) + op['clients'] = IntFlag("--clients", 512) opts = op.parse(args) opts["netrecord"] = False # We don't want to slow down the network @@ -113,7 +114,8 @@ def long_test_function(opts, test_dir): , "gets": opts["nreads"] , "appends": opts["nappends"] , "prepends": opts["nprepends"] - }, duration=opts["duration"], test_dir = test_dir) + }, duration=opts["duration"], test_dir = test_dir, + clients = opts["clients"]) except: pass finally:
Add configurable number of clients for stress_client.
rethinkdb_rethinkdb
train
py
9261a14ebb6fd6c430e58f0e97f3be81386dfa8b
diff --git a/source/org/jasig/portal/concurrency/locking/ReferenceEntityLockService.java b/source/org/jasig/portal/concurrency/locking/ReferenceEntityLockService.java index <HASH>..<HASH> 100644 --- a/source/org/jasig/portal/concurrency/locking/ReferenceEntityLockService.java +++ b/source/org/jasig/portal/concurrency/locking/ReferenceEntityLockService.java @@ -275,8 +275,6 @@ throws LockingException { if ( locks[i].getLockType() == WRITE_LOCK ) { throw new LockingException("Could not create lock: entity already write locked."); } - if ( locks[i].getLockOwner().equals(owner) ) - { throw new LockingException("Could not create lock: owner " + owner + " already holds lock on this entity."); } } }
Allow duplicate read locks for a single owner and entity. (See bugzilla #<I>.) git-svn-id: <URL>
Jasig_uPortal
train
java
703550200faa23416b0c04b249a29a1d115ce4a5
diff --git a/scanorama/scanorama.py b/scanorama/scanorama.py index <HASH>..<HASH> 100644 --- a/scanorama/scanorama.py +++ b/scanorama/scanorama.py @@ -503,7 +503,7 @@ def visualize(assembled, labels, namespace, data_names, # Exact nearest neighbors search. def nn(ds1, ds2, knn=KNN, metric_p=2): # Find nearest neighbors of first dataset. - nn_ = NearestNeighbors(knn, p=metric_p) + nn_ = NearestNeighbors(n_neighbors=knn, p=metric_p) nn_.fit(ds2) ind = nn_.kneighbors(ds1, return_distance=False)
make compatible with future sklearn version
brianhie_scanorama
train
py
a45f1258227e34a97cfab0d70c6cb54f9b33d2dd
diff --git a/bosh_vsphere_cpi/spec/integration/lifecycle_spec.rb b/bosh_vsphere_cpi/spec/integration/lifecycle_spec.rb index <HASH>..<HASH> 100644 --- a/bosh_vsphere_cpi/spec/integration/lifecycle_spec.rb +++ b/bosh_vsphere_cpi/spec/integration/lifecycle_spec.rb @@ -212,5 +212,13 @@ describe VSphereCloud::Cloud, external_cpi: false do vm_lifecycle(network_spec, [], resource_pool) end end + + context 'when disk is being re-attached' do + it 'does not lock cd-rom' do + vm_lifecycle(network_spec, [], resource_pool) + @cpi.attach_disk(@vm_id, @disk_id) + @cpi.detach_disk(@vm_id, @disk_id) + end + end end end
Test that re-attaching disk does not lock the cd-rom on vsphere
cloudfoundry_bosh
train
rb
5418077e8ece792834580e3c059464c7ed282aff
diff --git a/swipe.js b/swipe.js index <HASH>..<HASH> 100644 --- a/swipe.js +++ b/swipe.js @@ -423,6 +423,11 @@ function Swipe(container, options) { return index; }, + getNumSlides: function() { + + // return total number of slides + return slides.length; + }, kill: function() { // cancel slideshow
Added getNumSlides to Swipe.js This method returns the number of slides in the slideshow. This could be useful for all kinds of purposes i.e. indicators for the slides.
lyfeyaj_swipe
train
js
e33b57b2710e4fec700aa97ba46186db66598487
diff --git a/consumer.go b/consumer.go index <HASH>..<HASH> 100644 --- a/consumer.go +++ b/consumer.go @@ -265,12 +265,22 @@ func (c *Consumer) fetchMessages() { for _, msgBlock := range block.MsgSet.Messages { for _, msg := range msgBlock.Messages() { + + event := &ConsumerEvent{Topic: c.topic, Partition: c.partition} + if msg.Offset != c.offset { + event.Err = IncompleteResponse + } else { + event.Key = msg.Msg.Key + event.Value = msg.Msg.Value + event.Offset = msg.Offset + } + select { case <-c.stopper: close(c.events) close(c.done) return - case c.events <- &ConsumerEvent{Key: msg.Msg.Key, Value: msg.Msg.Value, Offset: msg.Offset, Topic: c.topic, Partition: c.partition}: + case c.events <- event: c.offset++ } }
Validate the offset received from kafka when consuming
Shopify_sarama
train
go
b5d66d1ebfc6495e1424bce3943e7182fda435d9
diff --git a/lib/pkgcloud/openstack/cdn/client/services.js b/lib/pkgcloud/openstack/cdn/client/services.js index <HASH>..<HASH> 100644 --- a/lib/pkgcloud/openstack/cdn/client/services.js +++ b/lib/pkgcloud/openstack/cdn/client/services.js @@ -197,7 +197,7 @@ exports.createService = function (details, callback) { * @returns {request|*} */ exports.updateService = function (service, callback) { - if (!service instanceof cdn.Service) { + if (!(service instanceof cdn.Service)) { callback(new Error('you must provide a service to update')); return; }
Fixing logic to account for operator precedence.
pkgcloud_pkgcloud
train
js
b74c1b70b6522a2dea03659b813f7a2cce80545d
diff --git a/src/client/Client.js b/src/client/Client.js index <HASH>..<HASH> 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -249,9 +249,6 @@ class Client extends EventEmitter { for (const i of this._intervals) clearInterval(i); this._timeouts.clear(); this._intervals.clear(); - this.token = null; - this.email = null; - this.password = null; return this.manager.destroy(); } diff --git a/src/client/ClientManager.js b/src/client/ClientManager.js index <HASH>..<HASH> 100644 --- a/src/client/ClientManager.js +++ b/src/client/ClientManager.js @@ -59,14 +59,15 @@ class ClientManager { } destroy() { - return new Promise(resolve => { - this.client.ws.destroy(); - if (!this.client.user.bot) { - resolve(this.client.rest.methods.logout()); - } else { - resolve(); - } - }); + this.client.ws.destroy(); + if (this.client.user.bot) { + this.client.token = null; + return Promise.resolve(); + } else { + return this.client.rest.methods.logout().then(() => { + this.client.token = null; + }); + } } }
fix <I> (#<I>)
discordjs_discord.js
train
js,js
762133aea6b5e3f3635d7157cd7a9ff9127342f3
diff --git a/js/hollaex.js b/js/hollaex.js index <HASH>..<HASH> 100644 --- a/js/hollaex.js +++ b/js/hollaex.js @@ -1182,19 +1182,20 @@ module.exports = class hollaex extends Exchange { const defaultExpires = this.safeInteger2 (this.options, 'api-expires', 'expires', parseInt (this.timeout / 1000)); const expires = this.sum (this.seconds (), defaultExpires); const expiresString = expires.toString (); - const auth = method + path + expiresString; - const signature = this.hmac (this.encode (auth), this.encode (this.secret)); + let auth = method + path + expiresString; headers = { 'api-key': this.encode (this.apiKey), - 'api-signature': signature, 'api-expires': expiresString, }; - if (method !== 'GET') { + if (method === 'POST') { headers['Content-type'] = 'application/json'; if (Object.keys (query).length) { body = this.json (query); + auth += body; } } + const signature = this.hmac (this.encode (auth), this.encode (this.secret)); + headers['api-signature'] = signature; } return { 'url': url, 'method': method, 'body': body, 'headers': headers }; }
hollaex private POST sign fix
ccxt_ccxt
train
js
9771b5a31330fad0dbd2ea85f66f71df2a4cf8cb
diff --git a/salt/states/cloud.py b/salt/states/cloud.py index <HASH>..<HASH> 100644 --- a/salt/states/cloud.py +++ b/salt/states/cloud.py @@ -155,8 +155,8 @@ def absent(name, onlyif=None, unless=None): retcode = __salt__['cmd.retcode'] instance = __salt__['cloud.action'](fun='show_instance', names=[name]) if not instance or \ - ('Not Actioned/Not Running' in ret - and name in ret['Not Actioned/Not Running']): + ('Not Actioned/Not Running' in instance + and name in instance['Not Actioned/Not Running']): ret['result'] = True ret['comment'] = 'Instance {0} already absent'.format(name) return ret
Fix detection of absent LXC container in cloud state
saltstack_salt
train
py
ef1feac74885ea412d2eae9e2cbd887fb0bc7488
diff --git a/lib/OpenLayers/Format/WMC/v1.js b/lib/OpenLayers/Format/WMC/v1.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Format/WMC/v1.js +++ b/lib/OpenLayers/Format/WMC/v1.js @@ -147,10 +147,8 @@ OpenLayers.Format.WMC.v1 = OpenLayers.Class(OpenLayers.Format.XML, { read_wmc_BoundingBox: function(context, node) { context.projection = node.getAttribute("SRS"); context.bounds = new OpenLayers.Bounds( - parseFloat(node.getAttribute("minx")), - parseFloat(node.getAttribute("miny")), - parseFloat(node.getAttribute("maxx")), - parseFloat(node.getAttribute("maxy")) + node.getAttribute("minx"), node.getAttribute("miny"), + node.getAttribute("maxx"), node.getAttribute("maxy") ); },
remove unneeded parseFloat when building Bounds
openlayers_openlayers
train
js
35fb4d91ed7c0a2e095e0b6a74707f65f65fffb9
diff --git a/lib/rubyipmi/freeipmi/connection.rb b/lib/rubyipmi/freeipmi/connection.rb index <HASH>..<HASH> 100644 --- a/lib/rubyipmi/freeipmi/connection.rb +++ b/lib/rubyipmi/freeipmi/connection.rb @@ -4,7 +4,7 @@ require 'rubyipmi/commands/basecommand' require 'rubyipmi/freeipmi/commands/basecommand' Dir[File.dirname(__FILE__) + '/commands/*.rb'].each do |file| - require "#{file.split(".rb").first}" + require file end module Rubyipmi module Freeipmi diff --git a/lib/rubyipmi/ipmitool/connection.rb b/lib/rubyipmi/ipmitool/connection.rb index <HASH>..<HASH> 100644 --- a/lib/rubyipmi/ipmitool/connection.rb +++ b/lib/rubyipmi/ipmitool/connection.rb @@ -4,7 +4,7 @@ require 'rubyipmi/commands/basecommand' require 'rubyipmi/ipmitool/commands/basecommand' Dir[File.dirname(__FILE__) + '/commands/*.rb'].each do |file| - require "#{file.split(".rb").first}" + require file end module Rubyipmi
fixing loading error in rbenv environment
logicminds_rubyipmi
train
rb,rb
1ffc3dc18d95b7b0aaf841dc46bd363f546ceb8d
diff --git a/peer/peer.go b/peer/peer.go index <HASH>..<HASH> 100644 --- a/peer/peer.go +++ b/peer/peer.go @@ -1932,6 +1932,7 @@ func (p *Peer) start() error { case <-time.After(negotiateTimeout): return errors.New("protocol negotiation timeout") } + log.Debugf("Connected to %s", p.Addr()) // The protocol has been negotiated successfully so start processing input // and output messages. diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -1670,7 +1670,6 @@ func (s *server) establishConn(sp *serverPeer) error { return err } sp.Connect(conn) - srvrLog.Debugf("Connected to %s", sp.Addr()) s.addrManager.Attempt(sp.NA()) return nil }
peer: Fix logging of connected peer.
btcsuite_btcd
train
go,go
8e9c9b16b0517e9a0aab0c82aee66f048fd85f9a
diff --git a/lib/u2f/u2f.rb b/lib/u2f/u2f.rb index <HASH>..<HASH> 100644 --- a/lib/u2f/u2f.rb +++ b/lib/u2f/u2f.rb @@ -85,7 +85,7 @@ module U2F "\0".force_encoding('ASCII-8BIT') << key pem = "-----BEGIN PUBLIC KEY-----\r\n" + - Base64.urlsafe_encode64(der).scan(/.{1,64}/).join("\r\n") + + Base64.encode64(der).scan(/.{1,64}/).join("\r\n") + "\r\n-----END PUBLIC KEY-----" pem end
data should not be url safe encoded in PEM
castle_ruby-u2f
train
rb
ffd9d0105f31484290d9ebdd6e514652be392bcd
diff --git a/dist/karma.conf.js b/dist/karma.conf.js index <HASH>..<HASH> 100644 --- a/dist/karma.conf.js +++ b/dist/karma.conf.js @@ -15,7 +15,6 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ - './bower_components/jquery/dist/jquery.js', './all.js' ], diff --git a/dist/webpack.config.js b/dist/webpack.config.js index <HASH>..<HASH> 100644 --- a/dist/webpack.config.js +++ b/dist/webpack.config.js @@ -27,10 +27,7 @@ module.exports = { new CleanWebpackPlugin(["."], { exclude: [ "src", - "test/bower_components", - ".bowerrc", ".npmignore", - "bower.json", "karma.conf.js", "package.json", "tsconfig.js",
Removed all Bower mentions.
enepomnyaschih_jwidget
train
js,js
06813030646ec0ccf23f2c5bb04bfa03976dae5d
diff --git a/src/main/java/org/thymeleaf/standard/expression/LinkExpression.java b/src/main/java/org/thymeleaf/standard/expression/LinkExpression.java index <HASH>..<HASH> 100755 --- a/src/main/java/org/thymeleaf/standard/expression/LinkExpression.java +++ b/src/main/java/org/thymeleaf/standard/expression/LinkExpression.java @@ -721,7 +721,7 @@ public final class LinkExpression extends SimpleExpression { strBuilder.append(UriEscape.escapeUriQueryParam(this.parameterNames[i])); if (!URL_PARAM_NO_VALUE.equals(valueItem)) { strBuilder.append('='); - strBuilder.append(valueItem == null ? "" : UriEscape.escapeUriQueryParam(value.toString())); + strBuilder.append(valueItem == null ? "" : UriEscape.escapeUriQueryParam(valueItem.toString())); } }
Fixed formation of multi-valued parameters in LinkExpression
thymeleaf_thymeleaf
train
java
7c2ffebf340b551ff611ab26ce28a87ff6b31161
diff --git a/portaudio/portaudio.go b/portaudio/portaudio.go index <HASH>..<HASH> 100644 --- a/portaudio/portaudio.go +++ b/portaudio/portaudio.go @@ -18,7 +18,9 @@ import "C" import ( "fmt" + "os" "reflect" + "runtime" "time" "unsafe" ) @@ -717,6 +719,18 @@ func (s *Stream) Start() error { //export streamCallback func streamCallback(inputBuffer, outputBuffer unsafe.Pointer, frames C.ulong, timeInfo *C.PaStreamCallbackTimeInfo, statusFlags C.PaStreamCallbackFlags, userData unsafe.Pointer) { + defer func() { + // Don't let PortAudio silently swallow panics. + if x := recover(); x != nil { + buf := make([]byte, 1<<10) + for runtime.Stack(buf, true) == len(buf) { + buf = make([]byte, 2*len(buf)) + } + fmt.Fprintf(os.Stderr, "panic in portaudio stream callback: %s\n\n%s", x, buf) + os.Exit(2) + } + }() + s := (*Stream)(userData) s.timeInfo = StreamCallbackTimeInfo{duration(timeInfo.inputBufferAdcTime), duration(timeInfo.currentTime), duration(timeInfo.outputBufferDacTime)} s.flags = StreamCallbackFlags(statusFlags)
Don't let PortAudio silently swallow panics in stream callbacks.
gordonklaus_portaudio
train
go
e1ba7ef8e848fe1f84fd687f914b36d24ae93157
diff --git a/leash_test.go b/leash_test.go index <HASH>..<HASH> 100644 --- a/leash_test.go +++ b/leash_test.go @@ -189,8 +189,8 @@ func TestSampleRate(t *testing.T) { ts.rsp.reset() run(opts) // setting a sample rate of 20 and a rand seed of 1, 49 requests. - testEquals(t, ts.rsp.reqCounter, 49) - testEquals(t, ts.rsp.reqBody, `{"format":"json996"}`) + testEquals(t, ts.rsp.reqCounter, 55) + testEquals(t, ts.rsp.reqBody, `{"format":"json978"}`) sampleRate = ts.rsp.req.Header.Get("X-Honeycomb-Samplerate") testEquals(t, sampleRate, "20") }
oops, removing rand from the event metadata changed the rand sequence for tests
honeycombio_honeytail
train
go
8f677ef39b021b8c33636c228b07e958c9b30865
diff --git a/pefile.py b/pefile.py index <HASH>..<HASH> 100644 --- a/pefile.py +++ b/pefile.py @@ -3621,7 +3621,10 @@ class PE(object): if not hasattr(self, "DIRECTORY_ENTRY_IMPORT"): return "" for entry in self.DIRECTORY_ENTRY_IMPORT: - libname = entry.dll.decode().lower() + if isinstance(entry.dll, bytes): + libname = entry.dll.decode().lower() + else: + libname = entry.dll.lower() parts = libname.rsplit('.', 1) if len(parts) > 1 and parts[1] in exts: libname = parts[0]
Sometimes, the dll name is not a bytes...
erocarrera_pefile
train
py
6f636ea15aa741d7b4d94aeffc6cf680d6382d4d
diff --git a/client/gc.go b/client/gc.go index <HASH>..<HASH> 100644 --- a/client/gc.go +++ b/client/gc.go @@ -183,7 +183,7 @@ func (a *AllocGarbageCollector) destroyAllocRunner(allocID string, ar AllocRunne ar.Destroy() select { - case <-ar.WaitCh(): + case <-ar.DestroyCh(): case <-a.shutdownCh: }
gc: Wait for allocrunners to be destroyed
hashicorp_nomad
train
go
c45331669758327cb5e9dce50181e21175158263
diff --git a/client/lib/form-state/index.js b/client/lib/form-state/index.js index <HASH>..<HASH> 100644 --- a/client/lib/form-state/index.js +++ b/client/lib/form-state/index.js @@ -48,9 +48,9 @@ function Controller( options ) { this._debouncedSanitize = debounce( this.sanitize, debounceWait ); this._debouncedValidate = debounce( this.validate, debounceWait ); - this._hideFieldErrorsOnChange = isUndefined( options.hideFieldErrorsOnChange ) ? - false : - options.hideFieldErrorsOnChange; + this._hideFieldErrorsOnChange = isUndefined( options.hideFieldErrorsOnChange ) + ? false + : options.hideFieldErrorsOnChange; if ( this._loadFunction ) { this._loadFieldValues();
Framework: fix eslint error on ternary operator '?' and ':' should be placed at the beginning of the line.
Automattic_wp-calypso
train
js
f698d7718014c7d7b649bdafe1454f01edf05c33
diff --git a/test/browser/common.js b/test/browser/common.js index <HASH>..<HASH> 100644 --- a/test/browser/common.js +++ b/test/browser/common.js @@ -198,4 +198,4 @@ var loadFile = function (href) { }); }; -jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000; +jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
increase async timeout because appveyor can take <I> seconds to start up
less_less.js
train
js
931d25f6945c4fbf00413797b8234eaf67ed4909
diff --git a/c7n/output.py b/c7n/output.py index <HASH>..<HASH> 100644 --- a/c7n/output.py +++ b/c7n/output.py @@ -207,11 +207,16 @@ class SystemStats(DeltaStats): def get_snapshot(self): snapshot = { 'num_threads': self.process.num_threads(), - 'num_fds': self.process.num_fds(), 'snapshot_time': time.time(), 'cache_size': self.ctx.policy.get_cache().size() } + # no num_fds on Windows, but likely num_handles + if hasattr(self.process, "num_fds"): + snapshot['num_fds'] = self.process.num_fds() + elif hasattr(self.process, "num_handles"): + snapshot['num_handles'] = self.process.num_handles() + with self.process.oneshot(): # simpler would be json.dumps(self.process.as_dict()), but # that complicates delta diffing between snapshots.
fix windows psutil support (#<I>)
cloud-custodian_cloud-custodian
train
py
a95fdfef4d96c0538aac5bf6a2456001eb4b1fb0
diff --git a/lib/twingly/url.rb b/lib/twingly/url.rb index <HASH>..<HASH> 100644 --- a/lib/twingly/url.rb +++ b/lib/twingly/url.rb @@ -27,12 +27,12 @@ module Twingly addressable_uri = to_addressable_uri(potential_url) raise Twingly::URL::Error::ParseError if addressable_uri.nil? - public_suffix_domain = PublicSuffix.parse(addressable_uri.display_uri.host) - raise Twingly::URL::Error::ParseError if public_suffix_domain.nil? - scheme = addressable_uri.scheme raise Twingly::URL::Error::ParseError unless scheme =~ ACCEPTED_SCHEMES + public_suffix_domain = PublicSuffix.parse(addressable_uri.display_uri.host) + raise Twingly::URL::Error::ParseError if public_suffix_domain.nil? + self.new(addressable_uri, public_suffix_domain) rescue Addressable::URI::InvalidURIError, PublicSuffix::DomainInvalid => error error.extend(Twingly::URL::Error)
Improve ordering of "sanity" checks Should be somewhat more performant as a regex check is cheaper than PublicSuffix´s parse. It should also help with avoiding running into exceptions in PublicSuffix´s parse (I am guessing a URL with with a bad scheme is more likely to have a “bad” domain).
twingly_twingly-url
train
rb
609d1223b842ff0b912cc9364b4a67ef21fe0ee9
diff --git a/tilequeue/store.py b/tilequeue/store.py index <HASH>..<HASH> 100644 --- a/tilequeue/store.py +++ b/tilequeue/store.py @@ -144,7 +144,7 @@ class S3(object): try: io = StringIO() self.s3_client.download_fileobj(self.bucket_name, key_name, io) - return io.bytes() + return io.getvalue() except ClientError as e: if e.response['Error']['Code'] != '404':
Fix incorrect method call on StringIO in store.
tilezen_tilequeue
train
py
c7f92fda321ed30f104d7df055b012a225daecb9
diff --git a/src/store/setToolMode.js b/src/store/setToolMode.js index <HASH>..<HASH> 100644 --- a/src/store/setToolMode.js +++ b/src/store/setToolMode.js @@ -268,14 +268,14 @@ function _resolveInputConflicts (element, tool, options, interactionTypes) { let toolHasAnyActiveInteractionType = false; t.supportedInteractionTypes.forEach((interactionType) => { - if (tool.options[`is${interactionType}Active`]) { + if (t.options[`is${interactionType}Active`]) { toolHasAnyActiveInteractionType = true; } }); if (!toolHasAnyActiveInteractionType) { - console.info(`Setting tool ${tool.name}'s to PASSIVE`); - setToolPassiveForElement(element, tool.name); + console.info(`Setting tool ${t.name}'s to PASSIVE`); + setToolPassiveForElement(element, t.name); } }); }
Fix for checking wrong tool's interactive type
cornerstonejs_cornerstoneTools
train
js
98365d9c424950695d1c6babf1da6d860355909a
diff --git a/pyws/django/example/settings.py b/pyws/django/example/settings.py index <HASH>..<HASH> 100644 --- a/pyws/django/example/settings.py +++ b/pyws/django/example/settings.py @@ -97,3 +97,7 @@ INSTALLED_APPS = ( # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', ) + +import logging + +logging.basicConfig(level=logging.DEBUG) \ No newline at end of file
added logging to django example project
stepank_pyws
train
py
b7ccdfddbe19c78dab15d41b40c18797b8163191
diff --git a/src/main/java/com/j256/ormlite/android/AndroidDatabaseConnection.java b/src/main/java/com/j256/ormlite/android/AndroidDatabaseConnection.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/j256/ormlite/android/AndroidDatabaseConnection.java +++ b/src/main/java/com/j256/ormlite/android/AndroidDatabaseConnection.java @@ -191,6 +191,11 @@ public class AndroidDatabaseConnection implements DatabaseConnection { } } + public boolean isTableExists(String tableName) throws SQLException { + // NOTE: it is non trivial to do this check since the helper will auto-create if it doesn't exist + return true; + } + private void bindArgs(SQLiteStatement stmt, Object[] args, FieldType[] argFieldTypes) { if (args == null) { return;
Added isTableExists() boolean to the DAO and the DatabaseConnection.
j256_ormlite-android
train
java
8d991bd638f1d496a524f20430c0d494902e114c
diff --git a/src/ol/geom/geometry.js b/src/ol/geom/geometry.js index <HASH>..<HASH> 100644 --- a/src/ol/geom/geometry.js +++ b/src/ol/geom/geometry.js @@ -93,8 +93,10 @@ goog.inherits(ol.geom.Geometry, ol.Observable); /** + * Make a complete copy of the geometry. * @function * @return {ol.geom.Geometry} Clone. + * @api */ ol.geom.Geometry.prototype.clone = goog.abstractMethod; @@ -151,16 +153,22 @@ ol.geom.Geometry.prototype.getExtent = goog.abstractMethod; /** + * Create a simplified version of this geometry using the Douglas Peucker + * algorithm. + * @see http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm * @function * @param {number} squaredTolerance Squared tolerance. * @return {ol.geom.Geometry} Simplified geometry. + * @api */ ol.geom.Geometry.prototype.getSimplifiedGeometry = goog.abstractMethod; /** + * Get the type of this geometry. * @function * @return {ol.geom.GeometryType} Geometry type. + * @api */ ol.geom.Geometry.prototype.getType = goog.abstractMethod;
Add @todo API and describe ol.geom.Geometry funcs The `clone()`, `getSimplifiedGeometry()` and `getType()` methods are all base class methods documented in subclasses. They should appear in ol.geom.Geometry in the API docs as well.
openlayers_openlayers
train
js
2af07b0b65bcf4bf715ab5226f93e25a91739d90
diff --git a/query.py b/query.py index <HASH>..<HASH> 100644 --- a/query.py +++ b/query.py @@ -239,6 +239,9 @@ class Query(object): def values(self): return list(self.itervalues()) + def iterallitems(self): + return iter(self._pairs) + def allitems(self): return self._pairs[:]
input.Get seems to work with the same-ish interface.
mikeboers_MultiMap
train
py
e7821a8ea908d3e753606844c6fa8fb00468922b
diff --git a/install/lib/class.installerpage.php b/install/lib/class.installerpage.php index <HASH>..<HASH> 100644 --- a/install/lib/class.installerpage.php +++ b/install/lib/class.installerpage.php @@ -353,7 +353,7 @@ $Permissions = new XMLElement('fieldset'); $Permissions->appendChild(new XMLElement('legend', __('Permission Settings'))); - $Permissions->appendChild(new XMLElement('p', __('Symphony needs permission to read and write both files and directories.'))); + $Permissions->appendChild(new XMLElement('p', __('Set the permissions Symphony uses when saving files/directories.'))); $Div = new XMLElement('div', null, array('class' => 'two columns')); $Div->appendChild(Widget::label(__('Files'), Widget::Input('fields[file][write_mode]', $fields['file']['write_mode']), 'column'));
Make installation file permissions paragraph more explicit (gh-<I>)
symphonycms_symphony-2
train
php
4fd4f41a31dda556a3dab670312faab5afaec785
diff --git a/src/Engines/CollectionEngine.php b/src/Engines/CollectionEngine.php index <HASH>..<HASH> 100644 --- a/src/Engines/CollectionEngine.php +++ b/src/Engines/CollectionEngine.php @@ -189,13 +189,13 @@ class CollectionEngine extends BaseEngine $value = Arr::get($data, $column); if ($this->isCaseInsensitive()) { - if($regex) { - return preg_match('/' . Str::lower($keyword) . '/', Str::lower($value)) == 1; + if ($regex) { + return preg_match('/' . $keyword . '/i', $value) == 1; } else { return strpos(Str::lower($value), Str::lower($keyword)) !== false; } } else { - if($regex) { + if ($regex) { return preg_match('/' . $keyword . '/', $value) == 1; } else { return strpos($value, $keyword) !== false;
Refinements to regex handling of column searches
yajra_laravel-datatables
train
php
59c76334b17d5dd6f64d68914584eebaa6b1aa6d
diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index <HASH>..<HASH> 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -306,6 +306,10 @@ class OverviewMap extends Control { this.resetExtent_(); } } + + if (!this.ovmap_.isRendered()) { + this.updateBoxAfterOvmapIsRendered_(); + } } } @@ -520,6 +524,24 @@ class OverviewMap extends Control { } /** + * @private + */ + updateBoxAfterOvmapIsRendered_() { + if (this.ovmapPostrenderKey_) { + return; + } + this.ovmapPostrenderKey_ = listenOnce( + this.ovmap_, + MapEventType.POSTRENDER, + function (event) { + delete this.ovmapPostrenderKey_; + this.updateBox_(); + }, + this + ); + } + + /** * @param {MouseEvent} event The event to handle * @private */ @@ -551,14 +573,7 @@ class OverviewMap extends Control { } ovmap.updateSize(); this.resetExtent_(); - listenOnce( - ovmap, - MapEventType.POSTRENDER, - function (event) { - this.updateBox_(); - }, - this - ); + this.updateBoxAfterOvmapIsRendered_(); } }
Draw box if OverviewMap is added to an existing map
openlayers_openlayers
train
js
f0cab0e28512de5eecc0412212425cc74d62af71
diff --git a/internal/testutil/helpers.go b/internal/testutil/helpers.go index <HASH>..<HASH> 100644 --- a/internal/testutil/helpers.go +++ b/internal/testutil/helpers.go @@ -20,8 +20,8 @@ var DevZero io.Reader = devZero{} type devZero struct{} func (d devZero) Read(p []byte) (n int, err error) { - for i := 0; i < len(p); i++ { - p[i] = '\x00' + for i := range p { + p[i] = 0 } return len(p), nil }
TestImportExtremelyLargeImageWorks: optimize DevZero According to <URL> the following syntax: ```go for i := range b { b[i] = 0 } ``` so let's use it. Limited testing shows ~<I>x speed increase, compared to the previously used syntax.
moby_moby
train
go
6037a2543a592cc85ec8b7adc2416d2ddba665cd
diff --git a/lib/image/imagemagick.js b/lib/image/imagemagick.js index <HASH>..<HASH> 100644 --- a/lib/image/imagemagick.js +++ b/lib/image/imagemagick.js @@ -216,8 +216,8 @@ module.exports = function() { var args = baseArgs.slice(); args.push('--resize'); // "Largest that fits in the box" is not a built-in feature of gifsicle, so we do the math - var originalWidth = (crop && crop.width) || size.width; - var originalHeight = (crop && crop.height) || size.height; + var originalWidth = (crop && crop.width) || context.info.width; + var originalHeight = (crop && crop.height) || context.info.height; var width = originalWidth; var height = Math.round(size.width * originalHeight / originalWidth); if (height > originalHeight) {
whoops refer to original width and height properly for gifsicle
punkave_uploadfs
train
js
8ca800dc769c8ed52d880646513928538526e48c
diff --git a/api/app/handler.go b/api/app/handler.go index <HASH>..<HASH> 100644 --- a/api/app/handler.go +++ b/api/app/handler.go @@ -308,10 +308,21 @@ func SetEnv(w http.ResponseWriter, r *http.Request, u *auth.User) error { if err != nil { return err } + e := map[string]string{} variables := regex.FindAllStringSubmatch(string(body), -1) for _, v := range variables { parts := strings.Split(v[1], "=") app.SetEnv(parts[0], parts[1]) + e[parts[0]] = parts[1] } - return db.Session.Apps().Update(bson.M{"name": app.Name}, app) + if err = db.Session.Apps().Update(bson.M{"name": app.Name}, app); err != nil { + return err + } + mess := Message{ + app: &app, + env: e, + kind: "set", + } + env <- mess + return nil }
api/app: sending the environment variable to the environment agent When setting an environment variable via handler, the handler sends the change to a channel that runs a command to update the environment file in the unit of the app. In the future, when we support more than one unit per app, we will need to run the command in all units of the app.
tsuru_tsuru
train
go
42e18c94513578c3ad3f9de7b546a8ec05b31764
diff --git a/mknotebooks/plugin.py b/mknotebooks/plugin.py index <HASH>..<HASH> 100644 --- a/mknotebooks/plugin.py +++ b/mknotebooks/plugin.py @@ -54,7 +54,9 @@ class Plugin(mkdocs.plugins.BasePlugin): def on_files(self, files, config): files = Files( [ - NotebookFile(f, **config) if f.abs_src_path.endswith("ipynb") else f + NotebookFile(f, **config) + if str(f.abs_src_path).endswith("ipynb") + else f for f in files ] )
Fix failing if paths are from pathlib
greenape_mknotebooks
train
py
ad18ddd24cd264b61a8ba4e137235a10b7d036fd
diff --git a/src/BoomCMS/Http/Controllers/Asset/AssetSelectionController.php b/src/BoomCMS/Http/Controllers/Asset/AssetSelectionController.php index <HASH>..<HASH> 100644 --- a/src/BoomCMS/Http/Controllers/Asset/AssetSelectionController.php +++ b/src/BoomCMS/Http/Controllers/Asset/AssetSelectionController.php @@ -49,13 +49,6 @@ class AssetSelectionController extends Controller $zip->close(); - $response = Response::make() - ->header('Content-type', 'application/zip') - ->header('Content-Disposition', "attachment; filename=$downloadFilename") - ->setContent(file_get_contents($filename)); - - unlink($filename); - - return $response; + return Response::download($filename, $downloadFilename)->deleteFileAfterSend(true); } }
Asset manager: Refactored multipe asset download
boomcms_boom-core
train
php
fa721d54dc57baaf4ad798ca28ad393874e799df
diff --git a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/InitialRequestDispatcher.java b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/InitialRequestDispatcher.java index <HASH>..<HASH> 100644 --- a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/InitialRequestDispatcher.java +++ b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/InitialRequestDispatcher.java @@ -400,7 +400,7 @@ public class InitialRequestDispatcher extends RequestDispatcher { // Instead, the container must reject the request with 404 Not Found final response with no Retry-After header. throw new DispatcherException(Response.NOT_FOUND, "the Request-URI does not point to another domain, and there is no Route header," + "the container should not send the request as it will cause a loop. " + - "Instead, the container must reject the request with 404 Not Found final response with no Retry-After header."); + "Instead, the container must reject the request with 404 Not Found final response with no Retry-After header. You may want to check your dar configuration file to see if the request can be handled or make sure you use the correct Application Router jar."); } }
MODIFIED : log when a <I> Not Found is sent back in response to an initial request because no applications were found to handle it git-svn-id: <URL>
RestComm_sip-servlets
train
java
5cbaa84466e9104ef084040aba044cb98fbf540a
diff --git a/lib/rubyXL/worksheet.rb b/lib/rubyXL/worksheet.rb index <HASH>..<HASH> 100644 --- a/lib/rubyXL/worksheet.rb +++ b/lib/rubyXL/worksheet.rb @@ -59,7 +59,7 @@ module LegacyWorksheet #validates Workbook, ensures that this worksheet is in @workbook def validate_workbook() unless @workbook.nil? || @workbook.worksheets.nil? - return if @workbook.worksheets.include?(self) + return if @workbook.worksheets.any? { |sheet| sheet.equal?(self) } end raise "This worksheet #{self} is not in workbook #{@workbook}" @@ -72,7 +72,7 @@ module LegacyWorksheet validate_nonnegative(column_index) sheet_data.rows[row_index] || add_row(row_index) - end + end def get_col_xf(column_index) @workbook.cell_xfs[get_col_style(column_index)]
Improving performance of add_cell by fixing workbook validation This patch switches `validate_workbook` from using `==` (compare every cell of one worksheet to every cell of another one) to `equal?` (check if the given worksheet is included in the workbook)
weshatheleopard_rubyXL
train
rb
f6eca7e0aaea3836e6fc97d5437876b5202731f8
diff --git a/lib/netsuite/records/custom_list.rb b/lib/netsuite/records/custom_list.rb index <HASH>..<HASH> 100644 --- a/lib/netsuite/records/custom_list.rb +++ b/lib/netsuite/records/custom_list.rb @@ -14,12 +14,14 @@ module NetSuite field :custom_value_list, NetSuite::Support::GenericList + attr_reader :internal_id + attr_accessor :external_id + def initialize(attributes = {}) @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id) @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id) initialize_from_attributes_hash(attributes) end - end end end
Add reader method for internal_id
NetSweet_netsuite
train
rb
0dffcdf153bf4af381e4464277556a26f6acdcb4
diff --git a/lib/pdf/reader/resources.rb b/lib/pdf/reader/resources.rb index <HASH>..<HASH> 100644 --- a/lib/pdf/reader/resources.rb +++ b/lib/pdf/reader/resources.rb @@ -1,5 +1,5 @@ # coding: utf-8 -# typed: true +# typed: strict # frozen_string_literal: true module PDF
change PDF::Reader::Resources to typed:strict slowly slowly rolling out strict
yob_pdf-reader
train
rb
e475b9aded2a20a86ff5a182c18e3a2b37d32212
diff --git a/lib/attachment_saver.rb b/lib/attachment_saver.rb index <HASH>..<HASH> 100644 --- a/lib/attachment_saver.rb +++ b/lib/attachment_saver.rb @@ -28,7 +28,9 @@ module AttachmentSaver end if attachment_options[:processor] - require "processors/#{attachment_options[:processor].to_s.underscore}" unless Processors.const_defined?(attachment_options[:processor].to_s.classify) + unless Object.const_defined?(:Processors) && Processors.const_defined?(attachment_options[:processor].to_s.classify) + require "processors/#{attachment_options[:processor].to_s.underscore}" + end include Processors.const_get(attachment_options[:processor].to_s.classify) end end
fix the 'uninitialized constant AttachmentSaver::BaseMethods::Processors' you get running a single test
willbryant_attachment_saver
train
rb
64f7465a6c63088bd55aacc0d11afe9b2c8af0f7
diff --git a/test/rename.js b/test/rename.js index <HASH>..<HASH> 100644 --- a/test/rename.js +++ b/test/rename.js @@ -16,9 +16,12 @@ module.exports = function (t, a, d) { return deferred(lstat(name1)(a.never, function () { a.ok(true, "No first file"); }), lstat(name2)(function (stats2) { - // Do not compare eventual birthtime + // Do not compare eventual birthtime and ctime + // as in some envs they may not reflect value of source file delete stats1.birthtime; delete stats2.birthtime; + delete stats1.ctime; + delete stats2.ctime; a.deep(stats1, stats2, "Same"); return unlink(name2); }))(false);
test: do not test not guaranteed data
medikoo_fs2
train
js
fd9fc4a1983e8bd2c9bad52453849316ba322d89
diff --git a/Extractor/RecursiveJob.php b/Extractor/RecursiveJob.php index <HASH>..<HASH> 100644 --- a/Extractor/RecursiveJob.php +++ b/Extractor/RecursiveJob.php @@ -6,7 +6,8 @@ use Keboola\Juicer\Config\JobConfig, Keboola\Juicer\Common\Logger, Keboola\Juicer\Client\ClientInterface, Keboola\Juicer\Parser\ParserInterface; -use Keboola\Filter\Filter; +use Keboola\Filter\Filter, + Keboola\Filter\Exception\FilterException; use Keboola\Utils\Utils; use Keboola\Juicer\Exception\UserException; /** @@ -86,7 +87,11 @@ class RecursiveJob extends Job implements RecursiveJobInterface foreach($this->config->getChildJobs() as $jobId => $child) { if (!empty($child->getConfig()['recursionFilter'])) { - $filter = Filter::create($child->getConfig()['recursionFilter']); + try { + $filter = Filter::create($child->getConfig()['recursionFilter']); + } catch(FilterException $e) { + throw new UserException($e->getMessage(), 0, $e); + } } foreach($data as $result) {
fix: Catch exception from recursion filter
keboola_juicer
train
php
de6397322d20a4e12e565e89c7c832df412686a1
diff --git a/core/src/main/java/org/kohsuke/stapler/MetaClass.java b/core/src/main/java/org/kohsuke/stapler/MetaClass.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/kohsuke/stapler/MetaClass.java +++ b/core/src/main/java/org/kohsuke/stapler/MetaClass.java @@ -114,7 +114,7 @@ public class MetaClass extends TearOffSupport { else names=new String[]{camelize(f.getName().substring(2))}; // 'doFoo' -> 'foo' for (String name : names) { - dispatchers.add(new NameBasedDispatcher(name,0) { + dispatchers.add(new NameBasedDispatcher(name) { public boolean doDispatch(RequestImpl req, ResponseImpl rsp, Object node) throws IllegalAccessException, InvocationTargetException, ServletException, IOException { if(traceable()) trace(req,rsp,"-> <%s>.%s(...)",node,f.getName());
This is the default value of this argument
stapler_stapler
train
java
00ee2911ec34e02287fd47ef60b1b5a74a9e5bb8
diff --git a/toolbox/command_test.go b/toolbox/command_test.go index <HASH>..<HASH> 100644 --- a/toolbox/command_test.go +++ b/toolbox/command_test.go @@ -26,6 +26,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" "strconv" "strings" "testing" @@ -640,6 +641,10 @@ func TestVixDirectories(t *testing.T) { } func TestVixFiles(t *testing.T) { + if runtime.GOOS != "linux" { + t.Skip("requires Linux") + } + c := NewCommandClient() mktemp := &vix.CreateTempFileRequest{ diff --git a/toolbox/hgfs/server_test.go b/toolbox/hgfs/server_test.go index <HASH>..<HASH> 100644 --- a/toolbox/hgfs/server_test.go +++ b/toolbox/hgfs/server_test.go @@ -21,6 +21,7 @@ import ( "io/ioutil" "os" "path" + "runtime" "testing" ) @@ -334,6 +335,10 @@ func TestReadV3(t *testing.T) { } func TestWriteV3(t *testing.T) { + if runtime.GOOS != "linux" { + t.Skip("requires Linux") + } + Trace = testing.Verbose() f, err := ioutil.TempFile("", "toolbox")
toolbox: skip tests that require Linux
vmware_govmomi
train
go,go
af1abfb3144a2084c72086f01bcc35cc6ea617b0
diff --git a/dist/scroll-min.js b/dist/scroll-min.js index <HASH>..<HASH> 100644 --- a/dist/scroll-min.js +++ b/dist/scroll-min.js @@ -1,5 +1,5 @@ /** -* scroll-js - v1.2.12. +* scroll-js - v1.3.0. * https://github.com/mkay581/scroll-js.git * Copyright 2016 Mark Kennedy. Licensed MIT. */ diff --git a/dist/scroll.js b/dist/scroll.js index <HASH>..<HASH> 100644 --- a/dist/scroll.js +++ b/dist/scroll.js @@ -1,5 +1,5 @@ /** -* scroll-js - v1.2.12. +* scroll-js - v1.3.0. * https://github.com/mkay581/scroll-js.git * Copyright 2016 Mark Kennedy. Licensed MIT. */ diff --git a/package.json b/package.json index <HASH>..<HASH> 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scroll-js", - "version": "1.2.12", + "version": "1.3.0", "description": "Light Scroller class that uses native javascript only", "repository": { "type": "git",
<I> To decrease build file size, we are using src file for NPM entry point and exposing deps to ensure consumers are able to use their own build system. Browserify is recommended.
mkay581_scroll-js
train
js,js,json
5a64fa2b672fd180e0941aa59362a2ff6dea4aba
diff --git a/tests/integration/long/utils.py b/tests/integration/long/utils.py index <HASH>..<HASH> 100644 --- a/tests/integration/long/utils.py +++ b/tests/integration/long/utils.py @@ -52,8 +52,7 @@ class CoordinatorStats(): def init(self, session, keyspace, n, consistency_level=ConsistencyLevel.ONE): self.reset_coordinators() - # BUG: PYTHON-38 - # session.execute('USE %s' % keyspace) + session.execute('USE %s' % keyspace) for i in range(n): ss = SimpleStatement('INSERT INTO %s(k, i) VALUES (0, 0)' % 'cf', consistency_level=consistency_level)
Remove last PYTHON-<I> workaround
datastax_python-driver
train
py
038a29d580da935049c8e3e2cfcd75fba4ebf692
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -4352,12 +4352,13 @@ function reset_password_and_mail($user) { } $a = new object(); - $a->firstname = $user->firstname; - $a->sitename = format_string($site->fullname); - $a->username = $user->username; + $a->firstname = $user->firstname; + $a->lastname = $user->lastname; + $a->sitename = format_string($site->fullname); + $a->username = $user->username; $a->newpassword = $newpassword; - $a->link = $CFG->httpswwwroot .'/login/change_password.php'; - $a->signoff = generate_email_signoff(); + $a->link = $CFG->httpswwwroot .'/login/change_password.php'; + $a->signoff = generate_email_signoff(); $message = get_string('newpasswordtext', '', $a); @@ -4443,6 +4444,7 @@ function send_password_change_info($user) { $data = new object(); $data->firstname = $user->firstname; + $data->lastname = $user->lastname; $data->sitename = format_string($site->fullname); $data->admin = generate_email_signoff();
MDL-<I> more lastname support when resetting passwords; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
a11fe924c2cf83c6f0dae390edc2d25facae6406
diff --git a/components/overlay/Overlay.js b/components/overlay/Overlay.js index <HASH>..<HASH> 100644 --- a/components/overlay/Overlay.js +++ b/components/overlay/Overlay.js @@ -43,6 +43,7 @@ class Overlay extends Component { } componentWillUnmount () { + document.body.style.overflow = null; if (this.escKeyListener) { document.body.removeEventListener('keydown', this.handleEscKey); this.escKeyListener = null; diff --git a/lib/overlay/Overlay.js b/lib/overlay/Overlay.js index <HASH>..<HASH> 100644 --- a/lib/overlay/Overlay.js +++ b/lib/overlay/Overlay.js @@ -66,6 +66,7 @@ var Overlay = function (_Component) { }, { key: 'componentWillUnmount', value: function componentWillUnmount() { + document.body.style.overflow = null; if (this.escKeyListener) { document.body.removeEventListener('keydown', this.handleEscKey); this.escKeyListener = null; @@ -127,4 +128,4 @@ Overlay.defaultProps = { invisible: false }; exports.default = (0, _reactCssThemr.themr)(_identifiers.OVERLAY)(Overlay); -exports.Overlay = Overlay; \ No newline at end of file +exports.Overlay = Overlay;
Reset overflow when unmounting
react-toolbox_react-toolbox
train
js,js
bc55e4fc9dd0a5381da2c487de943dbe303e8430
diff --git a/lib/nestful/request.rb b/lib/nestful/request.rb index <HASH>..<HASH> 100644 --- a/lib/nestful/request.rb +++ b/lib/nestful/request.rb @@ -112,7 +112,7 @@ module Nestful def callback(type, *args) procs = self.class.callbacks(type) + callbacks(type) - procs.each {|c| c.call(*args) } + procs.compact.each {|c| c.call(*args) } end end
make sure we do not try and execute nils
maccman_nestful
train
rb
949f6dfae0efa5c5f80148b0397ea430918987d4
diff --git a/pyblish_qml/ipc/server.py b/pyblish_qml/ipc/server.py index <HASH>..<HASH> 100644 --- a/pyblish_qml/ipc/server.py +++ b/pyblish_qml/ipc/server.py @@ -267,6 +267,8 @@ class Server(object): sys.stdout.write(line) if not self.listening: + self._start_pulse() + if self.modal: _listen() else: @@ -274,8 +276,6 @@ class Server(object): thread.daemon = True thread.start() - self._start_pulse() - self.listening = True def _start_pulse(self):
Ensure pulse thread is created before we start listening
pyblish_pyblish-qml
train
py
1e6fb6ef28d005b55a059a6b28df718423b8fe83
diff --git a/Engine/HtmlEngine.php b/Engine/HtmlEngine.php index <HASH>..<HASH> 100644 --- a/Engine/HtmlEngine.php +++ b/Engine/HtmlEngine.php @@ -14,7 +14,6 @@ namespace LastCall\Mannequin\Html\Engine; use LastCall\Mannequin\Core\Exception\UnsupportedPatternException; use LastCall\Mannequin\Core\Pattern\PatternInterface; use LastCall\Mannequin\Core\Rendered; -use LastCall\Mannequin\Core\Variable\Set; use LastCall\Mannequin\Html\Pattern\HtmlPattern; class HtmlEngine implements \LastCall\Mannequin\Core\Engine\EngineInterface @@ -25,7 +24,7 @@ class HtmlEngine implements \LastCall\Mannequin\Core\Engine\EngineInterface $this->scripts = $scripts; } - public function render(PatternInterface $pattern, Set $set): Rendered + public function render(PatternInterface $pattern, array $values = []): Rendered { if ($this->supports($pattern)) { $rendered = new Rendered();
Implement new Variant class, use instead of sets
LastCallMedia_Mannequin-Html
train
php
df13819d4b1c904627fd0fb363fc7f819a0b65f8
diff --git a/src/SpeckPaypal/Response/Response.php b/src/SpeckPaypal/Response/Response.php index <HASH>..<HASH> 100644 --- a/src/SpeckPaypal/Response/Response.php +++ b/src/SpeckPaypal/Response/Response.php @@ -242,6 +242,14 @@ class Response return $keyName; } + /** + * @return array + */ + public function toArray() + { + return (array)$this->_response; + } + //map to properties /**
Add method to get all response values as array
speckcommerce_SpeckPaypal
train
php
5d4a00212b394110c596b7a04d7db87bc96b13d6
diff --git a/multiqc/templates/default/assets/js/multiqc_plotting.js b/multiqc/templates/default/assets/js/multiqc_plotting.js index <HASH>..<HASH> 100644 --- a/multiqc/templates/default/assets/js/multiqc_plotting.js +++ b/multiqc/templates/default/assets/js/multiqc_plotting.js @@ -115,8 +115,9 @@ $(function () { var startHeight = wrapper.height(); var pY = e.pageY; $(document).on('mouseup', function(e){ + // Clear listeners now that we've let go $(document).off('mousemove'); - $(document).resize(); // send resize trigger for replotting + $(document).off('mouseup'); // Fire off a custom jQuery event for other javascript chunks to tie into // Bind to the plot div, which should have a custom ID $(wrapper.parent().find('.hc-plot')).trigger('mqc_plotresize'); @@ -125,6 +126,12 @@ $(function () { wrapper.css('height', startHeight + (me.pageY - pY)); }); }); + // Trigger HighCharts reflow when a plot is resized + $('.hc-plot').on('mqc_plotresize', function(e){ + if($(this).highcharts()) { + $(this).highcharts().reflow(); + } + }); });
Made plot height drag bar explicitly call a highcharts reflow. Fixes #<I>.
ewels_MultiQC
train
js
6ce313403edcadfc8acd6f658c80beea2e6ef7ca
diff --git a/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java b/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java index <HASH>..<HASH> 100644 --- a/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java +++ b/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java @@ -161,7 +161,7 @@ public final class Coordinator { String updateInterval = props.get("MANAGEMENT_CENTER_UPDATE_INTERVAL").trim(); String updateIntervalAttr = (updateInterval.isEmpty()) ? "" : " update-interval=\"" + updateInterval + "\""; settings.hzConfig = settings.hzConfig.replace("<!--MANAGEMENT_CENTER_CONFIG-->", - format("<management-center enabled=\"true\"%s>\n %s\n" + " </management-center>\n", + format("<management-center enabled=\"true\"%s>%n %s%n" + " </management-center>%n", updateIntervalAttr, manCenterURL)); } }
Removed newline issue in Coordinator (SonarQube issue).
hazelcast_hazelcast-simulator
train
java
5467e5e34fcbf25b7e398d3d8ddb3c7c3b8eee36
diff --git a/rwslib/__init__.py b/rwslib/__init__.py index <HASH>..<HASH> 100644 --- a/rwslib/__init__.py +++ b/rwslib/__init__.py @@ -2,9 +2,9 @@ __title__ = 'rwslib' __author__ = 'Ian Sparks (isparks@mdsol.com)' -__version__ = '1.0.9' +__version__ = '1.1.0' __license__ = 'MIT' -__copyright__ = 'Copyright 2015 Medidata Solutions Inc' +__copyright__ = 'Copyright 2016 Medidata Solutions Inc' import requests
Bumped version number to <I>
mdsol_rwslib
train
py
2a482be4b5f2b4b58867660f20f98e13086ac020
diff --git a/netsnmpagent.py b/netsnmpagent.py index <HASH>..<HASH> 100644 --- a/netsnmpagent.py +++ b/netsnmpagent.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # python-netsnmpagent module # diff --git a/netsnmpapi.py b/netsnmpapi.py index <HASH>..<HASH> 100644 --- a/netsnmpapi.py +++ b/netsnmpapi.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # # python-netsnmpagent module #
Remove the she-bang from netsnmpagent.py and netsnmpapi.py These are Python modules not supposed to be called directly.
pief_python-netsnmpagent
train
py,py
607b8e01064130a083ae8be9359cf83c3639830e
diff --git a/plans/models.py b/plans/models.py index <HASH>..<HASH> 100644 --- a/plans/models.py +++ b/plans/models.py @@ -265,16 +265,15 @@ class UserPlan(models.Model): """ Creates or updates plan renewal information for this userplan with given order """ - recurring, _ = RecurringUserPlan.objects.update_or_create( + self.recurring.delete() + recurring = RecurringUserPlan.objects.create( user_plan=self, - defaults={ - 'pricing': order.pricing, - 'amount': order.amount, - 'tax': order.tax, - 'currency': order.currency, - 'has_automatic_renewal': has_automatic_renewal, - **kwargs, - }, + pricing=order.pricing, + amount=order.amount, + tax=order.tax, + currency=order.currency, + has_automatic_renewal=has_automatic_renewal, + **kwargs, ) return recurring
erease renewal data in set_plan_renewal() function to start with clear settings
django-getpaid_django-plans
train
py
1704e42d5188cd4a2940250e12d1374d70ba6169
diff --git a/core/model/SQLQuery.php b/core/model/SQLQuery.php index <HASH>..<HASH> 100755 --- a/core/model/SQLQuery.php +++ b/core/model/SQLQuery.php @@ -378,6 +378,10 @@ class SQLQuery { * @return string */ function sql() { + // Don't process empty queries + $select = is_array($this->select) ? $this->select[0] : $this->select; + if($select == '*' && !$this->from) return ''; + $sql = DB::getConn()->sqlQueryToString($this); if($this->replacementsOld) $sql = str_replace($this->replacementsOld, $this->replacementsNew, $sql); return $sql;
MINOR Return empty string from SQLQuery->sql() if SELECT is the default value, and no FROM is set (moved logic from DB-specific implementations)
silverstripe_silverstripe-framework
train
php
594ac9a71045a0702724938be093b58273b5ee7f
diff --git a/saltcloud/cloud.py b/saltcloud/cloud.py index <HASH>..<HASH> 100644 --- a/saltcloud/cloud.py +++ b/saltcloud/cloud.py @@ -1385,7 +1385,8 @@ class Map(Cloud): obj.values()[0]['ret'] = out[obj.keys()[0]] output.update(obj) else: - output = output_multip + for obj in output_multip: + output.update(obj) return output
further fix to return from -P create refs e<I>
saltstack_salt
train
py
fe9bcbf3efda8e1b373c58915ff00d09ea608eba
diff --git a/framework/views/log-firebug.php b/framework/views/log-firebug.php index <HASH>..<HASH> 100644 --- a/framework/views/log-firebug.php +++ b/framework/views/log-firebug.php @@ -1,4 +1,4 @@ -<script language="javascript" type="text/javascript"> +<script type="text/javascript"> /*<![CDATA[*/ if(typeof(console)=='object') { diff --git a/framework/views/profile-callstack-firebug.php b/framework/views/profile-callstack-firebug.php index <HASH>..<HASH> 100644 --- a/framework/views/profile-callstack-firebug.php +++ b/framework/views/profile-callstack-firebug.php @@ -1,4 +1,4 @@ -<script language="javascript" type="text/javascript"> +<script type="text/javascript"> /*<![CDATA[*/ if(typeof(console)=='object') { diff --git a/framework/views/profile-summary-firebug.php b/framework/views/profile-summary-firebug.php index <HASH>..<HASH> 100644 --- a/framework/views/profile-summary-firebug.php +++ b/framework/views/profile-summary-firebug.php @@ -1,4 +1,4 @@ -<script language="javascript" type="text/javascript"> +<script type="text/javascript"> /*<![CDATA[*/ if(typeof(console)=='object') {
(Fixes issue <I>)
yiisoft_yii
train
php,php,php
84f4ddd7507d5ee66ebcabf02272d0d79fcda3e2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -70,7 +70,20 @@ // Publish request to the RealFaviconGenerator API, stream unzipped response module.exports.generateFaviconStream = function (config, callback) { var client = new Client(), - parserStream = unzip.Parse(); + parserStream = unzip.Parse(), + ended = false, + // monkeypatch + old_emit = parserStream.emit; + parserStream.emit = function() { + if (arguments[0] == 'close' || arguments[0] == 'end') { + if (!ended) { + ended = true; + old_emit.apply(parserStream, ['end']); + } + } else { + old_emit.apply(parserStream, arguments); + } + } client.post("http://realfavicongenerator.net/api/favicon", config, function (data, response) { if (print) { print('Posted request to RealFaviconGenerator');
monkeypatch unzip.Parse.emit() to emit single 'end' unzip is not so well-behaved. It typically emits a 'close' event when it's done, but there are reports that sometimes it doesn't, and that sometimes it emits 'end' instead. Monkeypatch emit() so that it emits just one 'end' event from any combination of 'close' and 'end' events.
itgalaxy_favicons
train
js
48e8c379e51a7e2fe43efb416f2e2ac5ecf472ad
diff --git a/src/Entities/Entity.php b/src/Entities/Entity.php index <HASH>..<HASH> 100644 --- a/src/Entities/Entity.php +++ b/src/Entities/Entity.php @@ -264,8 +264,14 @@ abstract class Entity /** * Save a revision */ - public function save() + public function save($newRevision = false) { + if ($newRevision) { + $revision = new Revision; + $revision->language_id = $this->revision->language_id; + + $this->revision = $revision; + } DB::transaction( function () use ($newRevision) { @@ -282,13 +288,21 @@ abstract class Entity //TODO :: remove deleted fields - $field->each(function (Field $value, $key) use ($fieldName) { - $value->weight = $key; - $value->revision_id = $this->revision->id; - $value->name = $fieldName; + $field->each( + function (Field $value, $key) use ($newRevision, $fieldName) { + + if ($newRevision) { + $value->id = null; + $value->created_at = null; + } + + $value->weight = $key; + $value->revision_id = $this->revision->id; + $value->name = $fieldName; - $value->save(); - }); + $value->save(); + } + ); } } );
Add ability to create new revision on save
RocketPropelledTortoise_Core
train
php
2b2db7162b0c70dcbab6f26f63f42f2efa0e5b2c
diff --git a/src/Product/ProductListingRequestHandler.php b/src/Product/ProductListingRequestHandler.php index <HASH>..<HASH> 100644 --- a/src/Product/ProductListingRequestHandler.php +++ b/src/Product/ProductListingRequestHandler.php @@ -173,7 +173,7 @@ class ProductListingRequestHandler implements HttpRequestHandler $criteria = $this->applyFiltersToSelectionCriteria($originalCriteria, $selectedFilters); - $currentPageNumber = (int) $request->getQueryParameter(self::PAGINATION_QUERY_PARAMETER_NAME); + $currentPageNumber = max(0, $request->getQueryParameter(self::PAGINATION_QUERY_PARAMETER_NAME) - 1); $productsPerPage = (int) $this->defaultNumberOfProductsPerPage; return $this->dataPoolReader->getSearchResultsMatchingCriteria(
Issue #<I>: Fix pagination retrieval from HTTP request
lizards-and-pumpkins_catalog
train
php
42555d9bd9f8d344ea709e9a5307286e5d15c324
diff --git a/js/snippetPreview.js b/js/snippetPreview.js index <HASH>..<HASH> 100644 --- a/js/snippetPreview.js +++ b/js/snippetPreview.js @@ -150,7 +150,7 @@ YoastSEO_SnippetPreview.prototype.formatKeywordUrl = function ( textString ) { */ YoastSEO_SnippetPreview.prototype.renderOutput = function() { document.getElementById( "snippet_title" ).innerHTML = this.output.title; - document.getElementById( "snippet_cite" ).innerHTML = this.output.cite.replace(/https?:\/\//i, "").slice(0, -1).replace(/\/\//g, "/"); + document.getElementById( "snippet_cite" ).innerHTML = this.output.cite.replace(/https?:\/\//i, "").replace(/\/\//g, "/"); document.getElementById( "snippet_meta" ).innerHTML = this.output.meta; };
fixed bug that removed characters from url string
Yoast_YoastSEO.js
train
js
fffc7aa3cd0352db347ebb173213760d5a4c9e2c
diff --git a/grimoire_elk/elk/mbox.py b/grimoire_elk/elk/mbox.py index <HASH>..<HASH> 100644 --- a/grimoire_elk/elk/mbox.py +++ b/grimoire_elk/elk/mbox.py @@ -105,9 +105,10 @@ class MBoxEnrich(Enrich): def get_project_repository(self, eitem): mls_list = eitem['origin'] - # Eclipse specific yet - repo = "/mnt/mailman_archives/" - repo += mls_list+".mbox/"+mls_list+".mbox" + # This should be configurable + mboxes_dir = '/home/bitergia/mboxes/' + repo = mls_list + " " + mboxes_dir + repo += mls_list + ".mbox/" + mls_list + ".mbox" return repo @metadata
[enrich][mbox] Update the eclipse archives location so the project of a mailing lists can be found in projects.json
chaoss_grimoirelab-elk
train
py
60ce865712c69313a0fd81ec0bf76dc9822afe5f
diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index <HASH>..<HASH> 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -20,10 +20,13 @@ CLUSTER_NAME = 'test_cluster' CCM_CLUSTER = None CASSANDRA_VERSION = os.getenv('CASSANDRA_VERSION', '2.0.6') + if CASSANDRA_VERSION.startswith('1'): - PROTOCOL_VERSION = 1 + DEFAULT_PROTOCOL_VERSION = 1 else: - PROTOCOL_VERSION = 2 + DEFAULT_PROTOCOL_VERSION = 2 +PROTOCOL_VERSION = os.getenv('PROTOCOL_VERSION', DEFAULT_PROTOCOL_VERSION) + path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'ccm') if not os.path.exists(path):
Allow PROTOCOL_VERSION to be set by envar
datastax_python-driver
train
py
a3712f7c5bb60cf4a8da7ec9f6ccccae39ce4962
diff --git a/src/sku/Sku.js b/src/sku/Sku.js index <HASH>..<HASH> 100644 --- a/src/sku/Sku.js +++ b/src/sku/Sku.js @@ -368,6 +368,7 @@ export default createComponent({ ImagePreview({ images: this.imageList, startPosition: index, + closeOnPopstate: true, onClose: () => { this.$emit('close-preview', params); }
[improvement] Sku: should close image preview when popstate (#<I>)
youzan_vant
train
js
f6c902a46ec8a2baf4b85e303fdc8614db694b58
diff --git a/lib/pork/mode/parallel.rb b/lib/pork/mode/parallel.rb index <HASH>..<HASH> 100644 --- a/lib/pork/mode/parallel.rb +++ b/lib/pork/mode/parallel.rb @@ -10,7 +10,7 @@ module Pork def parallel stat=Stat.new, paths=all_paths paths.shuffle.each_slice(cores).map do |paths_slice| Thread.new do - execute(:shuffled, Stat.new, paths_slice) + execute(:shuffled, Stat.new(stat.io), paths_slice) end end.map(&:value).inject(stat, &:merge) end
should pass io along, and io should be thread-safe!
godfat_pork
train
rb
292101971d0da4fb25a65dbb23944c9dace820bd
diff --git a/views/js/qtiCreator/widgets/interactions/helpers/answerState.js b/views/js/qtiCreator/widgets/interactions/helpers/answerState.js index <HASH>..<HASH> 100644 --- a/views/js/qtiCreator/widgets/interactions/helpers/answerState.js +++ b/views/js/qtiCreator/widgets/interactions/helpers/answerState.js @@ -20,6 +20,7 @@ define([ 'jquery', 'lodash', 'i18n', + 'services/features', 'taoQtiItem/qtiItem/helper/response', 'taoQtiItem/qtiCreator/widgets/helpers/formElement', 'taoQtiItem/qtiCreator/widgets/component/minMax/minMax', @@ -30,6 +31,7 @@ define([ $, _, __, + features, responseHelper, formElement, minMaxComponentFactory, @@ -252,7 +254,7 @@ define([ serial: response.getSerial(), defineCorrect: defineCorrect, editMapping: editMapping, - editFeedbacks: template !== 'CUSTOM', + editFeedbacks: template !== 'CUSTOM' && features.isVisible('taoQtiItem/qtiCreator/widgets/interactions/modalFeedbacks'), mappingDisabled: _.isEmpty(response.mapEntries), template: template, templates: _getAvailableRpTemplates(
feat: use config to toggle modalFeedbacks response feature
oat-sa_extension-tao-itemqti
train
js
fc57964b035d3ee7d6e18455d60e3fa23e4cf345
diff --git a/chevron/renderer.py b/chevron/renderer.py index <HASH>..<HASH> 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -1,5 +1,5 @@ #!/usr/bin/python - +# -*- coding: utf-8 -*- # # Python 2 and 3, module and script compatability
Fix python 2 encoding problem with the new docstr Python 2 did not like my fancy new doc string with the unicode filetree
noahmorrison_chevron
train
py
4c4d8257697e0d1b9083b863055b0939dda8256d
diff --git a/lib/activeuuid/uuid.rb b/lib/activeuuid/uuid.rb index <HASH>..<HASH> 100644 --- a/lib/activeuuid/uuid.rb +++ b/lib/activeuuid/uuid.rb @@ -18,6 +18,11 @@ end module Arel module Visitors + class DepthFirst < Arel::Visitors::Visitor + def visit_UUIDTools_UUID(o) + o.quoted_id + end + end class MySQL < Arel::Visitors::ToSql def visit_UUIDTools_UUID(o) o.quoted_id
Adding visit_UUIDTools_UUID method to DepthFirst class since Arel each method calls DepthFirst and not MySQL visitor.
jashmenn_activeuuid
train
rb
c9b19831ec1f038edae5ee553aa8ae86503b4987
diff --git a/languagetool-language-modules/ru/src/main/java/org/languagetool/rules/ru/RussianDashRule.java b/languagetool-language-modules/ru/src/main/java/org/languagetool/rules/ru/RussianDashRule.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/ru/src/main/java/org/languagetool/rules/ru/RussianDashRule.java +++ b/languagetool-language-modules/ru/src/main/java/org/languagetool/rules/ru/RussianDashRule.java @@ -32,7 +32,7 @@ public class RussianDashRule extends AbstractDashRule { public RussianDashRule() { super(trie); - setDefaultOff(); // Slows down start up. See GitHub issue #1016. + setDefaultTempOff(); // Slows down start up. See GitHub issue #1016. } @Override
[ru] temp-activate rule for nightly test
languagetool-org_languagetool
train
java
3a99dfe8b1079facff3565267e65818c1d1928e5
diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -202,6 +202,8 @@ public class ClassicPluginStrategy implements PluginStrategy { throw new IOException(className+" doesn't extend from hudson.Plugin"); } wrapper.setPlugin((Plugin) o); + } catch (LinkageError e) { + throw new IOException2("Unable to load " + className + " from " + wrapper.getShortName(),e); } catch (ClassNotFoundException e) { throw new IOException2("Unable to load " + className + " from " + wrapper.getShortName(),e); } catch (IllegalAccessException e) {
failure to load plugins may be reported as NoClassDefError, for example if the dependency classes fail to load git-svn-id: <URL>
jenkinsci_jenkins
train
java
b7b5f76ecfcd5c33603822998b1132ae553c063f
diff --git a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java index <HASH>..<HASH> 100644 --- a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java +++ b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java @@ -123,9 +123,8 @@ public class JBossWSNonSpringBusFactory extends CXFBusFactory //RM RMManager rmManager = new RMManager(); -// rmManager.initialise(); -// rmManager.registerListeners(); - rmManager.setBus(bus); + bus.setExtension(rmManager, RMManager.class); +// rmManager.init(); //RM Policy policyInterceptorProviderRegistry.register(new RMPolicyInterceptorProvider(bus));
[JBWS-<I>] Need to set the RMManager in the bus for CXF <I>.x
jbossws_jbossws-cxf
train
java
e6c4071f5a294100f0dbab40ec37b73310165ce8
diff --git a/allauth/socialaccount/providers/openid/tests.py b/allauth/socialaccount/providers/openid/tests.py index <HASH>..<HASH> 100644 --- a/allauth/socialaccount/providers/openid/tests.py +++ b/allauth/socialaccount/providers/openid/tests.py @@ -1,3 +1,5 @@ +from unittest import expectedFailure + from django.test import override_settings from django.urls import reverse @@ -23,7 +25,9 @@ class OpenIDTests(TestCase): dict(openid='http://www.google.com')) self.assertTrue('openid' in resp.context['form'].errors) + @expectedFailure def test_login(self): + # Location: https://s.yimg.com/wm/mbr/html/openid-eol-0.0.1.html resp = self.client.post(reverse(views.login), dict(openid='http://me.yahoo.com')) assert 'login.yahooapis' in resp['location'] @@ -55,6 +59,7 @@ class OpenIDTests(TestCase): ) get_user_model().objects.get(first_name='raymond') + @expectedFailure @override_settings(SOCIALACCOUNT_PROVIDERS={'openid': {'SERVERS': [ dict(id='yahoo', name='Yahoo',
fix(openid): Mark tests as expected failures Long term solution: phase out OpenID <I> support. Current test relies on Yahoo (dead now) and Hyves (should be long dead, if it isn't, it's undead). This fix silences the tests, until someone wants to find a new provider or mock the discovery, but OpenID itself has moved on to the next shiny version: OpenID Connect, so it is best to sunset this support.
pennersr_django-allauth
train
py