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
|
---|---|---|---|---|---|
f4d6cc3dec26c54b49438d43bb71d82a053ea341 | diff --git a/lib/firefox/webdriver/firefoxDelegate.js b/lib/firefox/webdriver/firefoxDelegate.js
index <HASH>..<HASH> 100644
--- a/lib/firefox/webdriver/firefoxDelegate.js
+++ b/lib/firefox/webdriver/firefoxDelegate.js
@@ -40,8 +40,15 @@ class FirefoxDelegate {
function triggerExport() {
HAR.triggerExport()
.then((result) => {
- result.log.pages[0].title = document.title;
- return callback({'har': result});
+ // Different handling in FF 60 and 61 :|
+ if (result.log) {
+ result.log.pages[0].title = document.title;
+ }
+ else {
+ result.pages[0].title = document.title;
+ }
+ // Normalize
+ return callback({'har': result.log ? result: {log: result}});
})
.catch((e) => callback({'error': e}));
}; | FF <I> has changed what is returned as the HAR comparing to FF <I>. (#<I>) | sitespeedio_browsertime | train | js |
1b203dc6226fc58f15b49c28a5a7a1b59e2a079b | diff --git a/worker/modelcache/worker.go b/worker/modelcache/worker.go
index <HASH>..<HASH> 100644
--- a/worker/modelcache/worker.go
+++ b/worker/modelcache/worker.go
@@ -285,6 +285,7 @@ func (c *cacheWorker) translate(d multiwatcher.Delta) interface{} {
Life: life.Value(value.Life),
Config: value.Config,
Series: value.Series,
+ ContainerType: value.ContainerType,
SupportedContainers: value.SupportedContainers,
SupportedContainersKnown: value.SupportedContainersKnown,
HardwareCharacteristics: value.HardwareCharacteristics, | Translate ContainerType from MachineInfo to MachineChange | juju_juju | train | go |
cd6c49a9ecfbf73f82e301aab60d0e4b598384d4 | diff --git a/src/modules/vk.js b/src/modules/vk.js
index <HASH>..<HASH> 100644
--- a/src/modules/vk.js
+++ b/src/modules/vk.js
@@ -26,8 +26,7 @@
login: function(p) {
p.qs.display = window.navigator &&
window.navigator.userAgent &&
- /ipad|phone|phone|android/.test(window.navigator.userAgent.toLowerCase())
- ? 'mobile' : 'popup';
+ /ipad|phone|phone|android/.test(window.navigator.userAgent.toLowerCase()) ? 'mobile' : 'popup';
},
// API Base URL
@@ -65,7 +64,7 @@
function formatUser(o) {
- if (o != null && o.response != null && o.response.length) {
+ if (o !== null && o.response !== null && o.response.length) {
o = o.response[0];
o.id = o.uid;
o.thumbnail = o.picture = o.photo_max;
@@ -73,7 +72,7 @@
var vk = hello.utils.store('vk');
- if (vk != null && vk.email != null)
+ if (vk !== null && vk.email !== null)
o.email = vk.email;
} | Added vk.js | MrSwitch_hello.js | train | js |
c0b692b360c2eebf86c5873396b274fca27676d7 | diff --git a/builtin/providers/aws/resource_aws_db_subnet_group.go b/builtin/providers/aws/resource_aws_db_subnet_group.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_db_subnet_group.go
+++ b/builtin/providers/aws/resource_aws_db_subnet_group.go
@@ -27,9 +27,9 @@ func resourceAwsDbSubnetGroup() *schema.Resource {
Required: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
value := v.(string)
- if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) {
+ if !regexp.MustCompile(`^[0-9A-Za-z-_]+$`).MatchString(value) {
errors = append(errors, fmt.Errorf(
- "only alphanumeric characters and hyphens allowed in %q", k))
+ "only alphanumeric characters, hyphens and underscores allowed in %q", k))
}
if len(value) > 255 {
errors = append(errors, fmt.Errorf( | allow underscores in aws_db_subnet_group name, docs don't claim they are
allowed but they are. | hashicorp_terraform | train | go |
3d5d9068851960478c0ce02d279a372542404ec0 | diff --git a/lib/active_record/connection_adapters/sqlserver_adapter.rb b/lib/active_record/connection_adapters/sqlserver_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/connection_adapters/sqlserver_adapter.rb
+++ b/lib/active_record/connection_adapters/sqlserver_adapter.rb
@@ -374,7 +374,7 @@ module ActiveRecord
)
WHERE columns.TABLE_NAME = '#{table_name}'
ORDER BY columns.COLUMN_NAME
- }
+ }.gsub(/[ \t\r\n]+/,' ')
result = select(sql, name, true)
result.collect do |column_info|
# Remove brackets and outer quotes (if quoted) of default value returned by db, i.e: | Shrunk reflection query whitespace so each only takes one line of log space | rails-sqlserver_activerecord-sqlserver-adapter | train | rb |
cc5f381f3470de7ee27114af214cbb002e409b3d | diff --git a/test/extended/cli/explain.go b/test/extended/cli/explain.go
index <HASH>..<HASH> 100644
--- a/test/extended/cli/explain.go
+++ b/test/extended/cli/explain.go
@@ -115,7 +115,7 @@ var (
// {Group: "operator.openshift.io", Version: "v1", Resource: "kubecontrollermanagers"},
// {Group: "operator.openshift.io", Version: "v1", Resource: "kubeschedulers"},
// {Group: "operator.openshift.io", Version: "v1", Resource: "networks"},
- // {Group: "operator.openshift.io", Version: "v1", Resource: "openshiftcontrollermanagers"},
+ {Group: "operator.openshift.io", Version: "v1", Resource: "openshiftcontrollermanagers"},
// {Group: "operator.openshift.io", Version: "v1", Resource: "servicecas"},
// {Group: "operator.openshift.io", Version: "v1", Resource: "servicecatalogapiservers"},
// {Group: "operator.openshift.io", Version: "v1", Resource: "servicecatalogcontrollermanagers"}, | Bug <I>: Verify ocm's CRD schema
Requires openshift/cluster-openshift-controller-manager-operator#<I> to
merge first. | openshift_origin | train | go |
16adfaca22b8a040e0d17f06f6bde02b6cea1d7c | diff --git a/ipyrad/analysis/bucky.py b/ipyrad/analysis/bucky.py
index <HASH>..<HASH> 100644
--- a/ipyrad/analysis/bucky.py
+++ b/ipyrad/analysis/bucky.py
@@ -289,8 +289,8 @@ class Bucky(object):
## check the steps argument
if not steps:
steps = [1, 2, 3, 4]
- if isinstance(steps, (int, str):
- steps = [int(i) for i in steps]
+ if isinstance(steps, (int, str)):
+ steps = [int(i) for i in [steps]]
if isinstance(steps, list):
if not all(isinstance(i, int) for i in steps):
raise IPyradWarningExit("steps must be a list of integers")
@@ -390,8 +390,9 @@ class Bucky(object):
time.sleep(0.1)
## check success
- if not async.successful():
- raise IPyradWarningExit(async.result())
+ for async in asyncs:
+ if not async.successful():
+ raise IPyradWarningExit(async.result()) | better error checking in bucky run commandipa tools | dereneaton_ipyrad | train | py |
9eceec20aad21e0eebbcc39de3d23498939c13e9 | diff --git a/lib/cfn_manage/aws_credentials.rb b/lib/cfn_manage/aws_credentials.rb
index <HASH>..<HASH> 100644
--- a/lib/cfn_manage/aws_credentials.rb
+++ b/lib/cfn_manage/aws_credentials.rb
@@ -28,6 +28,10 @@ module CfnManage
credentials = Aws::InstanceProfileCredentials.new(retries: 2, http_open_timeout:1)
return credentials unless credentials.credentials.access_key_id.nil?
+ # check for ECS task credentials available
+ credentials = Aws::ECSCredentials.new(retries: 2)
+ return credentials unless credentials.credentials.access_key_id.nil?
+
# use default profile
return Aws::SharedCredentials.new() | add credential support for ECS tasks | base2Services_cfn-start-stop-stack | train | rb |
e850d9e32ac08a331398e352bba4f85b31d9df48 | diff --git a/src/browser/AudioInputCaptureProxy.js b/src/browser/AudioInputCaptureProxy.js
index <HASH>..<HASH> 100644
--- a/src/browser/AudioInputCaptureProxy.js
+++ b/src/browser/AudioInputCaptureProxy.js
@@ -89,6 +89,8 @@ function start(success, error, opts) {
format = opts[3] || format;
audioSourceType = opts[4] || audioSourceType;
fileUrl = opts[5] || fileUrl;
+ // the URL must be converted to a cdvfile:... URL to ensure it's readable from the outside
+ fileUrl = fileUrl.replace("filesystem:file:///", "cdvfile://localhost/");
console.log("AudioInputCaptureProxy: start - fileUrl: " + fileUrl);
if (!audioRecorder) { | Get fileUrl usage working on Chrome by ensuring URL is of the form cdvfile://localhost/... | edimuj_cordova-plugin-audioinput | train | js |
f5decc90ca1b965fd27c9b94d34da0417876133d | diff --git a/testing/test_assertion.py b/testing/test_assertion.py
index <HASH>..<HASH> 100644
--- a/testing/test_assertion.py
+++ b/testing/test_assertion.py
@@ -221,3 +221,10 @@ def test_warn_missing(testdir):
result.stderr.fnmatch_lines([
"*WARNING*assertion*",
])
+
+def test_load_fake_pyc(testdir):
+ path = testdir.makepyfile("x = 'hello'")
+ co = compile("x = 'bye'", str(path), "exec")
+ plugin._write_pyc(co, path)
+ mod = path.pyimport()
+ assert mod.x == "bye" | test that python loads our fake pycs | vmalloc_dessert | train | py |
6207bcb3a35b0c0eb2f9a44eb90bf3130b201d30 | diff --git a/login.php b/login.php
index <HASH>..<HASH> 100644
--- a/login.php
+++ b/login.php
@@ -323,9 +323,7 @@ case 'register':
WT_I18N::translate('Username') . " " . $user_name . WT_Mail::EOL .
WT_I18N::translate('Verification code:') . " " . get_user_setting($user_id, 'reg_hashcode') . WT_Mail::EOL .
WT_I18N::translate('Comments').": " . $user_comments . WT_Mail::EOL .
- WT_I18N::translate('If you didn’t request an account, you can just delete this message.') .
- ' '.
- WT_I18N::translate('You won’t get any more email from this site, because the account request will be deleted automatically after seven days.') . WT_Mail::EOL;
+ WT_I18N::translate('If you didn’t request an account, you can just delete this message.') . WT_Mail::EOL;
$mail2_subject=/* I18N: %s is a server name/URL */ WT_I18N::translate('Your registration at %s', WT_SERVER_NAME.WT_SCRIPT_PATH);
$mail2_to =$user_email;
$mail2_from =$WEBTREES_EMAIL; | Remove registration message about accounts being automatically deleted - because they aren't\! | fisharebest_webtrees | train | php |
cdee8cbee943f4b0c1f91555829ed55a97afa595 | diff --git a/upload/catalog/controller/payment/pp_express.php b/upload/catalog/controller/payment/pp_express.php
index <HASH>..<HASH> 100644
--- a/upload/catalog/controller/payment/pp_express.php
+++ b/upload/catalog/controller/payment/pp_express.php
@@ -953,19 +953,13 @@ class ControllerPaymentPPExpress extends Controller {
$option_data = array();
foreach ($product['option'] as $option) {
- if ($option['type'] != 'file') {
- $value = $option['option_value'];
- } else {
- $value = $this->encryption->decrypt($option['option_value']);
- }
-
$option_data[] = array(
'product_option_id' => $option['product_option_id'],
'product_option_value_id' => $option['product_option_value_id'],
'option_id' => $option['option_id'],
'option_value_id' => $option['option_value_id'],
'name' => $option['name'],
- 'value' => $value,
+ 'value' => $option['value'],
'type' => $option['type']
);
} | Encryption is not required for 'File' type option | opencart_opencart | train | php |
746fb6481c71309deb94825ddc6c5c2eba48850c | diff --git a/sftpman/model.py b/sftpman/model.py
index <HASH>..<HASH> 100644
--- a/sftpman/model.py
+++ b/sftpman/model.py
@@ -101,7 +101,7 @@ class SystemModel(object):
self.mount_opts = list(kwargs.get('mountOptions', []))
self.mount_point = kwargs.get('mountPoint', None)
self.ssh_key = kwargs.get('sshKey', None)
- self.cmd_before_mount = kwargs.get('beforeMount', None)
+ self.cmd_before_mount = kwargs.get('beforeMount', '/bin/true')
def validate(self):
def is_alphanumeric(value):
@@ -134,7 +134,8 @@ class SystemModel(object):
errors.append(('port', msg))
if not isinstance(self.mount_opts, list):
errors.append(('mount_opts', 'Bad options received.'))
- if not isinstance(self.cmd_before_mount, basestring):
+ if not isinstance(self.cmd_before_mount, basestring) or \
+ self.cmd_before_mount == '':
errors.append(('cmd_before_mount', 'Invalid before mount command.'))
return (len(errors) == 0, errors) | Added a default cmd_before_mount command. | spantaleev_sftpman | train | py |
7395ce0470022a3715343d69cbf99a56a687cbed | diff --git a/fabfile.py b/fabfile.py
index <HASH>..<HASH> 100644
--- a/fabfile.py
+++ b/fabfile.py
@@ -601,8 +601,10 @@ def copySSHKeyToDocker():
run('rm /tmp/'+os.path.basename(key_file)+'.pub')
@task
-def behat(options=''):
+def behat(options='', name=False):
check_config()
+ if name:
+ options += '--name="'+name+'"'
if not 'behatPath' in env.config:
print(red('missing behatPath in fabfile.yaml')) | add name-option for behat-task, so you can run a specific task w/o mangling with the shell | factorial-io_fabalicious | train | py |
4ee387d0770ed379e2d524f7077938517b38cd7c | diff --git a/config/tendermint/config.go b/config/tendermint/config.go
index <HASH>..<HASH> 100644
--- a/config/tendermint/config.go
+++ b/config/tendermint/config.go
@@ -57,7 +57,7 @@ func GetConfig(rootDir string) cfg.Config {
if mapConfig.IsSet("version") {
Exit("Cannot set 'version' via config.toml")
}
- mapConfig.SetDefault("chain_id", "tendermint_testnet_8")
+ mapConfig.SetDefault("chain_id", "tendermint_testnet_9")
mapConfig.SetDefault("version", "0.5.0") // JAE: encrypted p2p!
mapConfig.SetDefault("genesis_file", rootDir+"/genesis.json")
mapConfig.SetDefault("moniker", "anonymous")
@@ -98,10 +98,10 @@ func defaultConfig(moniker string) (defaultConfig string) {
}
var defaultGenesis = `{
- "chain_id": "tendermint_testnet_8",
+ "chain_id": "tendermint_testnet_9",
"accounts": [
{
- "address": "F81CB9ED0A868BD961C4F5BBC0E39B763B89FCB6",
+ "address": "9FCBA7F840A0BFEBBE755E853C9947270A912D04",
"amount": 690000000000
},
{ | change genesis addr for testnet testing | tendermint_tendermint | train | go |
f590871c232c1156030e95fb6c7620b66a3196cd | diff --git a/sacred/dependencies.py b/sacred/dependencies.py
index <HASH>..<HASH> 100644
--- a/sacred/dependencies.py
+++ b/sacred/dependencies.py
@@ -203,9 +203,19 @@ def is_local_source(filename, modname, experiment_path):
def gather_sources_and_dependencies(globs):
dependencies = set()
- main = Source.create(globs.get('__file__'))
- sources = {main}
- experiment_path = os.path.dirname(main.filename)
+ filename = globs.get('__file__')
+
+ if filename is None:
+ import warnings
+ warnings.warn("Defining an experiment in interactive mode! "
+ "The sourcecode cannot be stored and the experiment "
+ "won't be reproducible")
+ sources = set()
+ experiment_path = os.path.abspath(os.path.curdir)
+ else:
+ main = Source.create(globs.get('__file__'))
+ sources = {main}
+ experiment_path = os.path.dirname(main.filename)
for glob in globs.values():
if isinstance(glob, module):
mod_path = glob.__name__ | added (warned) support for running sacred in interactive mode | IDSIA_sacred | train | py |
4fc45d8796ece084dd900149b4e9e657411c900c | diff --git a/test/on_yubikey/test_piv.py b/test/on_yubikey/test_piv.py
index <HASH>..<HASH> 100644
--- a/test/on_yubikey/test_piv.py
+++ b/test/on_yubikey/test_piv.py
@@ -171,10 +171,9 @@ class KeyManagement(PivTestCase):
self.controller.import_key(SLOT.AUTHENTICATION, private_key)
def test_read_certificate_does_not_require_authentication(self):
- public_key = self.generate_key()
+ cert = parse_certificate(self_signed_cert_pem, None)
self.controller.authenticate(DEFAULT_MANAGEMENT_KEY)
- self.controller.generate_self_signed_certificate(
- SLOT.AUTHENTICATION, public_key, 'alice', now(), now())
+ self.controller.import_certificate(SLOT.AUTHENTICATION, cert)
self.reconnect() | Import PIV cert to read from test data instead of generating self-signed on YubiKey | Yubico_yubikey-manager | train | py |
283eb8a6d59d5c4e8c0c8839fa50634d2653e4ea | diff --git a/lib/mobility.rb b/lib/mobility.rb
index <HASH>..<HASH> 100644
--- a/lib/mobility.rb
+++ b/lib/mobility.rb
@@ -69,8 +69,10 @@ module Mobility
require "sequel"
raise VersionNotSupportedError, "Mobility is only compatible with Sequel 4.0 and greater" if ::Sequel::MAJOR < 4
require "sequel/plugins/mobility"
- #TODO avoid automatically including the inflector extension
- require "sequel/extensions/inflector"
+ unless defined?(ActiveSupport::Inflector)
+ # TODO: avoid automatically including the inflector extension
+ require "sequel/extensions/inflector"
+ end
require "sequel/plugins/dirty"
require "mobility/sequel"
Loaded::Sequel = true | Conditionally load the Sequel inflections
Loading the Sequel inflection support will cause conflicts with the inflectors from Rails
See issue #<I> for details | shioyama_mobility | train | rb |
4809ec1ed201adeb49d92889057a79f47f248efc | diff --git a/pyardrone/at/arguments.py b/pyardrone/at/arguments.py
index <HASH>..<HASH> 100644
--- a/pyardrone/at/arguments.py
+++ b/pyardrone/at/arguments.py
@@ -44,7 +44,7 @@ class Int32Arg(Argument):
@staticmethod
def pack(value):
- return str(value).encode()
+ return str(int(value)).encode()
class FloatArg(Argument):
diff --git a/tests/test_at.py b/tests/test_at.py
index <HASH>..<HASH> 100644
--- a/tests/test_at.py
+++ b/tests/test_at.py
@@ -1,3 +1,4 @@
+import enum
import unittest
from pyardrone import at
from pyardrone.at import arguments
@@ -54,6 +55,15 @@ class ArgumentTest(unittest.TestCase):
b'100'
)
+ def test_int_pack_intenum(self):
+ class SomeEnum(enum.IntEnum):
+ some_flag = 10
+
+ self.assertEqual(
+ arguments.Int32Arg.pack(10),
+ b'10'
+ )
+
def test_float_pack(self):
# ieee754 specification is not the scope of this test
self.assertIsInstance( | IntEnum in Int<I>Arg should be packed as int | afg984_pyardrone | train | py,py |
3543c6f339c28c2a7dc49e5269cc366034c1e4f4 | diff --git a/src/javascripts/ng-admin/Crud/fieldView/ReferenceManyFieldView.js b/src/javascripts/ng-admin/Crud/fieldView/ReferenceManyFieldView.js
index <HASH>..<HASH> 100644
--- a/src/javascripts/ng-admin/Crud/fieldView/ReferenceManyFieldView.js
+++ b/src/javascripts/ng-admin/Crud/fieldView/ReferenceManyFieldView.js
@@ -1,6 +1,6 @@
export default {
getReadWidget: () => '<ma-choices-column values="::entry.listValues[field.name()]"></ma-choices-column>',
getLinkWidget: () => '<ma-reference-many-link-column ids="::value" values="::entry.listValues[field.name()]" field="::field"></ma-reference-many-link-column>',
- getFilterWidget: () => '<ma-reference-many-field field="::field" value="value" datastore="::datastore"></reference-many-field-field>',
+ getFilterWidget: () => '<ma-reference-many-field field="::field" value="value" datastore="::datastore"></ma-reference-many-field>',
getWriteWidget: () => '<ma-reference-many-field field="::field" value="value" datastore="::datastore"></ma-reference-many-field>'
}; | Fix wrong closing tag in reference_many filter
Refs #<I> | marmelab_ng-admin | train | js |
7cf94fc66d862bf356d3dc0b21c1c8d01e8d773d | diff --git a/lib/devise_invitable/model.rb b/lib/devise_invitable/model.rb
index <HASH>..<HASH> 100644
--- a/lib/devise_invitable/model.rb
+++ b/lib/devise_invitable/model.rb
@@ -254,7 +254,7 @@ module Devise
invitable = find_or_initialize_with_errors(invite_key_array, attributes_hash)
invitable.assign_attributes(attributes)
invitable.invited_by = invited_by
- unless invitable.password
+ unless invitable.password || invitable.encrypted_password
invitable.password = Devise.friendly_token[0, 20]
end | avoid generating new password if there already is a encrypted one, fixes #<I> | scambra_devise_invitable | train | rb |
19a9cd63d1a7799cebe9a5ae7f5fe24a3cb105f4 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -49,7 +49,7 @@ setup(name="ChainConsumer",
author="Samuel Hinton",
author_email="[email protected]",
requires=["numpy", "scipy", "matplotlib", "statsmodels"],
- install_requires=["numpy", "scipy", "matplotlib!=2.1.0", "statsmodels"],
+ install_requires=["numpy", "scipy", "matplotlib<2.1.0", "statsmodels"],
tests_require=["pytest","pytest-cov"],
cmdclass={"test": PyTest},
) | Why does matplotlib have to release a new version literally when Im in the middle of doing so? | Samreay_ChainConsumer | train | py |
9e6b9a137f07c1fd0942d97a8c3182189ffb3f29 | diff --git a/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java b/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java
index <HASH>..<HASH> 100644
--- a/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java
+++ b/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java
@@ -184,19 +184,6 @@ public class FirefoxBinary {
return builtPath.toString();
}
- public void createProfile(String profileName) throws IOException {
- CommandLine command = new CommandLine(
- executable.getPath(), "--verbose", "-CreateProfile", profileName);
- command.setEnvironmentVariable("MOZ_NO_REMOTE", "1");
-
- if (stream == null) {
- stream = executable.getDefaultOutputStream();
- }
- command.copyOutputTo(stream);
-
- command.execute();
- }
-
/**
* Waits for the process to execute, returning the command output taken from the profile's
* execution. | Firefox: Deleting unused method | SeleniumHQ_selenium | train | java |
94f8a045d91f803cb97a5cc410da1fcd782677fb | diff --git a/ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java b/ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java
index <HASH>..<HASH> 100644
--- a/ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java
+++ b/ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java
@@ -11,6 +11,7 @@ package org.jruby.ext.thread_safe.jsr166e;
import org.jruby.RubyClass;
import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
+import org.jruby.ext.thread_safe.jsr166y.ThreadLocalRandom;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
@@ -25,7 +26,6 @@ import java.util.Enumeration;
import java.util.ConcurrentModificationException;
import java.util.NoSuchElementException;
import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.locks.AbstractQueuedSynchronizer;
import java.io.Serializable; | Switch to packaged ThreadLocalRandom. Fixes #3. | ruby-concurrency_thread_safe | train | java |
ae2ec9643ee71e0bbfb2c73e5e39e4ea69c0c799 | diff --git a/pkg/bpf/map_linux.go b/pkg/bpf/map_linux.go
index <HASH>..<HASH> 100644
--- a/pkg/bpf/map_linux.go
+++ b/pkg/bpf/map_linux.go
@@ -25,7 +25,6 @@ import (
"os"
"path"
"reflect"
- "sync"
"time"
"unsafe"
@@ -98,7 +97,6 @@ type Map struct {
fd int
name string
path string
- once sync.Once
lock lock.RWMutex
// inParallelMode is true when the Map is currently being run in | pkg/bpf: remove unused Map.once member | cilium_cilium | train | go |
6c3d3b0a9703fc7e154fb93fd192be9416a860aa | diff --git a/enrol/authorize/db/mysql.php b/enrol/authorize/db/mysql.php
index <HASH>..<HASH> 100755
--- a/enrol/authorize/db/mysql.php
+++ b/enrol/authorize/db/mysql.php
@@ -18,7 +18,7 @@ function enrol_authorize_upgrade($oldversion=0) {
execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX userid(userid)", false);
}
- if ($oldversion < 2005071602) {
+ if ($oldversion && $oldversion < 2005071602) {
notify("If you are using the authorize.net enrolment plugin for credit card
handling, please ensure that you have turned loginhttps ON in Admin >> Variables >> Security.");
}
diff --git a/enrol/authorize/db/postgres7.php b/enrol/authorize/db/postgres7.php
index <HASH>..<HASH> 100644
--- a/enrol/authorize/db/postgres7.php
+++ b/enrol/authorize/db/postgres7.php
@@ -19,7 +19,7 @@ function enrol_authorize_upgrade($oldversion=0) {
// Authorize module was installed before. Upgrades must be applied to SQL file.
- if ($oldversion < 2005071602) {
+ if ($oldversion && $oldversion < 2005071602) {
notify("If you are using the authorize.net enrolment plugin for credit card
handling, please ensure that you have turned loginhttps ON in Admin >> Variables >> Security.");
} | DOn't show some notces on new install | moodle_moodle | train | php,php |
bef3d80f45ab3e5916db2740afae6817e685188e | diff --git a/examples/radio-node/src/main/js/radioProvider.js b/examples/radio-node/src/main/js/radioProvider.js
index <HASH>..<HASH> 100644
--- a/examples/radio-node/src/main/js/radioProvider.js
+++ b/examples/radio-node/src/main/js/radioProvider.js
@@ -145,7 +145,12 @@ joynr.load(provisioning).then(function(loadedJoynr) {
radioProviderImpl);
radioProviderImpl.setProvider(radioProvider);
- joynr.registration.registerProvider(domain, radioProvider, providerQos).then(function() {
+ var expiryDateMs; // intentionally left undefined by default
+ var loggingContext; // intentionally left undefined by default
+ var participantId; // intentionally left undefined by default
+ var awaitGlobalRegistration = true;
+
+ joynr.registration.registerProvider(domain, radioProvider, providerQos, expiryDateMs, loggingContext, participantId, awaitGlobalRegistration).then(function() {
log("provider registered successfully");
runInteractiveConsole(radioProviderImpl, function() {
return joynr.registration.unregisterProvider(domain, radioProvider)
@@ -158,6 +163,7 @@ joynr.load(provisioning).then(function(loadedJoynr) {
return null;
}).catch(function(error) {
log("error registering provider: " + error.toString());
+ joynr.shutdown();
});
return loadedJoynr;
}).catch(function(error){ | [JS] radio-node uses awaitGlobalRegistration
* awaitGlobalRegistration is used as parameter to registerProvider()
* properly shutdown joynr in case of registration error.
Change-Id: Ie4a<I>e0c<I>ab9d<I>d3b<I>c<I> | bmwcarit_joynr | train | js |
9e8e6f24b0f373c8a8f62202c9a91a11beb0bc0f | diff --git a/test/integration/generated_regress_test.rb b/test/integration/generated_regress_test.rb
index <HASH>..<HASH> 100644
--- a/test/integration/generated_regress_test.rb
+++ b/test/integration/generated_regress_test.rb
@@ -847,6 +847,7 @@ describe Regress, "The generated Regress module" do
describe "#test_garray_container_return" do
before do
+ skip unless get_introspection_data 'Regress', 'test_garray_container_return'
@arr = Regress.test_garray_container_return
end
@@ -866,7 +867,7 @@ describe Regress, "The generated Regress module" do
before do
@hash = Regress.test_ghash_container_return
end
-
+
it "returns an instance of GLib::HashTable" do
@hash.must_be_instance_of GLib::HashTable
end | Skip test for Regress#test_garray_container_return if it doesn't exist. | mvz_gir_ffi | train | rb |
bcecbc390488e0da1b93cbd1f861f13343314507 | diff --git a/lib/mobility/attributes.rb b/lib/mobility/attributes.rb
index <HASH>..<HASH> 100644
--- a/lib/mobility/attributes.rb
+++ b/lib/mobility/attributes.rb
@@ -173,20 +173,6 @@ with other backends.
"#<Attributes (#{backend_name}) @names=#{names.join(", ")}>"
end
- # Process options passed into accessor method before calling backend, and
- # return locale
- # @deprecated This method was mainly used internally but is no longer
- # needed. It will be removed in the next major release.
- # @param [Hash] options Options hash passed to accessor method
- # @return [Symbol] locale
- # TODO: Remove in v1.0
- def self.process_options!(options)
- (options[:locale] || Mobility.locale).tap { |locale|
- Mobility.enforce_available_locales!(locale)
- options[:locale] &&= !!locale
- }.to_sym
- end
-
private
def define_backend(attribute) | Remove deprecated Mobility::Attributes.process_options! | shioyama_mobility | train | rb |
90cd5feb4d72d1a0cd69c936beefb70a9a6a9e20 | diff --git a/elasticsearch-extensions/lib/elasticsearch/extensions/test/cluster.rb b/elasticsearch-extensions/lib/elasticsearch/extensions/test/cluster.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-extensions/lib/elasticsearch/extensions/test/cluster.rb
+++ b/elasticsearch-extensions/lib/elasticsearch/extensions/test/cluster.rb
@@ -139,7 +139,12 @@ module Elasticsearch
def stop(arguments={})
arguments[:port] ||= (ENV['TEST_CLUSTER_PORT'] || 9250).to_i
- nodes = JSON.parse(Net::HTTP.get(URI("http://localhost:#{arguments[:port]}/_nodes/?process"))) rescue nil
+ nodes = begin
+ JSON.parse(Net::HTTP.get(URI("http://localhost:#{arguments[:port]}/_nodes/?process")))
+ rescue Exception => e
+ STDERR.puts "[!] Exception raised when stopping the cluster: #{e.inspect}".ansi(:red)
+ nil
+ end
return false if nodes.nil? or nodes.empty? | [EXT] Display any exception encountered when stopping the test cluster nodes | elastic_elasticsearch-ruby | train | rb |
87d698e6fd0643d9fb1b8aadb6bcda35ca027f21 | diff --git a/src/com/google/javascript/jscomp/AbstractCompiler.java b/src/com/google/javascript/jscomp/AbstractCompiler.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/AbstractCompiler.java
+++ b/src/com/google/javascript/jscomp/AbstractCompiler.java
@@ -371,7 +371,7 @@ public abstract class AbstractCompiler implements SourceExcerptProvider {
/**
* Returns the root node of the AST, which includes both externs and source.
*/
- abstract Node getRoot();
+ public abstract Node getRoot();
abstract CompilerOptions getOptions(); | Don't force folks to cast to Compiler to call getRoot. It is public in Compiler so it is reasonable for it to public in AbstractCompiler.
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
6bf4ef9b3b0a62b88c67c80e434ccd774dee670f | diff --git a/eZ/Publish/API/Repository/Tests/SetupFactory/LegacyElasticsearch.php b/eZ/Publish/API/Repository/Tests/SetupFactory/LegacyElasticsearch.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/API/Repository/Tests/SetupFactory/LegacyElasticsearch.php
+++ b/eZ/Publish/API/Repository/Tests/SetupFactory/LegacyElasticsearch.php
@@ -58,8 +58,8 @@ class LegacyElasticsearch extends Legacy
$containerBuilder->addCompilerPass( new Compiler\Storage\Elasticsearch\AggregateFieldValueMapperPass() );
$containerBuilder->addCompilerPass( new Compiler\Storage\Elasticsearch\AggregateSortClauseVisitorContentPass() );
$containerBuilder->addCompilerPass( new Compiler\Storage\Elasticsearch\AggregateSortClauseVisitorLocationPass() );
- $containerBuilder->addCompilerPass( new Compiler\Storage\Solr\FieldRegistryPass() );
- $containerBuilder->addCompilerPass( new Compiler\Storage\Solr\SignalSlotPass() );
+ $containerBuilder->addCompilerPass( new Compiler\Search\Solr\FieldRegistryPass() );
+ $containerBuilder->addCompilerPass( new Compiler\Search\Solr\SignalSlotPass() );
$containerBuilder->setParameter(
"legacy_dsn", | EZP-<I>: adapt LegacyElasticsearch test setup factory | ezsystems_ezpublish-kernel | train | php |
6923f2531df23b9de55830d802c363b2b3f2676f | diff --git a/webapps/webapp/src/main/webapp/app/cockpit/directives/processDiagram.js b/webapps/webapp/src/main/webapp/app/cockpit/directives/processDiagram.js
index <HASH>..<HASH> 100644
--- a/webapps/webapp/src/main/webapp/app/cockpit/directives/processDiagram.js
+++ b/webapps/webapp/src/main/webapp/app/cockpit/directives/processDiagram.js
@@ -314,7 +314,6 @@ ngDefine('cockpit.directives', [
$scope.selection['view'] = {};
$scope.selection.view['bpmnElements'] = [ selectedBpmnElement ];
$scope.selection.view['selectedBpmnElement'] = {element: selectedBpmnElement, ctrlKey: false, remove: false};
- $scope.selection.view['scrollToBpmnElement'] = selectedBpmnElement;
$scope.$apply();
}; | fix(diagram): Fix scrolling to element on click
- remove scroll behavior on click on an element
related to CAM-<I> | camunda_camunda-bpm-platform | train | js |
e25153c4e814384c83f7f5d0e8c452881c680000 | diff --git a/src/select.js b/src/select.js
index <HASH>..<HASH> 100644
--- a/src/select.js
+++ b/src/select.js
@@ -301,6 +301,9 @@
ctrl.setActiveItem = function(item) {
ctrl.activeIndex = ctrl.items.indexOf(item);
+ ctrl.onHighlightCallback($scope, {
+ $item: item
+ });
};
ctrl.isActive = function(itemScope) {
@@ -605,6 +608,7 @@
$select.onSelectCallback = $parse(attrs.onSelect);
$select.onRemoveCallback = $parse(attrs.onRemove);
+ $select.onHighlightCallback = $parse(attrs.onHighlight);
//From view --> model
ngModel.$parsers.unshift(function (inputValue) { | Adding ability to have a callback for highlighting an item | angular-ui_ui-select | train | js |
b7327a34d0664faf8f2400daed49eac6fbbeab42 | diff --git a/services/managers/teamspeak3_manager.py b/services/managers/teamspeak3_manager.py
index <HASH>..<HASH> 100755
--- a/services/managers/teamspeak3_manager.py
+++ b/services/managers/teamspeak3_manager.py
@@ -139,9 +139,9 @@ class Teamspeak3Manager:
server_groups = Teamspeak3Manager._group_list()
if not settings.DEFAULT_AUTH_GROUP in server_groups:
- Teamspeak3Manager._create_group(settings.DEFAULT_ALLIANCE_GROUP)
+ Teamspeak3Manager._create_group(settings.DEFAULT_AUTH_GROUP)
- alliance_group_id = Teamspeak3Manager._group_id_by_name(settings.DEFAULT_ALLIANCE_GROUP)
+ alliance_group_id = Teamspeak3Manager._group_id_by_name(settings.DEFAULT_AUTH_GROUP)
ret = server.send_command('tokenadd', {'tokentype': 0, 'tokenid1': alliance_group_id, 'tokenid2': 0,
'tokendescription': username_clean, | Corrected reference to misnamed group. | allianceauth_allianceauth | train | py |
d81d18f1b1dfe95231ba8d3fcb3bd48a8bf132b6 | diff --git a/lib/sass/scss/rx.rb b/lib/sass/scss/rx.rb
index <HASH>..<HASH> 100644
--- a/lib/sass/scss/rx.rb
+++ b/lib/sass/scss/rx.rb
@@ -63,7 +63,7 @@ module Sass
IDENT = /-?#{NMSTART}#{NMCHAR}*/
NAME = /#{NMCHAR}+/
- NUM = /[0-9]+|[0-9]*.[0-9]+/
+ NUM = /[0-9]+|[0-9]*\.[0-9]+/
STRING = /#{STRING1}|#{STRING2}/
URLCHAR = /[#%&*-~]|#{NONASCII}|#{ESCAPE}/
URL = /(#{URLCHAR}*)/ | [Sass] [SCSS] Fix a bug in the parser that allowed for some numbers to be misrecognized and also caused performance issues in some rare cases. | sass_ruby-sass | train | rb |
4a18d35546cc4a918787b83ddb666674921deb8b | diff --git a/remix-tests/src/index.js b/remix-tests/src/index.js
index <HASH>..<HASH> 100644
--- a/remix-tests/src/index.js
+++ b/remix-tests/src/index.js
@@ -153,7 +153,7 @@ var runTestFiles = function (filepath, isDirectory, web3, opts) {
function determineTestContractsToRun (compilationResult, contracts, next) {
let contractsToTest = []
let contractsToTestDetails = []
- var gatherContractsFrom = (filename) => {
+ const gatherContractsFrom = (filename) => {
if (filename.indexOf('_test.sol') < 0) {
return
}
@@ -178,12 +178,7 @@ var runTestFiles = function (filepath, isDirectory, web3, opts) {
})
}
fs.walkSync(filepath, foundpath => {
- if (foundpath.indexOf('_test.sol') < 0) {
- return
- }
- Object.keys(compilationResult[foundpath]).forEach(contractName => {
- contractsToTest.push(contractName)
- })
+ gatherContractsFrom(foundpath)
})
} else {
gatherContractsFrom(filepath) | Use gatherContractsFrom to collect contracts in fs.walkSync | ethereum_remix | train | js |
d6951d24a72e6acaf998b116f45b80c0aab7cd06 | diff --git a/lib/utils.js b/lib/utils.js
index <HASH>..<HASH> 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -88,7 +88,7 @@ module.exports = {
var expiryLength = (jsonWebTokens.expiry && jsonWebTokens.expiry.length) || 7;
var expires = moment().add(expiryLength, expiryUnit).valueOf();
var issued = Date.now();
- var user = user || req.session.user;
+ user = user || req.session.user;
var token = jwt.encode({
iss: user.id + '|' + req.remoteAddress, | Don't work on too many things at once. | waterlock_waterlock | train | js |
0091b75ac0b149da55134f89b4914e8bc5382784 | diff --git a/pyte/document.py b/pyte/document.py
index <HASH>..<HASH> 100644
--- a/pyte/document.py
+++ b/pyte/document.py
@@ -191,7 +191,7 @@ class DocumentElement(object):
All three parameters are optional, and can be set at a later point by
assinging to the identically named instance attributes."""
- self._document = document
+ self.document = document
self.parent = parent
self.source = source
@@ -208,6 +208,19 @@ class DocumentElement(object):
"""Set `document` as owner of this element."""
self._document = document
+ @property
+ def source(self):
+ """The source element this document element was created from."""
+ if self._source is not None:
+ return self._source
+ else:
+ return self.parent.source
+
+ @source.setter
+ def source(self, source):
+ """Set `source` as the source element of this document element."""
+ self._source = source
+
def warn(self, message):
"""Present the warning `message` to the user, adding information on the
location of the related element in the input file.""" | return the parent's source element if no source is assigned | brechtm_rinohtype | train | py |
02a9a57e3b8674a656a3baf3f14a0cfa73693800 | diff --git a/spec/lib/logger_spec.rb b/spec/lib/logger_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/logger_spec.rb
+++ b/spec/lib/logger_spec.rb
@@ -15,8 +15,12 @@ module Marty
end
it "log has its own connection" do
- expect(Marty::Log.connection).not_to equal(Marty::Posting.connection)
- expect(Marty::Posting.connection).to equal(Marty::Script.connection)
+ log_conn = Marty::Log.connection.raw_connection
+ posting_conn = Marty::Posting.connection.raw_connection
+ script_conn = Marty::Script.connection.raw_connection
+
+ expect(log_conn).not_to equal(posting_conn)
+ expect(posting_conn).to equal(script_conn)
end
it "logs" do | Fix logget spec test to compare raw_connection not connection. | arman000_marty | train | rb |
06e2dce12b460298a530080bbf62f716378c797c | diff --git a/types/utils.go b/types/utils.go
index <HASH>..<HASH> 100644
--- a/types/utils.go
+++ b/types/utils.go
@@ -2,7 +2,6 @@ package types
import (
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"strconv"
@@ -75,12 +74,9 @@ func getRootlessRuntimeDirIsolated(env rootlessRuntimeDirEnvironment) (string, e
return runtimeDir, nil
}
- initCommand, err := ioutil.ReadFile(env.getProcCommandFile())
- if err != nil || string(initCommand) == "systemd" {
- runUserDir := env.getRunUserDir()
- if isRootlessRuntimeDirOwner(runUserDir, env) {
- return runUserDir, nil
- }
+ runUserDir := env.getRunUserDir()
+ if isRootlessRuntimeDirOwner(runUserDir, env) {
+ return runUserDir, nil
}
tmpPerUserDir := env.getTmpPerUserDir() | Use /run/user/UID in rootless mode if writable
Other parts of the code are using this directory, so we end up
with us creating an empty directory.
I don't see a reason why we would just use this directory only if
the init program is systemd?
Fixes: <URL> | containers_storage | train | go |
a5f15f7df14c45bbba9a8ccb46871880d87c194e | diff --git a/abydos/stemmer.py b/abydos/stemmer.py
index <HASH>..<HASH> 100644
--- a/abydos/stemmer.py
+++ b/abydos/stemmer.py
@@ -112,7 +112,6 @@ def porter(word, early_english=False):
# uppercase, normalize, decompose, and filter non-A-Z out
word = unicodedata.normalize('NFKD', _unicode(word.lower()))
- word = word.replace('ß', 'ss')
word = ''.join([c for c in word if c in
set('abcdefghijklmnopqrstuvwxyz')])
@@ -435,7 +434,6 @@ def porter2(word, early_english=False):
# uppercase, normalize, decompose, and filter non-A-Z out
word = unicodedata.normalize('NFKD', _unicode(word.lower()))
- word = word.replace('ß', 'ss')
# replace apostrophe-like characters with U+0027, per
# http://snowball.tartarus.org/texts/apostrophe.html
word = word.replace('’', '\'') | removed German-specific esszet, which shouldn't appear in English words | chrislit_abydos | train | py |
4b70cfeb9aee795512d5d09508d06e32e7140d41 | diff --git a/modules/core/src/main/java/org/rapidpm/microservice/Main.java b/modules/core/src/main/java/org/rapidpm/microservice/Main.java
index <HASH>..<HASH> 100644
--- a/modules/core/src/main/java/org/rapidpm/microservice/Main.java
+++ b/modules/core/src/main/java/org/rapidpm/microservice/Main.java
@@ -150,7 +150,9 @@ public class Main {
private static void executeStartupActions(final Optional<String[]> args) {
final Set<Class<? extends MainStartupAction>> classes = DI.getSubTypesOf(MainStartupAction.class);
- createInstances(classes).forEach((mainStartupAction) -> mainStartupAction.execute(args));
+ createInstances(classes).stream()
+ .map(DI::activateDI)
+ .forEach((mainStartupAction) -> mainStartupAction.execute(args));
}
private static DeploymentInfo createServletDeploymentInfos() { | all StartupActions are now DI managed | svenruppert_rapidpm-microservice | train | java |
5dade526212bad0d63a887c05b48cc495e453951 | diff --git a/internal/ui/ui_js.go b/internal/ui/ui_js.go
index <HASH>..<HASH> 100644
--- a/internal/ui/ui_js.go
+++ b/internal/ui/ui_js.go
@@ -26,18 +26,9 @@ import (
var canvas js.Object
var context *opengl.Context
-var windowIsFocused = true
-
-func init() {
- // TODO: Check IE
- window := js.Global.Get("window")
- // Get the top window in case that this window is in an iframe.
- window.Get("top").Call("addEventListener", "focus", func() {
- windowIsFocused = true
- })
- window.Get("top").Call("addEventListener", "blur", func() {
- windowIsFocused = false
- })
+func shown() bool {
+ w := js.Global.Get("window").Get("top")
+ return !w.Get("document").Get("hidden").Bool()
}
func Use(f func(*opengl.Context)) {
@@ -54,7 +45,7 @@ func vsync() {
func DoEvents() {
vsync()
- for !windowIsFocused {
+ for !shown() {
vsync()
}
} | Bug fix: Use document.hidden (focus/blue event is not reliable when using <iframe>) | hajimehoshi_ebiten | train | go |
7e669ada4797fcce9e7e5c1d21e1bbcd3ad11db2 | diff --git a/PHPCI/Plugin/Util/Factory.php b/PHPCI/Plugin/Util/Factory.php
index <HASH>..<HASH> 100644
--- a/PHPCI/Plugin/Util/Factory.php
+++ b/PHPCI/Plugin/Util/Factory.php
@@ -36,7 +36,28 @@ class Factory {
'array'
);
}
-
+
+ /**
+ * Trys to get a function from the file path specified. If the
+ * file returns a function then $this will be passed to it.
+ * This enables the config file to call any public methods.
+ *
+ * @param $configPath
+ * @return bool - true if the function exists else false.
+ */
+ public function addConfigFromFile($configPath)
+ {
+ // The file is expected to return a function which can
+ // act on the pluginFactory to register any resources needed.
+ if (file_exists($configPath)) {
+ $configFunction = require($configPath);
+ if (is_callable($configFunction)) {
+ $configFunction($this);
+ return true;
+ }
+ }
+ return false;
+ }
public function getLastOptions()
{ | Merge remote-tracking branch 'origin/master' into feature/pluginfactoryconfig
Conflicts:
PHPCI/Builder.php
PHPCI/Plugin/Util/Factory.php | dancryer_PHPCI | train | php |
0f008908629121d78943351c8542ea6acb4b7407 | diff --git a/speed_test.py b/speed_test.py
index <HASH>..<HASH> 100755
--- a/speed_test.py
+++ b/speed_test.py
@@ -80,6 +80,7 @@ def deltaToFloat( delta ):
print "Speed test compares the time required for " \
"cdmpyparser and the standard pyclbr modules to collect module info."
+print "cdmpyparser version: " + cdmbriefparser.getVersion()
print "" | Print the parser version as well | SergeySatskiy_cdm-pythonparser | train | py |
f3feaeca4384a6541f41d4e554b3e05fad3fc651 | diff --git a/src/Api/ChannelFeed.php b/src/Api/ChannelFeed.php
index <HASH>..<HASH> 100644
--- a/src/Api/ChannelFeed.php
+++ b/src/Api/ChannelFeed.php
@@ -269,4 +269,24 @@ trait ChannelFeed
return $this->post(sprintf('feed/%s/posts/%s/comments', $channelIdentifier, $postId), $params, $accessToken);
}
+
+ /**
+ * Delete a feed post comment
+ *
+ * @param string|int $channelIdentifier
+ * @param string $postId
+ * @param string $accessToken
+ * @param string|int $commentId
+ * @throws InvalidIdentifierException
+ * @throws InvalidTypeException
+ * @return array|json
+ */
+ public function deleteFeedComment($channelIdentifier, $postId, $commentId, $accessToken)
+ {
+ if ($this->apiVersionIsGreaterThanV4() && !is_numeric($channelIdentifier)) {
+ throw new InvalidIdentifierException('channel');
+ }
+
+ return $this->delete(sprintf('feed/%s/posts/%s/comments/%s', $channelIdentifier, $postId, $commentId), [], $accessToken);
+ }
} | Added deleteFeedComment method | nicklaw5_twitch-api-php | train | php |
92041239349ba7a72c0504152ded9439a593400d | diff --git a/koala/Spreadsheet.py b/koala/Spreadsheet.py
index <HASH>..<HASH> 100644
--- a/koala/Spreadsheet.py
+++ b/koala/Spreadsheet.py
@@ -51,6 +51,7 @@ class Spreadsheet(object):
self.count = 0
self.volatile_to_remove = ["INDEX", "OFFSET"]
self.volatiles = volatiles
+ self.volatiles_to_reset = volatiles
self.Range = RangeFactory(cellmap)
self.reset_buffer = set()
self.debug = debug
@@ -339,6 +340,8 @@ class Spreadsheet(object):
todo.append(child)
done.add(cell)
+
+ self.volatiles_to_reset = alive
return alive
@@ -499,7 +502,7 @@ class Spreadsheet(object):
# set the value
cell.value = val
- for vol in self.volatiles: # reset all volatiles
+ for vol in self.volatiles_to_reset: # reset all volatiles
self.reset(self.cellmap[vol])
def reset(self, cell): | added Spreadsheet.volatiles_to_reset | anthill_koala | train | py |
61b9fc964e73421238c8a45da421aec1210c740d | diff --git a/core/Pass.php b/core/Pass.php
index <HASH>..<HASH> 100644
--- a/core/Pass.php
+++ b/core/Pass.php
@@ -7,11 +7,12 @@ class Pass {
/**
* Encrypt a plaintext password using the best available algorithm
* @todo: check php5.5 password api
+ * @todo: upgrade default md5 hashing to something more secure
* @param string $plainPass Plain text password to encrypt
* @param string $desiredAlgo Name of desiresd algo
* @return string $encPass Encrypted password
*/
- public function encrypt( $plainPass, $desiredAlgo = 'sha256' )
+ public function encrypt( $plainPass, $desiredAlgo = 'md5' )
{
// If no password was supplied, return empty
// FIXME: Either log this event, or throw an exception, so client code | Switched default hashing algo to MD5 for backwards compatibility; Added note about sha<I> | phpList_core | train | php |
d169f562496621002aa03e761e784c104e174e60 | diff --git a/test/leak-tester.js b/test/leak-tester.js
index <HASH>..<HASH> 100644
--- a/test/leak-tester.js
+++ b/test/leak-tester.js
@@ -29,7 +29,8 @@ function run () {
})
if (getCount % 1000 === 0) {
- gc()
+ if (typeof gc != 'undefined')
+ gc()
console.log(
'getCount ='
, getCount | qualify 'gc()' use | Level_leveldown-mobile | train | js |
43049fa10932ca5500e364bed9bef71fb5a4382d | diff --git a/moreLess.js b/moreLess.js
index <HASH>..<HASH> 100644
--- a/moreLess.js
+++ b/moreLess.js
@@ -53,13 +53,17 @@
me._switchMoreLess( $moreless, height, $morelink, $moreblur );
} );
- if( $moreless.height() >= $moreless.get( 0 ).scrollHeight ) {
- $morelink.css( 'display', 'none' );
- if( $moreblur ) {
- $moreblur.css( 'display', 'none' );
+ var hideShowMore = function() {
+ if( $moreless.height() >= $moreless.get( 0 ).scrollHeight ) {
+ $morelink.css( 'display', 'none' );
+ if( $moreblur ) {
+ $moreblur.css( 'display', 'none' );
+ }
}
- }
+ };
+ hideShowMore();
+ $moreless.ready( hideShowMore );
},
_switchMoreLess: function( $moreless, inHeight, $morelink, $moreblur ) { | MoreLess control fixed more button showing on content area equal to or smaller than div hieght | Brightspace_jquery-valence-ui-more-less | train | js |
a0807dd79fc1680a7b1f2d5a2081d92567aab97d | diff --git a/doc.go b/doc.go
index <HASH>..<HASH> 100644
--- a/doc.go
+++ b/doc.go
@@ -2,7 +2,7 @@
// http.Transport and http.Client structs.
//
// Values set on http.DefaultClient and http.DefaultTransport affect all
-// callers. This can have detrimental effects, esepcially in TLS contexts,
+// callers. This can have detrimental effects, especially in TLS contexts,
// where client or root certificates set to talk to multiple endpoints can end
// up displacing each other, leading to hard-to-debug issues. This package
// provides non-shared http.Client and http.Transport structs to ensure that | Correct spelling in doc (#<I>) | hashicorp_go-cleanhttp | train | go |
e1ea10fa2d2dd02dd462e524827f1bf0ad7bde6c | diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -243,9 +243,16 @@ func (cn *connection) PeerHasPiece(piece int) bool {
return cn.peerSentHaveAll || cn.peerPieces.Contains(piece)
}
+// Writes a message into the write buffer.
func (cn *connection) Post(msg pp.Message) {
messageTypesPosted.Add(strconv.FormatInt(int64(msg.Type), 10), 1)
+ // We don't need to track bytes here because a connection.w Writer wrapper
+ // takes care of that (although there's some delay between us recording
+ // the message, and the connection writer flushing it out.).
cn.writeBuffer.Write(msg.MustMarshalBinary())
+ // Last I checked only Piece messages affect stats, and we don't post
+ // those.
+ cn.wroteMsg(&msg)
cn.tickleWriter()
} | Wasn't recording posted message stats | anacrolix_torrent | train | go |
3b3bd519bec0bea773dc614c9485ad4dd87cf5a3 | diff --git a/spec/support/shared/a_command_with_an_option.rb b/spec/support/shared/a_command_with_an_option.rb
index <HASH>..<HASH> 100644
--- a/spec/support/shared/a_command_with_an_option.rb
+++ b/spec/support/shared/a_command_with_an_option.rb
@@ -1,11 +1,23 @@
shared_examples 'a command with an option' do |command, option, directory = nil, switch_override: nil|
- switch = switch_override.nil? ? "-#{option.to_s.sub('_', '-')}" : switch_override
+ switch = if switch_override.nil?
+ "-#{option.to_s.sub('_',
+ '-')}"
+ else
+ switch_override
+ end
+ switch_value = 'true'
argument = directory.nil? ? nil : " #{directory}"
it_behaves_like 'a valid command line', {
reason: "adds a #{switch} option if a #{option} is provided",
- expected_command: "terraform #{command} #{switch}=true#{argument}",
+ expected_command: "terraform #{command} #{switch}=#{switch_value}#{argument}",
options: { directory: directory,
- option => 'true' }
+ option => switch_value }
+ }
+
+ it_behaves_like 'a valid command line', {
+ reason: "does not add a #{switch} option if a #{option} is not provided",
+ expected_command: "terraform #{command}#{argument}",
+ options: { directory: directory }
}
end | Add negative test to the option shared example
The original test only checked if the option was supplied in the command line but there was no test to verify it wasn't included when the option was nil / not supplied. | infrablocks_ruby_terraform | train | rb |
9166ba49d12e9a9996b4e250dd6a2ea9f4250094 | diff --git a/src/MvcCore/Ext/Routers/Media/PreRouting.php b/src/MvcCore/Ext/Routers/Media/PreRouting.php
index <HASH>..<HASH> 100644
--- a/src/MvcCore/Ext/Routers/Media/PreRouting.php
+++ b/src/MvcCore/Ext/Routers/Media/PreRouting.php
@@ -48,7 +48,8 @@ trait PreRouting
if (!$this->manageMediaSwitchingAndRedirect()) return FALSE;
} else if (
- (($this->isGet && $this->routeGetRequestsOnly) || !$this->routeGetRequestsOnly) &&
+ // wrong, because for example requests with HEAD were not recognized into any media version:
+ /*(($this->isGet && $this->routeGetRequestsOnly) || !$this->routeGetRequestsOnly) && */
$this->sessionMediaSiteVersion === NULL
) {
// if there is no session record about media site version: | bugfix for HEAD methods starting a session | mvccore_ext-router-media | train | php |
9f879ab856f2610a3b60b21a6cad05b906bbdc24 | diff --git a/lib/config.js b/lib/config.js
index <HASH>..<HASH> 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -34,13 +34,6 @@ config = new (function () {
baseConfig.rotateWorkers = false;
}
- // The configuration key "bind" should be used to supply
- // the hostname. We should consider deprecating "hostname"
- // in favor of "bind".
- if (opts.bind && !opts.hostname) {
- opts.hostname = opts.bind;
- }
-
// App configs
for (var i = 0; i < dirList.length; i++) {
fileName = dirList[i]; | bind is an alias now for hostname | mde_ejs | train | js |
e2f71539d065f938a1e483cd2427c7a1a1e80fff | diff --git a/codado/_version.py b/codado/_version.py
index <HASH>..<HASH> 100644
--- a/codado/_version.py
+++ b/codado/_version.py
@@ -1,2 +1,2 @@
-__version__ = "0.3.3"
+__version__ = "0.4.0"
__all__ = ["__version__"] | coda-1 bump to <I> | corydodt_Codado | train | py |
a9b7e517e7467e09e2a066215bb9f58b462e7c4b | diff --git a/examples/src/main/java/org/javasimon/examples/jdbc/JdbcExample.java b/examples/src/main/java/org/javasimon/examples/jdbc/JdbcExample.java
index <HASH>..<HASH> 100644
--- a/examples/src/main/java/org/javasimon/examples/jdbc/JdbcExample.java
+++ b/examples/src/main/java/org/javasimon/examples/jdbc/JdbcExample.java
@@ -27,7 +27,7 @@ public class JdbcExample {
// JDBC URL:
// 1) it has :simon: between jdbc and real driver name
// 2) it specifies the simon namespace where to put JDBC simons (any.sql instead of default)
- try (Connection connection = DriverManager.getConnection("jdbc:simon:h2:mem;simon_prefix=any.sql")) {
+ try (Connection connection = DriverManager.getConnection("jdbc:simon:h2:mem:;simon_prefix=any.sql")) {
prepareTable(connection);
runDemo(connection);
}
@@ -105,6 +105,5 @@ public class JdbcExample {
" start TIMESTAMP," +
" nanos BIGINT)");
}
- System.out.println("Connection schema: " + connection.getSchema());
}
} | removed line printing connected schema, this fails on H2 | virgo47_javasimon | train | java |
5be0d03d8a567d0f43a3dd3ae815358588435c3d | diff --git a/app/MediaFile.php b/app/MediaFile.php
index <HASH>..<HASH> 100644
--- a/app/MediaFile.php
+++ b/app/MediaFile.php
@@ -192,14 +192,14 @@ class MediaFile {
'dir' => 'auto',
'src' => $src,
'srcset' => implode(',', $srcset),
- 'alt' => strip_tags($this->media->getFullName()),
+ 'alt' => htmlspecialchars_decode(strip_tags($this->media->getFullName())),
]) . '>';
$attributes = Html::attributes([
'class' => 'gallery',
'type' => $this->mimeType(),
'href' => $this->imageUrl(0, 0, 'contain'),
- 'data-title' => strip_tags($this->media->getFullName()),
+ 'data-title' => htmlspecialchars_decode(strip_tags($this->media->getFullName())),
]);
return '<a ' . $attributes . '>' . $image . '</a>'; | Fix: #<I> - double-encoding of names on media list | fisharebest_webtrees | train | php |
6483759013a18e9d0f0f2a91755a1e96ceafb3b0 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -21,7 +21,7 @@
var obj = {};
// find the href of the file
obj.href = str.match(/href\=\"([^\"]*)\"/m)[1];
- obj.url = (url + obj.href).replace(/([^:])\/\//, "$1\/", "g");
+ obj.url = (url + obj.href).replace(/([^:])\/\//, "$1\/", "g").replace(/&/g, "&");
// find the file name (preserve truncation)
obj.name = str.match(/<a href\=\"(?:[^\"]*)\">(.+)<\/a>/)[1]; | fixing an issue with & escaping | weisjohn_autoindex | train | js |
3c1dca6cefdd702b3ba0828c19853013ab02f99d | diff --git a/src/crypto/verification/request/VerificationRequest.js b/src/crypto/verification/request/VerificationRequest.js
index <HASH>..<HASH> 100644
--- a/src/crypto/verification/request/VerificationRequest.js
+++ b/src/crypto/verification/request/VerificationRequest.js
@@ -258,6 +258,7 @@ export class VerificationRequest extends EventEmitter {
* verification.
*/
get encodedSharedSecret() {
+ if (!this._sharedSecret) this._generateSharedSecret();
return this._sharedSecret;
} | Generate a shared secret if we don't have one | matrix-org_matrix-js-sdk | train | js |
afb8142aad7621525188125c96c409f463a48709 | diff --git a/lib/program.js b/lib/program.js
index <HASH>..<HASH> 100644
--- a/lib/program.js
+++ b/lib/program.js
@@ -123,7 +123,7 @@ var Program = Base.extend({
get_sources: function() {
return this._get_nodes_helper(this.graph.head, function(proc) {
- return (proc.sourceType);
+ return (proc instanceof Juttle.proc.source);
});
}, | get_sources filters based on inheritance
Get sources in program should filter based on presence of `source` proc
in the inheritance chain. | juttle_juttle | train | js |
bce9b6a62970e295d343ac82bc60a70d4eaf6a3b | diff --git a/wikitextparser/wikitext.py b/wikitextparser/wikitext.py
index <HASH>..<HASH> 100644
--- a/wikitextparser/wikitext.py
+++ b/wikitextparser/wikitext.py
@@ -381,20 +381,12 @@ class WikiText:
for spans in self._type_to_spans.values():
for span in spans:
s, e = span
- if estart < s or (
- # Not at the beginning of selfspan
- estart == s != ss and e != se
- ):
- # Added part is before the span
+ # estart is before s, or at s but not on self_span
+ if estart < s or s == estart != ss:
span[:] = s + elength, e + elength
- elif s < estart < e or (
- # At the end of selfspan
- estart == s == ss and e == se
- ) or (
- estart == e == se and s == ss
- ):
+ elif estart < e or e == estart == se:
# Added part is inside the span
- span[1] = e + elength
+ span[1] += elength
@property
def _indent_level(self) -> int: | Simplify _extend_span_update logic | 5j9_wikitextparser | train | py |
b6ae9273771a652f28439e89b4481c8a3910e2a3 | diff --git a/webroot/js/search.js b/webroot/js/search.js
index <HASH>..<HASH> 100644
--- a/webroot/js/search.js
+++ b/webroot/js/search.js
@@ -144,12 +144,20 @@ var search = search || {};
var timestamp = Math.round(1000000 * Math.random());
var inputHtml = this.fieldInputHtml;
+
+ // add hidden input with field type as value
inputHtml = inputHtml.replace('{{fieldType}}', this._generateFieldType(field, properties.type, timestamp));
+
+ // add label
inputHtml = inputHtml.replace('{{fieldLabel}}', this._generateFieldLabel(field, properties.label));
+
+ // add operators
inputHtml = inputHtml.replace(
'{{fieldOperator}}',
this._generateSearchOperator(field, properties.operators, timestamp, operator)
);
+
+ // add input
inputHtml = inputHtml.replace(
'{{fieldInput}}',
this._generateFieldInput(field, properties.input, timestamp, value) | Code comments (task #<I>) | QoboLtd_cakephp-search | train | js |
89b4c6e0d1b65514c04f1a05a13b55a1d269bde5 | diff --git a/gin_test.go b/gin_test.go
index <HASH>..<HASH> 100644
--- a/gin_test.go
+++ b/gin_test.go
@@ -334,7 +334,7 @@ func TestHandleStaticFile(t *testing.T) {
w := httptest.NewRecorder()
r := Default()
- r.ServeFiles("/*filepath", http.Dir("./"))
+ r.Static("./", testRoot)
r.ServeHTTP(w, req)
@@ -359,7 +359,7 @@ func TestHandleStaticDir(t *testing.T) {
w := httptest.NewRecorder()
r := Default()
- r.ServeFiles("/*filepath", http.Dir("./"))
+ r.Static("/", "./")
r.ServeHTTP(w, req) | Replaced deprecated ServeFiles | gin-gonic_gin | train | go |
ba4eb850a5e00114174c9df09b51c96d0d0c6dbe | diff --git a/Collection.php b/Collection.php
index <HASH>..<HASH> 100644
--- a/Collection.php
+++ b/Collection.php
@@ -1608,9 +1608,9 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
return json_decode($value->toJson(), true);
} elseif ($value instanceof Arrayable) {
return $value->toArray();
- } else {
- return $value;
}
+
+ return $value;
}, $this->items);
} | Clean elses (#<I>) | illuminate_support | train | php |
76b9c6331669b16ef2b7078e8fbe17e2a38ad036 | diff --git a/public/bundle.js b/public/bundle.js
index <HASH>..<HASH> 100644
--- a/public/bundle.js
+++ b/public/bundle.js
@@ -41141,6 +41141,7 @@ var VPromptIfDirty = function (_VBase) {
results.push({
action: 'prompt_if_dirty',
+ statusCode: 412,
squelch: true,
dirty: dirty
});
diff --git a/views/mdc/assets/js/components/events/prompt_if_dirty.js b/views/mdc/assets/js/components/events/prompt_if_dirty.js
index <HASH>..<HASH> 100644
--- a/views/mdc/assets/js/components/events/prompt_if_dirty.js
+++ b/views/mdc/assets/js/components/events/prompt_if_dirty.js
@@ -40,6 +40,7 @@ export class VPromptIfDirty extends VBase {
results.push({
action: 'prompt_if_dirty',
+ statusCode: 412,
squelch: true,
dirty: dirty,
}); | Add statusCode to prompt_if_dirty action result
This ensures the action's result is consistent with other action
results. <I> Precondition Failed was chosen to indicate that the
precondition of discarding unsaved changes was not met and to
communicate the action's result was not successful. | rx_presenters | train | js,js |
08113ef57f10bdc54575c1b10be0970a8271404a | diff --git a/spaceship/lib/spaceship/tunes/language_item.rb b/spaceship/lib/spaceship/tunes/language_item.rb
index <HASH>..<HASH> 100644
--- a/spaceship/lib/spaceship/tunes/language_item.rb
+++ b/spaceship/lib/spaceship/tunes/language_item.rb
@@ -26,7 +26,7 @@ module Spaceship
end
return result if result
- raise "Language '#{lang}' is not activated for this app version."
+ raise "Language '#{lang}' is not activated / available for this app version."
end
# @return (Array) An array containing all languages that are already available
diff --git a/spaceship/spec/tunes/app_version_spec.rb b/spaceship/spec/tunes/app_version_spec.rb
index <HASH>..<HASH> 100644
--- a/spaceship/spec/tunes/app_version_spec.rb
+++ b/spaceship/spec/tunes/app_version_spec.rb
@@ -578,7 +578,7 @@ describe Spaceship::AppVersion, all: true do
it "raises an exception if language is not available" do
expect do
version.description["ja-JP"]
- end.to raise_error "Language 'ja-JP' is not activated for this app version."
+ end.to raise_error "Language 'ja-JP' is not activated / available for this app version."
end
# it "allows the creation of a new language" do | Make language error message more clear for the user | fastlane_fastlane | train | rb,rb |
50d5109cd28ff563c8646b032088ec62fbf048f8 | diff --git a/create-enum.js b/create-enum.js
index <HASH>..<HASH> 100644
--- a/create-enum.js
+++ b/create-enum.js
@@ -3,7 +3,7 @@
var forEach = require('es5-ext/object/for-each')
, isPlainObject = require('es5-ext/object/is-plain-object')
, isMap = require('es6-map/is-map')
- , d = require('d/d')
+ , d = require('d')
, memoize = require('memoizee/lib/regular')
, validDb = require('dbjs/valid-dbjs')
, validNested = require('dbjs/valid-dbjs-nested-object')
diff --git a/enum-define-get-labels.js b/enum-define-get-labels.js
index <HASH>..<HASH> 100644
--- a/enum-define-get-labels.js
+++ b/enum-define-get-labels.js
@@ -1,6 +1,6 @@
'use strict';
-var d = require('d/d')
+var d = require('d')
, lazy = require('d/lazy')
, memoize = require('memoizee/lib/regular') | Update up to changes in d package | medikoo_dbjs-ext | train | js,js |
ed81a75e41bb013ee96e7e0cae3208bbd3dd4694 | diff --git a/spec/integration/root_repository_spec.rb b/spec/integration/root_repository_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/root_repository_spec.rb
+++ b/spec/integration/root_repository_spec.rb
@@ -76,6 +76,13 @@ RSpec.describe ROM::Repository::Root do
expect(result.posts[0].author_id).to be(result.id)
expect(result.posts[0].title).to eql('Jade post')
end
+
+ it 'builds same relation as manual combine' do
+ left = repo.aggregate(:posts)
+ right = repo.users.combine_children(many: repo.posts)
+
+ expect(left.to_ast).to eql(right.to_ast)
+ end
end
end
end | Add a spec for aggregate vs manual combine | rom-rb_rom | train | rb |
d11f8ed38f3b131c623cd0f4028ed79da48b473f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -62,7 +62,7 @@ setup_kwargs = dict(name='snakebacon',
'Programming Language :: Python :: 3'],
keywords='marine radiocarbon c14',
- install_requires=['setuptools', 'numpy', 'Cython', 'pandas', 'matplotlib', 'scipy'],
+ install_requires=['numpy', 'Cython', 'pandas', 'matplotlib', 'scipy'],
packages=find_packages(),
package_data={'snakebacon': ['tests/*.csv', 'bacon/Curves/*.14C']},
) | Attempt workaround for conda package building. | brews_snakebacon | train | py |
4cb69dd05fd6a3b71c121760b03ad18036ad9484 | diff --git a/lib/rack/jekyll.rb b/lib/rack/jekyll.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/jekyll.rb
+++ b/lib/rack/jekyll.rb
@@ -93,8 +93,10 @@ module Rack
end
else
- body = if ::File.exist?(@destination + "/404.html")
- file_info(@destination + "/404.html")[:body]
+ custom_404_file = @files.get_filename("/404.html")
+
+ body = if custom_404_file
+ file_info(custom_404_file)[:body]
else
"Not found"
end | Use FileHandler to locate custom <I> file | adaoraul_rack-jekyll | train | rb |
685e926d96358af65c2eb85e91dd79ff0d9d7443 | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -1,6 +1,10 @@
if ENV["MODEL_ADAPTER"].nil? || ENV["MODEL_ADAPTER"] == "active_record"
require "spec_helper"
+ RSpec.configure do |config|
+ config.extend WithModel
+ end
+
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
describe CanCan::ModelAdapters::ActiveRecordAdapter do
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
@@ -14,7 +14,6 @@ RSpec.configure do |config|
Project.delete_all
Category.delete_all
end
- config.extend WithModel if defined? WithModel
end
class Ability | moving with_model rspec configuration into Active Record model adapter spec | ryanb_cancan | train | rb,rb |
67d40df3298b3abfca864214c776dbdf4cc481cb | diff --git a/src/ddp.js b/src/ddp.js
index <HASH>..<HASH> 100644
--- a/src/ddp.js
+++ b/src/ddp.js
@@ -362,8 +362,12 @@ class DDP extends EventEmitter {
if (numberOfPending > 0 && this.status === 'connected') {
this.emit('restoring');
subscriptionsToRestore.forEach((id) => {
- this.subscriptions[id].setCallback(cb);
- this.socket.send(this.subscriptions[id].toDDPMessage(id));
+ // NOTE: Double check if this is still a valid subscription just in case,
+ // e.g. it could have been manually stopped by the time we got here.
+ if (this.subscriptions[id]) {
+ this.subscriptions[id].setCallback(cb);
+ this.socket.send(this.subscriptions[id].toDDPMessage(id));
+ }
});
} else {
reconcileCollections();
@@ -391,6 +395,10 @@ class DDP extends EventEmitter {
if (this.status === 'connected') {
this.socket.send({ id, msg: 'unsub' });
}
+ const i = this.subscriptionsToRestore.indexOf(id);
+ if (i >= 0) {
+ this.subscriptionsToRestore.splice(i, 1);
+ }
delete this.subscriptions[id];
if (onStop) {
onStop(); | Fix error when subscription id is deleted early | theclinician_ddp-client | train | js |
ae9b7b07f1c8372396a0a98322875fc60c773d5a | diff --git a/lib/statsd.js b/lib/statsd.js
index <HASH>..<HASH> 100644
--- a/lib/statsd.js
+++ b/lib/statsd.js
@@ -51,12 +51,7 @@ function getKey(stat) {
}
function getSlowKey(stat, prefix) {
- /*eslint complexity: [2, 30]*/
- switch (prefix) {
- // other types
- default:
- return 'tchannel.bad-stat-object';
- }
+ return 'tchannel.bad-stat-object';
}
TChannelStatsd.prototype.onStat = function onStat(stat) { | lib/statsd: drop unused relay latency slow key | uber_tchannel-node | train | js |
5209d425961fb6bc0fa8636a71702c1f8477b943 | diff --git a/lib/ey-deploy/version.rb b/lib/ey-deploy/version.rb
index <HASH>..<HASH> 100644
--- a/lib/ey-deploy/version.rb
+++ b/lib/ey-deploy/version.rb
@@ -1,3 +1,3 @@
module EY
- VERSION = '0.4.1.pre'
+ VERSION = '0.4.1'
end | Bump to version <I> | engineyard_engineyard-serverside | train | rb |
fbda40c0b9e964528f86b85852aeebab391f359c | diff --git a/drools-core/src/main/java/org/drools/core/common/AbstractWorkingMemory.java b/drools-core/src/main/java/org/drools/core/common/AbstractWorkingMemory.java
index <HASH>..<HASH> 100644
--- a/drools-core/src/main/java/org/drools/core/common/AbstractWorkingMemory.java
+++ b/drools-core/src/main/java/org/drools/core/common/AbstractWorkingMemory.java
@@ -374,8 +374,6 @@ public class AbstractWorkingMemory
}
this.agenda.setWorkingMemory(this);
- initManagementBeans();
-
if ( initInitFactHandle ) {
initInitialFact(ruleBase, null);
}
@@ -1770,6 +1768,7 @@ public class AbstractWorkingMemory
public void setKnowledgeRuntime(InternalKnowledgeRuntime kruntime) {
this.kruntime = kruntime;
this.processRuntime = createProcessRuntime();
+ initManagementBeans();
}
public InternalKnowledgeRuntime getKnowledgeRuntime() { | BZ-<I> - JMX does not show process data
- delaying initManagementBeans() until processRuntime is created | kiegroup_drools | train | java |
171130db1c22f56384fc695f2952b8909898e56b | diff --git a/shinken/misc/regenerator.py b/shinken/misc/regenerator.py
index <HASH>..<HASH> 100644
--- a/shinken/misc/regenerator.py
+++ b/shinken/misc/regenerator.py
@@ -252,7 +252,6 @@ class Regenerator(object):
# Link SERVICEGROUPS with services
for sg in inp_servicegroups:
new_members = []
- print sg.members
for (i, sname) in sg.members:
if i not in inp_services:
continue | Remove a print statement in the regenerator (who wants to see servicegroup members?) | Alignak-monitoring_alignak | train | py |
fcbd56f051fe4cc2e806dc3b0c03269cf9569d2c | diff --git a/lib/jets/aws_info.rb b/lib/jets/aws_info.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/aws_info.rb
+++ b/lib/jets/aws_info.rb
@@ -49,6 +49,8 @@ module Jets
# aws sts get-caller-identity
def account
return '123456789' if test?
+ return ENV['JETS_AWS_ACCOUNT'] if ENV['JETS_AWS_ACCOUNT']
+
# ensure region set, required for sts.get_caller_identity.account to work
ENV['AWS_REGION'] ||= region
begin
diff --git a/lib/jets/resource/lambda/function/environment.rb b/lib/jets/resource/lambda/function/environment.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/resource/lambda/function/environment.rb
+++ b/lib/jets/resource/lambda/function/environment.rb
@@ -19,6 +19,7 @@ class Jets::Resource::Lambda::Function
env[:JETS_ENV_EXTRA] = Jets.config.env_extra if Jets.config.env_extra
env[:JETS_PROJECT_NAME] = ENV['JETS_PROJECT_NAME'] if ENV['JETS_PROJECT_NAME']
env[:JETS_STAGE] = Jets::Resource::ApiGateway::Deployment.stage_name
+ env[:JETS_AWS_ACCOUNT] = Jets.aws.account
env
end | set AWS_ACCOUNT env var on function to prevent the sts call on Jets.boot on AWS Lambda | tongueroo_jets | train | rb,rb |
711bb11483a0ccb46600795c636c98d9c3a7f16c | diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go
index <HASH>..<HASH> 100644
--- a/workflow/controller/operator.go
+++ b/workflow/controller/operator.go
@@ -1944,7 +1944,7 @@ func processItem(fstTmpl *fasttemplate.Template, name string, index int, item wf
vals := make([]string, 0)
for itemKey, itemVal := range item.MapVal {
replaceMap[fmt.Sprintf("item.%s", itemKey)] = fmt.Sprintf("%v", itemVal)
-
+ vals = append(vals, fmt.Sprintf("%s:%s", itemKey, itemVal))
}
// sort the values so that the name is deterministic
sort.Strings(vals) | Fix withParam node naming issue (#<I>) | argoproj_argo | train | go |
288575fa3225559ba98965b716e3c081711ec799 | diff --git a/salt/auth/ldap.py b/salt/auth/ldap.py
index <HASH>..<HASH> 100644
--- a/salt/auth/ldap.py
+++ b/salt/auth/ldap.py
@@ -284,7 +284,11 @@ def auth(username, password):
'''
Simple LDAP auth
'''
- #If bind credentials are configured, use them instead of user's
+ if not HAS_LDAP:
+ log.error('LDAP authentication requires python-ldap module')
+ return False
+
+ # If bind credentials are configured, use them instead of user's
if _config('binddn', mandatory=False) and _config('bindpw', mandatory=False):
bind = _bind_for_search(anonymous=_config('anonymous', mandatory=False))
else: | Log an error if python-ldap is not installed and ldap auth is used | saltstack_salt | train | py |
c33dfb92853321e51cd55d55eff191bb4ab00ecf | diff --git a/src/Strategies/BootstrapStrategy.php b/src/Strategies/BootstrapStrategy.php
index <HASH>..<HASH> 100644
--- a/src/Strategies/BootstrapStrategy.php
+++ b/src/Strategies/BootstrapStrategy.php
@@ -23,6 +23,10 @@ class BootstrapStrategy
public function shouldAllow()
{
+ if (getenv('VAIMO_COMPOSER_PATCHER_ALLOW_GLOBAL_COMMANDS', true)) {
+ return true;
+ }
+
if (!$this->isPluginAvailable()) {
return false;
} | allow to use a global installation of this plugin | vaimo_composer-patches | train | php |
43c3ab1c43273310d200682d377e95ea0a3a186f | diff --git a/lib/default_value_for.rb b/lib/default_value_for.rb
index <HASH>..<HASH> 100644
--- a/lib/default_value_for.rb
+++ b/lib/default_value_for.rb
@@ -41,7 +41,11 @@ module DefaultValueFor
end
def evaluate(instance)
- return @block.call(instance)
+ if @block.arity == 0
+ return @block.call
+ else
+ return @block.call(instance)
+ end
end
end
diff --git a/test.rb b/test.rb
index <HASH>..<HASH> 100644
--- a/test.rb
+++ b/test.rb
@@ -224,7 +224,8 @@ class DefaultValuePluginTest < Test::Unit::TestCase
def test_default_values
define_model_class do
default_values :type => "normal",
- :number => lambda { 10 + 5 }
+ :number => lambda { 10 + 5 },
+ :timestamp => lambda {|_| Time.now }
end
object = TestClass.new | Test was breaking when default_values was given a lambda of arity 0. Added logic to check block's arity and only pass the instance if it is non-0. | FooBarWidget_default_value_for | train | rb,rb |
92bfd6970776a6e4eca0ab329ff50b672fc4dd2d | diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/bot.rb
+++ b/lib/discordrb/bot.rb
@@ -503,7 +503,7 @@ module Discordrb
# Internal handler for GUILD_UPDATE
def update_guild(data)
- @servers[data['id']].update_data(data)
+ @servers[data['id'].to_i].update_data(data)
end
# Internal handler for GUILD_DELETE | Use the integer ID to update server data on the event | meew0_discordrb | train | rb |
45d790ce4de3ff7cbb79b1b22effb283f28c78d6 | diff --git a/lib/texmath/converter.rb b/lib/texmath/converter.rb
index <HASH>..<HASH> 100644
--- a/lib/texmath/converter.rb
+++ b/lib/texmath/converter.rb
@@ -52,6 +52,8 @@ module TeXMath
raise ArgumentError.new(error) unless error.empty?
return output.strip
end
+ rescue Errno::ENOENT
+ raise ArgumentError.new("Can't find the '#{EXECUTABLE}' executable.")
end
attr_reader :reader, :writer | Raise ArgumentError when executable isn't found | hollingberry_texmath-ruby | train | rb |
730085961af57075865c2b297bcedc07caed6e88 | diff --git a/lib/librarian/dsl.rb b/lib/librarian/dsl.rb
index <HASH>..<HASH> 100644
--- a/lib/librarian/dsl.rb
+++ b/lib/librarian/dsl.rb
@@ -68,6 +68,8 @@ module Librarian
end
def run(specfile = nil, sources = [])
+ specfile, sources = nil, specfile if specfile.kind_of?(Array) && sources.empty?
+
Target.new(self).tap do |target|
target.precache_sources(sources)
debug_named_source_cache("Pre-Cached Sources", target) | Fix the arguments to Librarian::Dsl#run.
To handle the case where it is passed 0 or 1 arguments. | applicationsonline_librarian | train | rb |
3a1701ea9d86fe3b91de2161201abc36cd921de3 | diff --git a/spec/install_spec.rb b/spec/install_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/install_spec.rb
+++ b/spec/install_spec.rb
@@ -1,15 +1,20 @@
require 'spec_helper'
+require "fileutils"
describe Lobot::InstallGenerator do
include GeneratorSpec::TestCase
destination File.expand_path("../tmp", __FILE__)
# arguments %w(something)
- before(:each) do
+ before do
prepare_destination
run_generator
end
+ after :all do
+ FileUtils.rm_rf ::File.expand_path("../tmp", __FILE__)
+ end
+
it "creates ci.yml" do
assert_file "config/ci.yml", /app_name/
end | Clean up spec/tmp after spec runs. | pivotal-legacy_lobot | train | rb |
f7c63065e596a7694fadefdb858d5d3ec68d2030 | diff --git a/pycbc/results/legacy_grb.py b/pycbc/results/legacy_grb.py
index <HASH>..<HASH> 100755
--- a/pycbc/results/legacy_grb.py
+++ b/pycbc/results/legacy_grb.py
@@ -22,13 +22,10 @@
from __future__ import division
-import os,sys,datetime,re,glob,shutil,ConfigParser
+import re
from argparse import ArgumentParser
-import random
-import string
-from pycbc.workflow.core import make_external_call
from glue import markup
-from pylal import grbsummary,rate,antenna,git_version
+from pylal import antenna,git_version
from lal.gpstime import gps_to_utc,LIGOTimeGPS
__author__ = "Andrew Williamson <[email protected]>" | Removing unused imports from legacy_grb.py | gwastro_pycbc | train | py |
83adda70dbd7caf424957d8575fa85baddc4aa04 | diff --git a/src/Application.php b/src/Application.php
index <HASH>..<HASH> 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -228,7 +228,7 @@ class Application extends BaseApplication
if (true === $input->hasParameterOption(['--shell', '-s'])) {
$this->runShell($input);
- return;
+ return 0;
}
if (true === $input->hasParameterOption(array('--generate-doc', '--gd'))) {
@@ -240,7 +240,7 @@ class Application extends BaseApplication
);
}
- parent::doRun($input, $output);
+ return parent::doRun($input, $output);
}
/** | Add exit code for Application::doRun()
Symfony console application expected that method doRun() will return an exit code: zero if everything went fine, or an error code.
It prevents `The command terminated with an error status ()` error after every command in console. | hechoendrupal_drupal-console | train | php |
de128d15dc954a0261227d3a7c8919686ff67d05 | diff --git a/src/sync.js b/src/sync.js
index <HASH>..<HASH> 100644
--- a/src/sync.js
+++ b/src/sync.js
@@ -116,7 +116,7 @@ function handleError(m, key, error) {
// TODO: this should be configurable for each sync
if (key !== "sso") {
- const stopError = new Error("An error ocurred when fetching data.");
+ const stopError = new Error("An error occurred when fetching data.");
stopError.code = "sync";
stopError.origin = error;
result = l.stop(result, stopError); | Fix spelling of occurred (#<I>)
Just bugged me. ;) | auth0_lock | train | js |
a87cc5e7708ff7c3fcec1e05a0d70e1f7923e17f | diff --git a/lib/rb/ext/extconf.rb b/lib/rb/ext/extconf.rb
index <HASH>..<HASH> 100644
--- a/lib/rb/ext/extconf.rb
+++ b/lib/rb/ext/extconf.rb
@@ -24,7 +24,7 @@ else
$ARCH_FLAGS = Config::CONFIG['CFLAGS'].scan( /(-arch )(\S+)/ ).map{|x,y| x + y + ' ' }.join('')
- $CFLAGS = "-g -O2 -Wall -Werror " + $ARCH_FLAGS
+ $CFLAGS = "-fsigned-char -g -O2 -Wall -Werror " + $ARCH_FLAGS
have_func("strlcpy", "string.h") | Thrift-<I>: Ruby extension on ARM complains about signed chars
Client: rb
Patch: Elias Karakoulakis
Updated extension makefile to use signed char flag | limingxinleo_thrift | train | rb |
0bfa1bee63f7569a32ec44f57bdd48d4fd72bd21 | diff --git a/test/robinhood.js b/test/robinhood.js
index <HASH>..<HASH> 100644
--- a/test/robinhood.js
+++ b/test/robinhood.js
@@ -4,37 +4,19 @@
* @license AGPLv3 - See LICENSE file for more details
*/
-var should = require('should'),
- Robinhood = require('../src/robinhood.js');
-
+var should = require('should');
+var Robinhood = require('../src/robinhood');
+
describe('Robinhood API', function() {
- var trader = null;
-
- before(function(done){
- // I don't have a valid username at the moment
- // so can't really test this
- try{
- trader = Robinhood({
- username: 'user',
- password: 'pass'
- }, function(){
- done();
- return;
- });
- }catch(err){
- done(err);
- return;
- }
- });
-
- it('Should get Quote data', function(done) {
- trader.quote_data('GOOG', function(err, httpResponse, body){
- if(err){
- done(err);
- return;
- }
- console.log('Quote data:', body);
- done();
+ it('Should get GOOGLE quote', function(done) {
+ Robinhood(null).quote_data('GOOG', function(err, response, body) {
+ if(err){
+ done(err);
+ return;
+ }
+
+ console.log(body);
+ done();
+ });
});
- });
}); | test cleanup. Still needs to assert things | aurbano_robinhood-node | train | js |
131c3be9e3f2a0385fe519036f19a93256a21e40 | diff --git a/lib/spout/version.rb b/lib/spout/version.rb
index <HASH>..<HASH> 100644
--- a/lib/spout/version.rb
+++ b/lib/spout/version.rb
@@ -3,7 +3,7 @@ module Spout
MAJOR = 0
MINOR = 8
TINY = 0
- BUILD = "beta1" # nil, "pre", "rc", "rc2"
+ BUILD = "beta2" # nil, "pre", "rc", "rc2"
STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
end | Version bump to <I>.beta2 | nsrr_spout | train | rb |
a7d1dc7ac30005a4729e277ec45b64c18da8d668 | diff --git a/facade/pool.go b/facade/pool.go
index <HASH>..<HASH> 100644
--- a/facade/pool.go
+++ b/facade/pool.go
@@ -80,7 +80,7 @@ func (f *Facade) addResourcePool(ctx datastore.Context, entity *pool.ResourcePoo
return err
} else if err = f.poolStore.Put(ctx, pool.Key(entity.ID), entity); err != nil {
return err
- } else if err = f.zzk.UpdateResourcePool(entity); err != nil {
+ } else if err = f.zzk.updateResourcePool(entity); err != nil {
return err
} | don't use public update to update resource pool | control-center_serviced | train | go |
0448c2db040a88b4412fd9115ae470260554dfb2 | diff --git a/src/Phinx/Migration/Manager.php b/src/Phinx/Migration/Manager.php
index <HASH>..<HASH> 100644
--- a/src/Phinx/Migration/Manager.php
+++ b/src/Phinx/Migration/Manager.php
@@ -132,6 +132,10 @@ class Manager
$versions = $env->getVersions();
$current = $env->getCurrentVersion();
+ if (empty($versions) && empty($migrations)) {
+ return;
+ }
+
if (null === $version) {
$version = max(array_merge($versions, array_keys($migrations)));
} else { | Fix warnings on migrate with no versions or migrations | cakephp_phinx | train | php |
96f282f00d6c3949d70cb7c2d04e5e56c92d3a2c | diff --git a/src/intercooler.js b/src/intercooler.js
index <HASH>..<HASH> 100644
--- a/src/intercooler.js
+++ b/src/intercooler.js
@@ -1918,6 +1918,8 @@ var Intercooler = Intercooler || (function() {
isDependent: isDependent,
getTarget: getTarget,
processHeaders: processHeaders,
+ startPolling: startPolling,
+ cancelPolling: cancelPolling,
setIsDependentFunction: function(func) {
_isDependentFunction = func;
}, | Expose the polling methods in the public API
I need to be able to start and pause polling dynamically on the client side. To do that I have added startPolling and cancelPolling to the public API. | intercoolerjs_intercooler-js | train | js |
c867aa09343b55cbcb600958542d6e8b0c405d86 | diff --git a/category_encoders/target_encoder.py b/category_encoders/target_encoder.py
index <HASH>..<HASH> 100644
--- a/category_encoders/target_encoder.py
+++ b/category_encoders/target_encoder.py
@@ -11,10 +11,11 @@ __author__ = 'chappers'
class TargetEncoder(BaseEstimator, TransformerMixin):
def __init__(self, verbose=0, cols=None, drop_invariant=False, return_df=True, impute_missing=True,
handle_unknown='impute', min_samples_leaf=1, smoothing=1.0):
- """Target Encode for categorical features. Categorical variables are replaced with a blend
- of the average of the target over all the training data and the average of the
- target over the training data taking the given categorical value.
-
+ """Target encoding for categorical features.
+ For the case of categorical target: features are replaced with a blend of posterior probability of the target
+ given particular categorical value and prior probability of the target over all the training data.
+ For the case of continuous target: features are replaced with a blend of expected value of the target
+ given particular categorical value and expected value of the target over all the training data.
Parameters
---------- | Issue #<I>. Corrected misleading description for the TargetEncoder. Merge with temporary version of description. | scikit-learn-contrib_categorical-encoding | train | py |
6a572dd1e9730e9df80f3a8f0a2fc89984aca286 | diff --git a/nion/swift/Panel.py b/nion/swift/Panel.py
index <HASH>..<HASH> 100644
--- a/nion/swift/Panel.py
+++ b/nion/swift/Panel.py
@@ -122,15 +122,16 @@ class OutputPanel(Panel):
self.__old_stderr = sys.stderr
class StdoutCatcher:
- def __init__(self):
- pass
+ def __init__(self, out):
+ self.__out = out
def write(self, stuff):
queue_message(stuff)
+ self.__out.write(stuff)
def flush(self):
- pass
+ self.__out.flush()
- sys.stdout = StdoutCatcher()
- sys.stderr = sys.stdout
+ sys.stdout = StdoutCatcher(self.__old_stdout)
+ sys.stderr = StdoutCatcher(self.__old_stderr)
def close(self):
sys.stdout = self.__old_stdout | Fix output bug, ensuring output override is chained in OutputPanel. | nion-software_nionswift | train | py |
b9e0c0a2139f5bdebbca9f778780a5b0f38174e3 | diff --git a/src/Joomlatools/Console/Application.php b/src/Joomlatools/Console/Application.php
index <HASH>..<HASH> 100644
--- a/src/Joomlatools/Console/Application.php
+++ b/src/Joomlatools/Console/Application.php
@@ -110,6 +110,7 @@ class Application extends \Symfony\Component\Console\Application
new Command\ExtensionSymlink(),
new Command\ExtensionInstall(),
new Command\ExtensionInstallFile(),
+ new Command\ExtensionRegister(),
new Command\PluginList(),
new Command\PluginInstall(),
new Command\PluginUninstall(), | re #<I>: Add missing command to the list. | joomlatools_joomlatools-console | train | php |
1d1be9bf06cef17778b18d04c30f32896b5f9caa | diff --git a/api/service/service_instance.go b/api/service/service_instance.go
index <HASH>..<HASH> 100644
--- a/api/service/service_instance.go
+++ b/api/service/service_instance.go
@@ -15,28 +15,15 @@ type ServiceInstance struct {
func (si *ServiceInstance) Create() error {
err := db.Session.ServiceInstances().Insert(si)
return err
- // s := si.Service()
- // apps := si.AllApps()
- // appUnit := unit.Unit{Name: apps[0].Name}
- // serviceUnit := unit.Unit{Name: s.Name}
- // appUnit.AddRelation(&serviceUnit)
- /* return nil */
}
func (si *ServiceInstance) Delete() error {
doc := bson.M{"_id": si.Name, "apps": si.Apps}
err := db.Session.ServiceInstances().Remove(doc)
return err
- // s := si.Service()
- // a := si.AllApps()
- // appUnit := unit.Unit{Name: a.Name}
- // serviceUnit := unit.Unit{Name: s.Name}
- // appUnit.RemoveRelation(&serviceUnit)
- /* return nil */
}
func (si *ServiceInstance) Service() *Service {
- //s := &Service{"_id": si.ServiceName}
s := &Service{}
db.Session.Services().Find(bson.M{"_id": si.ServiceName}).One(&s)
return s | Removing commented code on service instance schema | tsuru_tsuru | train | go |
Subsets and Splits