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 |
|---|---|---|---|---|---|
75d094d1a4953a061b1decdb9bedad73a5bd0205 | diff --git a/nunaliit2-js/src/main/js/nunaliit2/tuio/tuioclient.js b/nunaliit2-js/src/main/js/nunaliit2/tuio/tuioclient.js
index <HASH>..<HASH> 100644
--- a/nunaliit2-js/src/main/js/nunaliit2/tuio/tuioclient.js
+++ b/nunaliit2-js/src/main/js/nunaliit2/tuio/tuioclient.js
@@ -496,10 +496,6 @@ function dispatchMouseEventWin(eventType, winX, winY)
function removeObject(dict, inst) {
// Object is long dead and no longer influential, remove
- if (dict == cursors) {
- // Cursor is no longer alive, (cursor up)
- onCursorUp(inst);
- }
if (dict[inst].div != undefined) {
// Remove calibration div
@@ -540,6 +536,13 @@ function updateAlive(dict, alive) {
// No longer alive, flag as dead and schedule removal
dict[inst].alive = false;
dict[inst].deathTime = Date.now();
+
+ // Issue cursor up immediately for responsive clicking
+ if (dict == cursors) {
+ onCursorUp(inst);
+ }
+
+ // Schedule full removal for when spring no longer has influence
window.setTimeout(removeObject, springFadeTime, dict, inst);
}
} | Dispatch mouseup early for more reponsive clicking | GCRC_nunaliit | train | js |
9dde205b007305c4c01aee57c631eb683b085bbb | diff --git a/clustering/infinispan/src/main/java/org/jboss/as/clustering/infinispan/LegacyGlobalConfigurationAdapter.java b/clustering/infinispan/src/main/java/org/jboss/as/clustering/infinispan/LegacyGlobalConfigurationAdapter.java
index <HASH>..<HASH> 100644
--- a/clustering/infinispan/src/main/java/org/jboss/as/clustering/infinispan/LegacyGlobalConfigurationAdapter.java
+++ b/clustering/infinispan/src/main/java/org/jboss/as/clustering/infinispan/LegacyGlobalConfigurationAdapter.java
@@ -142,7 +142,7 @@ public class LegacyGlobalConfigurationAdapter {
;
for (AdvancedExternalizerConfig externalizerConfig : legacy.getExternalizers()) {
- builder.serialization().addAdvancedExternalizer(externalizerConfig.getAdvancedExternalizer());
+ builder.serialization().addAdvancedExternalizer(externalizerConfig.getId(), externalizerConfig.getAdvancedExternalizer());
}
builder.asyncTransportExecutor() | AS7-<I>: When copying advancedexternalizer from the legacy configuration, use the
id coming from the externalizerconfig, since it may have been assigned
by a module lifecycle and not overridden from
AbstractExternalizer | wildfly_wildfly | train | java |
358510ad8449df2282f9321567a8f59eca5f687b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,9 @@ setup(name='spatialist',
author='John Truckenbrodt',
author_email='john.truckenbrodt@uni-jena.de',
license='MIT',
- zip_safe=False)
+ zip_safe=False,
+ long_description='an in-depth package description can be found on GitHub '
+ '[here]("https://github.com/johntruckenbrodt/spatialist")')
if platform.system() is 'Windows':
subdir = os.path.join(directory, 'mod_spatialite') | [setup.py] added short description with link to github | johntruckenbrodt_spatialist | train | py |
711fe0e77a125fe466d13e74eb56a18065b58fbe | diff --git a/js/test/.eslintrc.js b/js/test/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/js/test/.eslintrc.js
+++ b/js/test/.eslintrc.js
@@ -25,6 +25,7 @@ module.exports = {
"curly": "off",
"rest-spread-spacing": "off",
"no-multiple-empty-lines": "off",
+ "no-undef": "off",
"no-undef-init": "off",
"no-useless-return": "off",
"no-console": "off", | removed undef rule from test/.eslintrc as it falsely complains about mocha's globally defined functions | ccxt_ccxt | train | js |
ad8cb7c812984a5736ba7ac46a83a10bc95e3659 | diff --git a/lib/bbcloud/api.rb b/lib/bbcloud/api.rb
index <HASH>..<HASH> 100644
--- a/lib/bbcloud/api.rb
+++ b/lib/bbcloud/api.rb
@@ -53,6 +53,8 @@ module Brightbox
objects = args.collect do |arg|
cached_get(arg)
end
+ elsif args.respond_to? :to_s
+ objects = [cached_get(args.to_s)]
end
# wrap in our objects
objects.collect! { |o| new(o) unless o.nil? } | handle strings that don't respond to collect (as in Ruby <I>). Fixes #<I> | brightbox_brightbox-cli | train | rb |
5ec3cfc38d8ad335b7656cae8f75a4d2be20ad78 | diff --git a/geoshape/settings.py b/geoshape/settings.py
index <HASH>..<HASH> 100644
--- a/geoshape/settings.py
+++ b/geoshape/settings.py
@@ -218,9 +218,10 @@ LEAFLET_CONFIG = {
}
}
-# Absolute filesystem path to the directory that will hold user-uploaded files.
-# Used to upload schema.xsd files through gsschema app
-MEDIA_ROOT = OGC_SERVER['default']['GEOSERVER_DATA_DIR']
+# Absolute filesystem path to the directory that will be used to upload/download schema.xsd files through gsschema app
+GSSCHEMA_CONFIG = {
+ 'gsschema_dir': '/var/lib/geoserver_data/'
+}
# where to save tilebundler tilesets. Should move this to OGC_SERVER['default']['TILEBUNDLER_DATASTORE_DIR']
TILEBUNDLER_CONFIG = { | Update settings.py
added gsschema_config setting | ROGUE-JCTD_rogue_geonode | train | py |
1a1a8cfb6adbe6475263b67e3f95dcc9914dedfe | diff --git a/apostrophe.js b/apostrophe.js
index <HASH>..<HASH> 100644
--- a/apostrophe.js
+++ b/apostrophe.js
@@ -698,6 +698,7 @@ function Apos() {
if (extension && extension.length) {
extension = extension.substr(1);
}
+ extension = extension.toLowerCase();
// Do we accept this file extension?
var accepted = [];
var group = _.find(self.fileGroups, function(group) { | Here's an idea, let's accept uppercase file extensions (: | apostrophecms_apostrophe | train | js |
49b1dcc991bf9b7a2f3f33ffe9dd0de5f3ee8842 | diff --git a/test/integration/kubernetes_deploy_test.rb b/test/integration/kubernetes_deploy_test.rb
index <HASH>..<HASH> 100644
--- a/test/integration/kubernetes_deploy_test.rb
+++ b/test/integration/kubernetes_deploy_test.rb
@@ -891,7 +891,7 @@ unknown field \"myKey\" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta",
result = deploy_fixtures(
"invalid",
subset: ["bad_probe.yml", "cannot_run.yml", "missing_volumes.yml", "config_map.yml"],
- max_watch_seconds: 15
+ max_watch_seconds: 20
) do |f|
bad_probe = f["bad_probe.yml"]["Deployment"].first
bad_probe["metadata"]["annotations"]["kubernetes-deploy.shopify.io/timeout-override"] = '5s'
@@ -906,7 +906,7 @@ unknown field \"myKey\" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta",
"ConfigMap/test",
"Deployment/cannot-run: FAILED",
"Deployment/bad-probe: TIMED OUT (timeout: 5s)",
- "Deployment/missing-volumes: GLOBAL WATCH TIMEOUT (15 seconds)"
+ "Deployment/missing-volumes: GLOBAL WATCH TIMEOUT (20 seconds)"
])
end | Bump global timeout to fix flakey test (#<I>) | Shopify_kubernetes-deploy | train | rb |
0c79c11606b6816eeb7c41b660fff102b254978d | diff --git a/cayley.go b/cayley.go
index <HASH>..<HASH> 100644
--- a/cayley.go
+++ b/cayley.go
@@ -193,6 +193,9 @@ func load(ts graph.TripleStore, cfg *config.Config, path, typ string) error {
if path == "" {
path = cfg.DatabasePath
}
+ if path == "" {
+ return nil
+ }
u, err := url.Parse(path)
if err != nil || u.Scheme == "file" || u.Scheme == "" {
// Don't alter relative URL path or non-URL path parameter. | Allow memstore instances to be started empty
This allows easier debugging of web UI problem. | cayleygraph_cayley | train | go |
0f4d779b00649a6b3e0d2224ee8a90afba5863b7 | diff --git a/pywb/rewrite/html_rewriter.py b/pywb/rewrite/html_rewriter.py
index <HASH>..<HASH> 100644
--- a/pywb/rewrite/html_rewriter.py
+++ b/pywb/rewrite/html_rewriter.py
@@ -109,6 +109,8 @@ class HTMLRewriterMixin(object):
# get opts from urlrewriter
self.opts = url_rewriter.rewrite_opts
+ self.force_decl = self.opts.get('force_html_decl', None)
+
self.parsed_any = False
# ===========================
@@ -300,6 +302,10 @@ class HTMLRewriterMixin(object):
# Clear buffer to create new one for next rewrite()
self.out = None
+ if self.force_decl:
+ result = self.force_decl + '\n' + result
+ self.force_decl = None
+
return result
def close(self):
@@ -409,6 +415,7 @@ class HTMLRewriter(HTMLRewriterMixin, HTMLParser):
def handle_decl(self, data):
self.out.write('<!' + data + '>')
+ self.force_decl = None
def handle_pi(self, data):
self.out.write('<?' + data + '>') | html rewrite: add 'force_html_decl' option, which if set in rewrite_opts, can be used to force an HTML decl, eg. <!DOCTYPE html> if a default one was not provided | webrecorder_pywb | train | py |
e19499dbf22db90874f0953e9093feab1edea8e2 | diff --git a/pyroma/__init__.py b/pyroma/__init__.py
index <HASH>..<HASH> 100644
--- a/pyroma/__init__.py
+++ b/pyroma/__init__.py
@@ -89,7 +89,7 @@ def main():
sys.exit(1)
modes = (options.auto, options.directory, options.file, options.pypi)
- if sum([1 if x else 0 for x in modes]) > 1:
+ if sum(1 if x else 0 for x in modes) > 1:
print("You can only select one of the options -a, -d, -f and -p")
sys.exit(1) | That list isn't needed any more | regebro_pyroma | train | py |
9067328c60f265d2ee4b4da9cce90ebab69508b1 | diff --git a/src/DependencyInjection/DoctrineCacheExtension.php b/src/DependencyInjection/DoctrineCacheExtension.php
index <HASH>..<HASH> 100755
--- a/src/DependencyInjection/DoctrineCacheExtension.php
+++ b/src/DependencyInjection/DoctrineCacheExtension.php
@@ -30,4 +30,12 @@ class DoctrineCacheExtension extends Extension
$container->setParameter('doctrine_cache.providers', $config['providers']);
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getAlias()
+ {
+ return 'doctrine_cache';
+ }
} | Added a alias for the config | php-cache_adapter-bundle | train | php |
f7893e750113267b58f66ecbe69a1a1a23c50fac | diff --git a/src/d3-funnel/D3Funnel.js b/src/d3-funnel/D3Funnel.js
index <HASH>..<HASH> 100644
--- a/src/d3-funnel/D3Funnel.js
+++ b/src/d3-funnel/D3Funnel.js
@@ -58,6 +58,10 @@ class D3Funnel {
this.labelFormatter = new LabelFormatter();
this.navigator = new Navigator();
+
+ // Bind event handlers
+ this.onMouseOver = this.onMouseOver.bind(this);
+ this.onMouseOut = this.onMouseOut.bind(this);
}
/**
@@ -683,8 +687,8 @@ class D3Funnel {
return;
}
- target.on('mouseover', this.onMouseOver.bind(this))
- .on('mouseout', this.onMouseOut.bind(this));
+ target.on('mouseover', this.onMouseOver)
+ .on('mouseout', this.onMouseOut);
});
} | Bind event handlers more efficiently | jakezatecky_d3-funnel | train | js |
cd90e5ef050128760c4603d982d0d3c9286b524e | diff --git a/server/config.js b/server/config.js
index <HASH>..<HASH> 100644
--- a/server/config.js
+++ b/server/config.js
@@ -4,6 +4,6 @@ exports.config = {
defaultUserName: 'me',
port: 80,
initialTokens: {
- '4eb4b398c36e62da87469133e2f0cb3f9574d5b3865051': ['messages:rw']
+ '4eb4b398c36e62da87469133e2f0cb3f9574d5b3865051': [':rw']
}
} | changed default token in example server config to root-scope | remotestorage_remotestorage.js | train | js |
856fae9fe6dd9a59f9c1db38540042e7a301ffc8 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -38,12 +38,15 @@ function fork(options, callback) {
if (!promise) {
defer = Q.defer();
cache[key] = promise = defer.promise;
+ promise._firstCall = true;
}
promise.done(function(result) {
- callback(null, result[0], result[1]);
+ callback(null, result[0], result[1], promise._firstCall);
+ promise._firstCall = false;
}, function(err) {
- callback(err);
+ callback(err, undefined, undefined, promise._firstCall);
+ promise._firstCall = false;
});
if (!defer) { | feat: mark the callback for the first execution | avwo_pfork | train | js |
fefce13700f88aec3cd8ed7fa14496d057e623e1 | diff --git a/lib/tern.js b/lib/tern.js
index <HASH>..<HASH> 100644
--- a/lib/tern.js
+++ b/lib/tern.js
@@ -137,7 +137,10 @@
var file = this.findFile(name);
if (file) {
this.needsPurge.push(file.name);
- this.files.splice(this.files.indexOf(file), 1);
+ for (var i = 0; i < this.files.length; i++) {
+ if (this.files[i] == file) this.files.splice(i--, 1);
+ else if (this.files[i].parent == name) files[i].parent = null;
+ }
delete this.fileMap[file.name];
}
}, | Don't leave dangling parent pointers when deleting a file
Issue #<I> | ternjs_tern | train | js |
2f18b2772d4ebf76dca22ff2f7428e28b2642564 | diff --git a/src/parser.js b/src/parser.js
index <HASH>..<HASH> 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -967,6 +967,10 @@ function convert(context) {
// ^
let startOfInterpolation = op.range[0];
while (source[startOfInterpolation] !== '#') {
+ if (startOfInterpolation >= source.length) {
+ throw new Error(
+ `Unable to find start of interpolation for op ${JSON.stringify(op)}`);
+ }
startOfInterpolation += 1;
}
let range = [op.range[0], startOfInterpolation];
@@ -978,6 +982,10 @@ function convert(context) {
// ^
let endOfInterpolation = op.range[1] - 1;
while (source[endOfInterpolation] !== '}') {
+ if (endOfInterpolation < 0) {
+ throw new Error(
+ `Unable to find last interpolation for op ${JSON.stringify(op)}`);
+ }
endOfInterpolation -= 1;
}
return buildQuasi([endOfInterpolation + 1, op.range[1]]); | fix: add infinite loop safeguards in string interpolation code (#<I>)
This should prevent potential future bugs that could cause an infinite loop
(although all known cases causing an infinite loop have been fixed). | decaffeinate_decaffeinate-parser | train | js |
729249df202c6d83a7ac6d58b973072aba3b079c | diff --git a/tests/UI/specs/MultiSites_spec.js b/tests/UI/specs/MultiSites_spec.js
index <HASH>..<HASH> 100644
--- a/tests/UI/specs/MultiSites_spec.js
+++ b/tests/UI/specs/MultiSites_spec.js
@@ -16,7 +16,12 @@ describe("MultiSitesTest", function () {
var createdSiteId = null;
before(function (done) {
- var callback = function (undefined, response) {
+ var callback = function (error, response) {
+ if (error) {
+ done(error, response);
+ return;
+ }
+
createdSiteId = response.value;
done();
}; | make sure to pass error to done callback in case there is an error | matomo-org_matomo | train | js |
459d54d042bb0a42b7edeab7b4ad82fdd04d107e | diff --git a/query.go b/query.go
index <HASH>..<HASH> 100644
--- a/query.go
+++ b/query.go
@@ -288,8 +288,9 @@ type WriteResponse struct {
// ChangeResponse is a helper type used when dealing with changefeeds. The type
// contains both the value before the query and the new value.
type ChangeResponse struct {
- NewValue interface{} `gorethink:"new_val"`
- OldValue interface{} `gorethink:"old_val"`
+ NewValue interface{} `gorethink:"new_val,omitempty"`
+ OldValue interface{} `gorethink:"old_val,omitempty"`
+ State string `gorethink:"state,omitempty"`
}
// RunOpts contains the optional arguments for the Run function. | query: include "state" in ChangeResponse object
When `IncludeStates` is true, the DB will return a couple objects with
the `state` field set to either "initializing" or "ready." Add this
field to ChangeResponse as well as omitempty tags. | rethinkdb_rethinkdb-go | train | go |
14712f35b347f1287f575eff5c5a1b50e7bc3350 | diff --git a/lib/linkser/objects/html.rb b/lib/linkser/objects/html.rb
index <HASH>..<HASH> 100644
--- a/lib/linkser/objects/html.rb
+++ b/lib/linkser/objects/html.rb
@@ -60,6 +60,7 @@ module Linkser
nokogiri.css('img').each do |img|
break if images.length >= max_images
img_src = img.get_attribute("src")
+ next unless img_src
img_src = complete_url img_src, last_url
img_uri = URI.parse(img_src)
img_ext = File.extname(img_uri.path) | Skip image if no src attribute is present | ging_linkser | train | rb |
2ca009c4c43e212b54b61099f4e840a49419107f | diff --git a/src/Images/ImageUtils.php b/src/Images/ImageUtils.php
index <HASH>..<HASH> 100644
--- a/src/Images/ImageUtils.php
+++ b/src/Images/ImageUtils.php
@@ -46,6 +46,10 @@ class ImageUtils {
$locallyStoredImages = [];
foreach ($localImages as $localImage) {
+ if (empty($localImage->file)) {
+ continue;
+ }
+
$imageDetails = self::getImageDimensions($localImage->file);
$locallyStoredImages[] = new LocallyStoredImage([ | avoid exceptions on empty images (#<I>) | scotteh_php-goose | train | php |
3e4a9631da5205d90c7df58e86a677d83f4e83af | diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php
index <HASH>..<HASH> 100644
--- a/cake/tests/lib/test_manager.php
+++ b/cake/tests/lib/test_manager.php
@@ -23,7 +23,7 @@ define('APP_TEST_CASES', TESTS . 'cases');
define('APP_TEST_GROUPS', TESTS . 'groups');
/**
- * TestManager is the base class that handles loading and initiating the running
+ * TestManager is the base class that handles loading and initiating the running
* of TestCase and TestSuite classes that the user has selected.
*
* @package cake
@@ -103,7 +103,7 @@ class TestManager {
if ($this->appTest) {
$test =& new TestSuite(__('All App Tests', true));
} else if ($this->pluginTest) {
- $test =& new TestSuite(sprintf(__('All %s Plugin Tests', true), Inflector::humanize($manager->pluginTest)));
+ $test =& new TestSuite(sprintf(__('All %s Plugin Tests', true), Inflector::humanize($this->pluginTest)));
} else {
$test =& new TestSuite(__('All Core Tests', true));
} | Fixing notice due by using a non-existent variable. | cakephp_cakephp | train | php |
24e6e63343f0dda59bf86a5ca16f9223f159350e | diff --git a/lxd/cluster/heartbeat.go b/lxd/cluster/heartbeat.go
index <HASH>..<HASH> 100644
--- a/lxd/cluster/heartbeat.go
+++ b/lxd/cluster/heartbeat.go
@@ -217,14 +217,16 @@ func HeartbeatTask(gateway *Gateway) (task.Func, task.Schedule) {
// Since the database APIs are blocking we need to wrap the core logic
// and run it in a goroutine, so we can abort as soon as the context expires.
heartbeatWrapper := func(ctx context.Context) {
- ch := make(chan struct{})
- go func() {
- gateway.heartbeat(ctx, hearbeatNormal)
- ch <- struct{}{}
- }()
- select {
- case <-ch:
- case <-ctx.Done():
+ if gateway.HearbeatCancelFunc() == nil {
+ ch := make(chan struct{})
+ go func() {
+ gateway.heartbeat(ctx, hearbeatNormal)
+ close(ch)
+ }()
+ select {
+ case <-ch:
+ case <-ctx.Done():
+ }
}
} | lxd/cluster/heartbeat: Updates HeartbeatTask to skip starting new heartbeat if already running | lxc_lxd | train | go |
27bc297f96724ebf81a251aa8c0d335f214e25fb | diff --git a/spinoff/contrib/filetransfer/filetransfer.py b/spinoff/contrib/filetransfer/filetransfer.py
index <HASH>..<HASH> 100644
--- a/spinoff/contrib/filetransfer/filetransfer.py
+++ b/spinoff/contrib/filetransfer/filetransfer.py
@@ -66,15 +66,11 @@ class FilePublisher(Actor):
@classmethod
def get(cls, node=None):
- if isinstance(node, Ref):
- node = node._cell.root.node
if node not in cls._instances:
- cls._instances[node] = node.spawn(cls.using(node=node))
+ cls._instances[node] = node.spawn(cls.using())
return cls._instances[node]
- def pre_start(self, node):
- self._node = node
-
+ def pre_start(self):
self.published = {} # <pub_id> => (<local file path>, <time added>)
self.senders = {} # <sender> => <pub_id>
@@ -134,7 +130,7 @@ class FilePublisher(Actor):
del self.senders[sender]
def post_stop(self):
- del self._instances[self._node]
+ del self._instances[self.node]
class _Receiver(Process): | Removed the redundant FilePublisher._node attribute | eallik_spinoff | train | py |
7c80f3ea485ca5569505ff6683d04ce40bd4c5ce | diff --git a/lib/mini_fb.rb b/lib/mini_fb.rb
index <HASH>..<HASH> 100644
--- a/lib/mini_fb.rb
+++ b/lib/mini_fb.rb
@@ -14,7 +14,7 @@
require 'digest/md5'
require 'erb'
require 'json' unless defined? JSON
-require 'rest_client'
+require 'rest-client'
require 'hashie'
require 'base64'
require 'openssl' | Replace rest_client for rest-client | appoxy_mini_fb | train | rb |
b13a7f450efb3cb52ffe93c6160f80161533651f | diff --git a/lib/xpm/install.js b/lib/xpm/install.js
index <HASH>..<HASH> 100644
--- a/lib/xpm/install.js
+++ b/lib/xpm/install.js
@@ -202,7 +202,7 @@ class Install extends CliCommand {
} else {
log.warn('Package already installed. ' +
'Use --force to overwrite.')
- return CliExitCodes.ERROR.OUTPUT
+ return CliExitCodes.ERROR.NONE
}
} | [#3] no error for 'Package already installed' | xpack_xpm-js | train | js |
dedbe837f29ddfe6d7c0f7628c1fb4ac9dd46b6a | diff --git a/test/e2e/es_cluster_logging.go b/test/e2e/es_cluster_logging.go
index <HASH>..<HASH> 100644
--- a/test/e2e/es_cluster_logging.go
+++ b/test/e2e/es_cluster_logging.go
@@ -219,6 +219,11 @@ func ClusterLevelLoggingWithElasticsearch(f *framework.Framework) {
}
framework.Logf("Found %d healthy nodes.", len(nodes.Items))
+ // TODO: Figure out why initialization time influences
+ // results of the test and remove this step
+ By("Wait some more time to ensure ES and fluentd are ready")
+ time.Sleep(2 * time.Minute)
+
// Wait for the Fluentd pods to enter the running state.
By("Checking to make sure the Fluentd pod are running on each healthy node")
label = labels.SelectorFromSet(labels.Set(map[string]string{k8sAppKey: fluentdValue})) | Add additional delay to the es logging e2e test to make it stable | kubernetes_kubernetes | train | go |
ae49f76e78c384e42139cf0e82ebd40a328927b8 | diff --git a/src/class-extended-cpt-admin.php b/src/class-extended-cpt-admin.php
index <HASH>..<HASH> 100644
--- a/src/class-extended-cpt-admin.php
+++ b/src/class-extended-cpt-admin.php
@@ -116,6 +116,15 @@ class Extended_CPT_Admin {
# Post updated messages:
add_filter( 'post_updated_messages', [ $this, 'post_updated_messages' ], 1 );
add_filter( 'bulk_post_updated_messages', [ $this, 'bulk_post_updated_messages' ], 1, 2 );
+
+ /**
+ * Fired when the extended post type admin instance is set up.
+ *
+ * @todo Add @since tag when version is bumped.
+ *
+ * @param Extended_CPT_Admin $instance The extended post type admin instance.
+ */
+ do_action( "ext-cpts-admin/{$this->cpt->post_type}/instance", $this );
}
/** | Add the "ext-cpts-admin/{$post_type}/instance" action to allow access to the Extended_CPT_Admin instances. | johnbillion_extended-cpts | train | php |
c1b949869c3de8fc62f8ab072bbd77542b1d3605 | diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -784,7 +784,6 @@ Run `rake gems:install` to install the missing gems.
def threadsafe!
self.cache_classes = true
self.dependency_loading = false
- self.active_record.allow_concurrency = true
self.action_controller.allow_concurrency = true
self
end | Remove call to active_record.allow_concurrency since it's deprecated | rails_rails | train | rb |
ff928df3a30bae7379451bffe6f6e487b63b4909 | diff --git a/lib/node/default.js b/lib/node/default.js
index <HASH>..<HASH> 100644
--- a/lib/node/default.js
+++ b/lib/node/default.js
@@ -2,8 +2,6 @@
module.exports = require(__dirname).define({
type: 'DEFAULT',
- constructor: function() {
- },
value: function() {
return;
}
diff --git a/lib/node/index.js b/lib/node/index.js
index <HASH>..<HASH> 100644
--- a/lib/node/index.js
+++ b/lib/node/index.js
@@ -24,14 +24,16 @@ Node.prototype.addAll = function(nodes) {
}
Node.define = function(def) {
- //TODO - what was I thinking?
- //ALSO TODO - start commenting my code more. :p
var c = function() {
Node.apply(this, arguments);
- if(def.constructor) {
- def.constructor.apply(this, arguments);
- }
};
+ //allow custom sub-class constructor
+ if(def.constructor) {
+ c = function() {
+ Node.apply(this, arguments);
+ def.constructor.apply(this, arguments);
+ };
+ }
var key;
for(key in Node.prototype) {
c.prototype[key] = Node.prototype[key]; | make generated node constructors slightly less weird | brianc_node-sql | train | js,js |
e5fcde80bb1897f2a8d8fa7797aab55441982759 | diff --git a/src/core/text/Text.js b/src/core/text/Text.js
index <HASH>..<HASH> 100644
--- a/src/core/text/Text.js
+++ b/src/core/text/Text.js
@@ -409,6 +409,8 @@ Text.prototype.updateTexture = function ()
texture.baseTexture.hasLoaded = true;
texture.baseTexture.resolution = this.resolution;
+ texture.baseTexture.realWidth = this.canvas.width;
+ texture.baseTexture.realHeight = this.canvas.height;
texture.baseTexture.width = this.canvas.width / this.resolution;
texture.baseTexture.height = this.canvas.height / this.resolution;
texture.trim.width = texture._frame.width = this.canvas.width / this.resolution; | BaseTexture used for text now reports correct realWidth and realHeight (#<I>) | pixijs_pixi.js | train | js |
303c5ebc54b2f3237057ef12fb76147a4c5ddbd3 | diff --git a/validator/sawtooth_validator/execution/executor.py b/validator/sawtooth_validator/execution/executor.py
index <HASH>..<HASH> 100644
--- a/validator/sawtooth_validator/execution/executor.py
+++ b/validator/sawtooth_validator/execution/executor.py
@@ -296,7 +296,7 @@ class _Waiter(object):
# Wait for the processor type to be registered
self._processors.cancellable_wait(
processor_type=self._processor_type,
- is_cancelled=self._cancelled_event)
+ cancelled_event=self._cancelled_event)
if self._cancelled_event.is_set():
LOGGER.info("waiting cancelled on %s", self._processor_type) | Fix incorrect keyword argument
The TypeError on invalid keyword argument wasn't displayed due to
running in a threadpool. | hyperledger_sawtooth-core | train | py |
8905bcf22223bb1059416df8059ac05a9646971b | diff --git a/lib/marked.js b/lib/marked.js
index <HASH>..<HASH> 100644
--- a/lib/marked.js
+++ b/lib/marked.js
@@ -16,7 +16,7 @@ var block = {
hr: /^( *[\-*_]){3,} *\n/,
heading: /^ *(#{1,6}) *([^\0]+?) *#* *\n+/,
lheading: /^([^\n]+)\n *(=|-){3,}/,
- blockquote: /^ *>[^\0]+?(?=\n\n| *$)|^ *>[^\n]*(?:\n *>[^\n]*)*/,
+ blockquote: /^(^ *> ?[^\n]+\n([^\n]+\n)*\n*)+/,
list: /^( *)([*+-]|\d+\.) [^\0]+?(?:\n{2,}(?! )|\s*$)(?!\1\2|\1\d+\.)/,
html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,
paragraph: /^([^\n]+\n?(?!body))+\n*/, | more compliant lazy blockquotes. closes #<I>. | remarkjs_remark | train | js |
4585a02118c2f9c919e7885548ff4f3c5dbc4ea7 | diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingController.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingController.java
index <HASH>..<HASH> 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingController.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingController.java
@@ -164,14 +164,6 @@ public class AlternatingController implements CheckpointBarrierBehaviourControll
chooseController(barrier).obsoleteBarrierReceived(channelInfo, barrier);
}
- private void checkActiveController(CheckpointBarrier barrier) {
- if (isAligned(barrier)) {
- checkState(activeController == alignedController);
- } else {
- checkState(activeController == unalignedController);
- }
- }
-
private boolean isAligned(CheckpointBarrier barrier) {
return barrier.getCheckpointOptions().needsAlignment();
} | [refactor][checkpoint] Remove unused method in AlternatingController | apache_flink | train | java |
6360d74323d3d06227b99a1ad40226add1e7c006 | diff --git a/structr-ui/src/main/resources/structr/js/helper.js b/structr-ui/src/main/resources/structr/js/helper.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/helper.js
+++ b/structr-ui/src/main/resources/structr/js/helper.js
@@ -683,8 +683,8 @@ var _Logger = {
if (type) {
return (this.subscriptions.indexOf(type) !== -1 || this.subscriptions.indexOf(type.split('.')[0]) !== -1);
} else {
- console.error("undefined log type!");
- return false;
+ console.error("undefined log type - this should not happen!");
+ return true;
}
}, | dont ignore log messages with unknown log type (might happen for new/unknown websocket commands) | structr_structr | train | js |
9f17c35f2fd46dbf913a8c82c0c989cdb733b496 | diff --git a/app/controllers/cangaroo/endpoint_controller.rb b/app/controllers/cangaroo/endpoint_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/cangaroo/endpoint_controller.rb
+++ b/app/controllers/cangaroo/endpoint_controller.rb
@@ -42,6 +42,10 @@ module Cangaroo
def key
if Rails.configuration.cangaroo.basic_auth
+ if !ActionController::HttpAuthentication::Basic.has_basic_credentials?(request)
+ return nil
+ end
+
user, pass = ActionController::HttpAuthentication::Basic::user_name_and_password(request)
user
else
@@ -51,6 +55,10 @@ module Cangaroo
def token
if Rails.configuration.cangaroo.basic_auth
+ if !ActionController::HttpAuthentication::Basic.has_basic_credentials?(request)
+ return nil
+ end
+
user, pass = ActionController::HttpAuthentication::Basic::user_name_and_password(request)
pass
else | Check if basic auth creds are specified
without this, rails4 will throw a fatal error when attempting to extract username and password | nebulab_cangaroo | train | rb |
5735baaa4a66e08e726a590ae6c660807af63fac | diff --git a/src/Mysql/MysqlDriver.php b/src/Mysql/MysqlDriver.php
index <HASH>..<HASH> 100644
--- a/src/Mysql/MysqlDriver.php
+++ b/src/Mysql/MysqlDriver.php
@@ -479,6 +479,8 @@ class MysqlDriver extends PdoDriver implements UTF8MB4SupportInterface
*/
public function isMariaDb()
{
+ $this->connect();
+
return $this->mariadb;
}
diff --git a/src/Mysqli/MysqliDriver.php b/src/Mysqli/MysqliDriver.php
index <HASH>..<HASH> 100644
--- a/src/Mysqli/MysqliDriver.php
+++ b/src/Mysqli/MysqliDriver.php
@@ -589,6 +589,8 @@ class MysqliDriver extends DatabaseDriver implements UTF8MB4SupportInterface
*/
public function isMariaDb()
{
+ $this->connect();
+
return $this->mariadb;
} | Add connect to isMariaDB functions. | joomla-framework_database | train | php,php |
eb2cbf86238b219b07a76f8f3c786e31df3a8327 | diff --git a/ez_setup.py b/ez_setup.py
index <HASH>..<HASH> 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -31,7 +31,7 @@ try:
except ImportError:
USER_SITE = None
-DEFAULT_VERSION = "3.1"
+DEFAULT_VERSION = "3.0.1"
DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/"
def _python_cmd(*args):
diff --git a/setuptools/version.py b/setuptools/version.py
index <HASH>..<HASH> 100644
--- a/setuptools/version.py
+++ b/setuptools/version.py
@@ -1 +1 @@
-__version__ = '3.1'
+__version__ = '3.0.1' | Bumped to <I> in preparation for next release. | pypa_setuptools | train | py,py |
473074142d9c3bc24d3c1a43c7288216eb829666 | diff --git a/spec/amq/protocol/table_spec.rb b/spec/amq/protocol/table_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/amq/protocol/table_spec.rb
+++ b/spec/amq/protocol/table_spec.rb
@@ -117,7 +117,11 @@ module AMQ
"name" => "AMQP",
"major" => 0,
"minor" => "9",
- "rev" => 1.0
+ "rev" => 1.0,
+ "spec" => {
+ "url" => "http://bit.ly/hw2ELX",
+ "utf8" => "à bientôt"
+ }
},
"true" => true,
"false" => false, | Use non-ASCII characters & even deeper nested hashes in this example | ruby-amqp_amq-protocol | train | rb |
de31285ca52f155826e999fed1a0f27b43a5d32b | diff --git a/example/main.js b/example/main.js
index <HASH>..<HASH> 100644
--- a/example/main.js
+++ b/example/main.js
@@ -16,7 +16,7 @@ document.addEventListener('DOMContentLoaded', function () {
};
if (location.search.match('scroll')) {
- options.minPxPerSec = 20;
+ options.minPxPerSec = 100;
options.scrollParent = true;
} | set larget minPxPerSec for short sample | katspaugh_wavesurfer.js | train | js |
64974fdd5b048baf970844614b4ee58d5490a39c | diff --git a/nodeup/pkg/model/kube_apiserver.go b/nodeup/pkg/model/kube_apiserver.go
index <HASH>..<HASH> 100644
--- a/nodeup/pkg/model/kube_apiserver.go
+++ b/nodeup/pkg/model/kube_apiserver.go
@@ -441,8 +441,8 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) {
func (b *KubeAPIServerBuilder) buildAnnotations() map[string]string {
annotations := make(map[string]string)
- annotations["dns.alpha.kubernetes.io/internal"] = b.Cluster.Spec.MasterInternalName
if b.Cluster.Spec.API != nil && b.Cluster.Spec.API.DNS != nil {
+ annotations["dns.alpha.kubernetes.io/internal"] = b.Cluster.Spec.MasterInternalName
annotations["dns.alpha.kubernetes.io/external"] = b.Cluster.Spec.MasterPublicName
} | GH-<I> Only manage internal DNS zone if configuration has been specified | kubernetes_kops | train | go |
7be9ca18a6cdec525b0eb07544c306e311e37c15 | diff --git a/lib/fibers/transform.js b/lib/fibers/transform.js
index <HASH>..<HASH> 100644
--- a/lib/fibers/transform.js
+++ b/lib/fibers/transform.js
@@ -255,7 +255,8 @@ function transform(source, options) {
// Close up the function
body.map(walk);
- if (options.generators && async) {
+ // we don't need the extra `yield undefined;` for harmony generators because they signal the end with a done flag instead of an exception
+ if (false && options.generators && async) {
// add yield if necessary -- could do a smarter flow analysis but an extra yield won't hurt
var end = this.end - 1;
while (source[end] !== '}') end--;
diff --git a/lib/generators/runtime.js b/lib/generators/runtime.js
index <HASH>..<HASH> 100644
--- a/lib/generators/runtime.js
+++ b/lib/generators/runtime.js
@@ -53,7 +53,7 @@ var globals = require('streamline/lib/globals');
while (g) {
try {
val = err ? g.throw(err) : g.send(val);
- val = val.value;
+ val = val.done ? undefined : val.value;
err = null;
// if we get PENDING, the current call completed with a pending I/O
// resume will be called again when the I/O completes. So just save the context and return here. | issue #<I> - do not generate 'yield undefined' at the end of functions | Sage_streamlinejs | train | js,js |
604be9363edf47840820a1a7285fa232856953c9 | diff --git a/specs/Bag.spec.php b/specs/Bag.spec.php
index <HASH>..<HASH> 100644
--- a/specs/Bag.spec.php
+++ b/specs/Bag.spec.php
@@ -20,6 +20,11 @@ describe("Bag", function() {
expect( (array) $b )->to->equal(array());
});
+ it("can unset non-existing elements", function() {
+ $b = new Bag();
+ unset($b['foo']);
+ });
+
beforeEach(function(){
$this->bag = new Bag( array('x'=>42) );
});
diff --git a/src/Bag.php b/src/Bag.php
index <HASH>..<HASH> 100644
--- a/src/Bag.php
+++ b/src/Bag.php
@@ -28,6 +28,11 @@ class Bag extends \ArrayObject {
return $this->offsetExists($key) ? $this[$key] : $this[$key] = $default;
}
+ /* Allow unset of non-existing offset */
+ function offsetUnset($name) {
+ return $this->offsetExists($name) ? parent::offsetUnset($name) : null;
+ }
+
/* Update multiple argument values using an array (like Python .update())*/
function set($data) {
# Use a loop to retain overall key order | Allow bags to unset non-existing offsets | dirtsimple_imposer | train | php,php |
e936ed651d915d3feba5ce6d0d63febe6a667a5a | diff --git a/liquibase-core/src/main/java/liquibase/database/core/OracleDatabase.java b/liquibase-core/src/main/java/liquibase/database/core/OracleDatabase.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/database/core/OracleDatabase.java
+++ b/liquibase-core/src/main/java/liquibase/database/core/OracleDatabase.java
@@ -60,7 +60,7 @@ public class OracleDatabase extends AbstractJdbcDatabase {
@Override
public void setConnection(DatabaseConnection conn) {
- reservedWords.addAll(Arrays.asList("GROUP", "USER", "SESSION", "PASSWORD", "RESOURCE", "START", "SIZE", "UID", "DESC")); //more reserved words not returned by driver
+ reservedWords.addAll(Arrays.asList("GROUP", "USER", "SESSION", "PASSWORD", "RESOURCE", "START", "SIZE", "UID", "DESC", "ORDER")); //more reserved words not returned by driver
Connection sqlConn = null;
if (!(conn instanceof OfflineConnection)) { | CORE-<I>
ORDER keyword isn't escaped for Oracle | liquibase_liquibase | train | java |
c70601ec666c6ebc19227320d0e2a4920ae11d90 | diff --git a/habu/lib/webid.py b/habu/lib/webid.py
index <HASH>..<HASH> 100644
--- a/habu/lib/webid.py
+++ b/habu/lib/webid.py
@@ -167,12 +167,12 @@ def webid(url, no_cache=False, verbose=False):
logging.info("removing {exlude} because its excluded by {t}".format(exlude=exclude, t=t))
del(tech[t])
- response = []
+ response = {}
for t in sorted(tech):
if 'version' in tech[t]:
- response.append('{app} {version}'.format(app=t, version=version))
+ response[t] = version #version.append('{app} {version}'.format(app=t, version=version))
else:
- response.append('{app}'.format(app=t))
+ response[t] = None #.append('{app}'.format(app=t))
return response
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ with open('README.rst') as f:
setup(
name='habu',
- version='0.0.56',
+ version='0.0.57',
description='Python Network Hacking Toolkit',
long_description=readme,
author='Fabian Martinez Portantier', | response now is a dict with key=tech value=version | portantier_habu | train | py,py |
e81bf0a757e41510f28ae4829c5690004b681a2d | diff --git a/inginious/client/_zeromq_client.py b/inginious/client/_zeromq_client.py
index <HASH>..<HASH> 100644
--- a/inginious/client/_zeromq_client.py
+++ b/inginious/client/_zeromq_client.py
@@ -108,7 +108,9 @@ class BetterParanoidPirateClient(object, metaclass=abc.ABCMeta):
"""
Handle a pong
"""
- self._ping_count = 0
+ # this is done when a packet is received, not need to redo it here
+ # self._ping_count = 0
+ pass
async def _handle_unknown(self, _):
"""
@@ -206,6 +208,7 @@ class BetterParanoidPirateClient(object, metaclass=abc.ABCMeta):
try:
while True:
message = await ZMQUtils.recv(self._socket)
+ self._ping_count = 0 # restart ping count
msg_class = message.__msgtype__
if msg_class in self._handlers_registered:
# If a handler is registered, give the message to it | Improve client resilience when backend is under high load but is still responding | UCL-INGI_INGInious | train | py |
745593e54aee160e5c24cb818b3f665e3fd51b81 | diff --git a/nion/swift/LineGraphCanvasItem.py b/nion/swift/LineGraphCanvasItem.py
index <HASH>..<HASH> 100755
--- a/nion/swift/LineGraphCanvasItem.py
+++ b/nion/swift/LineGraphCanvasItem.py
@@ -376,9 +376,10 @@ def draw_line_graph(drawing_context, plot_height, plot_width, plot_origin_y, plo
drawing_context.begin_path()
if calibrated_data_range != 0.0 and uncalibrated_width > 0.0:
if data_style == "log":
- baseline = plot_origin_y + plot_height - (plot_height * float(numpy.amin(calibrated_xdata.data) - calibrated_data_min) / calibrated_data_range)
+ baseline = plot_origin_y + plot_height
else:
baseline = plot_origin_y + plot_height - (plot_height * float(0.0 - calibrated_data_min) / calibrated_data_range)
+
baseline = min(plot_origin_y + plot_height, baseline)
baseline = max(plot_origin_y, baseline)
# rebin so that uncalibrated_width corresponds to plot width | Always use x-axis as baseline for log-plots (consistent with other plotting software). Fixes #<I>. | nion-software_nionswift | train | py |
4141efd154be1edd3ad2349869504a4ee7292f53 | diff --git a/armor.go b/armor.go
index <HASH>..<HASH> 100644
--- a/armor.go
+++ b/armor.go
@@ -83,7 +83,7 @@ func (s *armorEncoderStream) Close() (err error) {
pad = " "
}
}
- if _, err := fmt.Fprintf(s.encoded, "%s%c\n\n%s%c\n", pad, s.params.Punctuation, s.footer, s.params.Punctuation); err != nil {
+ if _, err := fmt.Fprintf(s.encoded, "%s%c %s%c\n", pad, s.params.Punctuation, s.footer, s.params.Punctuation); err != nil {
return err
}
return nil
@@ -105,7 +105,7 @@ func NewArmorEncoderStream(encoded io.Writer, header string, footer string, para
params: params,
}
ret.encoder = basex.NewEncoder(params.Encoding, ret.buf)
- if _, err := fmt.Fprintf(encoded, "%s%c\n\n", header, params.Punctuation); err != nil {
+ if _, err := fmt.Fprintf(encoded, "%s%c ", header, params.Punctuation); err != nil {
return nil, err
}
return ret, nil | make the armor header and footer inline | keybase_saltpack | train | go |
03812bb1e7ec6af384976bc4a9fb22f054dece89 | diff --git a/plugin/rewrite/reverter.go b/plugin/rewrite/reverter.go
index <HASH>..<HASH> 100644
--- a/plugin/rewrite/reverter.go
+++ b/plugin/rewrite/reverter.go
@@ -36,7 +36,10 @@ func NewResponseReverter(w dns.ResponseWriter, r *dns.Msg) *ResponseReverter {
}
// WriteMsg records the status code and calls the underlying ResponseWriter's WriteMsg method.
-func (r *ResponseReverter) WriteMsg(res *dns.Msg) error {
+func (r *ResponseReverter) WriteMsg(res1 *dns.Msg) error {
+ // Deep copy 'res' as to not (e.g). rewrite a message that's also stored in the cache.
+ res := res1.Copy()
+
res.Question[0] = r.originalQuestion
if r.ResponseRewrite {
for _, rr := range res.Answer { | plugin/rewrite: copy msg before rewritting (#<I>)
Copy the msg to prevent messing with the (via the pointer) original
created message that may be stored in the cache or anything other data
store. | coredns_coredns | train | go |
ba14c047f85a1c841edb6576772daa6da9c1bfb1 | diff --git a/ui/src/kapacitor/components/ValuesSection.js b/ui/src/kapacitor/components/ValuesSection.js
index <HASH>..<HASH> 100644
--- a/ui/src/kapacitor/components/ValuesSection.js
+++ b/ui/src/kapacitor/components/ValuesSection.js
@@ -12,7 +12,7 @@ import {Tab, TabList, TabPanels, TabPanel, Tabs} from 'shared/components/Tabs'
const TABS = ['Threshold', 'Relative', 'Deadman']
-const handleChooseTrigger = (rule, onChooseTrigger) => {
+const handleChooseTrigger = (rule, onChooseTrigger) => triggerIndex => {
if (TABS[triggerIndex] === rule.trigger) {
return
} | Transform ValuesSection into an SFC | influxdata_influxdb | train | js |
7076e8dcf8ecb14a8a899178673a89c17e9f3fe4 | diff --git a/lib/rack/funky-cache.rb b/lib/rack/funky-cache.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/funky-cache.rb
+++ b/lib/rack/funky-cache.rb
@@ -13,15 +13,11 @@ module Rack
@directory = settings[:directory] || ::File.join(@root, @path) end
def call(env)
- dup._call(env)
- end
-
- def _call(env)
response = @app.call(env)
cache(env, response) if should_cache(env, response)
response
end
-
+
def cache(env, response)
path = Rack::Utils.unescape(env["PATH_INFO"])
@@ -47,9 +43,15 @@ module Rack
end
def should_cache(env, response)
- request = Rack::Request.new(env)
- request.get? && request.query_string.empty? &&
- /text\/html/ =~ response[1]["Content-Type"] && 200 == response[0]
+ unless env_excluded?(env)
+ request = Rack::Request.new(env)
+ request.get? && request.query_string.empty? &&
+ /text\/html/ =~ response[1]["Content-Type"] && 200 == response[0]
+ end
+ end
+
+ def env_excluded?(env)
+ @settings[:exclude] && @settings[:exclude].call(env)
end
end | Dup call is apparently not needed anymore. Add possibility to exclude pages with a proc. For example:
use Rack::FunkyCache, :exclude => proc { |env| env["PATH_INFO"].match(/^\/admin/) } | tuupola_rack-funky-cache | train | rb |
7677fb6d60a2011a3e046b66b699e62cd053aa4f | diff --git a/src/Models/TableMigration.php b/src/Models/TableMigration.php
index <HASH>..<HASH> 100644
--- a/src/Models/TableMigration.php
+++ b/src/Models/TableMigration.php
@@ -517,7 +517,7 @@ class TableMigration implements Countable
$modelNames = [];
foreach (explode('_', $tableName) as $word) {
- $modelNames[] = Inflector::singularize($word);
+ $modelNames[] = ucfirst(Inflector::singularize($word));
} //foreach
$modelName = implode('', $modelNames); | Bug fix 'Model Xxxxxx.php not found' when table contains underscore and consists of two words like order_items -> OrderItems.php ( was Orderitems.php) | b3nl_laravel-mwb-model | train | php |
bc081a03d85a88cc2160ade9256d96d7b84c4caa | diff --git a/api/client/cli.go b/api/client/cli.go
index <HASH>..<HASH> 100644
--- a/api/client/cli.go
+++ b/api/client/cli.go
@@ -23,6 +23,9 @@ var funcMap = template.FuncMap{
}
func (cli *DockerCli) getMethod(name string) (func(...string) error, bool) {
+ if len(name) == 0 {
+ return nil, false
+ }
methodName := "Cmd" + strings.ToUpper(name[:1]) + strings.ToLower(name[1:])
method := reflect.ValueOf(cli).MethodByName(methodName)
if !method.IsValid() { | docker '' causes a golang crash.
This patch fixes the problem.
Docker-DCO-<I>- | moby_moby | train | go |
a605e19ab129dbae030dd4924afda06add2eee62 | diff --git a/atlassian/jira.py b/atlassian/jira.py
index <HASH>..<HASH> 100644
--- a/atlassian/jira.py
+++ b/atlassian/jira.py
@@ -3394,6 +3394,13 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
url = "rest/agile/1.0/{board_id}/backlog".format(board_id=board_id)
return self.get(url)
+ def get_issues_for_board(self, board_id):
+ """
+ :param board_id: int, str
+ """
+ url = "rest/agile/1.0/board/{board_id}/issue".format(board_id=board_id)
+ return self.get(url)
+
def delete_agile_board(self, board_id):
"""
Delete agile board by id | [JIRA] Add a funciton to get issues for board (#<I>) | atlassian-api_atlassian-python-api | train | py |
caaeaf591b4bbbbc07bb3edb8fed4309872a7a87 | diff --git a/redisson/src/main/java/org/redisson/RedissonLock.java b/redisson/src/main/java/org/redisson/RedissonLock.java
index <HASH>..<HASH> 100644
--- a/redisson/src/main/java/org/redisson/RedissonLock.java
+++ b/redisson/src/main/java/org/redisson/RedissonLock.java
@@ -284,8 +284,10 @@ public class RedissonLock extends RedissonExpirable implements RLock {
return;
}
- // reschedule itself
- renewExpiration();
+ if (res) {
+ // reschedule itself
+ renewExpiration();
+ }
});
}
}, internalLockLeaseTime / 3, TimeUnit.MILLISECONDS); | Fixed - Redisson tries to renewed Lock expiration even if lock doesn't exist. Regression since <I> version #<I> | redisson_redisson | train | java |
eaaf3e49f774ccfb0ac9f5179fb917824e069561 | diff --git a/spec/spec_fixtures.rb b/spec/spec_fixtures.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_fixtures.rb
+++ b/spec/spec_fixtures.rb
@@ -7,7 +7,7 @@ module IniParse
if @@fixtures.has_key?(fix)
@@fixtures[fix]
else
- File.read(Pathname(__FILE__).dirname.expand_path / 'fixtures' / fix)
+ @@fixtures[fix] = File.read(Pathname(__FILE__).dirname.expand_path / 'fixtures' / fix)
end
end | Only hit the disk once when repeatedly loading a file-based fixture. | antw_iniparse | train | rb |
00059d621c147b3d69f2b86ea26195f762d74b08 | diff --git a/lang/fr/quiz.php b/lang/fr/quiz.php
index <HASH>..<HASH> 100644
--- a/lang/fr/quiz.php
+++ b/lang/fr/quiz.php
@@ -128,7 +128,7 @@ $string['editingrqp'] = '$a : modification d\'une question';
$string['editingshortanswer'] = 'Modifier une question � r�ponse courte';
$string['editingtruefalse'] = 'Modifier une question Vrai/Faux';
$string['editquestions'] = 'Modifier les questions';
-$string['editquiz'] = 'Modifier le test';
+$string['editquiz'] = 'Modifier les questions';
$string['errormissingquestion'] = 'Erreur ! Le syst�me ne trouve pas la question d\'identifiant $a';
$string['errornotnumbers'] = 'Erreur ! Les r�ponses doivent �tre num�riques';
$string['errorsdetected'] = '$a erreur(s) d�tect�e(s)'; | Small correction, suggested by Joseph R�zeau | moodle_moodle | train | php |
46bc47921895ca5bf31496076328d42a2e01893f | diff --git a/tests/test_plot.py b/tests/test_plot.py
index <HASH>..<HASH> 100644
--- a/tests/test_plot.py
+++ b/tests/test_plot.py
@@ -1,3 +1,5 @@
+from more_itertools.recipes import flatten
+
from svg.charts.plot import Plot
@@ -56,3 +58,27 @@ class TestPlot:
assert b'Sam' in svg
assert b'Dan' in svg
+ @staticmethod
+ def get_data():
+ yield (1, 0)
+ yield (2, 1)
+
+ def test_iterable_data_grouped(self):
+ g = Plot()
+ spec = dict(
+ data=self.get_data(),
+ title='labels',
+ )
+ g.add_data(spec)
+ svg = g.burn()
+ assert b'text="(1.00, 0.00)"' in svg
+
+ def test_iterable_data_flat(self):
+ g = Plot()
+ spec = dict(
+ data=flatten(self.get_data()),
+ title='labels',
+ )
+ g.add_data(spec)
+ svg = g.burn()
+ assert b'text="(1.00, 0.00)"' in svg | Add tests capturing failures with iterable data. Ref #<I>. | jaraco_svg.charts | train | py |
1e48e140ae1c7d0709f73a035861e2d7626d270f | diff --git a/src/toil/cwl/cwltoil.py b/src/toil/cwl/cwltoil.py
index <HASH>..<HASH> 100755
--- a/src/toil/cwl/cwltoil.py
+++ b/src/toil/cwl/cwltoil.py
@@ -30,7 +30,7 @@ import logging
import copy
import functools
import shutil
-from typing import Text, Mapping, MutableSequence
+from typing import Text, Mapping, MutableSequence, MutableMapping
import hashlib
import uuid
import datetime
@@ -1384,6 +1384,20 @@ def main(args=None, stdout=sys.stdout):
if runtime_context.research_obj is not None:
runtime_context.research_obj.create_job(outobj, None, True)
+
+ def remove_at_id(doc):
+ if isinstance(doc, MutableMapping):
+ for key in list(doc.keys()):
+ if key == '@id':
+ del doc[key]
+ else:
+ value = doc[key]
+ if isinstance(value, MutableMapping):
+ remove_at_id(value)
+ if isinstance(value, MutableSequence):
+ for entry in value:
+ remove_at_id(entry)
+ remove_at_id(outobj)
prov_dependencies = cwltool.main.prov_deps(workflowobj, document_loader, uri)
runtime_context.research_obj.generate_snapshot(prov_dependencies)
runtime_context.research_obj.close(options.provenance) | Added fix to remove @id values from job output dicts | DataBiosphere_toil | train | py |
4134e106685273a3b177943e01e9350882979111 | diff --git a/Kwc/Advanced/VideoPlayer/Component.js b/Kwc/Advanced/VideoPlayer/Component.js
index <HASH>..<HASH> 100644
--- a/Kwc/Advanced/VideoPlayer/Component.js
+++ b/Kwc/Advanced/VideoPlayer/Component.js
@@ -1,5 +1,7 @@
Kwf.onElementReady('.kwcAdvancedVideoPlayer', function(el, config) {
$(el.dom).children('video').mediaelementplayer({
+ //custom path to flash
+ flashName: '/assets/mediaelement/build/flashmediaelement.swf',
// if the <video width> is not specified, this is the default
defaultVideoWidth: config.defaultVideoWidth,
// if the <video height> is not specified, this is the default | fixed the path to the swf file, for the flash fallback (e.g. ie8) | koala-framework_koala-framework | train | js |
ce75f9d1046dd73a19c32d6410678d204cf0e12e | diff --git a/tests/Components/CheckBoxDesignTest.php b/tests/Components/CheckBoxDesignTest.php
index <HASH>..<HASH> 100644
--- a/tests/Components/CheckBoxDesignTest.php
+++ b/tests/Components/CheckBoxDesignTest.php
@@ -84,6 +84,8 @@ class CheckBoxDesignTest extends \PHPUnit_Framework_TestCase
$this->assertNull($quad->getImageUrl());
}
+ /*
+ * TODO: 'fix' this test which is failing on travis-ci for no reason
public function testApplyToQuadWithImageUrl()
{
$checkBoxDesign = new CheckBoxDesign("quad.image.url");
@@ -95,6 +97,7 @@ class CheckBoxDesignTest extends \PHPUnit_Framework_TestCase
$this->assertNull($quad->getSubStyle());
$this->assertEquals($quad->getImageUrl(), "quad.image.url");
}
+ */
public function testDesignStringWithStyles()
{ | commented out unit test that fails on travis CI for no reason | steeffeen_FancyManiaLinks | train | php |
d23ca0098c0ef28b79e4833fcf6ed85fae2aa11a | diff --git a/command/build_ext.py b/command/build_ext.py
index <HASH>..<HASH> 100644
--- a/command/build_ext.py
+++ b/command/build_ext.py
@@ -177,6 +177,21 @@ class build_ext (Command):
# building python standard extensions
self.library_dirs.append('.')
+ # The argument parsing will result in self.define being a string, but
+ # it has to be a list of 2-tuples. All the preprocessor symbols
+ # specified by the 'define' option will be set to '1'. Multiple
+ # symbols can be separated with commas.
+
+ if self.define:
+ defines = string.split(self.define, ',')
+ self.define = map(lambda symbol: (symbol, '1'), defines)
+
+ # The option for macros to undefine is also a string from the
+ # option parsing, but has to be a list. Multiple symbols can also
+ # be separated with commas here.
+ if self.undef:
+ self.undef = string.split(self.undef, ',')
+
# finalize_options () | Fix bug #<I>: the --define and --undef options didn't work, whether
specified on the command-line or in setup.cfg. The option processing
leaves them as strings, but they're supposed to be lists. | pypa_setuptools | train | py |
99497202fd877bf8005d374b26f9e4027c30c498 | diff --git a/packages/cqmd/src/index.js b/packages/cqmd/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/cqmd/src/index.js
+++ b/packages/cqmd/src/index.js
@@ -37,7 +37,8 @@ export default async function cqmd(text, opts={}) {
let fullFilename = path.join(opts.path, actualName);
let contents = fs.readFileSync(fullFilename).toString();
- let cqResults = cq(contents, blockOpts['crop-query']); // TODO
+
+ let cqResults = await cq(contents, blockOpts['crop-query']); // TODO
let replacement;
if(typeof format === "function") { | fixes cqmd to handle the promises | fullstackio_cq | train | js |
e6fadccc23a1516d47f8b89bdbec4ba348d44672 | diff --git a/tests/features/bootstrap/FeatureContext.php b/tests/features/bootstrap/FeatureContext.php
index <HASH>..<HASH> 100644
--- a/tests/features/bootstrap/FeatureContext.php
+++ b/tests/features/bootstrap/FeatureContext.php
@@ -76,7 +76,7 @@ class FeatureContext extends RawDrupalContext implements SnippetAcceptingContext
}
/**
- * Creates a menu item with specified name in the specified menu
+ * Creates a menu item with specified name in the specified menu.
*
* @Given /^I create an item "([^"]*)" in the "([^"]*)" menu$/
*/ | Added a dot to fix sniffer | ymcatwincities_openy | train | php |
080618f7328ce998739b17853657f37312191c1b | diff --git a/src/core/Mesh.js b/src/core/Mesh.js
index <HASH>..<HASH> 100644
--- a/src/core/Mesh.js
+++ b/src/core/Mesh.js
@@ -3,7 +3,7 @@ import { Mesh as ThreeMesh } from 'three'
import Node from './Node'
import { props, mapPropTo } from './props'
-// register behaviors that can be used with this class.
+// register behaviors that can be used on this element
// TODO: maybe useDefaultNames() should register these, otherwise the user can
// choose names for better flexibility. See TODO NAMING below.
import '../html/behaviors/BasicMaterialBehavior'
diff --git a/src/html/behaviors/BaseMaterialBehavior.js b/src/html/behaviors/BaseMaterialBehavior.js
index <HASH>..<HASH> 100644
--- a/src/html/behaviors/BaseMaterialBehavior.js
+++ b/src/html/behaviors/BaseMaterialBehavior.js
@@ -2,9 +2,6 @@ import Class from 'lowclass'
import BaseMeshBehavior from './BaseMeshBehavior'
import { props } from '../../core/props'
-import * as THREE from 'three'
-window.THREE = THREE
-
// base class for geometry behaviors
export default
Class( 'BaseMaterialBehavior' ).extends( BaseMeshBehavior, ({ Super }) => ({ | remove THREE from global (we don't need it global just yet, but we will soon and will do it in a better way) | trusktr_infamous | train | js,js |
73d8c2b190648d1c897c38bf8462058f66f368b9 | diff --git a/opfutils/src/main/java/org/onepf/opfutils/OPFPreferences.java b/opfutils/src/main/java/org/onepf/opfutils/OPFPreferences.java
index <HASH>..<HASH> 100644
--- a/opfutils/src/main/java/org/onepf/opfutils/OPFPreferences.java
+++ b/opfutils/src/main/java/org/onepf/opfutils/OPFPreferences.java
@@ -142,7 +142,7 @@ public class OPFPreferences {
}
public OPFPreferences(@NonNull final Context context, @Nullable String postfix) {
- this(context, postfix, Context.MODE_PRIVATE);
+ this(context, postfix, Context.MODE_MULTI_PROCESS);
}
public OPFPreferences(@NonNull final Context context, final int mode) { | Use MODE_MULTI_PROCESS as default mode for preferences. | onepf_OPFUtils | train | java |
ffd62759207cfb535e1905bf8da2adc0d008ed30 | diff --git a/Swat/SwatCellRendererContainer.php b/Swat/SwatCellRendererContainer.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatCellRendererContainer.php
+++ b/Swat/SwatCellRendererContainer.php
@@ -102,7 +102,8 @@ abstract class SwatCellRendererContainer extends SwatUIObject implements
public function getRenderers()
{
$out = array();
- foreach ($this->renderers as $renderer)
+ $renderers = clone $this->renderers;
+ foreach ($renderers as $renderer)
$out[] = $renderer;
return $out; | Clone before iterating to avoid breaking other iterations currently in-progress.
svn commit r<I> | silverorange_swat | train | php |
14ab09900caac2c6bb41df8433e5b6a1e08e09dd | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,6 @@
##
from sys import version_info
-from warnings import warn
try:
from setuptools import setup
@@ -32,7 +31,6 @@ install_requires = [
tests_require = None
if version_info[0] == 2:
- warn("For SNI support, please install the following from PyPI: 'ndg-httpsclient', 'pyopenssl', 'pyasn1'")
tests_require = [
"mock",
] | Remove SNI warning as SNI support has been backported to <I>
closes #<I> | xray7224_PyPump | train | py |
dbcff453fb859a028aafdddecaef11de48f630a8 | diff --git a/Tests/Auth/OpenID/Consumer.php b/Tests/Auth/OpenID/Consumer.php
index <HASH>..<HASH> 100644
--- a/Tests/Auth/OpenID/Consumer.php
+++ b/Tests/Auth/OpenID/Consumer.php
@@ -203,10 +203,9 @@ class Tests_Auth_OpenID_Consumer extends PHPUnit_TestCase {
$query['openid.sig'] = 'fake';
}
- list($status, $info) = $consumer->completeAuth($info->token, $query);
+ $result = $consumer->completeAuth($info->token, $query);
- $this->assertEquals(Auth_OpenID_SUCCESS, $status);
- $this->assertEquals($info, $user_url);
+ $this->assertEquals(array(Auth_OpenID_SUCCESS, $user_url), $result);
}
function _test_success($user_url, $delegate_url, $links, $immediate = false) | [project @ Reduce number of assertions] | openid_php-openid | train | php |
d3a9ce5afc46ff45adb63f6f06856fa6a29f865c | diff --git a/superset-frontend/src/explore/exploreUtils.js b/superset-frontend/src/explore/exploreUtils.js
index <HASH>..<HASH> 100644
--- a/superset-frontend/src/explore/exploreUtils.js
+++ b/superset-frontend/src/explore/exploreUtils.js
@@ -198,7 +198,12 @@ export const shouldUseLegacyApi = formData => {
return useLegacyApi || false;
};
-export const buildV1ChartDataPayload = ({ formData, force }) => {
+export const buildV1ChartDataPayload = ({
+ formData,
+ force,
+ resultFormat,
+ resultType,
+}) => {
const buildQuery =
getChartBuildQueryRegistry().get(formData.viz_type) ??
(buildQueryformData =>
@@ -210,6 +215,8 @@ export const buildV1ChartDataPayload = ({ formData, force }) => {
return buildQuery({
...formData,
force,
+ result_format: resultFormat,
+ result_type: resultType,
});
};
@@ -260,13 +267,12 @@ export const exportChart = ({
payload = formData;
} else {
url = '/api/v1/chart/data';
- const buildQuery = getChartBuildQueryRegistry().get(formData.viz_type);
- payload = buildQuery({
- ...formData,
+ payload = buildV1ChartDataPayload({
+ formData,
force,
+ resultFormat,
+ resultType,
});
- payload.result_type = resultType;
- payload.result_format = resultFormat;
}
postForm(url, payload);
}; | fix: chart export fails when buildQuery not present (#<I>) | apache_incubator-superset | train | js |
aa8943cd31100837ef276331609a240075c235fa | diff --git a/code/libraries/koowa/controller/view.php b/code/libraries/koowa/controller/view.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/controller/view.php
+++ b/code/libraries/koowa/controller/view.php
@@ -282,6 +282,7 @@ abstract class KControllerView extends KControllerBread
} else $row = $this->execute('add', $context);
+ //Create the redirect
$this->_redirect = KRequest::get('session.com.dispatcher.referrer', 'url');
return $row;
}
@@ -308,8 +309,10 @@ abstract class KControllerView extends KControllerBread
}
}
else $row = $this->execute('add', $context);
-
- $this->_redirect = 'view='.$this->_identifier->name.'&id='.$row->id;
+
+ //Create the redirect
+ $this->_redirect = KRequest::url();
+
return $row;
}
@@ -328,6 +331,7 @@ abstract class KControllerView extends KControllerBread
$row->unlock();
}
+ //Create the redirect
$this->_redirect = KRequest::get('session.com.dispatcher.referrer', 'url');
return $row;
} | Apply action should redirect to the request URL. This also solve the problem that the layout information dissapears from the URL after an apply RAP. | joomlatools_joomlatools-framework | train | php |
1fc125a954c9de0aa095083474f20c19d0cd59b6 | diff --git a/pmag_menu_dialogs.py b/pmag_menu_dialogs.py
index <HASH>..<HASH> 100755
--- a/pmag_menu_dialogs.py
+++ b/pmag_menu_dialogs.py
@@ -1984,6 +1984,7 @@ class PlotFrame(wx.Frame):
def on_save(self, event):
plt.savefig(self.figname)
+ plt.clf() # clear figure
dir_path, figname = os.path.split(self.figname)
if not dir_path:
dir_path = os.getcwd()
@@ -1996,6 +1997,7 @@ class PlotFrame(wx.Frame):
dlg = wx.MessageDialog(self, "Are you sure you want to delete this plot?", "Not so fast", style=wx.YES_NO|wx.NO_DEFAULT|wx.ICON_EXCLAMATION)
response = dlg.ShowModal()
if response == wx.ID_YES:
+ plt.clf() # clear figure
dlg.Destroy()
self.Destroy() | add clf() to PlotFrame to make sure each plot is unique | PmagPy_PmagPy | train | py |
8a46ef083380f481f15f46f7b53f6af95f4a9025 | diff --git a/tests/test_dates.py b/tests/test_dates.py
index <HASH>..<HASH> 100644
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
@@ -15,6 +15,21 @@ def test_date_rounding():
assert chart.date == '1996-08-03'
+def test_previous_next():
+ """Checks that the date, previousDate, and nextDate attributes are parsed
+ from the HTML, not computed. Specifically, we shouldn't assume charts are
+ always published seven days apart, since (as this example demonstrates)
+ this is not true.
+ """
+ chart = billboard.ChartData('hot-100', date='1962-01-06')
+ assert chart.date == '1962-01-06'
+ assert chart.previousDate == '1961-12-25'
+
+ chart = billboard.ChartData('hot-100', date='1961-12-25')
+ assert chart.date == '1961-12-25'
+ assert chart.nextDate == '1962-01-06'
+
+
def test_datetime_date():
"""Checks that ChartData correctly handles datetime objects as the
date parameter. | Test that date attributes are parsed, not computed
Currently failing. I brought this example up in #<I>. | guoguo12_billboard-charts | train | py |
68da3ff250e238793bd662474e7dc421a4a987f8 | diff --git a/packages/xod-client/src/project/selectors.js b/packages/xod-client/src/project/selectors.js
index <HASH>..<HASH> 100644
--- a/packages/xod-client/src/project/selectors.js
+++ b/packages/xod-client/src/project/selectors.js
@@ -352,6 +352,7 @@ export const getPatchSearchIndex = createSelector(
R.reject(
R.anyPass([
isPatchDeadTerminal,
+ XP.isUtilityPatch,
XP.isDeprecatedPatch,
patchEqualsToCurPatchPath(maybeCurPatchPath),
]) | feat(xod-client): do not show utility patches from suggester | xodio_xod | train | js |
050684450befaac8972120688b69825e8f0acbca | diff --git a/ethrpc/packages.go b/ethrpc/packages.go
index <HASH>..<HASH> 100644
--- a/ethrpc/packages.go
+++ b/ethrpc/packages.go
@@ -4,7 +4,8 @@ import (
"encoding/json"
"errors"
"github.com/ethereum/eth-go/ethpub"
- _ "log"
+ "github.com/ethereum/eth-go/ethutil"
+ "math/big"
)
type EthereumApi struct {
@@ -173,7 +174,10 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *string) error {
return err
}
state := p.ethp.GetStateObject(args.Address)
- value := state.GetStorage(args.Key)
+ // Convert the incoming string (which is a bigint) into hex
+ i, _ := new(big.Int).SetString(args.Key, 10)
+ hx := ethutil.Hex(i.Bytes())
+ value := state.GetStorage(hx)
*reply = NewSuccessRes(GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value})
return nil
} | Assume arguments are supplied as strings to the rpc interface | ethereum_go-ethereum | train | go |
4ef6f1ba145042fa723c133b4758aa27c9b3e745 | diff --git a/src/Libraries/File/File.php b/src/Libraries/File/File.php
index <HASH>..<HASH> 100644
--- a/src/Libraries/File/File.php
+++ b/src/Libraries/File/File.php
@@ -17,8 +17,6 @@ namespace Quantum\Libraries\File;
/**
* File class
*
- * Initialize the database
- *
* @package Quantum
* @subpackage Libraries.File
* @category Libraries
diff --git a/src/Libraries/Validation/Validation.php b/src/Libraries/Validation/Validation.php
index <HASH>..<HASH> 100644
--- a/src/Libraries/Validation/Validation.php
+++ b/src/Libraries/Validation/Validation.php
@@ -19,8 +19,6 @@ use GUMP;
/**
* Validation class
*
- * Initialize the database
- *
* @package Quantum
* @subpackage Libraries.Validation
* @category Libraries | Removing incorrect comments from doc block | softberg_quantum-core | train | php,php |
4e8f1bb153bdd160ed6641925be1d2a45d999a75 | diff --git a/core/src/main/java/org/bitcoinj/core/Block.java b/core/src/main/java/org/bitcoinj/core/Block.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/bitcoinj/core/Block.java
+++ b/core/src/main/java/org/bitcoinj/core/Block.java
@@ -180,7 +180,7 @@ public class Block extends Message {
hash = null;
}
- private void parseHeader() throws ProtocolException {
+ protected void parseHeader() throws ProtocolException {
if (headerParsed)
return;
@@ -198,7 +198,7 @@ public class Block extends Message {
headerBytesValid = parseRetain;
}
- private void parseTransactions() throws ProtocolException {
+ protected void parseTransactions() throws ProtocolException {
if (transactionsParsed)
return;
@@ -561,6 +561,12 @@ public class Block extends Message {
public Block cloneAsHeader() {
maybeParseHeader();
Block block = new Block(params);
+ copyBitcoinHeaderTo(block);
+ return block;
+ }
+
+ /** Copy the block without transactions into the provided empty block. */
+ protected final void copyBitcoinHeaderTo(final Block block) {
block.nonce = nonce;
block.prevBlockHash = prevBlockHash;
block.merkleRoot = getMerkleRoot();
@@ -569,7 +575,6 @@ public class Block extends Message {
block.difficultyTarget = difficultyTarget;
block.transactions = null;
block.hash = getHash();
- return block;
}
/** | Block.parseHeader() and Block.parseTransactions() are now protected, so they can be called from subclasses. | bitcoinj_bitcoinj | train | java |
4441fa13723bba6ddc3b22cb30bbc26c25f24c05 | diff --git a/NavigationReactNative/sample/twitter/Home.js b/NavigationReactNative/sample/twitter/Home.js
index <HASH>..<HASH> 100644
--- a/NavigationReactNative/sample/twitter/Home.js
+++ b/NavigationReactNative/sample/twitter/Home.js
@@ -18,7 +18,6 @@ const styles = StyleSheet.create({
paddingTop: 40,
paddingLeft: 60,
paddingBottom: 20,
- marginBottom: 10,
borderBottomWidth: 2,
borderColor: '#ccd6dd',
},
@@ -28,5 +27,6 @@ const styles = StyleSheet.create({
view: {
paddingLeft: 10,
paddingRight: 10,
+ paddingTop: 10,
},
}); | Removed whitespace gap at top on scroll | grahammendick_navigation | train | js |
e5056e67de1d0bbd6344ef9d135b3a44607e3a27 | diff --git a/lib/active_admin.rb b/lib/active_admin.rb
index <HASH>..<HASH> 100644
--- a/lib/active_admin.rb
+++ b/lib/active_admin.rb
@@ -1,4 +1,6 @@
-require 'active_support/core_ext/class/attribute' # needed for Ransack
+require 'active_support/core_ext'
+require 'set'
+
require 'ransack'
require 'ransack_ext'
require 'bourbon' | clearly require dependencies
activerecord-hackery/ransack#<I> | activeadmin_activeadmin | train | rb |
3050a471ad1dd26222756ae969f535a116d41b41 | diff --git a/nodes/api_current-state/api_current-state.js b/nodes/api_current-state/api_current-state.js
index <HASH>..<HASH> 100644
--- a/nodes/api_current-state/api_current-state.js
+++ b/nodes/api_current-state/api_current-state.js
@@ -59,7 +59,8 @@ module.exports = function(RED) {
} else {
RED.util.setMessageProperty(message, this.nodeConfig.property, currentState);
}
-
+ var prettyDate = new Date().toLocaleDateString("en-US",{month: 'short', day: 'numeric', hour12: false, hour: 'numeric', minute: 'numeric'});
+ this.status({fill:"green",shape:"dot",text:`${currentState.state} at: ${prettyDate}`});
this.node.send(message);
}
} | re-add success status to api-call-service | zachowj_node-red-contrib-home-assistant-websocket | train | js |
377d358cc60afbb7cda19db327b6efa65ca76f03 | diff --git a/src/PHPUnit/PHPMatcherConstraint.php b/src/PHPUnit/PHPMatcherConstraint.php
index <HASH>..<HASH> 100644
--- a/src/PHPUnit/PHPMatcherConstraint.php
+++ b/src/PHPUnit/PHPMatcherConstraint.php
@@ -16,7 +16,9 @@ final class PHPMatcherConstraint extends Constraint
public function __construct(string $pattern)
{
- parent::__construct();
+ if (\method_exists(Constraint::class, '__construct')) {
+ parent::__construct();
+ }
$this->pattern = $pattern;
$this->matcher = $this->createMatcher(); | Fix PHPUnit 8 BC break by conditionally call Constraint constructor (#<I>) | coduo_php-matcher | train | php |
f4ea03d2fb1e046a16a4bcb8e59b9451ee152d5b | diff --git a/lib/resque/worker.rb b/lib/resque/worker.rb
index <HASH>..<HASH> 100644
--- a/lib/resque/worker.rb
+++ b/lib/resque/worker.rb
@@ -16,6 +16,12 @@ module Resque
WORKER_HEARTBEAT_KEY = "workers:heartbeat"
+ @@all_heartbeat_threads = []
+ def self.kill_all_heartbeat_threads
+ @@all_heartbeat_threads.each(&:kill)
+ @@all_heartbeat_threads = []
+ end
+
def redis
Resque.redis
end
@@ -527,6 +533,8 @@ module Resque
heartbeat!
end
end
+
+ @@all_heartbeat_threads << @heart
end
# Kills the forked child immediately with minimal remorse. The job it
diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -46,7 +46,6 @@ MiniTest::Unit.after_tests do
end
module MiniTest::Unit::LifecycleHooks
-
def before_setup
reset_logger
Resque.redis.flushall
@@ -55,6 +54,9 @@ module MiniTest::Unit::LifecycleHooks
Resque.after_fork = nil
end
+ def after_teardown
+ Resque::Worker.kill_all_heartbeat_threads
+ end
end
if ENV.key? 'RESQUE_DISTRIBUTED' | Kill all heartbeat threads after each test run | resque_resque | train | rb,rb |
82dc8168af0c171ce28663ef7ab951f699c4856f | diff --git a/celeryconfig.py b/celeryconfig.py
index <HASH>..<HASH> 100644
--- a/celeryconfig.py
+++ b/celeryconfig.py
@@ -89,3 +89,8 @@ CELERY_IMPORTS = get_core_modules(engine) + [
]
os.environ["DJANGO_SETTINGS_MODULE"] = "openquake.engine.settings"
+
+try:
+ from openquake.engine.utils import tasks
+except ImportError: # circular import with celery 2, only affecting nose
+ pass | Fixed a bug affecting celery 2 only when nose is used to run the tests
Former-commit-id: <I>ce<I>fb<I>b<I>be3f3df<I>d<I>ac1e5 | gem_oq-engine | train | py |
55bf95102828fa0f209ce4594cd0ef6f0db1098f | diff --git a/test/13-integration-tests.js b/test/13-integration-tests.js
index <HASH>..<HASH> 100644
--- a/test/13-integration-tests.js
+++ b/test/13-integration-tests.js
@@ -1186,7 +1186,9 @@ describe('Integration tests', () => {
err.message.indexOf('You do not have permission to publish') > -1 ||
err.message.indexOf('auth required for publishing') > -1 ||
err.message.indexOf('operation not permitted') > -1 ||
- err.message.indexOf('You must be logged in to publish packages') > -1
+ err.message.indexOf('You must be logged in to publish packages') > -1 ||
+ //https://github.com/npm/cli/issues/1637
+ err.message.indexOf('npm ERR! 404 Not Found - PUT https://registry.npmjs.org/testing-repo - Not found') > -1
);
})); | fix 'Should allow publishing with special flag' | inikulin_publish-please | train | js |
c807d83b9aaea188355f1a64b4df96b53870ade4 | diff --git a/src/textlint-rule-no-nfd.js b/src/textlint-rule-no-nfd.js
index <HASH>..<HASH> 100644
--- a/src/textlint-rule-no-nfd.js
+++ b/src/textlint-rule-no-nfd.js
@@ -13,6 +13,9 @@ function reporter(context) {
}
const text = getSource(node);
matchCaptureGroupAll(text, /([\u309b\u309c\u309a\u3099])/g).forEach(({index}) => {
+ if (index === 0) {
+ return;
+ }
// \u309b\u309c => \u309a\u3099
const dakutenChars = text.slice(index - 1, index + 1);
const nfdlized = dakutenChars.replace("\u309B", "\u3099").replace("\u309C", "\u309A") | fix(rule): avoid -index | azu_textlint-rule-no-nfd | train | js |
e538361b9a351a2840f2e4b8e341ef983af41ce2 | diff --git a/lib/type.js b/lib/type.js
index <HASH>..<HASH> 100644
--- a/lib/type.js
+++ b/lib/type.js
@@ -114,7 +114,11 @@ function Type (type) {
if ('CString' == type.name) {
rtn = type.ffi_type = bindings.FFI_TYPES.pointer
} else {
- rtn = type.ffi_type = bindings.FFI_TYPES[type.name]
+ var cur = type
+ while (!rtn && cur) {
+ rtn = cur.ffi_type = bindings.FFI_TYPES[cur.name]
+ cur = Object.getPrototypeOf(cur)
+ }
}
}
diff --git a/test/types.js b/test/types.js
index <HASH>..<HASH> 100644
--- a/test/types.js
+++ b/test/types.js
@@ -33,6 +33,15 @@ describe('types', function () {
assert(Buffer.isBuffer(ffi_type))
})
+ it('should match a valid `ffi_type` for `ulong` without a cached value', function () {
+ // simulate a ref type without a "ffi_type" property set
+ var type = Object.create(ref.types.ulong)
+ type.ffi_type = undefined
+
+ var ffi_type = ffi.ffiType(type)
+ assert(Buffer.isBuffer(ffi_type))
+ })
+
})
}) | type: recurse up the prototype chain to type to find the `ffi_type` to use
Makes the "long" and "ulong" types work. | node-ffi-napi_node-ffi-napi | train | js,js |
cffa9c88c0a6296bf2197808ade18c9f74d9b77f | diff --git a/hotdoc/core/tree.py b/hotdoc/core/tree.py
index <HASH>..<HASH> 100644
--- a/hotdoc/core/tree.py
+++ b/hotdoc/core/tree.py
@@ -87,8 +87,8 @@ Logger.register_warning_code('markdown-bad-link', HotdocSourceException)
class Page:
"Banana banana"
meta_schema = {Optional('title'): And(str, len),
- Optional('short-description'): And(str, len),
- Optional('description'): And(str, len),
+ Optional('short-description'): And(str),
+ Optional('description'): And(str),
Optional('render-subpages'): bool,
Optional('auto-sort'): bool,
Optional('full-width'): bool, | We should not force short-description and description to be none empty | hotdoc_hotdoc | train | py |
dca5582062c10f22281f37960823c3d936cf75af | diff --git a/mama_cas/mixins.py b/mama_cas/mixins.py
index <HASH>..<HASH> 100644
--- a/mama_cas/mixins.py
+++ b/mama_cas/mixins.py
@@ -12,7 +12,7 @@ from django.views.decorators.cache import never_cache
from mama_cas.models import ServiceTicket
from mama_cas.models import ProxyTicket
from mama_cas.models import ProxyGrantingTicket
-from mama_cas.exceptions import InvalidTicket
+from mama_cas.exceptions import InvalidTicketSpec
from mama_cas.exceptions import ValidationError
from mama_cas.utils import get_callable
@@ -67,8 +67,8 @@ class ValidateTicketMixin(object):
logger.debug("Service validation request received for %s" % ticket)
# Check for proxy tickets passed to /serviceValidate
if ticket and ticket.startswith(ProxyTicket.TICKET_PREFIX):
- e = InvalidTicket('Proxy tickets cannot be validated'
- ' with /serviceValidate')
+ e = InvalidTicketSpec('Proxy tickets cannot be validated'
+ ' with /serviceValidate')
logger.warning("%s %s" % (e.code, e))
return None, None, e | Use more specific error for wrong ticket type | jbittel_django-mama-cas | train | py |
0866dfa1dd7f1eb0ef72e703959046b3750789f3 | diff --git a/pyrogram/connection/transport/tcp/__init__.py b/pyrogram/connection/transport/tcp/__init__.py
index <HASH>..<HASH> 100644
--- a/pyrogram/connection/transport/tcp/__init__.py
+++ b/pyrogram/connection/transport/tcp/__init__.py
@@ -17,5 +17,6 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .tcp_abridged import TCPAbridged
+from .tcp_abridged_o import TCPAbridgedO
from .tcp_full import TCPFull
from .tcp_intermediate import TCPIntermediate | Make TCPAbridgedO importable | pyrogram_pyrogram | train | py |
d5485cd4be1dfe7e0239231ffecf01d62db02535 | diff --git a/src/User/UserIdentityDetails.php b/src/User/UserIdentityDetails.php
index <HASH>..<HASH> 100644
--- a/src/User/UserIdentityDetails.php
+++ b/src/User/UserIdentityDetails.php
@@ -64,7 +64,7 @@ class UserIdentityDetails implements \JsonSerializable
/**
* @return array
*/
- function jsonSerialize()
+ public function jsonSerialize()
{
return [
'uuid' => $this->userId->toNative(), | III-<I> Fixed coding standards. | cultuurnet_udb3-php | train | php |
f714250daa67efce08b5a7320e28ca1368eaba06 | diff --git a/tests/test_pygdk3.py b/tests/test_pygdk3.py
index <HASH>..<HASH> 100644
--- a/tests/test_pygdk3.py
+++ b/tests/test_pygdk3.py
@@ -1,14 +1,18 @@
+from pyscreenshot.util import use_x_display
+
from ref import backend_to_check, check_import
ok = False
if check_import("gi"):
- import gi
- # Arch: AttributeError: module 'gi' has no attribute 'require_version'
- try:
- gi.require_version
- ok = True
- except AttributeError:
- pass
+ if use_x_display():
+ import gi
+
+ # Arch: AttributeError: module 'gi' has no attribute 'require_version'
+ try:
+ gi.require_version
+ ok = True
+ except AttributeError:
+ pass
if ok:
def test_pygdk3(): | test: check gdk3 import | ponty_pyscreenshot | train | py |
6a28ba076fafec2105ca225a0e2d88a5c0a48221 | diff --git a/src/pylast/__init__.py b/src/pylast/__init__.py
index <HASH>..<HASH> 100644
--- a/src/pylast/__init__.py
+++ b/src/pylast/__init__.py
@@ -932,7 +932,15 @@ class _Request:
raise NetworkError(self.network, e)
try:
- response_text = _unicode(conn.getresponse().read())
+ response = conn.getresponse()
+ if response.status in [500, 502, 503, 504]:
+ raise WSError(
+ self.network,
+ response.status,
+ "Connection to the API failed with HTTP code "
+ + str(response.status),
+ )
+ response_text = _unicode(response.read())
except Exception as e:
raise MalformedResponseError(self.network, e) | Improve handling of error responses from the API | pylast_pylast | train | py |
527082ca27701634e2ad727e4a51cba057ea7803 | diff --git a/tests/Feature/UIWithCustomAssetConfigurationTest.php b/tests/Feature/UIWithCustomAssetConfigurationTest.php
index <HASH>..<HASH> 100644
--- a/tests/Feature/UIWithCustomAssetConfigurationTest.php
+++ b/tests/Feature/UIWithCustomAssetConfigurationTest.php
@@ -18,7 +18,7 @@ class UIWithCustomAssetConfigurationTest extends TestCase
$valuesInOrder = ['<head>', asset('/headerscript.js'), '</head>'];
if (method_exists($response, 'assertSeeInOrder')) {
- $response->assertSeeInOrder($valuesInOrder);
+ $response->assertSeeInOrder($valuesInOrder, false);
} else {
$this->assertThat($valuesInOrder, new SeeInOrder($response->getContent()));
}
@@ -35,7 +35,7 @@ class UIWithCustomAssetConfigurationTest extends TestCase
$valuesInOrder = ['</head>', asset('/footerstyle.css'), '</body>'];
if (method_exists($response, 'assertSeeInOrder')) {
- $response->assertSeeInOrder($valuesInOrder);
+ $response->assertSeeInOrder($valuesInOrder, false);
} else {
$this->assertThat($valuesInOrder, new SeeInOrder($response->getContent()));
} | Fixed L7 `assertSee` test compatibility (prevent from unwanted escape) | artkonekt_appshell | train | php |
4f81ddabfff902853e668e278f1d44b96c8b8c4c | diff --git a/modules/ViewDataTable.php b/modules/ViewDataTable.php
index <HASH>..<HASH> 100644
--- a/modules/ViewDataTable.php
+++ b/modules/ViewDataTable.php
@@ -214,13 +214,13 @@ abstract class Piwik_ViewDataTable
protected function getUniqIdTable()
{
-
+ $uniqIdTable = '';
// if we request a subDataTable the $this->currentControllerAction DIV ID is already there in the page
// we make the DIV ID really unique by appending the ID of the subtable requested
- if( $this->idSubtable !== false
- && $this->idSubtable != 0)
+ if( $this->idSubtable != false)
{
- $uniqIdTable .= 'subTable_' . $this->idSubtable;
+ // see also datatable.js (the ID has to match with the html ID created to be replaced by the result of the ajax call)
+ $uniqIdTable = 'subDataTable_' . $this->idSubtable;
}
else
{ | - fixing bug recently introduced, tables were not ajaxified anymore
git-svn-id: <URL> | matomo-org_matomo | train | php |
313a3fcd83f0f35fced405db9b1442fb4938b1cf | diff --git a/site/assets/js/app.js b/site/assets/js/app.js
index <HASH>..<HASH> 100644
--- a/site/assets/js/app.js
+++ b/site/assets/js/app.js
@@ -41,7 +41,7 @@ if ($lgInlineContainer) {
rotate: false,
download: false,
slideDelay: 400,
- plugins: [lgZoom, lgFullscreen, lgShare, lgAutoplay, lgThumbnail],
+ plugins: [lgZoom, lgShare, lgAutoplay, lgThumbnail],
appendSubHtmlTo: '.lg-item',
...getResponsiveThumbnailsSettings(),
dynamicEl: [ | docs(demo): remove fullscreen from inline demo | sachinchoolur_lightGallery | train | js |
2c8c643ce39414f56a6bc72dca7a8a88b03095f9 | diff --git a/src/Dev/Tasks/MigrateFileTask.php b/src/Dev/Tasks/MigrateFileTask.php
index <HASH>..<HASH> 100644
--- a/src/Dev/Tasks/MigrateFileTask.php
+++ b/src/Dev/Tasks/MigrateFileTask.php
@@ -144,6 +144,8 @@ class MigrateFileTask extends BuildTask
}
}
+ $this->logger->info("Done!");
+
$this->extend('postFileMigration');
} | MigrateFileTask now outputs "Done" when it has finished running (#<I>) | silverstripe_silverstripe-framework | train | php |
da717a741070edbc8d694b8d208b247bc652028e | diff --git a/Metadata/Driver/DoctrineTypeDriver.php b/Metadata/Driver/DoctrineTypeDriver.php
index <HASH>..<HASH> 100644
--- a/Metadata/Driver/DoctrineTypeDriver.php
+++ b/Metadata/Driver/DoctrineTypeDriver.php
@@ -76,7 +76,7 @@ class DoctrineTypeDriver implements DriverInterface
$classMetadata = $this->delegate->loadMetadataForClass($class);
// Abort if the given class is not a mapped entity
- if (!$doctrineMetadata = $this->tryLoadingDoctrineMetadata($class)) {
+ if (!$doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->getName())) {
return $classMetadata;
} | Fix incorrect parameter in DoctrineTypeDriver
Reflection class was passed in instead of class name | alekitto_serializer | train | php |
c133597c4acb228cdce7ac416229464afb53cc55 | diff --git a/km3pipe/utils/h5extract.py b/km3pipe/utils/h5extract.py
index <HASH>..<HASH> 100644
--- a/km3pipe/utils/h5extract.py
+++ b/km3pipe/utils/h5extract.py
@@ -34,6 +34,19 @@ def main():
args = docopt(__doc__, version=kp.version)
+ default_flags = (
+ "--offline-header",
+ "--event-info",
+ "--offline-hits",
+ "--mc-hits",
+ "--mc-tracks",
+ "--mc-tracks-usr-data",
+ "--reco-tracks",
+ )
+ if not any([args[k] for k in default_flags]):
+ for k in default_flags:
+ args[k] = True
+
outfile = args["-o"]
if outfile is None:
outfile = args["FILENAME"] + ".h5" | h5extract everything as default | tamasgal_km3pipe | train | py |
8957c58e20a2458da4591d28760463d09b892bcd | diff --git a/clients/java/src/test/java/com/thoughtworks/selenium/ClientUnitTestSuite.java b/clients/java/src/test/java/com/thoughtworks/selenium/ClientUnitTestSuite.java
index <HASH>..<HASH> 100644
--- a/clients/java/src/test/java/com/thoughtworks/selenium/ClientUnitTestSuite.java
+++ b/clients/java/src/test/java/com/thoughtworks/selenium/ClientUnitTestSuite.java
@@ -1,9 +1,10 @@
package com.thoughtworks.selenium;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
-public class ClientUnitTestSuite {
+public class ClientUnitTestSuite extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite(ClientUnitTestSuite.class.getName());
suite.addTestSuite(CSVTest.class); | Stupid Maven bug; suites only get run if they extend TestCase
r<I> | SeleniumHQ_selenium | train | java |
a8ca9adfcf918d97bd9c4f4917c9c2c30df25cf7 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -29,7 +29,7 @@ return array(
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
- 'version' => '16.2.3',
+ 'version' => '16.2.4',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoTests' => '>=6.5.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -1611,6 +1611,6 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->setVersion('16.2.0');
}
- $this->skip('16.2.0', '16.2.3');
+ $this->skip('16.2.0', '16.2.4');
}
} | Bump to version <I> | oat-sa_extension-tao-testqti | train | php,php |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.