diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/webtul/db.py b/webtul/db.py
index <HASH>..<HASH> 100644
--- a/webtul/db.py
+++ b/webtul/db.py
@@ -103,7 +103,10 @@ class MySQL:
if not isinstance(param, list) and not isinstance(param, tuple):
param = (param,)
cursor = self.conn.cursor()
- ret = cursor.execute(sql, param)
+ if param is not ():
+ ret = cursor.execute(sql, param)
+ else:
+ ret = cursor.execute(sql)
res = cursor.fetchall()
cursor.close()
return ret, res | fix a bug that sql statement have %s or %s and so on, that it doesn't work |
diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -222,10 +222,10 @@ func readContents(path string) ([]byte, error) {
if err != nil {
return nil, err
}
+ defer res.Body.Close()
if res.StatusCode != http.StatusOK {
return nil, fmt.Errorf("status %s", res.Status)
}
- defer res.Body.Close()
return ioutil.ReadAll(res.Body)
} | close the response body regardless of the status code
Change-Id: Ieb4aecebfa<I>a<I>adca<I>e<I>f2b<I> |
diff --git a/docs/webpack.prd.config.js b/docs/webpack.prd.config.js
index <HASH>..<HASH> 100644
--- a/docs/webpack.prd.config.js
+++ b/docs/webpack.prd.config.js
@@ -57,14 +57,14 @@ module.exports = Object.assign({}, webpackBaseConfig, {
context: '.',
manifest: dllManifest,
}),
- // new webpack.optimize.UglifyJsPlugin({
- // compress: {
- // warnings: false,
- // },
- // output: {
- // comments: false,
- // },
- // }),
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false,
+ },
+ output: {
+ comments: false,
+ },
+ }),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'), | minify docs bundle in production |
diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py
index <HASH>..<HASH> 100644
--- a/telethon/tl/custom/message.py
+++ b/telethon/tl/custom/message.py
@@ -90,6 +90,9 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
You may want to access the `photo`, `document`
etc. properties instead.
+ If the media was not present or it was :tl:`MessageMediaEmpty`,
+ this member will instead be ``None`` for convenience.
+
reply_markup (:tl:`ReplyMarkup`):
The reply markup for this message (which was sent
either via a bot or by a bot). You probably want
@@ -153,7 +156,9 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
self.message = message
self.fwd_from = fwd_from
self.via_bot_id = via_bot_id
- self.media = media
+ self.media = None if isinstance(
+ media, types.MessageMediaEmpty) else media
+
self.reply_markup = reply_markup
self.entities = entities
self.views = views | Set media as None if it is MessageMediaEmpty |
diff --git a/cli/lib/cli/version.rb b/cli/lib/cli/version.rb
index <HASH>..<HASH> 100644
--- a/cli/lib/cli/version.rb
+++ b/cli/lib/cli/version.rb
@@ -1,5 +1,5 @@
module Bosh
module Cli
- VERSION = "0.3.7"
+ VERSION = "0.4.0"
end
end | CLI -> <I> (new syntax for some commands) |
diff --git a/src/IBAN/Core/IBAN.php b/src/IBAN/Core/IBAN.php
index <HASH>..<HASH> 100644
--- a/src/IBAN/Core/IBAN.php
+++ b/src/IBAN/Core/IBAN.php
@@ -70,6 +70,7 @@ class IBAN
}
private function getNumericRepresentation($letterRepresentation) {
+ $numericRepresentation = '';
foreach (str_split($letterRepresentation) as $char) {
if (array_search($char, \IBAN\Core\Constants::$letterMapping)) {
$numericRepresentation .= array_search($char, \IBAN\Core\Constants::$letterMapping) + 9; | Initialized property numericRepresentation |
diff --git a/src/feat/agencies/emu/database.py b/src/feat/agencies/emu/database.py
index <HASH>..<HASH> 100644
--- a/src/feat/agencies/emu/database.py
+++ b/src/feat/agencies/emu/database.py
@@ -157,6 +157,9 @@ class Database(common.ConnectionManager, log.LogProxy, ChangeListener,
d.addCallback(self._perform_reduce, factory)
return d
+ def disconnect(self):
+ pass
+
### private
def _matches_filter(self, tup, **filter_options):
diff --git a/src/feat/agencies/net/agency.py b/src/feat/agencies/net/agency.py
index <HASH>..<HASH> 100644
--- a/src/feat/agencies/net/agency.py
+++ b/src/feat/agencies/net/agency.py
@@ -416,6 +416,8 @@ class Agency(agency.Agency):
d.addCallback(defer.drop_param, self._gateway.cleanup)
if self._journaler:
d.addCallback(defer.drop_param, self._journaler.close)
+ if self._database:
+ d.addCallback(defer.drop_param, self._database.disconnect)
if self._broker:
d.addCallback(defer.drop_param, self._broker.disconnect)
return d | Disconnect the DB when terminating the agency |
diff --git a/Random.php b/Random.php
index <HASH>..<HASH> 100644
--- a/Random.php
+++ b/Random.php
@@ -164,7 +164,7 @@ class Random {
* @param int $size
* The number of random keys to add to the object.
*
- * @return \stdClass
+ * @return object
* The generated object, with the specified number of random keys. Each key
* has a random string value.
*/ | Issue #<I> by yogeshmpawar, idebr, pifagor, klausi: Fix unused imports and update Coder to <I> |
diff --git a/lib/jdbc_adapter/jdbc_postgre.rb b/lib/jdbc_adapter/jdbc_postgre.rb
index <HASH>..<HASH> 100644
--- a/lib/jdbc_adapter/jdbc_postgre.rb
+++ b/lib/jdbc_adapter/jdbc_postgre.rb
@@ -121,7 +121,9 @@ module ::JdbcSpec
end
def quote_regclass(table_name)
- table_name.to_s.split('.').map { |part| quote_table_name(part) }.join('.')
+ table_name.to_s.split('.').map do |part|
+ part =~ /".*"/i ? part : quote_table_name(part)
+ end.join('.')
end
# Find a table's primary key and sequence. | FIX: table name parts were being quoted, even if they already had quotes. |
diff --git a/test_project/tests/model_tests.py b/test_project/tests/model_tests.py
index <HASH>..<HASH> 100644
--- a/test_project/tests/model_tests.py
+++ b/test_project/tests/model_tests.py
@@ -251,6 +251,26 @@ class TestEntityManager(EntityTestCase):
set(entities_0se).union([team_entity, team2_entity, team_group_entity, competitor_entity]),
set(Entity.objects.intersect_super_entities()))
+ def test_intersect_super_entities_none_is_type(self):
+ """
+ Tests the base case of intersection on no super entities with a type specified.
+ """
+ # Create test accounts that have three types of super entities
+ team = Team.objects.create()
+ team2 = Team.objects.create()
+ team_group = TeamGroup.objects.create()
+ competitor = Competitor.objects.create()
+
+ # Create accounts that have four super entities
+ for i in range(5):
+ Account.objects.create(competitor=competitor, team=team, team2=team2, team_group=team_group)
+
+ # Create accounts that have no super entities
+ entities_0se = set(Entity.objects.get_for_obj(Account.objects.create()) for i in range(5))
+
+ self.assertEquals(
+ set(entities_0se), set(Entity.objects.intersect_super_entities().is_type(self.account_type)))
+
def test_intersect_super_entities_manager(self):
"""
Tests the intersection of super entity types for an entity directly from the entity manager. | added one more test for intersection with type filtering |
diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/client/ssh/__init__.py
+++ b/salt/client/ssh/__init__.py
@@ -137,7 +137,7 @@ class SSH(object):
def get_pubkey(self):
'''
- Return the keystring for the SSH public key
+ Return the key string for the SSH public key
'''
priv = self.opts.get(
'ssh_priv',
@@ -245,7 +245,7 @@ class SSH(object):
def handle_ssh(self):
'''
Spin up the needed threads or processes and execute the subsequent
- rouintes
+ routines
'''
que = multiprocessing.Queue()
running = {}
@@ -470,7 +470,7 @@ class Single(object):
def cmd(self):
'''
- Prepare the precheck command to send to the subsystem
+ Prepare the pre-check command to send to the subsystem
'''
# 1. check if python is on the target
# 2. check is salt-call is on the target
@@ -496,7 +496,7 @@ class Single(object):
def cmd_block(self, is_retry=False):
'''
- Prepare the precheck command to send to the subsystem
+ Prepare the pre-check command to send to the subsystem
'''
# 1. check if python is on the target
# 2. check is salt-call is on the target | More spelling fixes in in-line docs. |
diff --git a/core-bundle/src/Resources/contao/library/Contao/Model/Collection.php b/core-bundle/src/Resources/contao/library/Contao/Model/Collection.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/library/Contao/Model/Collection.php
+++ b/core-bundle/src/Resources/contao/library/Contao/Model/Collection.php
@@ -139,13 +139,11 @@ class Collection implements \ArrayAccess, \Countable, \IteratorAggregate
static public function createFromDbResult(\Database\Result $objResult, $strTable)
{
$arrModels = array();
+ $strClass = \Model::getClassFromTable($strTable);
while ($objResult->next())
{
- $strClass = \Model::getClassFromTable($strTable);
- $strPk = $strClass::getPk();
- $intPk = $objResult->$strPk;
- $objModel = \Model\Registry::getInstance()->fetch($strTable, $intPk);
+ $objModel = \Model\Registry::getInstance()->fetch($strTable, $objResult->{$strClass::getPk()});
if ($objModel !== null)
{ | [Core] Micro-optimize the `Model\Collection::createFromDbResult()` method |
diff --git a/core/src/main/java/jenkins/util/JSONSignatureValidator.java b/core/src/main/java/jenkins/util/JSONSignatureValidator.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/jenkins/util/JSONSignatureValidator.java
+++ b/core/src/main/java/jenkins/util/JSONSignatureValidator.java
@@ -73,6 +73,9 @@ public class JSONSignatureValidator {
// which isn't useful at all
Set<TrustAnchor> anchors = new HashSet<TrustAnchor>(); // CertificateUtil.getDefaultRootCAs();
Jenkins j = Jenkins.getInstance();
+ if (j == null) {
+ return FormValidation.error("Jenkins has shut down, cannot find root CAs");
+ }
for (String cert : (Set<String>) j.servletContext.getResourcePaths("/WEB-INF/update-center-rootCAs")) {
if (cert.endsWith(".txt")) continue; // skip text files that are meant to be documentation
anchors.add(new TrustAnchor((X509Certificate)cf.generateCertificate(j.servletContext.getResourceAsStream(cert)),null)); | Avoid NPE if DailyCheck happens to run during shutdown. |
diff --git a/tests/acceptance/SwitchOffCest.php b/tests/acceptance/SwitchOffCest.php
index <HASH>..<HASH> 100644
--- a/tests/acceptance/SwitchOffCest.php
+++ b/tests/acceptance/SwitchOffCest.php
@@ -46,7 +46,15 @@ class SwitchOffCest extends Cest {
] );
$I->amEditingPostWithId( $id );
$I->switchOff();
- $I->seeCurrentUrlEquals( '/hello-world?switched_off=true' );
+
+ try {
+ // WordPress >= 5.7:
+ $I->seeCurrentUrlEquals( '/hello-world?switched_off=true' );
+ } catch ( \PHPUnit\Framework\ExpectationFailedException $e ) {
+ // WordPress < 5.7:
+ $I->seeCurrentUrlEquals( '?switched_off=true' );
+ }
+
$I->amLoggedOut();
} | Allow the redirect location assertion to vary. |
diff --git a/release/long_running_tests/workloads/serve_failure.py b/release/long_running_tests/workloads/serve_failure.py
index <HASH>..<HASH> 100644
--- a/release/long_running_tests/workloads/serve_failure.py
+++ b/release/long_running_tests/workloads/serve_failure.py
@@ -56,7 +56,6 @@ class RandomKiller:
class RandomTest:
def __init__(self, max_deployments=1):
- self.client = serve.connect()
self.max_deployments = max_deployments
self.weighted_actions = [
(self.create_deployment, 1),
@@ -69,8 +68,7 @@ class RandomTest:
def create_deployment(self):
if len(self.deployments) == self.max_deployments:
deployment_to_delete = self.deployments.pop()
- self.client.delete_deployment(deployment_to_delete)
- self.client.delete_backend(deployment_to_delete)
+ serve.delete_deployment(deployment_to_delete)
new_name = "".join(
[random.choice(string.ascii_letters) for _ in range(10)]) | Serve failure release test fix (#<I>)
This test is currently not tested in CI |
diff --git a/benchbuild/project.py b/benchbuild/project.py
index <HASH>..<HASH> 100644
--- a/benchbuild/project.py
+++ b/benchbuild/project.py
@@ -227,7 +227,7 @@ class Project(metaclass=ProjectDecorator):
source: Sources = attr.ib(
default=attr.Factory(lambda self: type(self).SOURCE, takes_self=True))
- primary_source: source.BaseSource = attr.ib(init=False)
+ primary_source: str = attr.ib(init=False)
@primary_source.default
def __default_primary_source(self) -> str: | project: annotate the correct type |
diff --git a/Lib/glyphsLib/classes.py b/Lib/glyphsLib/classes.py
index <HASH>..<HASH> 100755
--- a/Lib/glyphsLib/classes.py
+++ b/Lib/glyphsLib/classes.py
@@ -401,14 +401,19 @@ class GSCustomParameter(GSBase):
class GSAlignmentZone(GSBase):
+
+ def __init__(self, line = None, pos = 0, size = 20):
+ if line:
+ super(GSAlignmentZone, self).__init__(line)
+ else:
+ self.position = pos
+ self.size = size
+
def read(self, src):
if src is not None:
p = point(src)
self.position = float(p.value[0])
self.size = float(p.value[1])
- else:
- self.position = 0
- self.size = 20
return self
def __repr__(self): | add init method to GSAlignmentZone |
diff --git a/devices/philips.js b/devices/philips.js
index <HASH>..<HASH> 100644
--- a/devices/philips.js
+++ b/devices/philips.js
@@ -1866,7 +1866,7 @@ module.exports = [
ota: ota.zigbeeOTA,
},
{
- zigbeeModel: ['LOM002', 'LOM004'],
+ zigbeeModel: ['LOM002', 'LOM004', 'LOM010'],
model: '046677552343',
vendor: 'Philips',
description: 'Hue smart plug bluetooth',
@@ -2104,6 +2104,20 @@ module.exports = [
extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [222, 454]}),
},
{
+ zigbeeModel: ['LWE005'],
+ model: '9290024796',
+ vendor: 'Philips',
+ description: 'Hue Filament White E12',
+ extend: hueExtend.light_onoff_brightness(),
+ },
+ {
+ zigbeeModel: ['LTA007'],
+ model: '9290024783',
+ vendor: 'Philips',
+ description: 'Hue Filament White Ambiance A60/E27 Bluetooth',
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [222, 454]}),
+ },
+ {
zigbeeModel: ['LWV002'],
model: '046677551780',
vendor: 'Philips', | Add LOM<I> to <I> and add <I>, <I> (#<I>)
* Update philips.js
* Update philips.js
* Update philips.js
* Update philips.js
* Update philips.js |
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/resource/apt_repository.rb
+++ b/lib/chef/resource/apt_repository.rb
@@ -120,7 +120,7 @@ class Chef
property :components, Array,
description: "Package groupings, such as 'main' and 'stable'.",
- default: lazy { [] }
+ default: lazy { [] }, default_description: "'main' if using a PPA repository."
property :arch, [String, nil, FalseClass],
description: "Constrain packages to a particular CPU architecture such as 'i386' or 'amd64'." | apt_repository: add a description for components when using a PPA
When you're using a PPA there's a default here that doesn't apply to non-PPA repos. |
diff --git a/test/assertions/to-have-items-satisfying.spec.js b/test/assertions/to-have-items-satisfying.spec.js
index <HASH>..<HASH> 100644
--- a/test/assertions/to-have-items-satisfying.spec.js
+++ b/test/assertions/to-have-items-satisfying.spec.js
@@ -151,14 +151,6 @@ describe('to have items satisfying assertion', () => {
);
});
- it('provides the item index to the callback function', () => {
- var arr = ['0', '1', '2', '3'];
- expect(arr, 'to have items satisfying', function(item, index) {
- expect(index, 'to be a number');
- expect(index, 'to be', parseInt(item, 10));
- });
- });
-
it('fails when the assertion fails', () => {
expect(
function() { | to have items satisfying: Don't expect the index to be passed as the 2nd parameter |
diff --git a/tests/codeception/_support/WorkingSilex.php b/tests/codeception/_support/WorkingSilex.php
index <HASH>..<HASH> 100644
--- a/tests/codeception/_support/WorkingSilex.php
+++ b/tests/codeception/_support/WorkingSilex.php
@@ -26,6 +26,11 @@ class WorkingSilex extends Silex
public function _before(TestInterface $test)
{
$this->reloadApp();
+ }
+
+ protected function loadApp()
+ {
+ parent::loadApp();
$this->app->finish(function () {
if ($this->app['mailer.initialized'] && $this->app['swiftmailer.use_spool'] && $this->app['swiftmailer.spooltransport'] instanceof \Swift_Transport_SpoolTransport) { | [Codeception] Move mailer hack to `loadApp` method to ensure it's always applied. |
diff --git a/src/core/plugin.js b/src/core/plugin.js
index <HASH>..<HASH> 100644
--- a/src/core/plugin.js
+++ b/src/core/plugin.js
@@ -28,4 +28,4 @@ module.exports = plugin;
//module.exports._plugins = _plugins;
module.exports.enable = enable;
module.exports.getList = getList;
-module.exports.getActive = function(){return active};
\ No newline at end of file
+module.exports.getActive = function(){return active;};
\ No newline at end of file
diff --git a/src/loader/particleParser.js b/src/loader/particleParser.js
index <HASH>..<HASH> 100644
--- a/src/loader/particleParser.js
+++ b/src/loader/particleParser.js
@@ -8,6 +8,6 @@ module.exports = function() {
console.log('Es una particula');
next();
- }
+ };
};
\ No newline at end of file | fixed some jshint errors |
diff --git a/SpiffWorkflow/serializer/dict.py b/SpiffWorkflow/serializer/dict.py
index <HASH>..<HASH> 100644
--- a/SpiffWorkflow/serializer/dict.py
+++ b/SpiffWorkflow/serializer/dict.py
@@ -585,9 +585,19 @@ class DictionarySerializer(Serializer):
s_state = dict(name=spec.name,
description=spec.description,
file=spec.file)
+
+ if 'Root' not in spec.task_specs:
+ # This is to fix up the case when we
+ # load in a task spec and there is no root object.
+ # it causes problems when we deserialize and then re-serialize
+ # because the deserialize process adds a root.
+ root = Simple(spec, 'Root')
+ spec.task_specs['Root'] = root
+
mylista = [v for k, v in list(spec.task_specs.items())]
mylist = [(k, v.serialize(self))
for k, v in list(spec.task_specs.items())]
+
s_state['task_specs'] = dict(mylist)
return s_state | Fixed a problem when we had a serialize/deserialize loop where root was not in the initial serialize, but the deserialize added it |
diff --git a/lib/routes.js b/lib/routes.js
index <HASH>..<HASH> 100644
--- a/lib/routes.js
+++ b/lib/routes.js
@@ -28,7 +28,7 @@ const _ = require('lodash'),
*/
function addSiteLocals(site) {
return function (req, res, next) {
- res.locals.url = req.protocol + '://' + req.get('host') + req.originalUrl;
+ res.locals.url = req.protocol + '://' + req.hostname + req.originalUrl;
res.locals.site = site;
next(); | use X-Forwarded-Host for locals.url if exists |
diff --git a/cmd/minikube/cmd/update-context.go b/cmd/minikube/cmd/update-context.go
index <HASH>..<HASH> 100644
--- a/cmd/minikube/cmd/update-context.go
+++ b/cmd/minikube/cmd/update-context.go
@@ -45,5 +45,11 @@ var updateContextCmd = &cobra.Command{
} else {
out.T(style.Meh, `No changes required for the "{{.context}}" context`, out.V{"context": cname})
}
+
+ if err := kubeconfig.SetCurrentContext(cname, kubeconfig.PathFromEnv()); err != nil {
+ out.ErrT(style.Sad, `Error while setting kubectl current context: {{.error}}`, out.V{"error": err})
+ } else {
+ out.T(style.Kubectl, `Current context is "{{.context}}"`, out.V{"context": cname})
+ }
},
} | update-context: Automatically set the context as current/active in kubeconfig |
diff --git a/src/Payload/Decoder.php b/src/Payload/Decoder.php
index <HASH>..<HASH> 100644
--- a/src/Payload/Decoder.php
+++ b/src/Payload/Decoder.php
@@ -55,7 +55,7 @@ class Decoder extends AbstractPayload implements Countable
($payload[0] >> 0b100) & 0b1]; // rsv3
$this->opCode = $payload[0] & 0xF;
- $this->mask = (bool) $payload[1] >> 0b111;
+ $this->mask = (bool) ($payload[1] >> 0b111);
$payloadOffset = 2; | $this->mask is boolean type! |
diff --git a/test/integration/test-promise-wrappers.js b/test/integration/test-promise-wrappers.js
index <HASH>..<HASH> 100644
--- a/test/integration/test-promise-wrappers.js
+++ b/test/integration/test-promise-wrappers.js
@@ -1,5 +1,12 @@
var config = require('../common.js').config;
+var skipTest = false;
+if (!Promise) {
+ console.log('no Promise support, skipping test');
+ skipTest = true;
+ return;
+}
+
var assert = require('assert');
var createConnection = require('../../promise.js').createConnection;
@@ -49,6 +56,9 @@ testBasic();
testErrors();
process.on('exit', function () {
+ if (skipTest) {
+ return;
+ }
assert.equal(doneCalled, true);
assert.equal(exceptionCaught, true);
}); | skip Promise test in node with no Promise support |
diff --git a/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java b/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java
index <HASH>..<HASH> 100644
--- a/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java
+++ b/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java
@@ -19,7 +19,7 @@ import java.util.Map.Entry;
public class NodeChecker extends AbstractScheduledService {
private final static Logger logger = LoggerFactory.getLogger(NodeChecker.class);
- private final NodesInfo action = new NodesInfo.Builder().build();
+ private final NodesInfo action = new NodesInfo.Builder().http(true).build();
//actual client config instance
JestClient client;
ClientConfig clientConfig; | enhancement: NodesInfo action in NodeChecker needs only the http section but requested all. This should reduce the payload for each NodeChecker run. |
diff --git a/lib/jets/spec_helpers.rb b/lib/jets/spec_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/spec_helpers.rb
+++ b/lib/jets/spec_helpers.rb
@@ -9,7 +9,7 @@ module Jets
end
end
-unless ENV["SKIP_MIGRATION_CHECK"] == "true"
+if File.exist?("#{Jets.root}/config/database.yml") && !ENV["SKIP_MIGRATION_CHECK"]
ActiveRecord::Tasks::DatabaseTasks.db_dir = "#{Jets.root}/db"
ActiveRecord::Migration.extend ActiveRecord::MigrationChecker
ActiveRecord::Migration.prepare_test_db | fix rspec execution for projects with no database |
diff --git a/lib/neo4j/rails/railtie.rb b/lib/neo4j/rails/railtie.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/rails/railtie.rb
+++ b/lib/neo4j/rails/railtie.rb
@@ -15,7 +15,6 @@ module Neo4j
# register migrations in config/initializers
initializer "neo4j.start", :after => :load_config_initializers do |app|
Neo4j::Config.setup.merge!(app.config.neo4j.to_hash)
- Neo4j.start
end
end
end | No need to start up neo4j unless needed. E.g. prevent starting neo4j for rake routes. |
diff --git a/lib/tachikoma_ai/strategies/bundler/gem.rb b/lib/tachikoma_ai/strategies/bundler/gem.rb
index <HASH>..<HASH> 100644
--- a/lib/tachikoma_ai/strategies/bundler/gem.rb
+++ b/lib/tachikoma_ai/strategies/bundler/gem.rb
@@ -2,7 +2,7 @@ require 'rubygems'
require 'json'
module TachikomaAi
- module Bundler
+ class Bundler
class Gem
STRING_PATTERN = /[-|\+]\s+(\S+)\s\((.+?)\)/
major, minor = RUBY_VERSION.split('.')
diff --git a/spec/tachikoma_ai/strategies/bundler/gem_spec.rb b/spec/tachikoma_ai/strategies/bundler/gem_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/tachikoma_ai/strategies/bundler/gem_spec.rb
+++ b/spec/tachikoma_ai/strategies/bundler/gem_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
module TachikomaAi
- module Bundler
+ class Bundler
describe Gem do
describe '.parse' do
subject { Gem.parse('+ byebug (5.0.0)') } | :cocktail: Fix the mix of Module and Class |
diff --git a/zipline/utils/calendars/calendar_utils.py b/zipline/utils/calendars/calendar_utils.py
index <HASH>..<HASH> 100644
--- a/zipline/utils/calendars/calendar_utils.py
+++ b/zipline/utils/calendars/calendar_utils.py
@@ -33,6 +33,7 @@ _default_calendar_aliases = {
'ICEUS': 'ICE',
'NYFE': 'ICE',
}
+default_calendar_names = sorted(_default_calendar_factories.keys())
class TradingCalendarDispatcher(object): | BUG/ENH: Allow users to switch between calendars (#<I>)
* BUG: Allow users to switch between calendars
You previously could not switch between different calendars because
the `trading_calendar` parameter was not being passed into run_algo
or `TradingAlgorithm`. You now can pass which calendar you'd like to
use via the CLI using `--trading-calendar`.
* DEV/MAINT: Add pdb++ and change fixtures variable |
diff --git a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java
index <HASH>..<HASH> 100644
--- a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java
+++ b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java
@@ -592,7 +592,15 @@ public class SSHLauncher extends ComputerLauncher {
sftpClient = new SFTPv3Client(connection);
sftpClient.rm(fileName);
} catch (Exception e) {
- e.printStackTrace(listener.error(Messages.SSHLauncher_ErrorDeletingFile(getTimestamp())));
+ if (sftpClient == null) {// system without SFTP
+ try {
+ connection.exec("rm " + fileName, listener.getLogger());
+ } catch (Exception x) {
+ x.printStackTrace(listener.error(Messages.SSHLauncher_ErrorDeletingFile(getTimestamp())));
+ }
+ } else {
+ e.printStackTrace(listener.error(Messages.SSHLauncher_ErrorDeletingFile(getTimestamp())));
+ }
} finally {
if (sftpClient != null) {
sftpClient.close(); | [FIXED HUDSON-<I>] fallback if SFTP is not available. |
diff --git a/Gulpfile.js b/Gulpfile.js
index <HASH>..<HASH> 100644
--- a/Gulpfile.js
+++ b/Gulpfile.js
@@ -3,7 +3,7 @@ var express = require('express');
var fs = require('fs');
var gulp = require('gulp');
var lr = require('tiny-lr');
-var path = require('path')
+var path = require('path');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
@@ -78,7 +78,7 @@ gulp.task('file-system', function () {
});
gulp.task('jshint', function() {
- gulp.src('src/js/**/*.js')
+ gulp.src(['Gulpfile.js', 'src/js/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
}); | add gulpfile to jshint |
diff --git a/gns3server/version.py b/gns3server/version.py
index <HASH>..<HASH> 100644
--- a/gns3server/version.py
+++ b/gns3server/version.py
@@ -23,8 +23,8 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)
-__version__ = "2.2.4"
-__version_info__ = (2, 2, 4, 0)
+__version__ = "2.2.5dev1"
+__version_info__ = (2, 2, 5, -99)
if "dev" in __version__:
try: | Development on <I>dev1 |
diff --git a/pybar/run_manager.py b/pybar/run_manager.py
index <HASH>..<HASH> 100644
--- a/pybar/run_manager.py
+++ b/pybar/run_manager.py
@@ -407,7 +407,7 @@ class RunManager(object):
'''
self.current_run.abort(msg)
- def run_run(self, run, run_conf=None, use_thread=False, catch_exception=True):
+ def run_run(self, run, conf=None, run_conf=None, use_thread=False, catch_exception=True):
'''Runs a run in another thread. Non-blocking.
Parameters
@@ -424,6 +424,9 @@ class RunManager(object):
If use_thread is True, returns function, which blocks until thread terminates, and which itself returns run status.
If use_thread is False, returns run status.
'''
+ if conf is not None:
+ self.conf.update(conf)
+
if isclass(run):
# instantiate the class
run = run(conf=self.conf) | ENH: allow passing conf to run_run |
diff --git a/h2o-core/src/main/java/water/AutoBuffer.java b/h2o-core/src/main/java/water/AutoBuffer.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/AutoBuffer.java
+++ b/h2o-core/src/main/java/water/AutoBuffer.java
@@ -519,6 +519,8 @@ public /* final */ class AutoBuffer {
assert !_read;
_read = true;
_bb.flip();
+ if(_firstPage)
+ _bb.position(2);
_firstPage = true;
return this;
} | Fix auto serial test - auto buffer now leaves 2 bytes of the first buffer of data empty to leave space for message size (if the message is small), fixed flipForReading to account for that |
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index <HASH>..<HASH> 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -2450,6 +2450,7 @@ def load_publickey(type, buffer):
pkey = PKey.__new__(PKey)
pkey._pkey = _ffi.gc(evp_pkey, _lib.EVP_PKEY_free)
+ pkey._only_public = True
return pkey
diff --git a/tests/test_crypto.py b/tests/test_crypto.py
index <HASH>..<HASH> 100644
--- a/tests/test_crypto.py
+++ b/tests/test_crypto.py
@@ -2427,6 +2427,20 @@ def _runopenssl(pem, *args):
return output
+class TestFunctions(object):
+ """
+ py.test-based tests for the free functions in the crypto module.
+
+ If possible, add new tests here.
+ """
+ def test_load_publickey_sets_only_public(self):
+ """
+ _only_public should be set on PKeys loaded with load_publickey.
+ """
+ key = load_publickey(FILETYPE_PEM, cleartextPublicKeyPEM)
+ assert key._only_public is True
+
+
class FunctionTests(TestCase):
"""
Tests for free-functions in the :py:obj:`OpenSSL.crypto` module. | fix a small bug with load_publickey (#<I>)
* fix a small bug with load_publickey
* update docstring, rename test method
* make hynek happy |
diff --git a/src/test/java/org/la4j/matrix/AbstractMatrixTest.java b/src/test/java/org/la4j/matrix/AbstractMatrixTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/la4j/matrix/AbstractMatrixTest.java
+++ b/src/test/java/org/la4j/matrix/AbstractMatrixTest.java
@@ -2060,4 +2060,25 @@ public abstract class AbstractMatrixTest extends TestCase {
assertFalse(b.is(Matrices.TRIDIAGONAL_MATRIX));
}
+ public void testSymmetricMatrixPredicate() {
+
+ Matrix a = factory().createMatrix(new double[][] {
+ { 0.0, 1.0, 0.0, 0.0 },
+ { 1.0, 2.0, 3.0, 5.0 },
+ { 0.0, 3.0, 0.0, 0.0 },
+ { 0.0, 5.0, 0.0, 2.0 }
+ });
+
+ assertTrue(a.is(Matrices.SYMMETRIC_MATRIX));
+
+ Matrix b = factory().createMatrix(new double[][] {
+ { 0.0, 0.0, 0.0, 0.0 },
+ { 0.0, 2.0, 3.0, 0.0 },
+ { 3.0, 3.0, 0.0, 0.0 },
+ { 0.0, 0.0, 0.0, 2.0 }
+ });
+
+ assertFalse(b.is(Matrices.SYMMETRIC_MATRIX));
+
+ }
} | added sym matrix predicate test |
diff --git a/src/HttpResponse.php b/src/HttpResponse.php
index <HASH>..<HASH> 100644
--- a/src/HttpResponse.php
+++ b/src/HttpResponse.php
@@ -85,7 +85,7 @@ class HttpResponse
public function xml(): ?SimpleXMLElement
{
return simplexml_load_string(
- utf8_encode($this->response->getBody()),
+ utf8_encode($this->response->getBody()->getContents()),
'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS
);
} | Retrieve Contents instead of Stream for xml |
diff --git a/src/NewRelicExceptionHandler.php b/src/NewRelicExceptionHandler.php
index <HASH>..<HASH> 100644
--- a/src/NewRelicExceptionHandler.php
+++ b/src/NewRelicExceptionHandler.php
@@ -41,7 +41,7 @@ class NewRelicExceptionHandler implements ExceptionHandler
*/
public function report(Exception $e)
{
- if (!in_array(get_class($e), $this->ignoredExceptions)) {
+ if ($this->shouldReport($e)) {
$this->logException($e);
}
}
@@ -64,6 +64,18 @@ class NewRelicExceptionHandler implements ExceptionHandler
}
+ /**
+ * @inheritdoc
+ */
+ public function shouldReport(Exception $e)
+ {
+ foreach ($this->ignoredExceptions as $type) {
+ if ($e instanceof $type) {
+ return false;
+ }
+ }
+ return true;
+ }
/**
* Logs the exception to New Relic (if the extension is loaded) | made compatible to new illuminate exception contract from lumen <I> |
diff --git a/activerecord/lib/active_record/enum.rb b/activerecord/lib/active_record/enum.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/enum.rb
+++ b/activerecord/lib/active_record/enum.rb
@@ -54,11 +54,12 @@ module ActiveRecord
# remove unused values, the explicit +Hash+ syntax should be used.
#
# In rare circumstances you might need to access the mapping directly.
- # The mappings are exposed through a constant with the attributes name:
+ # The mappings are exposed through a class method with the pluralized attribute
+ # name:
#
# Conversation.statuses # => { "active" => 0, "archived" => 1 }
#
- # Use that constant when you need to know the ordinal value of an enum:
+ # Use that class method when you need to know the ordinal value of an enum:
#
# Conversation.where("status <> ?", Conversation.statuses[:archived])
module Enum | Updated comment to mention the enum mapping class method [ci skip] |
diff --git a/lib/deliver/itunes_connect.rb b/lib/deliver/itunes_connect.rb
index <HASH>..<HASH> 100644
--- a/lib/deliver/itunes_connect.rb
+++ b/lib/deliver/itunes_connect.rb
@@ -77,6 +77,11 @@ module Deliver
result = visit ITUNESCONNECT_URL
raise "Could not open iTunesConnect" unless result['status'] == 'success'
+ if page.has_content?"My Apps"
+ # Already logged in
+ return true
+ end
+
fill_in "accountname", with: user
fill_in "accountpassword", with: password | Improved iTC handling if user is already logged in |
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -3,6 +3,8 @@ var extname = require('path').extname;
var _ = require('lodash');
var Prism = require('prismjs');
var he = require('he');
+var vm = require('vm');
+var fs = require('fs');
var jsonSyntax = require('./prism-json');
@@ -17,11 +19,20 @@ module.exports = function(options) {
Prism.languages.json = options.json ? options.json : jsonSyntax;
return function(files, metalsmith, done) {
+
setImmediate(done);
function requireLanguage(language) {
+
if (!Prism.languages[language]) {
- require('prismjs/components/prism-' + language);
+
+ var path = require.resolve('prismjs/components/prism-' + language);
+ var code = fs.readFileSync(path).toString();
+
+ // make Prism object available in the plugins local scope
+ vm.runInNewContext(code, {
+ Prism: Prism
+ });
}
} | pass Prism context when requiring the language plugins |
diff --git a/spring-security-jwt/src/test/java/org/springframework/security/jwt/RubyJwtIntegrationTests.java b/spring-security-jwt/src/test/java/org/springframework/security/jwt/RubyJwtIntegrationTests.java
index <HASH>..<HASH> 100644
--- a/spring-security-jwt/src/test/java/org/springframework/security/jwt/RubyJwtIntegrationTests.java
+++ b/spring-security-jwt/src/test/java/org/springframework/security/jwt/RubyJwtIntegrationTests.java
@@ -28,7 +28,9 @@ import org.springframework.security.jwt.crypto.sign.MacSigner;
/**
* Tests for compatibility with Ruby's JWT Gem.
*
- * Requires a local JRuby installation and maven must be run with:
+ * Requires a local JRuby installation with jruby.home as a system property. Using RVM
+ * sets this up automatically (e.g. "rvm use jruby-1.7.12"), or alternatively Maven can be
+ * run with:
*
* <pre>
* mvn -DargLine="-Djruby.home=${JRUBY_HOME}" test | Clarify usage of ruby integration test |
diff --git a/src/Kwf/FileWatcher/Helper/Links.php b/src/Kwf/FileWatcher/Helper/Links.php
index <HASH>..<HASH> 100644
--- a/src/Kwf/FileWatcher/Helper/Links.php
+++ b/src/Kwf/FileWatcher/Helper/Links.php
@@ -9,7 +9,7 @@ class Links
$finder = new Finder();
$finder->directories();
foreach ($excludePatterns as $excludePattern) {
- $finder->notName($excludePattern);
+ $finder->notPath($excludePattern);
}
foreach ($paths as $p) {
$finder->in($p); | Fix symlink lookup: excludePattern shoud be used as path so it doesn't recurse into excludes paths |
diff --git a/test/unit/pseudoimager.js b/test/unit/pseudoimager.js
index <HASH>..<HASH> 100644
--- a/test/unit/pseudoimager.js
+++ b/test/unit/pseudoimager.js
@@ -2,7 +2,6 @@ let path = require("path");
let fs = require("fs");
let lwip = require("lwip");
let Image = require("lwip/lib/image");
-let Sinon = require("sinon");
let Mocha = require("mocha");
let describe = Mocha.describe;
let it = require("mocha").it; | We don't use Sinon (yet). |
diff --git a/src/Composer/Repository/Vcs/GitDriver.php b/src/Composer/Repository/Vcs/GitDriver.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Repository/Vcs/GitDriver.php
+++ b/src/Composer/Repository/Vcs/GitDriver.php
@@ -242,7 +242,7 @@ class GitDriver extends VcsDriver
}
$process = new ProcessExecutor($io);
- if($process->execute('git ls-remote --heads ' . ProcessExecutor::escape($url)) === 0) {
+ if($process->execute('git ls-remote --heads ' . ProcessExecutor::escape($url), $output) === 0) {
return true;
} | fix bug in GitDriver::supports for remote repo
for some reason it does not work (in packagist) without the $output param. I don't get any error message here, maybe someone has an idea, why?
Anyway, need this ;) |
diff --git a/src/frontend/org/voltdb/compiler/DDLCompiler.java b/src/frontend/org/voltdb/compiler/DDLCompiler.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/compiler/DDLCompiler.java
+++ b/src/frontend/org/voltdb/compiler/DDLCompiler.java
@@ -1689,8 +1689,8 @@ public class DDLCompiler {
}
if (db.getGroups().get(role) == null) {
throw compiler.new VoltCompilerException(
- String.format("Unknown user group %s defined in the ALLOW attribute of STREAM %s",
- role, table.getTypeName()));
+ String.format("Unknown role %s listed in the ALLOW attribute of STREAM %s", role,
+ table.getTypeName()));
}
definedRoles.add(role);
} | ENG-<I>: Use role not user group |
diff --git a/src/parser/Parser.js b/src/parser/Parser.js
index <HASH>..<HASH> 100644
--- a/src/parser/Parser.js
+++ b/src/parser/Parser.js
@@ -147,15 +147,15 @@ function Parser(source) {
let hasImplicationSymbol = true;
if (_foundToBe(TokenTypes.Symbol, '<-')) {
- clauseNode.addChild(new AstNode(NodeTypes.Symbol, currentToken));
+ clauseNode.addChild(new AstNode(NodeTypes.BinaryOperator, currentToken));
_expect(TokenTypes.Symbol);
} else if (_foundToBe(TokenTypes.Symbol, '->')) {
- clauseNode.addChild(new AstNode(NodeTypes.Symbol, currentToken));
+ clauseNode.addChild(new AstNode(NodeTypes.BinaryOperator, currentToken));
_expect(TokenTypes.Symbol);
} else {
clauseNode.addChild(_literalSet());
if (_foundToBe(TokenTypes.Symbol, '<-') || _foundToBe(TokenTypes.Symbol, '->')) {
- clauseNode.addChild(new AstNode(NodeTypes.Symbol, currentToken));
+ clauseNode.addChild(new AstNode(NodeTypes.BinaryOperator, currentToken));
_expect(TokenTypes.Symbol);
} else {
hasImplicationSymbol = false; | update -> and <- to be binary operators |
diff --git a/src/main/java/cocaine/message/HandshakeMessage.java b/src/main/java/cocaine/message/HandshakeMessage.java
index <HASH>..<HASH> 100644
--- a/src/main/java/cocaine/message/HandshakeMessage.java
+++ b/src/main/java/cocaine/message/HandshakeMessage.java
@@ -1,23 +1,25 @@
package cocaine.message;
+import java.util.UUID;
+
/**
* @author Anton Bobukh <abobukh@yandex-team.ru>
*/
public class HandshakeMessage extends Message {
- private final String uniqueId;
+ private final UUID id;
- public HandshakeMessage(long session, String uniqueId) {
+ public HandshakeMessage(long session, UUID id) {
super(Type.HANDSHAKE, session);
- this.uniqueId = uniqueId;
+ this.id = id;
}
- public String getUniqueId() {
- return uniqueId;
+ public UUID getId() {
+ return id;
}
@Override
public String toString() {
- return "HandshakeMessage/" + getSession() + ": " + uniqueId;
+ return "HandshakeMessage/" + getSession() + ": " + id;
}
} | Application ID type is changed to java.util.UUID |
diff --git a/trunk/ipaddr.py b/trunk/ipaddr.py
index <HASH>..<HASH> 100644
--- a/trunk/ipaddr.py
+++ b/trunk/ipaddr.py
@@ -1045,6 +1045,17 @@ class _BaseV4(object):
return self in IPv4Network('224.0.0.0/4')
@property
+ def is_unspecified(self):
+ """Test if the address is unspecified.
+
+ Returns:
+ A boolean, True if this is the unspecified address as defined in
+ RFC 5735 3.
+
+ """
+ return self in IPv4Network('0.0.0.0')
+
+ @property
def is_loopback(self):
"""Test if the address is a loopback address.
diff --git a/trunk/ipaddr_test.py b/trunk/ipaddr_test.py
index <HASH>..<HASH> 100755
--- a/trunk/ipaddr_test.py
+++ b/trunk/ipaddr_test.py
@@ -656,6 +656,8 @@ class IpaddrUnitTest(unittest.TestCase):
self.assertEquals(True, ipaddr.IPAddress('127.42.0.0').is_loopback)
self.assertEquals(False, ipaddr.IPAddress('128.0.0.0').is_loopback)
+ self.assertEquals(True, ipaddr.IPNetwork('0.0.0.0').is_unspecified)
+
def testReservedIpv6(self): | + add IPv4Network().is_unspecified. issue<I>.
(thanks to rep.dot.net for the bug report and patch).
git-svn-id: <URL> |
diff --git a/tasks/ccop.rb b/tasks/ccop.rb
index <HASH>..<HASH> 100644
--- a/tasks/ccop.rb
+++ b/tasks/ccop.rb
@@ -23,7 +23,9 @@ task :ccop do
file_list.each do |file|
corrected = "#{file}_corrected"
begin
- system("indent #{file} -o #{corrected}")
+ result = `indent #{file} -o #{corrected}`
+ break unless result
+
if FileUtils.compare_file(file, corrected)
print(green('.'))
else | Backticks wait for the system command to finish? |
diff --git a/gumble/client.go b/gumble/client.go
index <HASH>..<HASH> 100644
--- a/gumble/client.go
+++ b/gumble/client.go
@@ -190,7 +190,7 @@ func (c *Client) AudioOutgoing() chan<- AudioBuffer {
// pingRoutine sends ping packets to the server at regular intervals.
func (c *Client) pingRoutine() {
- ticker := time.NewTicker(time.Second * 10)
+ ticker := time.NewTicker(time.Second * 5)
defer ticker.Stop()
packet := MumbleProto.Ping{ | change sending ping packets every 5 seconds from <I> seconds |
diff --git a/allauth/socialaccount/providers/__init__.py b/allauth/socialaccount/providers/__init__.py
index <HASH>..<HASH> 100644
--- a/allauth/socialaccount/providers/__init__.py
+++ b/allauth/socialaccount/providers/__init__.py
@@ -1,3 +1,5 @@
+from collections import OrderedDict
+
from django.conf import settings
from allauth.compat import importlib
@@ -5,7 +7,7 @@ from allauth.compat import importlib
class ProviderRegistry(object):
def __init__(self):
- self.provider_map = {}
+ self.provider_map = OrderedDict()
self.loaded = False
def get_list(self, request=None): | changed provider_map from dict to OrderedDict to ensure ordering when calling as_choices(). (#<I>) |
diff --git a/dockermap/map/policy/cache.py b/dockermap/map/policy/cache.py
index <HASH>..<HASH> 100644
--- a/dockermap/map/policy/cache.py
+++ b/dockermap/map/policy/cache.py
@@ -69,8 +69,7 @@ class CachedImages(CachedItems, dict):
if update_latest or full_name not in self:
self._client.pull(repository=image, tag=tag, insecure_registry=insecure_registry)
images = self._client.images(name=image_name)
- if images:
- new_image = images[0]
+ for new_image in images:
tags = new_image.get('RepoTags')
if tags:
self._latest.update(tags) | Fix adding multiple images of same repository. |
diff --git a/examples/angular-demo/app/js/directives/heatMap.js b/examples/angular-demo/app/js/directives/heatMap.js
index <HASH>..<HASH> 100644
--- a/examples/angular-demo/app/js/directives/heatMap.js
+++ b/examples/angular-demo/app/js/directives/heatMap.js
@@ -302,6 +302,7 @@ angular.module('heatMapDirective', []).directive('heatMap', ['ConnectionService'
$scope.clearFilter = function () {
$scope.messenger.removeFilter($scope.filterKey, function () {
$scope.$apply(function () {
+ $scope.queryForMapData();
$scope.hideClearFilterButton();
});
}, function () { | map was not querying for new data after removing filters |
diff --git a/cursor.go b/cursor.go
index <HASH>..<HASH> 100644
--- a/cursor.go
+++ b/cursor.go
@@ -2,15 +2,13 @@ package disruptor
import "sync/atomic"
-type Cursor [cpuCacheLinePadding]int64
+type Cursor [8]int64 // prevent false sharing of the cursor by padding the CPU cache line with 64 *bytes* of data.
func NewCursor() *Cursor {
- this := &Cursor{}
- this.Store(InitialCursorSequenceValue)
- return this
+ var this Cursor
+ this[0] = InitialCursorSequenceValue
+ return &this
}
func (this *Cursor) Store(sequence int64) { atomic.StoreInt64(&this[0], sequence) }
func (this *Cursor) Load() int64 { return atomic.LoadInt64(&this[0]) }
-
-const cpuCacheLinePadding = 8 | Inlined constant; revised constructor. |
diff --git a/openquake/engine/tools/load_hazards.py b/openquake/engine/tools/load_hazards.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/tools/load_hazards.py
+++ b/openquake/engine/tools/load_hazards.py
@@ -60,6 +60,9 @@ def transfer_data(curs, model, **foreign_keys):
conn = curs.connection
+ # FIXME(lp). In order to avoid alter the table, we should use a
+ # data modifying CTE. I am not using data modifying CTE as I
+ # consider it a maintenance nightmare at this moment.
curs.execute(
"ALTER TABLE %s ADD load_id INT" % model_table(model))
args = dict( | added comment explaining why I am temporarly altering the tables |
diff --git a/master/buildbot/process/buildstep.py b/master/buildbot/process/buildstep.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/process/buildstep.py
+++ b/master/buildbot/process/buildstep.py
@@ -57,6 +57,7 @@ from buildbot.process.results import SUCCESS
from buildbot.process.results import WARNINGS
from buildbot.process.results import Results
from buildbot.process.results import worst_status
+from buildbot.util import bytes2NativeString
from buildbot.util import debounce
from buildbot.util import flatten
from buildbot.worker_transition import WorkerAPICompatMixin
@@ -804,6 +805,7 @@ class BuildStep(results.ResultComputingConfigMixin,
logid = yield self.master.data.updates.addLog(self.stepid,
util.ascii2unicode(name), u'h')
l = self._newLog(name, u'h', logid)
+ html = bytes2NativeString(html)
yield l.addContent(html)
yield l.finish() | Make sure that html is a native string |
diff --git a/polyaxon/hpsearch/search_managers/bayesian_optimization/manager.py b/polyaxon/hpsearch/search_managers/bayesian_optimization/manager.py
index <HASH>..<HASH> 100644
--- a/polyaxon/hpsearch/search_managers/bayesian_optimization/manager.py
+++ b/polyaxon/hpsearch/search_managers/bayesian_optimization/manager.py
@@ -25,8 +25,12 @@ class BOSearchManager(BaseSearchAlgorithmManager):
configs = []
metrics = []
for key in experiments_metrics.keys():
- configs.append(experiments_configs[key])
- metrics.append(experiments_metrics[key])
+ if key in experiments_configs:
+ configs.append(experiments_configs[key])
+ metrics.append(experiments_metrics[key])
+
+ if not configs or not metrics:
+ return None
optimizer = BOOptimizer(hptuning_config=self.hptuning_config)
optimizer.add_observations(configs=configs, metrics=metrics)
suggestion = optimizer.get_suggestion() | Handle missing experiments in suggestion algorithms gracefully |
diff --git a/cmd/influx_inspect/tsm.go b/cmd/influx_inspect/tsm.go
index <HASH>..<HASH> 100644
--- a/cmd/influx_inspect/tsm.go
+++ b/cmd/influx_inspect/tsm.go
@@ -549,7 +549,7 @@ func cmdDumpTsm1dev(opts *tsdmDumpOpts) {
buf := make([]byte, e.Size-4)
f.Read(buf)
- blockSize += int64(len(buf)) + 4
+ blockSize += int64(e.Size)
blockType := buf[0]
@@ -584,7 +584,7 @@ func cmdDumpTsm1dev(opts *tsdmDumpOpts) {
blockStats.size(len(buf))
if opts.filterKey != "" && !strings.Contains(key, opts.filterKey) {
- i += (4 + int64(e.Size))
+ i += blockSize
blockCount++
continue
}
@@ -601,7 +601,7 @@ func cmdDumpTsm1dev(opts *tsdmDumpOpts) {
fmt.Sprintf("%d/%d", len(ts), len(values)),
}, "\t"))
- i += (4 + int64(e.Size))
+ i += blockSize
blockCount++
}
} | Fix block sizes reported by influx_inspect |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -44,7 +44,7 @@ extras_require={
':python_version>="3"': ['avro-python3']}
setup(name='schema-salad',
- version='3.0',
+ version='2.5.1',
description='Schema Annotations for Linked Avro Data (SALAD)',
long_description=open(README).read(),
author='Common workflow language working group',
@@ -72,8 +72,8 @@ setup(name='schema-salad',
"Operating System :: MacOS :: MacOS X",
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 2.7",
- #"Programming Language :: Python :: 3.3", # TODO: uncomment these
- #"Programming Language :: Python :: 3.4", # lines
- #"Programming Language :: Python :: 3.5"
+ "Programming Language :: Python :: 3.3",
+ "Programming Language :: Python :: 3.4",
+ "Programming Language :: Python :: 3.5"
]
) | setup.py: change version, uncomment classifiers for py3 |
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index <HASH>..<HASH> 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -26,7 +26,7 @@ I18n.enforce_available_locales = false
FIXTURE_LOAD_PATH = File.expand_path('fixtures', File.dirname(__FILE__))
ActionMailer::Base.view_paths = FIXTURE_LOAD_PATH
-class Rails
+module Rails
def self.root
File.expand_path('../', File.dirname(__FILE__))
end | Rails is a module not a class |
diff --git a/nunaliit2-js/src/main/js/nunaliit2/n2.couchImportProfile.js b/nunaliit2-js/src/main/js/nunaliit2/n2.couchImportProfile.js
index <HASH>..<HASH> 100644
--- a/nunaliit2-js/src/main/js/nunaliit2/n2.couchImportProfile.js
+++ b/nunaliit2-js/src/main/js/nunaliit2/n2.couchImportProfile.js
@@ -1371,6 +1371,12 @@ var AnalysisReport = $n2.Class({
var doc = null;
if( schema ){
doc = schema.createObject();
+
+ // Remove attachment instructions
+ if( doc.nunaliit_attachments ){
+ delete doc.nunaliit_attachments;
+ };
+
} else {
doc = {};
}; | nunaliit2-js: When importing data via an import profile, do not include
an empty section "nunaliit_attachments"
Issue #<I> |
diff --git a/src/main/java/com/synopsys/integration/blackduck/notification/content/detail/NotificationContentDetail.java b/src/main/java/com/synopsys/integration/blackduck/notification/content/detail/NotificationContentDetail.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/synopsys/integration/blackduck/notification/content/detail/NotificationContentDetail.java
+++ b/src/main/java/com/synopsys/integration/blackduck/notification/content/detail/NotificationContentDetail.java
@@ -192,7 +192,11 @@ public class NotificationContentDetail extends Stringable {
}
public boolean isVulnerability() {
- return !isPolicy();
+ return CONTENT_KEY_GROUP_VULNERABILITY.equals(notificationGroup);
+ }
+
+ public boolean isBomEdit() {
+ return CONTENT_KEY_GROUP_BOM_EDIT.equals(notificationGroup);
}
public List<UriSingleResponse<? extends HubResponse>> getPresentLinks() { | Correct logic for determining the type of a NotificationContentDetail. |
diff --git a/lib/regexp_parser/expression/classes/backref.rb b/lib/regexp_parser/expression/classes/backref.rb
index <HASH>..<HASH> 100644
--- a/lib/regexp_parser/expression/classes/backref.rb
+++ b/lib/regexp_parser/expression/classes/backref.rb
@@ -16,7 +16,7 @@ module Regexp::Expression
attr_reader :number
def initialize(token)
- @number = token.text[3..-2]
+ @number = token.text[token.token.equal?(:number) ? 1..-1 : 3..-2]
super(token)
end
end | Fix number attribute for traditional backref expressions |
diff --git a/src/image-preview/index.js b/src/image-preview/index.js
index <HASH>..<HASH> 100644
--- a/src/image-preview/index.js
+++ b/src/image-preview/index.js
@@ -54,6 +54,7 @@ const ImagePreview = (images, startPosition = 0) => {
});
if (options.onClose) {
+ instance.$off('close');
instance.$once('close', options.onClose);
}
diff --git a/src/image-preview/test/index.spec.js b/src/image-preview/test/index.spec.js
index <HASH>..<HASH> 100644
--- a/src/image-preview/test/index.spec.js
+++ b/src/image-preview/test/index.spec.js
@@ -102,6 +102,26 @@ test('onClose option', async done => {
done();
});
+test('onClose should only trigger once', async done => {
+ const onClose = jest.fn();
+ const instance = ImagePreview({
+ images,
+ startPostion: 1,
+ onClose
+ });
+
+ ImagePreview({
+ images,
+ startPostion: 1,
+ onClose
+ });
+
+ instance.close();
+
+ expect(onClose).toHaveBeenCalledTimes(1);
+ done();
+});
+
test('onChange option', async done => {
const instance = ImagePreview({
images, | fix(ImagePreview): onClose should only trigger once (#<I>) |
diff --git a/Propel/Behavior/Tos/templates/queryHaveNotAgreedToAnyTerms.php b/Propel/Behavior/Tos/templates/queryHaveNotAgreedToAnyTerms.php
index <HASH>..<HASH> 100644
--- a/Propel/Behavior/Tos/templates/queryHaveNotAgreedToAnyTerms.php
+++ b/Propel/Behavior/Tos/templates/queryHaveNotAgreedToAnyTerms.php
@@ -8,7 +8,7 @@ public function haveNotAgreedToAnyTerms()
{
return $this
->useAgreementQuery(null, Criteria::LEFT_JOIN)
- ->filterByAgreedAt(null) // TODO: this selects entity with 0000-00-00 also
+ ->filterByAgreedAt(null)
->endUse()
->distinct();
} | removed TODO of already taken care issue |
diff --git a/lib/sprout/generator.rb b/lib/sprout/generator.rb
index <HASH>..<HASH> 100644
--- a/lib/sprout/generator.rb
+++ b/lib/sprout/generator.rb
@@ -88,14 +88,21 @@ module Sprout
# suggest[http://groups.google.com/group/projectsprouts/] any improvements to
# the Google Group.
#
- # @see Sprout::GeneratorGenerator
- #
# ---
#
# Back to Home: {file:README.textile}
#
# Next Topic: {Sprout::Library}
#
+ # ---
+ #
+ # @see Sprout::GeneratorGenerator
+ # @see Sprout::Library
+ # @see Sprout::Executable
+ # @see Sprout::Specification
+ # @see Sprout::RubyFeature
+ # @see Sprout::System
+ #
module Generator
include RubyFeature
@@ -137,7 +144,8 @@ module Sprout
# @param type [Symbol] A snake-cased name of the class without the Generator suffix.
# for example, to instantiate a generator named, +TestSuiteGenerator+, this argument
# would be +:test_suite+
- def create_instance type
+ # @param options [Hash] deprecated - please remove this argument wherever it's found.
+ def create_instance type, options=nil
class_name = "#{type.to_s.camel_case}Generator"
registered_entities.each do |entity|
if(entity.to_s.match(/::#{class_name}$/) || entity.to_s.match(/^#{class_name}$/)) | Updated interface to be compatible with existing generators |
diff --git a/c7n/filters/core.py b/c7n/filters/core.py
index <HASH>..<HASH> 100644
--- a/c7n/filters/core.py
+++ b/c7n/filters/core.py
@@ -271,7 +271,7 @@ class ValueFilter(Filter):
elif self.expr:
r = self.expr.search(i)
else:
- self.expr = jmespath.compile(self.k)
+ self.expr = jmespath.compile(k)
r = self.expr.search(i)
return r | get resource value should be using passed value of key not instance value (#<I>) |
diff --git a/lib/rubocop/config_loader.rb b/lib/rubocop/config_loader.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/config_loader.rb
+++ b/lib/rubocop/config_loader.rb
@@ -153,12 +153,7 @@ module RuboCop
warn Rainbow('For more information: https://docs.rubocop.org/rubocop/versioning.html').yellow
end
- # Merges the given configuration with the default one. If
- # AllCops:DisabledByDefault is true, it changes the Enabled params so
- # that only cops from user configuration are enabled.
- # If AllCops::EnabledByDefault is true, it changes the Enabled params
- # so that only cops explicitly disabled in user configuration are
- # disabled.
+ # Merges the given configuration with the default one.
def merge_with_default(config, config_file, unset_nil: true)
resolver.merge_with_default(config, config_file, unset_nil: unset_nil)
end | Remove duplicated comment
This comment already exists in the ConfigLoaderResolver. I think that
level of details is a better fit there and it doesn't make sense to
maintain it duplicated. |
diff --git a/crypto/src/main/java/org/springframework/security/crypto/password/NoOpPasswordEncoder.java b/crypto/src/main/java/org/springframework/security/crypto/password/NoOpPasswordEncoder.java
index <HASH>..<HASH> 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/password/NoOpPasswordEncoder.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/password/NoOpPasswordEncoder.java
@@ -26,7 +26,8 @@ package org.springframework.security.crypto.password;
* @deprecated This PasswordEncoder is not secure. Instead use an
* adaptive one way function like BCryptPasswordEncoder, Pbkdf2PasswordEncoder, or
* SCryptPasswordEncoder. Even better use {@link DelegatingPasswordEncoder} which supports
- * password upgrades.
+ * password upgrades. There are no plans to remove this support. It is deprecated to indicate that
+ * this is a legacy implementation and using it is considered insecure.
*/
@Deprecated
public final class NoOpPasswordEncoder implements PasswordEncoder { | Document NoOpPasswordEncoder will not be removed
This commit adds extension to deprecation notice.
Fixes gh-<I> |
diff --git a/gulpTaskFactory.js b/gulpTaskFactory.js
index <HASH>..<HASH> 100644
--- a/gulpTaskFactory.js
+++ b/gulpTaskFactory.js
@@ -12,7 +12,7 @@ var concat = require('gulp-concat'),
exports.gulpTaskFactory = function(gulpTask, options) {
var task = function (gulpTask, options) {
- var isJs = gulpTask.toString().endsWith('.js'),
+ var isJs = gulpTask.indexOf('.js') > 0,
isCss = !isJs;
if (options.concat !== undefined && options.concat.active && options.concat.config === undefined) { | Fixing gulpTaskFactory to work in older versions of nodejs. |
diff --git a/app/utils.js b/app/utils.js
index <HASH>..<HASH> 100644
--- a/app/utils.js
+++ b/app/utils.js
@@ -112,7 +112,7 @@ _.extend(Helper.prototype, {
},
setExecutable: function(filePath) {
- fs.chownSync(this.$.destinationPath(filePath), '755');
+ fs.chmodSync(this.$.destinationPath(filePath), '755');
},
/** | fix setting executable flag for gradlew |
diff --git a/tests/py/test_unittest.py b/tests/py/test_unittest.py
index <HASH>..<HASH> 100644
--- a/tests/py/test_unittest.py
+++ b/tests/py/test_unittest.py
@@ -19,10 +19,17 @@
import unittest
-def assertMultiLineEqual(self, a, b, msg=None): self.assertEqual(a,b,msg)
-unittest.TestCase.assertMultiLineEqual = assertMultiLineEqual
+# Monkey-patch a few unittest 2.7 features for Python 2.6.
+#
+# These are note the pretty versions provided by 2.7 but they do the
+# same job as far as correctness is concerned.
+
+if not hasattr(unittest.TestCase, "assertMultiLineEqual"):
+ def assertMultiLineEqual(self, a, b, msg=None): self.assertEqual(a,b,msg)
+ unittest.TestCase.assertMultiLineEqual = assertMultiLineEqual
-def assertIn(self, a, b, msg=None): self.assertTrue(a in b,msg)
-unittest.TestCase.assertIn = assertIn
+if not hasattr(unittest.TestCase, "assertIn"):
+ def assertIn(self, a, b, msg=None): self.assertTrue(a in b,msg)
+ unittest.TestCase.assertIn = assertIn | NO-JIRA: [c,cpp] fix monkey-patch of python <I> unittest features for python <I>
Don't apply patch on versions that have the feature. |
diff --git a/autograder_sandbox/autograder_sandbox.py b/autograder_sandbox/autograder_sandbox.py
index <HASH>..<HASH> 100644
--- a/autograder_sandbox/autograder_sandbox.py
+++ b/autograder_sandbox/autograder_sandbox.py
@@ -111,7 +111,8 @@ class AutograderSandbox:
The default value for this parameter can be changed by
setting the SANDBOX_MEM_LIMIT environment variable.
- See https://docs.docker.com/config/containers/resource_constraints/#limit-a-containers-access-to-memory
+ See https://docs.docker.com/config/containers/resource_constraints/\
+#limit-a-containers-access-to-memory
for more information.
:param min_fallback_timeout: The timeout argument to run_command | Fixed pycodestyle warning. |
diff --git a/packages/adapters/snapshot-adapters/resolve-snapshot-mysql/src/index.js b/packages/adapters/snapshot-adapters/resolve-snapshot-mysql/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/adapters/snapshot-adapters/resolve-snapshot-mysql/src/index.js
+++ b/packages/adapters/snapshot-adapters/resolve-snapshot-mysql/src/index.js
@@ -49,7 +49,7 @@ const loadSnapshot = async (pool, snapshotKey) => {
const content = rows.length > 0 ? rows[0].SnapshotContent.toString() : null
- return content != null ? content.SnapshotContent : null
+ return content != null ? JSON.parse(content) : null
}
const saveSnapshot = async (pool, snapshotKey, content) => {
@@ -67,6 +67,8 @@ const saveSnapshot = async (pool, snapshotKey, content) => {
}
pool.counters.set(snapshotKey, 0)
+ const stringContent = JSON.stringify(content)
+
await pool.connection.execute(
`INSERT INTO ${escapeId(
pool.tableName
@@ -74,7 +76,7 @@ const saveSnapshot = async (pool, snapshotKey, content) => {
VALUES(?, ?)
ON DUPLICATE KEY UPDATE
\`SnapshotContent\` = ?`,
- [snapshotKey, content, content]
+ [snapshotKey, stringContent, stringContent]
)
} | Hotfixing snapshot mysql adapter stringifying conent (#<I>) |
diff --git a/src/Validators/PayloadValidator.php b/src/Validators/PayloadValidator.php
index <HASH>..<HASH> 100644
--- a/src/Validators/PayloadValidator.php
+++ b/src/Validators/PayloadValidator.php
@@ -62,7 +62,7 @@ class PayloadValidator extends Validator
*/
protected function validateStructure(array $payload)
{
- if (count(array_diff_key($this->requiredClaims, array_keys($payload))) !== 0) {
+ if (count(array_diff($this->requiredClaims, array_keys($payload))) !== 0) {
throw new TokenInvalidException('JWT payload does not contain the required claims');
} | Use array_diff to check presence of required claims |
diff --git a/lib/App/index.js b/lib/App/index.js
index <HASH>..<HASH> 100644
--- a/lib/App/index.js
+++ b/lib/App/index.js
@@ -29,9 +29,9 @@ const VALIDATION_LEVELS = [
'publish',
];
const IMAGE_MARKERS = {
- '.jpg': new Buffer([ 0xFF, 0xD8 ]),
- '.jpeg': new Buffer([ 0xFF, 0xD8 ]),
- '.png': new Buffer([ 0x89, 0x50, 0x4e, 0x47 ]),
+ '.jpg': Buffer.from([ 0xFF, 0xD8 ]),
+ '.jpeg': Buffer.from([ 0xFF, 0xD8 ]),
+ '.png': Buffer.from([ 0x89, 0x50, 0x4e, 0x47 ]),
}
const IMAGE_SIZES = {
'app': {
@@ -554,7 +554,7 @@ class App {
filepath = join( this._path, filepath );
const fd = await openAsync(filepath, 'r');
- const buffer = new Buffer(numBytes);
+ const buffer = Buffer.from(numBytes);
await readAsync(fd, buffer, 0, numBytes, 0);
return buffer;
} | new Buffer -> Buffer.from |
diff --git a/mllib/src/test/java/org/apache/spark/mllib/recommendation/JavaALSSuite.java b/mllib/src/test/java/org/apache/spark/mllib/recommendation/JavaALSSuite.java
index <HASH>..<HASH> 100644
--- a/mllib/src/test/java/org/apache/spark/mllib/recommendation/JavaALSSuite.java
+++ b/mllib/src/test/java/org/apache/spark/mllib/recommendation/JavaALSSuite.java
@@ -90,8 +90,8 @@ public class JavaALSSuite implements Serializable {
double err = confidence * (truePref - prediction) * (truePref - prediction);
sqErr += err;
denom += 1.0;
- }
}
+ }
double rmse = Math.sqrt(sqErr / denom);
Assert.assertTrue(String.format("Confidence-weighted RMSE=%2.4f above threshold of %2.2f",
rmse, matchThreshold), Math.abs(rmse) < matchThreshold); | Fixing closing brace indentation |
diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py
index <HASH>..<HASH> 100644
--- a/pylint/__pkginfo__.py
+++ b/pylint/__pkginfo__.py
@@ -22,7 +22,7 @@
from os.path import join
# For an official release, use dev_version = None
-numversion = (2, 4, 1)
+numversion = (2, 4, 2)
dev_version = None
version = ".".join(str(num) for num in numversion) | Bump master to <I> |
diff --git a/internal/plugin/plugin.go b/internal/plugin/plugin.go
index <HASH>..<HASH> 100644
--- a/internal/plugin/plugin.go
+++ b/internal/plugin/plugin.go
@@ -33,6 +33,14 @@ var (
"myplugin": myplugin.CommandOptions,
"otherplugin": otherplugin.CommandOptions,
}
+ CacheableComponents = []component.Type{
+ component.CommandType,
+ component.ConfigType,
+ component.HostType,
+ component.MapperType,
+ component.PluginInfoType,
+ component.PushType,
+ }
)
type Plugin struct {
@@ -186,8 +194,10 @@ func (p *Plugin) InstanceOf(
return
}
- // Store the instance for later usage
- p.components[c] = i
+ if p.isCacheable(c) {
+ // Store the instance for later usage
+ p.components[c] = i
+ }
return
}
@@ -258,3 +268,13 @@ func (p *Plugin) loadParent(i *Instance) error {
return nil
}
+
+// Check if component type can be cached
+func (p *Plugin) isCacheable(t component.Type) bool {
+ for _, v := range CacheableComponents {
+ if t == v {
+ return true
+ }
+ }
+ return false
+} | Define component types which can be cached |
diff --git a/lib/cabbage_doc/web.rb b/lib/cabbage_doc/web.rb
index <HASH>..<HASH> 100644
--- a/lib/cabbage_doc/web.rb
+++ b/lib/cabbage_doc/web.rb
@@ -11,6 +11,8 @@ module CabbageDoc
ROOT = File.expand_path("../../../web", __FILE__).freeze
set :root, proc {
+ Configuration.instance.validate!
+
dir = File.join(Configuration.instance.root, 'web')
if Dir.exists?(dir)
dir | validate configuration in the mountable sinatra app |
diff --git a/lib/jasmine_rails/runner.rb b/lib/jasmine_rails/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/jasmine_rails/runner.rb
+++ b/lib/jasmine_rails/runner.rb
@@ -13,7 +13,7 @@ module JasmineRails
File.open(runner_path, 'w') {|f| f << html.gsub('/assets', './assets')}
phantomjs_runner_path = File.join(File.dirname(__FILE__), '..', 'assets', 'javascripts', 'jasmine-runner.js')
- run_cmd %{phantomjs "#{phantomjs_runner_path}" "#{runner_path.to_s}?spec=#{spec_filter}"}
+ run_cmd %{"#{Phantomjs.path}" "#{phantomjs_runner_path}" "#{runner_path.to_s}?spec=#{spec_filter}"}
end
end | use phantomjs path if it's not in PATH |
diff --git a/raft/src/main/java/net/kuujo/copycat/raft/Raft.java b/raft/src/main/java/net/kuujo/copycat/raft/Raft.java
index <HASH>..<HASH> 100644
--- a/raft/src/main/java/net/kuujo/copycat/raft/Raft.java
+++ b/raft/src/main/java/net/kuujo/copycat/raft/Raft.java
@@ -331,8 +331,6 @@ public class Raft implements Protocol, Managed<Raft> {
@Override
public Raft build() {
- if (log == null)
- throw new ConfigurationException("log not configured");
if (stateMachine == null)
throw new ConfigurationException("state machine not configured");
if (cluster == null) | Allow Raft algorithm to be started without a log. |
diff --git a/keanu-project/src/test/java/io/improbable/keanu/network/BayesianNetworkTest.java b/keanu-project/src/test/java/io/improbable/keanu/network/BayesianNetworkTest.java
index <HASH>..<HASH> 100644
--- a/keanu-project/src/test/java/io/improbable/keanu/network/BayesianNetworkTest.java
+++ b/keanu-project/src/test/java/io/improbable/keanu/network/BayesianNetworkTest.java
@@ -10,7 +10,7 @@ import org.junit.Before;
import org.junit.Test;
import io.improbable.keanu.vertices.bool.BoolVertex;
-import io.improbable.keanu.vertices.bool.probabilistic.Flip;
+import io.improbable.keanu.vertices.bool.probabilistic.BernoulliVertex;
public class BayesianNetworkTest {
@@ -21,8 +21,8 @@ public class BayesianNetworkTest {
@Before
public void setUpNetwork() {
- input1 = new Flip(0.25);
- input2 = new Flip(0.75);
+ input1 = new BernoulliVertex(0.25);
+ input2 = new BernoulliVertex(0.75);
output = input1.or(input2);
network = new BayesianNetwork(output.getConnectedGraph()); | fixed compile error in test after merge |
diff --git a/cake/libs/folder.php b/cake/libs/folder.php
index <HASH>..<HASH> 100644
--- a/cake/libs/folder.php
+++ b/cake/libs/folder.php
@@ -530,7 +530,10 @@ class Folder extends Object{
* @return boolean Success
* @access public
*/
- function delete($path) {
+ function delete($path = null) {
+ if (!$path) {
+ $path = $this->pwd();
+ }
$path = $this->slashTerm($path);
if (is_dir($path) === true) {
$files = glob($path . "*", GLOB_NOSORT);
diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php
index <HASH>..<HASH> 100644
--- a/cake/tests/cases/libs/folder.test.php
+++ b/cake/tests/cases/libs/folder.test.php
@@ -106,6 +106,17 @@ class FolderTest extends UnitTestCase {
$result = $Folder->delete($mv);
$this->assertTrue($result);
+
+ $new = TMP . 'test_folder_new';
+ $result = $Folder->create($new);
+ $this->assertTrue($result);
+
+ $result = $Folder->cd($new);
+ $this->assertTrue($result);
+
+ $result = $Folder->delete();
+ $this->assertTrue($result);
+
}
function testRealPathForWebroot() { | closes #<I>, Folder delete does not require path
git-svn-id: <URL> |
diff --git a/inc/posttype/namespace.php b/inc/posttype/namespace.php
index <HASH>..<HASH> 100644
--- a/inc/posttype/namespace.php
+++ b/inc/posttype/namespace.php
@@ -71,7 +71,7 @@ function register_post_types() {
'capability_type' => 'page',
'has_archive' => true,
'hierarchical' => true,
- 'supports' => [ 'title', 'editor', 'page-attributes' ],
+ 'supports' => [ 'title', 'editor', 'page-attributes', 'revisions' ],
'show_in_menu' => false,
'show_in_admin_bar' => true,
'show_in_rest' => true, | Add revisions support to parts (#<I>) |
diff --git a/Tests/Command/InfoDoctrineCommandTest.php b/Tests/Command/InfoDoctrineCommandTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Command/InfoDoctrineCommandTest.php
+++ b/Tests/Command/InfoDoctrineCommandTest.php
@@ -25,9 +25,6 @@ class InfoDoctrineCommandTest extends TestCase
$testContainer = $this->createYamlBundleTestContainer();
$kernel = $this->getMock('Symfony\Component\HttpKernel\Kernel', array(), array(), '', false);
$kernel->expects($this->once())
- ->method('getBundles')
- ->will($this->returnValue(array()));
- $kernel->expects($this->once())
->method('getContainer')
->will($this->returnValue($testContainer));
$application = new Application($kernel); | changed Application to have nice error messages when something bad happens early on the CLI |
diff --git a/monty/pprint.py b/monty/pprint.py
index <HASH>..<HASH> 100644
--- a/monty/pprint.py
+++ b/monty/pprint.py
@@ -5,7 +5,8 @@ Pretty printing functions.
from io import StringIO
import sys
-
+from json import JSONEncoder, loads
+from IPython.display import JSON, display
def pprint_table(table, out=sys.stdout, rstrip=False):
"""
@@ -81,3 +82,27 @@ def _draw_tree(node, prefix, child_iter, text_str):
buf.write(_draw_tree(child, sub_prefix, child_iter, text_str))
return buf.getvalue()
+
+class DisplayEcoder(JSONEncoder):
+ def default(self, o):
+ try:
+ return o.as_dict()
+ except Exception:
+ try:
+ return o.__dict__
+ except Exception:
+ return str(o)
+
+def pprint_json(data):
+ """
+ Display a tree-like object in a jupyter notebook.
+ Allows for collapsable interactive interaction with data.
+
+ Args:
+ data: a dictionary or object
+
+ Based on:
+ https://gist.github.com/jmmshn/d37d5a1be80a6da11f901675f195ca22
+
+ """
+ display(JSON(loads(DisplayEcoder().encode(data))))
\ No newline at end of file | added helper function to display tree-like objects
fixed |
diff --git a/raven/utils/http.py b/raven/utils/http.py
index <HASH>..<HASH> 100644
--- a/raven/utils/http.py
+++ b/raven/utils/http.py
@@ -48,7 +48,11 @@ def urlopen(url, data=None, timeout=defaults.TIMEOUT, ca_certs=None,
if verify_ssl:
handlers = [ValidHTTPSHandler]
else:
- handlers = []
+ try:
+ handlers = [urllib2.HTTPSHandler(
+ context=ssl._create_unverified_context())]
+ except AttributeError:
+ handlers = []
opener = urllib2.build_opener(*handlers) | Fix disabling of ssl certs check with python <I>/<I> |
diff --git a/lib/ApiWeb.php b/lib/ApiWeb.php
index <HASH>..<HASH> 100644
--- a/lib/ApiWeb.php
+++ b/lib/ApiWeb.php
@@ -335,6 +335,10 @@ class ApiWeb extends ApiCLI {
// }}}
// {{{ Miscelanious Functions
+ /** Render only specified object or object with specified name */
+ function cut($object){
+ $_GET['cut_object']=is_object($object)?$object->name:$object;
+ }
/** Perform instant redirect to another page */
function redirect($page=null,$args=array()){
/** | A better way to cut an object, instead of messing with _GET directly |
diff --git a/lib/node_modules/@stdlib/repl/lib/context/regexp/index.js b/lib/node_modules/@stdlib/repl/lib/context/regexp/index.js
index <HASH>..<HASH> 100644
--- a/lib/node_modules/@stdlib/repl/lib/context/regexp/index.js
+++ b/lib/node_modules/@stdlib/repl/lib/context/regexp/index.js
@@ -7,6 +7,9 @@ var NS = {};
var getKeys = require( 'object-keys' ).shim();
NS.RE_EOL = require( '@stdlib/regexp/eol' );
+NS.RE_DIRNAME = require( '@stdlib/regexp/dirname' );
+NS.RE_DIRNAME_POSIX = require( '@stdlib/regexp/dirname-posix' );
+NS.RE_DIRNAME_WINDOWS = require( '@stdlib/regexp/dirname-windows' );
NS.RE_EXTNAME = require( '@stdlib/regexp/extname' );
NS.RE_EXTNAME_POSIX = require( '@stdlib/regexp/extname-posix' );
NS.RE_EXTNAME_WINDOWS = require( '@stdlib/regexp/extname-windows' ); | Add dirname RegExps to REPL context |
diff --git a/core/src/main/java/io/undertow/util/ImmediateAuthenticationMechanismFactory.java b/core/src/main/java/io/undertow/util/ImmediateAuthenticationMechanismFactory.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/undertow/util/ImmediateAuthenticationMechanismFactory.java
+++ b/core/src/main/java/io/undertow/util/ImmediateAuthenticationMechanismFactory.java
@@ -20,6 +20,6 @@ public class ImmediateAuthenticationMechanismFactory implements AuthenticationMe
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
- return null;
+ return authenticationMechanism;
}
} | Fixed NPE and problem in which custom AuthenticationMechanisms aren't used
The DeploymentInfo wraps an AuthenticationMechanism with a
ImmediateAuthenticationMechanismFactory. However, that factory always returns
null when create() is called. Fix is to simply returns the AuthenticationMechanism
that was provided to it during construction. |
diff --git a/bin/release.py b/bin/release.py
index <HASH>..<HASH> 100755
--- a/bin/release.py
+++ b/bin/release.py
@@ -329,7 +329,7 @@ def release():
prettyprint("Step 6: Uploading Artifacts", Levels.INFO)
do_task(upload_artifacts, [base_dir, version], async_processes)
- do_task(upload_artifacts, [base_dir % "as-modules", version], async_processes)
+ do_task(upload_artifacts, [base_dir + "/as-modules", version], async_processes)
prettyprint("Step 6: Complete", Levels.INFO)
prettyprint("Step 7: Uploading to configuration XML schema", Levels.INFO) | ISPN-<I> Issue with the release script (bin/release.py) |
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -11,3 +11,4 @@ exports.RangeIterator = require('./lib/RangeIterator');
exports.SubsetIterator = require('./lib/SubsetIterator');
exports.PermutationIterator = require('./lib/PermutationIterator');
exports.TransformIterator = require('./lib/TransformIterator');
+exports.RepeatIterator = require('./lib/RepeatIterator'); | Oops, need to actually expose RepeatIterator to be able to use it |
diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -2582,6 +2582,7 @@
// Reset the input to correspond to the selection (or to be empty,
// when not typing and nothing is selected)
function resetInput(cm, typing) {
+ if (cm.display.contextMenuPending) return;
var minimal, selected, doc = cm.doc;
if (cm.somethingSelected()) {
cm.display.prevInput = "";
@@ -3446,6 +3447,7 @@
resetInput(cm);
// Adds "Select all" to context menu in FF
if (!cm.somethingSelected()) display.input.value = display.prevInput = " ";
+ display.contextMenuPending = true;
display.selForContextMenu = cm.doc.sel;
clearTimeout(display.detectingSelectAll);
@@ -3464,6 +3466,7 @@
}
}
function rehide() {
+ display.contextMenuPending = false;
display.inputDiv.style.position = "relative";
display.input.style.cssText = oldCSS;
if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); | Prevent resetInput from breaking context menu 'select all' in FF
Closes #<I> |
diff --git a/test/simple.test.js b/test/simple.test.js
index <HASH>..<HASH> 100644
--- a/test/simple.test.js
+++ b/test/simple.test.js
@@ -47,13 +47,6 @@ test('GET /_ping => pong', async (t) => {
t.true(stdout[0].includes('GET /_ping'))
})
-test('GET /_routes => 200 with routes', async (t) => {
- const { statusCode, body } = await $get('/_routes')
- t.is(statusCode, 200)
- t.true(Array.isArray(body))
- t.true(body.length > 0)
-})
-
test('GET /404 => 404 status code', async (t) => {
const { statusCode, body } = await $get('/404')
t.is(statusCode, 404) | test: Remove _routes test |
diff --git a/lib/handlers/ReactNative.js b/lib/handlers/ReactNative.js
index <HASH>..<HASH> 100644
--- a/lib/handlers/ReactNative.js
+++ b/lib/handlers/ReactNative.js
@@ -469,7 +469,21 @@ class RecvHandler extends Handler
const localId = id;
const mid = kind;
- const streamId = rtpParameters.rtcp.cname;
+ let streamId = rtpParameters.rtcp.cname;
+
+ // NOTE: In iOS we cannot reuse the same remote MediaStream for new remote
+ // tracks. This is because the libwebrtc ObjC bindgins do not react on new
+ // tracks generated within already existing streams (a terrible bug the
+ // libwebrtc team will never fix). So force the streamId to be different.
+ const { Platform } = require('react-native');
+
+ if (Platform.OS === 'ios')
+ {
+ logger.debug(
+ 'receive() | forcing a random remote streamId to avoid well known bug in libwebrtc for iOS');
+
+ streamId += `-hack-iOS-${utils.generateRandomNumber()}`;
+ }
this._remoteSdp.receive(
{ | Hack for #<I> (to avoid bug in ObjC bindings of libwebrtc in iOS) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.