diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
---|---|
diff --git a/src/test/java/com/ibm/disni/examples/SpdkProbe.java b/src/test/java/com/ibm/disni/examples/SpdkProbe.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/ibm/disni/examples/SpdkProbe.java
+++ b/src/test/java/com/ibm/disni/examples/SpdkProbe.java
@@ -51,7 +51,7 @@ public class SpdkProbe {
System.out.println(" Multi host = " + multipathIOCapabilities.hasMultiHost());
System.out.println(" SR-IOV = " + multipathIOCapabilities.hasSingleRootIOVirtualization());
- System.out.print("Maximum data transfer size = ")
+ System.out.print("Maximum data transfer size = ");
if (data.getMaximumDataTransferSize() == 0) {
System.out.println("unlimited");
} else {
|
nvmef: fix missing ;
|
diff --git a/scripts/rollup/plugins/index.js b/scripts/rollup/plugins/index.js
index <HASH>..<HASH> 100644
--- a/scripts/rollup/plugins/index.js
+++ b/scripts/rollup/plugins/index.js
@@ -11,7 +11,7 @@ module.exports = function(version, options) {
aliasPlugin,
nodeResolve({
extensions: ['.ts', '.js', '.json'],
- jsnext: true
+ mainFields: ['module', 'main']
}),
commonjs({
include: 'node_modules/**'
|
Replaced deprecated rollup node-resolve option.jsnext with mainfield setting
|
diff --git a/test/unit/render.js b/test/unit/render.js
index <HASH>..<HASH> 100644
--- a/test/unit/render.js
+++ b/test/unit/render.js
@@ -237,6 +237,23 @@ tests = [
}
},
result: '<p>The population of the UK is 62.6 million.</p>'
+ },
+ {
+ name: 'Responding to downstream changes',
+ template: '<p>Total: {{( total( numbers ) )}}</p>',
+ data: {
+ numbers: [ 1, 2, 3, 4 ],
+ total: function ( numbers ) {
+ return numbers.reduce( function ( prev, curr ) {
+ return prev + curr;
+ });
+ }
+ },
+ result: '<p>Total: 10</p>',
+ new_data: {
+ 'numbers[4]': 5
+ },
+ new_result: '<p>Total: 15</p>'
}
];
|
added test of upstream keypath dependants
|
diff --git a/src/Lucid/QueryBuilder/proxyHandler.js b/src/Lucid/QueryBuilder/proxyHandler.js
index <HASH>..<HASH> 100644
--- a/src/Lucid/QueryBuilder/proxyHandler.js
+++ b/src/Lucid/QueryBuilder/proxyHandler.js
@@ -65,7 +65,8 @@ proxyHandler.get = function (target, name) {
proxyHandler.set = function (target, name, value) {
if (notToTouch.indexOf(name) > -1) {
target[name] = value
- return
+ return true
}
target.modelQueryBuilder[name] = value
+ return true
}
|
refactor(*): make it ready for node v6
|
diff --git a/indra/sources/indra_db_rest/query.py b/indra/sources/indra_db_rest/query.py
index <HASH>..<HASH> 100644
--- a/indra/sources/indra_db_rest/query.py
+++ b/indra/sources/indra_db_rest/query.py
@@ -1,3 +1,8 @@
+__all__ = ['Query', 'And', 'Or', 'HasAgent', 'FromMeshIds', 'HasHash',
+ 'HasSources', 'HasOnlySource', 'HasReadings', 'HasDatabases',
+ 'HasType', 'HasNumAgents', 'HasNumEvidence', 'FromPapers',
+ 'EmptyQuery']
+
from indra.sources.indra_db_rest.util import make_db_rest_request
|
Add __all__ to query file.
|
diff --git a/jquery.maphilight.js b/jquery.maphilight.js
index <HASH>..<HASH> 100755
--- a/jquery.maphilight.js
+++ b/jquery.maphilight.js
@@ -236,8 +236,7 @@
if(options.alwaysOn) {
$(map).find('area[coords]').each(mouseover);
} else {
- $(map).find('area[coords]')
- .trigger('alwaysOn.maphilight')
+ $(map).trigger('alwaysOn.maphilight').find('area[coords]')
.bind('mouseover.maphilight', mouseover)
.bind('mouseout.maphilight', function(e) { clear_canvas(canvas); });
}
|
Performance change
alwaysOn event was firing for all areas, instead of just for the map
|
diff --git a/pandas/io/json/_normalize.py b/pandas/io/json/_normalize.py
index <HASH>..<HASH> 100644
--- a/pandas/io/json/_normalize.py
+++ b/pandas/io/json/_normalize.py
@@ -159,11 +159,10 @@ def _json_normalize(
Examples
--------
- >>> from pandas.io.json import json_normalize
>>> data = [{'id': 1, 'name': {'first': 'Coleen', 'last': 'Volk'}},
... {'name': {'given': 'Mose', 'family': 'Regner'}},
... {'id': 2, 'name': 'Faye Raker'}]
- >>> json_normalize(data)
+ >>> pandas.json_normalize(data)
id name name.family name.first name.given name.last
0 1.0 NaN NaN Coleen NaN Volk
1 NaN NaN Regner NaN Mose NaN
|
Update documentation to use recommended library (#<I>)
|
diff --git a/application/init.php b/application/init.php
index <HASH>..<HASH> 100755
--- a/application/init.php
+++ b/application/init.php
@@ -34,6 +34,7 @@ if (
set_include_path(
realpath(APPLICATION_PATH.'/../library')
+ . PATH_SEPARATOR . realpath(GARP_APPLICATION_PATH.'/../library')
. PATH_SEPARATOR . '.'
);
@@ -44,6 +45,7 @@ if (
set_include_path(
'.'
. PATH_SEPARATOR . BASE_PATH . '/library'
+ . PATH_SEPARATOR . realpath(GARP_APPLICATION_PATH.'/../library')
. PATH_SEPARATOR . get_include_path()
);
@@ -60,7 +62,7 @@ if (!defined('GARP_VERSION')) {
}
-require 'Garp/Loader.php';
+require GARP_APPLICATION_PATH . '/../library/Garp/Loader.php';
/**
* Set up class loading.
@@ -72,6 +74,10 @@ $classLoader = Garp_Loader::getInstance(array(
'path' => realpath(APPLICATION_PATH.'/../library')
),
array(
+ 'namespace' => 'Garp',
+ 'path' => realpath(GARP_APPLICATION_PATH.'/../library')
+ ),
+ array(
'namespace' => 'Model',
'path' => APPLICATION_PATH.'/modules/default/models/',
'ignore' => 'Model_'
|
Removed Garp from library. Save a symlink, save the world.
|
diff --git a/activesupport/lib/active_support/testing/deprecation.rb b/activesupport/lib/active_support/testing/deprecation.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/testing/deprecation.rb
+++ b/activesupport/lib/active_support/testing/deprecation.rb
@@ -19,18 +19,17 @@ module ActiveSupport
result
end
- private
- def collect_deprecations
- old_behavior = ActiveSupport::Deprecation.behavior
- deprecations = []
- ActiveSupport::Deprecation.behavior = Proc.new do |message, callstack|
- deprecations << message
- end
- result = yield
- [result, deprecations]
- ensure
- ActiveSupport::Deprecation.behavior = old_behavior
+ def collect_deprecations
+ old_behavior = ActiveSupport::Deprecation.behavior
+ deprecations = []
+ ActiveSupport::Deprecation.behavior = Proc.new do |message, callstack|
+ deprecations << message
end
+ result = yield
+ [result, deprecations]
+ ensure
+ ActiveSupport::Deprecation.behavior = old_behavior
+ end
end
end
end
|
make `collect_deprecations` available.
There are circumstances where the capabilities of `assert_deprecated` and
`assert_not_deprecated` are not enough. For example if a ccertain call-path
raises two deprecations but should only raise a single one.
This module is still :nodoc and intented for internal use.
/cc @rafaelfranca
|
diff --git a/classes/Pods.php b/classes/Pods.php
index <HASH>..<HASH> 100644
--- a/classes/Pods.php
+++ b/classes/Pods.php
@@ -118,6 +118,16 @@ class Pods {
public $datatype_id;
+ public $page_template;
+
+ public $body_classes;
+
+ public $meta;
+
+ public $meta_properties;
+
+ public $meta_extra;
+
/**
* Constructor - Pods Framework core
*
|
Added properties that will be used on the global $pods object
|
diff --git a/metrics.go b/metrics.go
index <HASH>..<HASH> 100644
--- a/metrics.go
+++ b/metrics.go
@@ -242,7 +242,7 @@ func (m *metrics) getPayload() MetricsData {
return metricsData
}
-func (m metrics) getClientData() ClientData {
+func (m *metrics) getClientData() ClientData {
return ClientData{
m.options.appName,
m.options.instanceId,
@@ -253,7 +253,7 @@ func (m metrics) getClientData() ClientData {
}
}
-func (m metrics) getMetricsData() MetricsData {
+func (m *metrics) getMetricsData() MetricsData {
return MetricsData{
m.options.appName,
m.options.instanceId,
|
metrics: use pointer receiver for all
Because the metrics struct contains a lock, linting complains when
passing by value.
|
diff --git a/src/components/organisms/Footer.js b/src/components/organisms/Footer.js
index <HASH>..<HASH> 100644
--- a/src/components/organisms/Footer.js
+++ b/src/components/organisms/Footer.js
@@ -1,7 +1,7 @@
import React from 'react'
import FooterLinks from '../molecules/FooterLinks'
import SocialLinks from '../molecules/SocialLinks'
-import stateSeal from '../../../node_modules/@massds/mayflower/images/stateseal.png'
+import stateSeal from '@massds/mayflower/images/stateseal.png'
/**
* Scaffolds out Mayflower footer pattern: @organisms/by-template/footer
|
Removing relative reference in import statement
|
diff --git a/zones/requests/fetch.js b/zones/requests/fetch.js
index <HASH>..<HASH> 100644
--- a/zones/requests/fetch.js
+++ b/zones/requests/fetch.js
@@ -1,6 +1,7 @@
var assert = require("assert");
var https = require("https");
var nodeFetch = require("node-fetch");
+var PassThrough = require("stream").PassThrough;
var resolveUrl = require("../../lib/util/resolve_url");
var TextDecoder = require("text-encoding").TextDecoder;
var webStreams = require("node-web-streams");
@@ -35,7 +36,8 @@ module.exports = function(request){
// Convert the Node.js Readable stream to a WHATWG stream.
response._readableBody = resp.body;
- response.body = toWebReadableStream(resp.body);
+ var body = resp.body.pipe(new PassThrough());
+ response.body = toWebReadableStream(body);
response.json = resp.json.bind(resp);
response.text = resp.text.bind(resp);
return response;
|
Clone the Node readable stream 'body'
Clonining the Node readable 'body' stream prevents it from being paused
permanently when converted into a web readable. Fixes #<I>
|
diff --git a/test/validation-regression.rb b/test/validation-regression.rb
index <HASH>..<HASH> 100644
--- a/test/validation-regression.rb
+++ b/test/validation-regression.rb
@@ -84,7 +84,7 @@ class ValidationRegressionTest < MiniTest::Test
repeated_cv = RepeatedCrossValidation.create model
repeated_cv.crossvalidations.each do |cv|
assert cv.r_squared > 0.34, "R^2 (#{cv.r_squared}) should be larger than 0.034"
- assert_operator cv.accuracy, :>, 0.7, "model accuracy < 0.7, this may happen by chance due to an unfavorable training/test set split"
+ assert cv.rmse < 0.5, "RMSE (#{cv.rmse}) should be smaller than 0.5"
end
end
|
fixed wrong accuracy assertion to rmse
|
diff --git a/src/HttpMasterWorker.js b/src/HttpMasterWorker.js
index <HASH>..<HASH> 100644
--- a/src/HttpMasterWorker.js
+++ b/src/HttpMasterWorker.js
@@ -57,7 +57,7 @@ function loadKeysforConfigEntry(config, callback) {
var SNImatchers = {};
if (config.ssl.SNI) {
for (key in config.ssl.SNI) {
- SNImatchers[key] = new RegExp(regexpQuote(key).replace(/^\\\*\\\./g, '^([^.]+\\.)?'), 'i'); // domain names are case insensitive
+ SNImatchers[key] = new RegExp('^' + regexpQuote(key).replace(/^\\\*\\\./g, '^([^.]+\\.)?') + '$', 'i'); // domain names are case insensitive
}
var sniCallback = function(hostname, cb) {
hostname = punycode.toUnicode(hostname);
@@ -318,9 +318,6 @@ function handleConfig(config, configHandled) {
}
self.logNotice('Start successful');
- // TODO
- //dropPrivileges();
-
self.servers = results.filter(function(server) {
return !!server;
});
|
Fix SNI hostname matching
Where sub.domain1.com was available along with sub2.domain.com there
was a possibility to give bad SNI certificate for sub2.domain.com
|
diff --git a/test/Psy/Test/CodeCleanerTest.php b/test/Psy/Test/CodeCleanerTest.php
index <HASH>..<HASH> 100644
--- a/test/Psy/Test/CodeCleanerTest.php
+++ b/test/Psy/Test/CodeCleanerTest.php
@@ -61,7 +61,7 @@ class CodeCleanerTest extends \PHPUnit_Framework_TestCase
public function unclosedStatementsProvider()
{
- return array(
+ $stmts = array(
array(array('echo "'), true),
array(array('echo \''), true),
array(array('if (1) {'), true),
@@ -73,10 +73,17 @@ class CodeCleanerTest extends \PHPUnit_Framework_TestCase
array(array("\$content = <<<EOS\n"), true),
array(array("\$content = <<<'EOS'\n"), true),
- array(array('/* unclosed comment'), true),
- array(array('/** unclosed comment'), true),
- array(array('// closed comment'), false),
+ array(array('// closed comment'), false),
);
+
+ // For some reason, HHVM doesn't consider unclosed comments an
+ // unexpected end of string?
+ if (!defined('HHVM_VERSION')) {
+ $stmts[] = array(array('/* unclosed comment'), true);
+ $stmts[] = array(array('/** unclosed comment'), true);
+ }
+
+ return $stmts;
}
/**
|
Fix unclosed comment tests on HHVM.
|
diff --git a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go
index <HASH>..<HASH> 100644
--- a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go
+++ b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go
@@ -176,6 +176,14 @@ func (_ *AutoscalingGroup) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Autos
request.MaxSize = e.MaxSize
changes.MaxSize = nil
}
+ if changes.Subnets != nil {
+ var subnetIDs []string
+ for _, s := range e.Subnets {
+ subnetIDs = append(subnetIDs, *s.ID)
+ }
+ request.VPCZoneIdentifier = aws.String(strings.Join(subnetIDs, ","))
+ changes.Subnets = nil
+ }
empty := &AutoscalingGroup{}
if !reflect.DeepEqual(empty, changes) {
|
upup: enable subnet changes on ASG
For kube-up upgrade
|
diff --git a/lib/polipus.rb b/lib/polipus.rb
index <HASH>..<HASH> 100644
--- a/lib/polipus.rb
+++ b/lib/polipus.rb
@@ -361,8 +361,7 @@ module Polipus
# It extracts URLs from the page
def links_for page
page.domain_aliases = domain_aliases
- links = @focus_crawl_block.nil? ? page.links : @focus_crawl_block.call(page)
- links
+ @focus_crawl_block.nil? ? page.links : @focus_crawl_block.call(page)
end
def page_expired? page
|
Assignment to local variable unnecessary in
#links_for
|
diff --git a/lib/View/Controllers/Save.php b/lib/View/Controllers/Save.php
index <HASH>..<HASH> 100644
--- a/lib/View/Controllers/Save.php
+++ b/lib/View/Controllers/Save.php
@@ -54,7 +54,11 @@ class Save implements ControllerInterface
public function read(ServerRequestInterface $request)
{
- if (strpos($request->getHeader('content-type'), 'application/json') === false) {
+ $header = $request->getHeader('content-type');
+ if (is_array($header)) {
+ $header = array_shift($header);
+ }
+ if (strpos($header, 'application/json') === false) {
throw new InvalidRequestException('MCM save operation requires an application/json content type');
}
$body = $request->getBody();
|
Fixed an issue when the header is provided as an array
|
diff --git a/raiden_mps/raiden_mps/webui/js/main.js b/raiden_mps/raiden_mps/webui/js/main.js
index <HASH>..<HASH> 100644
--- a/raiden_mps/raiden_mps/webui/js/main.js
+++ b/raiden_mps/raiden_mps/webui/js/main.js
@@ -169,7 +169,11 @@ $.getJSON("js/parameters.json", (json) => {
let cnt = 20;
// wait up to 20*200ms for web3 and call ready()
const pollingId = setInterval(() => {
- if (cnt < 0 || window.web3) {
+ if (Cookies.get("RDN-Insufficient-Confirmations")) {
+ clearInterval(pollingId);
+ $("body").html('<h1>Waiting confirmations...</h1>');
+ setTimeout(() => location.reload(), 5000);
+ } else if (cnt < 0 || window.web3) {
clearInterval(pollingId);
pageReady(json);
} else {
|
Retry if RDN-Insufficient-Confirmations cookie is present
|
diff --git a/config/nightwatch.conf.js b/config/nightwatch.conf.js
index <HASH>..<HASH> 100644
--- a/config/nightwatch.conf.js
+++ b/config/nightwatch.conf.js
@@ -2,12 +2,12 @@
const path = require('path')
module.exports = {
- src_folders: path.resolve('test/specs/'),
- globals_path: path.resolve('test/globals.js'),
- output_folder: path.resolve('test/reports'),
+ src_folders: path.resolve('tests/specs/'),
+ globals_path: path.resolve('tests/globals.js'),
+ output_folder: path.resolve('tests/reports'),
custom_commands_path: [path.resolve('node_modules/nightwatch-accessibility/commands')],
custom_assertions_path: [path.resolve('node_modules/nightwatch-accessibility/assertions')],
- page_objects_path: path.resolve('test/page-objects'),
+ page_objects_path: path.resolve('tests/page-objects'),
selenium: {
start_process: false,
},
|
fix(nighwatch): Update path to /tests in config file
|
diff --git a/refactor/adapters/mqtt/mqtt_test.go b/refactor/adapters/mqtt/mqtt_test.go
index <HASH>..<HASH> 100644
--- a/refactor/adapters/mqtt/mqtt_test.go
+++ b/refactor/adapters/mqtt/mqtt_test.go
@@ -144,8 +144,8 @@ func TestMQTTSend(t *testing.T) {
checkResponses(t, test.WantResponse, resp)
// Clean
- aclient.Disconnect(0)
- sclient.Disconnect(0)
+ aclient.Disconnect(250)
+ sclient.Disconnect(250)
<-time.After(time.Millisecond * 50)
}
}
|
[refactor] Add small delay for disconnecting mqtt client
|
diff --git a/expandedsingles/services/ExpandedSinglesService.php b/expandedsingles/services/ExpandedSinglesService.php
index <HASH>..<HASH> 100644
--- a/expandedsingles/services/ExpandedSinglesService.php
+++ b/expandedsingles/services/ExpandedSinglesService.php
@@ -33,6 +33,7 @@ class ExpandedSinglesService extends BaseApplicationComponent
// Create list of Singles
foreach ($singleSections as $single) {
$criteria = craft()->elements->getCriteria(ElementType::Entry);
+ $criteria->locale = craft()->i18n->getPrimarySiteLocale()->id;
$criteria->status = null;
$criteria->sectionId = $single->id;
$entry = $criteria->first();
|
Fix to work with multi-locales
|
diff --git a/spec/lib/stretcher_search_results_spec.rb b/spec/lib/stretcher_search_results_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/stretcher_search_results_spec.rb
+++ b/spec/lib/stretcher_search_results_spec.rb
@@ -66,10 +66,12 @@ describe Stretcher::SearchResults do
}
it 'returns a plain hash for raw_plain' do
+ sleep 1
search_result.raw_plain.should be_instance_of(::Hash)
end
it 'returns a hashie mash for raw' do
+ sleep 1
search_result.raw.should be_instance_of(Hashie::Mash)
end
end
|
Try even more delays to help travis out
|
diff --git a/simple-concat.js b/simple-concat.js
index <HASH>..<HASH> 100644
--- a/simple-concat.js
+++ b/simple-concat.js
@@ -11,6 +11,8 @@ module.exports = CachingWriter.extend({
enforceSingleInputTree: true,
init: function() {
+ this.description = 'SourcemapConcat';
+
if (!this.separator) {
this.separator = '\n';
}
|
Give `description`.
Without this the slow tree printout simply labels this as `Class` (from the CoreObject constructor function).
|
diff --git a/src/angularJwt/services/jwt.js b/src/angularJwt/services/jwt.js
index <HASH>..<HASH> 100644
--- a/src/angularJwt/services/jwt.js
+++ b/src/angularJwt/services/jwt.js
@@ -1,5 +1,5 @@
angular.module('angular-jwt.jwt', [])
- .service('jwtHelper', function() {
+ .service('jwtHelper', function($window) {
this.urlBase64Decode = function(str) {
var output = str.replace(/-/g, '+').replace(/_/g, '/');
@@ -11,7 +11,7 @@
throw 'Illegal base64url string!';
}
}
- return decodeURIComponent(escape(window.atob(output))); //polifyll https://github.com/davidchambers/Base64.js
+ return $window.decodeURIComponent(escape($window.atob(output))); //polyfill https://github.com/davidchambers/Base64.js
}
@@ -27,12 +27,11 @@
throw new Error('Cannot decode the token');
}
- return JSON.parse(decoded);
+ return angular.fromJson.parse(decoded);
}
this.getTokenExpirationDate = function(token) {
- var decoded;
- decoded = this.decodeToken(token);
+ var decoded = this.decodeToken(token);
if(typeof decoded.exp === "undefined") {
return null;
|
Typo fix and cleanup
Using $window so dependencies can be mocked for testing.
Fixed a typo
Using angular.fromJson for mocking purposes as well
|
diff --git a/lib/wechat/message.rb b/lib/wechat/message.rb
index <HASH>..<HASH> 100644
--- a/lib/wechat/message.rb
+++ b/lib/wechat/message.rb
@@ -69,8 +69,8 @@ module Wechat
end
end
- def to(userid)
- update(ToUserName: userid)
+ def to(openid_or_userid)
+ update(ToUserName: openid_or_userid)
end
def agent_id(agentid)
|
Still possible openid as 'to' is shared between public account and enterprise account.
|
diff --git a/src/Rocketeer/Services/Environment/Modules/ApplicationPathfinder.php b/src/Rocketeer/Services/Environment/Modules/ApplicationPathfinder.php
index <HASH>..<HASH> 100644
--- a/src/Rocketeer/Services/Environment/Modules/ApplicationPathfinder.php
+++ b/src/Rocketeer/Services/Environment/Modules/ApplicationPathfinder.php
@@ -47,7 +47,7 @@ class ApplicationPathfinder extends AbstractPathfinderModule
*/
public function getConfigurationPath()
{
- return $this->getRocketeerPath().DS.'config';
+ return $this->modulable->unifyLocalSlashes($this->getRocketeerPath().'/config');
}
/**
@@ -55,7 +55,7 @@ class ApplicationPathfinder extends AbstractPathfinderModule
*/
public function getLogsPath()
{
- return $this->getRocketeerPath().DS.'logs';
+ return $this->modulable->unifyLocalSlashes($this->getRocketeerPath().'/logs');
}
/**
@@ -67,7 +67,7 @@ class ApplicationPathfinder extends AbstractPathfinderModule
{
$namespace = ucfirst($this->config->get('application_name'));
- return $this->getRocketeerPath().DS.$namespace;
+ return $this->modulable->unifyLocalSlashes($this->getRocketeerPath().'/'.$namespace);
}
/**
|
Ensure slashes are unified in paths
|
diff --git a/optimizely/project_config.py b/optimizely/project_config.py
index <HASH>..<HASH> 100644
--- a/optimizely/project_config.py
+++ b/optimizely/project_config.py
@@ -116,11 +116,11 @@ class ProjectConfig(object):
self.forced_variation_map = {}
@staticmethod
- def _generate_key_map(list, key, entity_class):
+ def _generate_key_map(entity_list, key, entity_class):
""" Helper method to generate map from key to entity object for given list of dicts.
Args:
- list: List consisting of dict.
+ entity_list: List consisting of dict.
key: Key in each dict which will be key in the map.
entity_class: Class representing the entity.
@@ -129,7 +129,7 @@ class ProjectConfig(object):
"""
key_map = {}
- for obj in list:
+ for obj in entity_list:
key_map[obj[key]] = entity_class(**obj)
return key_map
|
Move away from using built-in name (#<I>)
|
diff --git a/spec/ronin_spec.rb b/spec/ronin_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/ronin_spec.rb
+++ b/spec/ronin_spec.rb
@@ -3,8 +3,9 @@ require 'ronin/version'
describe Ronin do
it "should have a version" do
- @version = Ronin.const_get('VERSION')
- @version.should_not be_nil
- @version.should_not be_empty
+ version = subject.const_get('VERSION')
+
+ version.should_not be_nil
+ version.should_not be_empty
end
end
|
More use of 'subject' in specs.
|
diff --git a/code/administrator/components/com_activities/controllers/activity.php b/code/administrator/components/com_activities/controllers/activity.php
index <HASH>..<HASH> 100644
--- a/code/administrator/components/com_activities/controllers/activity.php
+++ b/code/administrator/components/com_activities/controllers/activity.php
@@ -23,6 +23,8 @@ class ComActivitiesControllerActivity extends ComDefaultControllerDefault
// TODO To be removed as soon as the problem with language files loading on HMVC calls is solved
JFactory::getLanguage()->load('com_activities', JPATH_ADMINISTRATOR);
+
+ $this->registerCallback('before.add', array($this, 'setIp'));
}
protected function _actionPurge(KCommandContext $context)
@@ -46,4 +48,9 @@ class ComActivitiesControllerActivity extends ComDefaultControllerDefault
$context->status = KHttpResponse::NO_CONTENT;
}
}
+
+ public function setIp(KCommandContext $context)
+ {
+ $context->data->ip = KRequest::get('server.REMOTE_ADDR', 'ip');
+ }
}
\ No newline at end of file
|
Added callback for setting requester IP address before add.
re #<I>
|
diff --git a/js/luno.js b/js/luno.js
index <HASH>..<HASH> 100644
--- a/js/luno.js
+++ b/js/luno.js
@@ -323,6 +323,8 @@ module.exports = class luno extends Exchange {
}
async fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {}) {
+ if (typeof symbol === 'undefined')
+ throw new ExchangeError (this.id + ' fetchMyTrades requires a symbol argument');
await this.loadMarkets ();
let market = this.market (symbol);
let request = {
|
Adding exception for missing symbol in fetchMyTrades
|
diff --git a/docker/index.js b/docker/index.js
index <HASH>..<HASH> 100644
--- a/docker/index.js
+++ b/docker/index.js
@@ -88,16 +88,16 @@ function calcFinishStats(stats) {
const parser = new Parser({
environment: new Environment(getEnvOptions()),
});
- const results = await parser.parse(getRules());
+ const data = await parser.parse(getRules());
if (verbose) {
console.log('Work is done');
console.log('Execution time: ' + ((new Date).getTime() - time));
console.log('Results:');
- console.log(util.inspect(results, { showHidden: false, depth: null }));
+ console.log(util.inspect(data, { showHidden: false, depth: null }));
} else {
console.log(JSON.stringify({
- results,
- stats: calcFinishStats(stats),
+ data,
+ stat: calcFinishStats(stats),
}, null, ' '));
}
} catch (e) {
|
Updated return value in docker cli command
:goose:
|
diff --git a/src/constants/Style.js b/src/constants/Style.js
index <HASH>..<HASH> 100644
--- a/src/constants/Style.js
+++ b/src/constants/Style.js
@@ -52,6 +52,7 @@ module.exports = {
INCOME: '#133F49',
INVESTMENTS: '#FF7070',
KIDS: '#82D196',
+ OTHER: '#959CA6',
PETS: '#85507B',
PERSONAL_CARE: '#338B7A',
SHOPPING: '#CF5F84',
|
Adds OTHER as a category color in Style constants
|
diff --git a/spec/unit/provider/ifconfig/debian_spec.rb b/spec/unit/provider/ifconfig/debian_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/provider/ifconfig/debian_spec.rb
+++ b/spec/unit/provider/ifconfig/debian_spec.rb
@@ -52,6 +52,7 @@ describe Chef::Provider::Ifconfig::Debian do
File.should_receive(:new).with(@config_filename_ifaces).and_return(StringIO.new)
File.should_receive(:open).with(@config_filename_ifaces, "w").and_yield(@config_file_ifaces)
File.should_receive(:new).with(@config_filename_ifcfg, "w").and_return(@config_file_ifcfg)
+ File.should_receive(:exist?).with(@config_filename_ifaces).and_return(true)
end
it "should create network-scripts directory" do
|
Stub that /etc/network/interfaces really is there [on windows]
|
diff --git a/tests/Timer/TimersTest.php b/tests/Timer/TimersTest.php
index <HASH>..<HASH> 100644
--- a/tests/Timer/TimersTest.php
+++ b/tests/Timer/TimersTest.php
@@ -2,7 +2,6 @@
namespace React\Tests\EventLoop\Timer;
-use React\EventLoop\TimerInterface;
use React\Tests\EventLoop\TestCase;
use React\EventLoop\Timer\Timer;
use React\EventLoop\Timer\Timers;
@@ -30,10 +29,8 @@ class TimersTest extends TestCase
{
$timers = new Timers();
- /** @var TimerInterface $timer1 */
- $timer1 = $this->createMock('React\EventLoop\TimerInterface');
- /** @var TimerInterface $timer2 */
- $timer2 = $this->createMock('React\EventLoop\TimerInterface');
+ $timer1 = new Timer(0.1, function () {});
+ $timer2 = new Timer(0.1, function () {});
$timers->add($timer1);
|
Using a real `Timer` instance, since pre-historic PHPUnit versions are being used in CI
|
diff --git a/tasks/reqs/config.js b/tasks/reqs/config.js
index <HASH>..<HASH> 100644
--- a/tasks/reqs/config.js
+++ b/tasks/reqs/config.js
@@ -80,7 +80,7 @@ var config = {
parentIncludeJs: [
'src/scripts/[^_]*.*'
],
- scss: 'src/stylesheets/**/*.scss',
+ scss: 'src/stylesheets/**/*.{scss, scss.liquid}',
images: 'src/images/*.{png,jpg,gif}',
destAssets: 'dist/assets',
destSnippets: 'dist/snippets',
|
Add 'scss.liquid' files to watch
|
diff --git a/salt/modules/cmd.py b/salt/modules/cmd.py
index <HASH>..<HASH> 100644
--- a/salt/modules/cmd.py
+++ b/salt/modules/cmd.py
@@ -22,7 +22,7 @@ DEFAULT_CWD = os.path.expanduser('~')
__outputter__ = {
'run': 'txt',
}
-
+# TODO: Add a way to quiet down the logging here when salt-call -g is ran
def _run(cmd,
cwd=DEFAULT_CWD,
stdout=subprocess.PIPE,
|
Add a TODO for tomorrow for the new grain __salt__['cmd.run'] code
|
diff --git a/jsio/util/browser.js b/jsio/util/browser.js
index <HASH>..<HASH> 100644
--- a/jsio/util/browser.js
+++ b/jsio/util/browser.js
@@ -118,21 +118,22 @@ $.remove = function(el) {
$.cursorPos = function(ev, el) {
var offset = $.pos(el);
- offset.top = ev.clientY - offset.top + document.body.scrollTop;
- offset.left = ev.clientX - offset.left + document.body.scrollLeft;
+ offset.top = ev.clientY - offset.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
+ offset.left = ev.clientX - offset.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft);
return offset;
}
$.pos = function(el) {
var parent = el;
var offset = {top: 0, left: 0};
- do {
+ while(parent && parent != document.body) {
offset.left += parent.offsetLeft;
offset.top += parent.offsetTop;
while(parent.offsetParent != parent.parentNode) {
offset.top -= parent.scrollTop; offset.left -= parent.scrollLeft;
parent = parent.parentNode;
}
- } while((parent = parent.offsetParent) && parent != document);
+ parent = parent.offsetParent;
+ }
return offset;
}
\ No newline at end of file
|
compute scroll offsets in a cross-browser way
|
diff --git a/leveldb/db.go b/leveldb/db.go
index <HASH>..<HASH> 100644
--- a/leveldb/db.go
+++ b/leveldb/db.go
@@ -116,6 +116,7 @@ func openDB(s *session) (*DB, error) {
db.closeWg.Add(2)
go db.compaction()
go db.writeJournal()
+ db.wakeCompaction(0)
s.logf("db@open done T·%v", time.Since(start))
|
leveldb: Wake compaction goroutine when opening database
|
diff --git a/spec/functional/shell_spec.rb b/spec/functional/shell_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/functional/shell_spec.rb
+++ b/spec/functional/shell_spec.rb
@@ -81,7 +81,7 @@ describe Shell do
require "pty"
config = File.expand_path("shef-config.rb", CHEF_SPEC_DATA)
- reader, writer, pid = PTY.spawn("bundle exec #{ChefUtils::Dist::Infra::SHELL} --always-dump-stacktrace --no-multiline --no-singleline --no-colorize -c #{config} #{options}")
+ reader, writer, pid = PTY.spawn("bundle exec #{ChefUtils::Dist::Infra::SHELL} --no-multiline --no-singleline --no-colorize -c #{config} #{options}")
read_until(reader, "chef (#{Chef::VERSION})>")
yield reader, writer if block_given?
writer.puts('"done"')
|
Remove --always_dump_stacktrace from bundle exec chef-shell as it does not inherit from base class to support that option
|
diff --git a/src/Ballybran/Core/Collections/Collection/IteratorDot.php b/src/Ballybran/Core/Collections/Collection/IteratorDot.php
index <HASH>..<HASH> 100644
--- a/src/Ballybran/Core/Collections/Collection/IteratorDot.php
+++ b/src/Ballybran/Core/Collections/Collection/IteratorDot.php
@@ -124,7 +124,7 @@ class IteratorDot implements Countable
*
* @return bool
*/
- protected function exists($array, $key)
+ private function exists($array, $key)
{
return array_key_exists($key, $array);
}
@@ -366,21 +366,6 @@ class IteratorDot implements Countable
$options = $key === null ? 0 : $key;
return json_encode($this->elements, $options);
}
- /*
- * --------------------------------------------------------------
- * ArrayAccess interface
- * --------------------------------------------------------------
- */
- /**
- * Check if a given key exists
- *
- * @param int|string $key
- * @return bool
- */
- public function offsetExists($key)
- {
- return $this->has($key);
- }
/*
* --------------------------------------------------------------
|
Update IteratorDot.php
|
diff --git a/src/Commands/Install.php b/src/Commands/Install.php
index <HASH>..<HASH> 100644
--- a/src/Commands/Install.php
+++ b/src/Commands/Install.php
@@ -5,6 +5,7 @@ namespace TypiCMS\Modules\Core\Commands;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
+use Illuminate\Support\Facades\Hash;
use TypiCMS\Modules\Users\Models\User;
class Install extends Command
@@ -131,7 +132,7 @@ class Install extends Command
'email' => $email,
'superuser' => 1,
'activated' => 1,
- 'password' => bcrypt($password),
+ 'password' => Hash::make($password),
];
try {
|
bcrypt replaced by Hash::make
|
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
@@ -192,7 +192,7 @@ class RunBase():
log_status = logging.WARNING
else:
log_status = logging.ERROR
- logging.log(log_status, 'Stopped run #%d (%s) in %s. STATUS: %s' % (self.run_number, self.__class__.__name__, self.working_dir, self.run_status))
+ logging.log(log_status, 'Finished run #%d (%s) in %s. STATUS: %s' % (self.run_number, self.__class__.__name__, self.working_dir, self.run_status))
def stop(self, msg=None):
"""Stopping a run. Control for loops.
|
MAINT: avoid confision about run status
|
diff --git a/interp/interp.go b/interp/interp.go
index <HASH>..<HASH> 100644
--- a/interp/interp.go
+++ b/interp/interp.go
@@ -324,7 +324,6 @@ func (r *Runner) redir(rd *syntax.Redirect) io.Closer {
return nil
case syntax.DplIn:
panic(fmt.Sprintf("unhandled redirect op: %v", rd.Op))
- return nil
}
mode := os.O_RDONLY
switch rd.Op {
@@ -609,6 +608,7 @@ func (r *Runner) arithm(expr syntax.ArithmExpr) int {
b2, ok := x.Y.(*syntax.BinaryArithm)
if !ok || b2.Op != syntax.Colon {
// TODO: error
+ return 0
}
if cond == 1 {
return r.arithm(b2.X)
|
interp: fix a couple of linter issues
|
diff --git a/src/cache.js b/src/cache.js
index <HASH>..<HASH> 100644
--- a/src/cache.js
+++ b/src/cache.js
@@ -37,7 +37,7 @@ class HBaseThriftClientCache extends Cache {
super.get(getObj)
.then(value =>{
- callback(null, Promise.resolve(value));
+ callback(null, value);
})
.catch(err => callback(err));
}
|
fix cache - chace shouldn't return a promise
|
diff --git a/src/SmartlabelManager.js b/src/SmartlabelManager.js
index <HASH>..<HASH> 100644
--- a/src/SmartlabelManager.js
+++ b/src/SmartlabelManager.js
@@ -723,9 +723,10 @@ SmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight,
i = 0;
len = characterArr.length;
- minWidth = characterArr[0].elem.offsetWidth;
+ // if character array is not generated
+ minWidth = len && characterArr[0].elem.offsetWidth;
- if (minWidth > maxWidth) {
+ if (minWidth > maxWidth || !len) {
smartLabel.text = '';
smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;
|
added check if no characters are present in array
|
diff --git a/mopidy_spotify/translator.py b/mopidy_spotify/translator.py
index <HASH>..<HASH> 100644
--- a/mopidy_spotify/translator.py
+++ b/mopidy_spotify/translator.py
@@ -58,7 +58,7 @@ def to_album(sp_album):
if not sp_album.is_loaded:
return
- if sp_album.artist is not None:
+ if sp_album.artist is not None and sp_album.artist.is_loaded:
artists = [to_artist(sp_album.artist)]
else:
artists = []
@@ -171,7 +171,7 @@ def to_playlist(
tracks = filter(None, tracks)
if name is None:
# Use same starred order as the Spotify client
- tracks = reversed(tracks)
+ tracks = list(reversed(tracks))
if name is None:
name = 'Starred'
|
tests: Fix test errors catched by model validation
|
diff --git a/src/socket.js b/src/socket.js
index <HASH>..<HASH> 100644
--- a/src/socket.js
+++ b/src/socket.js
@@ -81,7 +81,7 @@ function createSocket(apiClient) {
var defer = Q.defer();
realtimeSessionPromise = defer.promise;
var url = apiClient.url("/messaging/realtime/sessions", {}, {unique: (Math.random() * Date.now()).toString(16)});
- apiClient.request("post", url)
+ apiClient.request("post", url, {})
.then(function(response) {
realtimeSessionId = response.realtimeSessionId;
defer.resolve();
|
Don't send empty POST, it triggers bug in react-native on Android.
|
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/classical.py
+++ b/openquake/calculators/classical.py
@@ -371,7 +371,7 @@ class ClassicalCalculator(base.HazardCalculator):
md = '%s->%d ... %s->%d' % (it[0] + it[-1])
else:
md = oq.maximum_distance(sg.trt)
- logging.info('max_dist={}, gsims={}, weight={:,d}, blocks={}'.
+ logging.info('max_dist={}, gsims={}, weight={:_d}, blocks={}'.
format(md, len(gsims), int(w), nb))
if oq.pointsource_distance['default']:
psd = getdefault(oq.pointsource_distance, sg.trt)
|
Better logging [skip CI]
|
diff --git a/addon/not-equal.js b/addon/not-equal.js
index <HASH>..<HASH> 100644
--- a/addon/not-equal.js
+++ b/addon/not-equal.js
@@ -1,7 +1,5 @@
-import curriedComputed from 'ember-macro-helpers/curried-computed';
+import { not, eq } from '.';
-export default curriedComputed((firstVal, ...values) => {
- return values.filter(value => {
- return value !== firstVal;
- }).length > 0;
-});
+export default function() {
+ return not(eq(...arguments));
+}
|
use not and equal as the base for notEqual
|
diff --git a/src/google/googlefontapi.js b/src/google/googlefontapi.js
index <HASH>..<HASH> 100644
--- a/src/google/googlefontapi.js
+++ b/src/google/googlefontapi.js
@@ -11,9 +11,19 @@ webfont.GoogleFontApi.NAME = 'google';
webfont.GoogleFontApi.prototype.supportUserAgent = function(userAgent, support) {
if (userAgent.getPlatform().match(/iPad|iPod|iPhone/) != null) {
- support(false);
+ support(true);
+ return;
}
- return support(userAgent.isSupportingWebFont());
+ if (userAgent.getPlatform().match(/Android/) != null) {
+ if (userAgent.getVersion().indexOf('2.2') != -1) {
+ support(true);
+ return;
+ } else {
+ support(false);
+ return;
+ }
+ }
+ support(userAgent.isSupportingWebFont());
};
webfont.GoogleFontApi.prototype.load = function(onReady) {
|
Added support for iPhone, iPod, iPad.
|
diff --git a/src/CatalogBundle/Model/Repository/CatalogRepository.php b/src/CatalogBundle/Model/Repository/CatalogRepository.php
index <HASH>..<HASH> 100644
--- a/src/CatalogBundle/Model/Repository/CatalogRepository.php
+++ b/src/CatalogBundle/Model/Repository/CatalogRepository.php
@@ -69,7 +69,7 @@ class CatalogRepository extends Repository
$client = $this->getClient();
$cacheKey = static::NAME . '-' . $id . '-' . $locale;
- $productRequest = RequestBuilder::of()->products()->getById($id);
+ $productRequest = RequestBuilder::of()->productProjections()->getById($id);
$product = $this->retrieve($client, $cacheKey, $productRequest, $locale);
|
WIP: catalog_bundle fix RequestBuilder to get ProductProjections instead of Products by id
|
diff --git a/sources/scalac/transformer/ExpandMixinsPhase.java b/sources/scalac/transformer/ExpandMixinsPhase.java
index <HASH>..<HASH> 100644
--- a/sources/scalac/transformer/ExpandMixinsPhase.java
+++ b/sources/scalac/transformer/ExpandMixinsPhase.java
@@ -415,6 +415,14 @@ public class ExpandMixinsPhase extends Phase {
case TypeRef(Type prefix, Symbol symbol, Type[] args):
Type inline = (Type)inlines.get(symbol);
if (inline != null) return inline;
+ if (symbol.isParameter()) {
+ Symbol clone = (Symbol)cloner.clones.get(symbol);
+ if (clone != null) {
+ assert prefix == Type.NoPrefix && args.length == 0:
+ type;
+ return Type.typeRef(prefix, clone, args);
+ }
+ }
return map(type);
case SingleType(Type prefix, Symbol symbol):
Symbol clone = (Symbol)cloner.clones.get(symbol);
|
- Added a missing substitution for cloned type ...
- Added a missing substitution for cloned type parameters
|
diff --git a/lib/esp/resources/resource.rb b/lib/esp/resources/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/esp/resources/resource.rb
+++ b/lib/esp/resources/resource.rb
@@ -22,7 +22,6 @@ module ESP
end
def self.where(clauses = {})
- puts "@@@@@@@@@ #{__FILE__}:#{__LINE__} \n********** clauses = " + clauses.inspect
fail ArgumentError, "expected a clauses Hash, got #{clauses.inspect}" unless clauses.is_a? Hash
from = clauses.delete(:from) || "#{prefix}#{name.demodulize.pluralize.underscore}"
clauses = { params: clauses }
@@ -34,7 +33,6 @@ module ESP
end
def self.find(*arguments)
- puts "@@@@@@@@@ #{__FILE__}:#{__LINE__} \n********** arguments = " + arguments.inspect
scope = arguments.slice!(0)
options = (arguments.slice!(0) || {}).with_indifferent_access
arrange_options(options)
@@ -65,7 +63,6 @@ module ESP
# Need to set from so paginated collection can use it for page calls.
object.tap do |collection|
collection.from = options['from']
- puts "@@@@@@@@@ #{__FILE__}:#{__LINE__} \n********** options = " + options.inspect
collection.original_params = options['params']
end
end
|
Didn't mean to commit that.
|
diff --git a/src/org/opencms/xml/containerpage/CmsXmlContainerPage.java b/src/org/opencms/xml/containerpage/CmsXmlContainerPage.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/xml/containerpage/CmsXmlContainerPage.java
+++ b/src/org/opencms/xml/containerpage/CmsXmlContainerPage.java
@@ -955,8 +955,12 @@ public class CmsXmlContainerPage extends CmsXmlContent {
I_CmsFormatterBean formatter = null;
if (formatterKey != null) {
Element formatterKeyElem = elemElement.addElement(XmlNode.FormatterKey.name());
- formatterKeyElem.addText(formatterKey);
+
formatter = adeConfig.findFormatter(formatterKey);
+ if ((formatter != null) && (formatter.getKeyOrId() != null)) {
+ formatterKey = formatter.getKeyOrId();
+ }
+ formatterKeyElem.addText(formatterKey);
}
CmsResource elementRes;
|
Fixed problem with formatter id not being rewritten to formatter key in new container page format.
|
diff --git a/mythril/ether/ethcontract.py b/mythril/ether/ethcontract.py
index <HASH>..<HASH> 100644
--- a/mythril/ether/ethcontract.py
+++ b/mythril/ether/ethcontract.py
@@ -12,8 +12,8 @@ class ETHContract(persistent.Persistent):
# Dynamic contract addresses of the format __[contract-name]_____________ are replaced with a generic address
# Apply this for creation_code & code
- creation_code = re.sub(r'(_+.*_+)', 'aa' * 20, creation_code)
- code = re.sub(r'(_+.*_+)', 'aa' * 20, code)
+ creation_code = re.sub(r'(_{2}.{38})', 'aa' * 20, creation_code)
+ code = re.sub(r'(_{2}.{38})', 'aa' * 20, code)
self.creation_code = creation_code
self.name = name
|
Chnage regex to limit to correct pattern
|
diff --git a/lib/clean.js b/lib/clean.js
index <HASH>..<HASH> 100644
--- a/lib/clean.js
+++ b/lib/clean.js
@@ -9,7 +9,7 @@ exports.usage = 'Removes any generated build files and the "out" dir'
var rm = require('rimraf')
, glob = require('glob')
- , targets = [ 'out' ]
+ , targets = []
/**
* Add the platform-specific targets to remove.
@@ -17,10 +17,13 @@ var rm = require('rimraf')
if (process.platform == 'win32') {
// Remove MSVC project files
+ targets.push('Debug')
+ targets.push('Release')
targets.push('*.sln')
targets.push('*.vcxproj*')
} else {
// Remove Makefile project files
+ targets.push('out')
targets.push('Makefile')
targets.push('*.Makefile')
targets.push('*.target.mk')
|
Clean the Debug and Release dirs on Windows.
|
diff --git a/core/src/main/java/hudson/matrix/Axis.java b/core/src/main/java/hudson/matrix/Axis.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/matrix/Axis.java
+++ b/core/src/main/java/hudson/matrix/Axis.java
@@ -197,12 +197,16 @@ public class Axis extends AbstractDescribableImpl<Axis> implements Comparable<Ax
public Object readResolve() {
if (getClass()!=Axis.class) return this;
+ /*
+ This method is necessary only because earlier versions of Jenkins treated
+ axis names "label" and "jdk" differently,
+ plus Axis was a concrete class, and we need to be able to read that back.
+ So this measure is not needed for newly added Axes.
+ */
if (getName().equals("jdk"))
return new JDKAxis(getValues());
if (getName().equals("label"))
return new LabelAxis(getName(),getValues());
- if (getName().equals("labelExp"))
- return new LabelExpAxis(getName(),getValues());
return new TextAxis(getName(),getValues());
}
|
this method is necessary only because earlier versions of Jenkins treated axis names "label" and "jdk" differently and we need to be able to read that back.
So this measure is not needed for newly added Axes.
|
diff --git a/sdk/tables/azure-data-tables/tests/test_table_client_cosmos.py b/sdk/tables/azure-data-tables/tests/test_table_client_cosmos.py
index <HASH>..<HASH> 100644
--- a/sdk/tables/azure-data-tables/tests/test_table_client_cosmos.py
+++ b/sdk/tables/azure-data-tables/tests/test_table_client_cosmos.py
@@ -6,10 +6,10 @@
import pytest
import platform
from time import sleep
+import sys
from azure.data.tables import TableServiceClient, TableClient
from azure.data.tables._version import VERSION
-from azure.core.exceptions import HttpResponseError
from _shared.testcase import (
TableTestCase,
@@ -419,7 +419,7 @@ class StorageTableClientTest(TableTestCase):
if self.is_live:
sleep(SLEEP_DELAY)
- @pytest.mark.xfail
+ @pytest.mark.skipif(sys.version_info < (3, 0), reason="Malformed string")
@CosmosPreparer()
def test_user_agent_default(self, tables_cosmos_account_name, tables_primary_cosmos_account_key):
service = TableServiceClient(self.account_url(tables_cosmos_account_name, "cosmos"), credential=tables_primary_cosmos_account_key)
|
added python3 conditional (#<I>)
addresses #<I>
|
diff --git a/termgraph/termgraph.py b/termgraph/termgraph.py
index <HASH>..<HASH> 100755
--- a/termgraph/termgraph.py
+++ b/termgraph/termgraph.py
@@ -144,7 +144,7 @@ def main():
print('termgraph v{}'.format(VERSION))
sys.exit()
- labels, data, colors = read_data(args)
+ _, labels, data, colors = read_data(args)
if args['calendar']:
calendar_heatmap(data, labels, args)
else:
|
Fix for unbalanced args
|
diff --git a/example/github_server.js b/example/github_server.js
index <HASH>..<HASH> 100644
--- a/example/github_server.js
+++ b/example/github_server.js
@@ -12,7 +12,7 @@ server.connection({
var opts = {
REDIRECT_URL: '/githubauth', // must match google app redirect URI
handler: require('./github_oauth_handler.js'), // your handler
- scope: 'user' // get user's profile see: developer.github.com/v3/oauth/#scopes
+ SCOPE: 'user' // get user's profile see: developer.github.com/v3/oauth/#scopes
};
var hapi_auth_github = require('../lib');
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -97,7 +97,7 @@ module.exports.login_url = function() {
var params = {
client_id : process.env.GITHUB_CLIENT_ID,
redirect_uri : process.env.BASE_URL + OPTIONS.REDIRECT_URL,
- scope : 'repo',
+ scope : OPTIONS.SCOPE,
state: crypto.createHash('sha256').update(Math.random().toString()).digest('hex')
}
console.log(params);
|
scope for auth is defined when registering the plugin. fixes #4
|
diff --git a/Swat/SwatUI.php b/Swat/SwatUI.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatUI.php
+++ b/Swat/SwatUI.php
@@ -174,9 +174,9 @@ class SwatUI extends SwatObject {
case 'boolean':
return ($value == 'true') ? true : false;
case 'integer':
- return intval(substr($value, 8));
+ return intval($value);
case 'float':
- return floatval(substr($value, 6));
+ return floatval($value);
case 'string':
return $this->translateValue($value, $translatable);
case 'data':
|
Fixed bug with SwatUI's handling of integer and float values for properties
svn commit r<I>
|
diff --git a/src/Forms/FormData.php b/src/Forms/FormData.php
index <HASH>..<HASH> 100644
--- a/src/Forms/FormData.php
+++ b/src/Forms/FormData.php
@@ -46,6 +46,20 @@ class FormData
}
/**
+ * @return array
+ */
+ public function getAllMessages()
+ {
+ $allMessages = [ ];
+ foreach ( $this->feedbacks as $feedback )
+ {
+ $allMessages = array_merge( $allMessages, $feedback->getMessages() );
+ }
+
+ return $allMessages;
+ }
+
+ /**
* @param string $key
*
* @return bool
|
Added getAllMessages to FormData
|
diff --git a/src/check.js b/src/check.js
index <HASH>..<HASH> 100644
--- a/src/check.js
+++ b/src/check.js
@@ -9,7 +9,8 @@ const lintedByEslintPrettier = {
const eslintConfig = (info.pkg && info.pkg.eslintConfig) || info.eslintrc
assert(
eslintConfig &&
- eslintConfig.extends.indexOf('eslint-config-cozy-app') > -1,
+ // eslint-config- can be ommitted
+ ['eslint-config-cozy-app', 'cozy-app'].includes(eslintConfig.extends),
'eslintConfig should extend from prettier'
)
},
|
📝 feat: accept also 'cozy-app' for eslint preset
|
diff --git a/lib/dragonfly/extended_temp_object.rb b/lib/dragonfly/extended_temp_object.rb
index <HASH>..<HASH> 100644
--- a/lib/dragonfly/extended_temp_object.rb
+++ b/lib/dragonfly/extended_temp_object.rb
@@ -87,9 +87,8 @@ module Dragonfly
def method_missing(method, *args, &block)
if analyser.has_delegatable_method?(method)
- # Define the method so we don't use method_missing next time
- instance_var = "@#{method}"
- self.class.class_eval do
+ # Define the method on the instance so we don't use method_missing next time
+ class << self; self; end.class_eval do
define_method method do
cache[method] ||= analyser.delegate(method, self)
end
|
Oops was defining a method on the class rather than the instance of extended_temp_object (was breaking specs elsewhere)
|
diff --git a/implementations/micrometer-registry-statsd/src/main/java/io/micrometer/statsd/StatsdGauge.java b/implementations/micrometer-registry-statsd/src/main/java/io/micrometer/statsd/StatsdGauge.java
index <HASH>..<HASH> 100644
--- a/implementations/micrometer-registry-statsd/src/main/java/io/micrometer/statsd/StatsdGauge.java
+++ b/implementations/micrometer-registry-statsd/src/main/java/io/micrometer/statsd/StatsdGauge.java
@@ -47,12 +47,15 @@ public class StatsdGauge<T> extends AbstractMeter implements Gauge, StatsdPollab
@Override
public double value() {
T obj = ref.get();
- return obj != null ? value.applyAsDouble(ref.get()) : 0;
+ return obj != null ? value.applyAsDouble(ref.get()) : Double.NaN;
}
@Override
public void poll() {
double val = value();
+ if (val == Double.NaN) {
+ val = 0;
+ }
if (!shutdown && (alwaysPublish || lastValue.getAndSet(val) != val)) {
subscriber.onNext(lineBuilder.gauge(val));
}
|
StatsdGauge#value returns NaN but still outputs 0 lines
|
diff --git a/lib/feed2email/database.rb b/lib/feed2email/database.rb
index <HASH>..<HASH> 100644
--- a/lib/feed2email/database.rb
+++ b/lib/feed2email/database.rb
@@ -11,11 +11,18 @@ module Feed2Email
private
- def setup_connection(options)
- @connection = Sequel.connect(options)
+ def create_entries_table
+ connection.create_table? :entries do
+ primary_key :id
+ foreign_key :feed_id, :feeds, null: false, index: true,
+ on_delete: :cascade
+ String :uri, null: false, unique: true
+ Time :created_at
+ Time :updated_at
+ end
end
- def setup_schema
+ def create_feeds_table
connection.create_table? :feeds do
primary_key :id
String :uri, null: false, unique: true
@@ -27,15 +34,15 @@ module Feed2Email
Time :created_at
Time :updated_at
end
+ end
- connection.create_table? :entries do
- primary_key :id
- foreign_key :feed_id, :feeds, null: false, index: true,
- on_delete: :cascade
- String :uri, null: false, unique: true
- Time :created_at
- Time :updated_at
- end
+ def setup_connection(options)
+ @connection = Sequel.connect(options)
+ end
+
+ def setup_schema
+ create_feeds_table
+ create_entries_table
end
end
end
|
Create each table in a separate method
SRP
|
diff --git a/lib/poolparty/net/remoter/connections.rb b/lib/poolparty/net/remoter/connections.rb
index <HASH>..<HASH> 100644
--- a/lib/poolparty/net/remoter/connections.rb
+++ b/lib/poolparty/net/remoter/connections.rb
@@ -69,7 +69,7 @@ module PoolParty
:timeout => 3.minutes,
:user => user
}.merge(opts)
- ssh_options_hash[:verbose]=:debug if debugging?
+ # ssh_options_hash[:verbose]=:debug if debugging?
puts "connecting to ssh with options = #{ssh_options_hash.inspect}"
Net::SSH.start(host, user, ssh_options_hash) do |ssh|
cmds.each do |command|
|
rm'd ssh debugging from debug output. this data is not particularly helpful and it makes it really tricky to read
|
diff --git a/Classes/Hooks/DrawItem.php b/Classes/Hooks/DrawItem.php
index <HASH>..<HASH> 100644
--- a/Classes/Hooks/DrawItem.php
+++ b/Classes/Hooks/DrawItem.php
@@ -896,7 +896,7 @@ class DrawItem implements PageLayoutViewDrawItemHookInterface, SingletonInterfac
{
$specificIds = $this->helper->getSpecificIds($row);
$grid = '<div class="t3-grid-container t3-grid-element-container' . ($layout['frame'] ? ' t3-grid-container-framed t3-grid-container-' . htmlspecialchars($layout['frame']) : '') . ($layout['top_level_layout'] ? ' t3-grid-tl-container' : '') . '">';
- if ($layout['frame'] || $this->helper->getBackendUser()->uc['showGridInformation'] === 1) {
+ if ($layout['frame'] || (int)$this->helper->getBackendUser()->uc['showGridInformation'] === 1) {
$grid .= '<h4 class="t3-grid-container-title-' . htmlspecialchars($layout['frame']) . '">' .
BackendUtility::wrapInHelp(
'tx_gridelements_backend_layouts',
|
[BUGFIX] Make sure values are integers for strict comparison
Change-Id: Ic<I>a<I>a<I>ce<I>d<I>a<I>d<I>de<I>e
Resolves: #<I>
Release: master, 8-0
Reviewed-on: <URL>
|
diff --git a/lib/hanami/slice.rb b/lib/hanami/slice.rb
index <HASH>..<HASH> 100644
--- a/lib/hanami/slice.rb
+++ b/lib/hanami/slice.rb
@@ -18,6 +18,14 @@ module Hanami
@container = container || define_container
end
+ def inflector
+ application.inflector
+ end
+
+ def namespace_path
+ @namespace_path ||= inflector.underscore(namespace.to_s)
+ end
+
def init
container.import application: application.container
@@ -113,13 +121,5 @@ module Hanami
container
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
-
- def namespace_path
- @namespace_path ||= inflector.underscore(namespace.to_s)
- end
-
- def inflector
- application.inflector
- end
end
end
|
Make a couple of slice methods public
We're using this for the work-in-progress hanami-view integration
|
diff --git a/mongostore/main.go b/mongostore/main.go
index <HASH>..<HASH> 100644
--- a/mongostore/main.go
+++ b/mongostore/main.go
@@ -7,8 +7,8 @@ import (
nSessions "github.com/goincremental/negroni-sessions"
"github.com/gorilla/securecookie"
gSessions "github.com/gorilla/sessions"
- "labix.org/v2/mgo"
- "labix.org/v2/mgo/bson"
+ "gopkg.in/mgo.v2"
+ "gopkg.in/mgo.v2/bson"
)
// New returns a new mongo store
|
Changed mgo import path to recommended one
|
diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php
index <HASH>..<HASH> 100644
--- a/src/Connection/Connection.php
+++ b/src/Connection/Connection.php
@@ -116,7 +116,7 @@ class Connection implements ConnectionInterface
$response = $this->getResponse();
- if ($command->isMultiLine()) {
+ if ($command->isMultiLine() && ($response->getStatusCode() >= 200 && $response->getStatusCode() <= 399)) {
$response = $command->isCompressed() ? $this->getCompressedResponse($response) : $this->getMultiLineResponse($response);
}
|
Multiline response only on success
Only process a multiline response when the command was successful.
Without this certain commands hang while waiting for a multiline
response that never comes such as a BODY command that returns a <I> or
an XOVER command without selecting a group first (<I>).
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -500,10 +500,7 @@ Pagelet.readable('connect', function connect(spark, next) {
return pagelet;
}
- if ('function' !== this.authorize) return substream(true);
- this.authorize(spark.request, substream);
-
- return this;
+ return this.authenticate(spark.request, substream);
});
/**
|
[major][security] Pagelet was not authenticated when a real-time connection was used.
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,6 +9,7 @@ setup(
packages=[
'two_factor',
],
+ package_data={'two_factor': ['templates/two_factor/*.html',],},
url='http://github.com/Bouke/django-two-factor-auth',
description='Complete Two-Factor Authentication for Django',
license='MIT',
|
Include templates in package_data, so they will be installed
|
diff --git a/WordPress/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php b/WordPress/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php
index <HASH>..<HASH> 100644
--- a/WordPress/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php
+++ b/WordPress/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php
@@ -193,10 +193,15 @@ class AssignmentInConditionSniff extends Sniff {
}
if ( true === $hasVariable ) {
+ $errorCode = 'Found';
+ if ( T_WHILE === $token['code'] ) {
+ $errorCode = 'FoundInWhileCondition';
+ }
+
$this->phpcsFile->addWarning(
'Variable assignment found within a condition. Did you mean to do a comparison?',
$hasAssignment,
- 'Found'
+ $errorCode
);
} else {
$this->phpcsFile->addWarning(
|
AssignmentInCondition: add separate errorcode for assignment found in while
A `while()` condition is the only control structure in which it is sometimes legitimate to use an assignment in condition.
Having a separate error code will enable people to selectively exclude warnings for this.
|
diff --git a/Script/Gt.js b/Script/Gt.js
index <HASH>..<HASH> 100644
--- a/Script/Gt.js
+++ b/Script/Gt.js
@@ -213,9 +213,6 @@ _nodeListHelpers = {
"querySelectorAll",
"qs",
"qsa",
- "removeAttribute",
- "removeAttributeNS",
- "removeAttributeNode",
"removeChild",
"replaceChild",
"scrollIntoView",
@@ -232,6 +229,9 @@ _nodeListHelpers = {
"dispatchEvent",
"normalise",
"remove",
+ "removeAttribute",
+ "removeAttributeNS",
+ "removeAttributeNode",
"removeEventListener",
"replace"
]
|
RemoveAttribute methods are invoked on all elements within collection.
|
diff --git a/lib/gds_api/test_helpers/support_api.rb b/lib/gds_api/test_helpers/support_api.rb
index <HASH>..<HASH> 100644
--- a/lib/gds_api/test_helpers/support_api.rb
+++ b/lib/gds_api/test_helpers/support_api.rb
@@ -102,6 +102,10 @@ module GdsApi
stub_http_request(:get, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/export-requests/#{id}").
to_return(status: 200, body: response_body.to_json)
end
+
+ def stub_any_support_api_call
+ stub_request(:any, %r{\A#{SUPPORT_API_ENDPOINT}})
+ end
end
end
end
|
Test helper to stub any call to the Support API
|
diff --git a/src/de/mrapp/android/validation/PasswordEditText.java b/src/de/mrapp/android/validation/PasswordEditText.java
index <HASH>..<HASH> 100644
--- a/src/de/mrapp/android/validation/PasswordEditText.java
+++ b/src/de/mrapp/android/validation/PasswordEditText.java
@@ -273,7 +273,7 @@ public class PasswordEditText extends EditText {
setHelperTextColor(helperTextColors.get(index));
}
- return -1;
+ return regularHelperTextColor;
}
/**
|
The default helper text color is now used, if no helper text colors are specified.
|
diff --git a/cloud4rpid.py b/cloud4rpid.py
index <HASH>..<HASH> 100644
--- a/cloud4rpid.py
+++ b/cloud4rpid.py
@@ -329,6 +329,7 @@ if __name__ == "__main__":
exit(1)
except NoSensorsError:
print('No sensors found... Exiting')
+ exit(1)
except Exception as e:
print('Unexpected error: {0}'.format(e.message))
log.exception(e)
|
Exit with a nonzero error code when no sensors found
|
diff --git a/src/locale.js b/src/locale.js
index <HASH>..<HASH> 100644
--- a/src/locale.js
+++ b/src/locale.js
@@ -621,7 +621,7 @@ function formatUTCWeekdayNumberMonday(d) {
}
function formatUTCWeekNumberSunday(d, p) {
- return pad(utcSunday.count(utcYear(d), d), p, 2);
+ return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
}
function formatUTCWeekNumberISO(d, p) {
@@ -635,7 +635,7 @@ function formatUTCWeekdayNumberSunday(d) {
}
function formatUTCWeekNumberMonday(d, p) {
- return pad(utcMonday.count(utcYear(d), d), p, 2);
+ return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
}
function formatUTCYear(d, p) {
|
Fix off-by-one in utcFormat.
|
diff --git a/lib/active_scaffold/helpers/association_helpers.rb b/lib/active_scaffold/helpers/association_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/helpers/association_helpers.rb
+++ b/lib/active_scaffold/helpers/association_helpers.rb
@@ -15,10 +15,7 @@ module ActiveScaffold
# Provides a way to honor the :conditions on an association while searching the association's klass
def association_options_find(association, conditions = nil, klass = nil, record = nil)
if klass.nil? && association.polymorphic?
- class_name = case association.macro
- when :belongs_to then record.send(association.foreign_type)
- when :belongs_to_record, :belongs_to_document then record.send(association.type)
- end
+ class_name = record.send(association.foreign_type) if association.belongs_to?
if class_name.present?
klass = class_name.constantize
else
|
fix usage of Association class to get foreign_type on polymorphic
|
diff --git a/src/Illuminate/Console/Scheduling/ScheduleTestCommand.php b/src/Illuminate/Console/Scheduling/ScheduleTestCommand.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Console/Scheduling/ScheduleTestCommand.php
+++ b/src/Illuminate/Console/Scheduling/ScheduleTestCommand.php
@@ -33,7 +33,7 @@ class ScheduleTestCommand extends Command
$commandNames = [];
foreach ($commands as $command) {
- $commandNames[] = $command->command;
+ $commandNames[] = $command->command ?? $command->getSummaryForDisplay();
}
$index = array_search($this->choice('Which command would you like to run?', $commandNames), $commandNames);
|
Fix running schedule test on CallbackEvents (#<I>)
|
diff --git a/koala/Range.py b/koala/Range.py
index <HASH>..<HASH> 100644
--- a/koala/Range.py
+++ b/koala/Range.py
@@ -539,7 +539,12 @@ class RangeCore(dict):
@staticmethod
def add(a, b):
try:
- return check_value(a) + check_value(b)
+ a = check_value(a)
+ b = check_value(b)
+ if isinstance(a, str) or isinstance(b, str):
+ a = str(a)
+ b = str(b)
+ return a + b
except Exception as e:
return ExcelError('#N/A', e)
|
Add strings
If one of the two values would be a string like in the formula "'<='&<I>", this would crash since Python cannot add int + str. If this is the case, parse them both as strings.
|
diff --git a/multiqc/modules/ngsderive/ngsderive.py b/multiqc/modules/ngsderive/ngsderive.py
index <HASH>..<HASH> 100644
--- a/multiqc/modules/ngsderive/ngsderive.py
+++ b/multiqc/modules/ngsderive/ngsderive.py
@@ -264,6 +264,9 @@ class MultiqcModule(BaseMultiqcModule):
headers["majoritypctdetected"] = {
"title": "Read Length: % Supporting",
"description": "Percentage of reads which were measured at the predicted read length.",
+ "min": 0,
+ "max": 100,
+ "suffix": "%",
}
self.general_stats_addcols(data, headers)
|
refactor: add percentage suffix to read length %
|
diff --git a/Listener/TaggedEntityListener.php b/Listener/TaggedEntityListener.php
index <HASH>..<HASH> 100644
--- a/Listener/TaggedEntityListener.php
+++ b/Listener/TaggedEntityListener.php
@@ -54,11 +54,11 @@ class TaggedEntityListener implements EventSubscriber
}
/**
- * Post remove event handler.
+ * Pre remove event handler.
*
* @param LifecycleEventArgs $eventArgs
*/
- public function postRemove(LifecycleEventArgs $eventArgs)
+ public function preRemove(LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getObject();
@@ -70,9 +70,9 @@ class TaggedEntityListener implements EventSubscriber
/**
* Post flush event handler.
*
- * @param PostFlushEventArgs $args
+ * @param PostFlushEventArgs $eventArgs
*/
- public function postFlush(PostFlushEventArgs $args)
+ public function postFlush(PostFlushEventArgs $eventArgs)
{
$this->eventDispatcher->dispatch(
HttpCacheEvents::INVALIDATE_TAG,
@@ -108,7 +108,7 @@ class TaggedEntityListener implements EventSubscriber
{
return array(
Events::postUpdate,
- Events::postRemove,
+ Events::preRemove,
Events::postFlush,
);
}
|
Fix TaggedEntity listener
Use preRemove instead of postRemove because id was never available
|
diff --git a/spec/circleci/cli/command/base_command_spec.rb b/spec/circleci/cli/command/base_command_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/circleci/cli/command/base_command_spec.rb
+++ b/spec/circleci/cli/command/base_command_spec.rb
@@ -29,7 +29,24 @@ describe CircleCI::CLI::Command::BaseCommand do
end
describe '.branch_name' do
- subject { described_class.branch_name(OpenStruct.new) }
+ subject { described_class.branch_name(options) }
+ let(:options) { OpenStruct.new }
+
+ context 'with all option' do
+ let(:options) { OpenStruct.new(all: true) }
+ let(:rugged_response_branch_name) { 'branch' }
+ let(:rugged_response_is_branch) { true }
+
+ it { is_expected.to eq(nil) }
+ end
+
+ context 'with branch option' do
+ let(:options) { OpenStruct.new(branch: 'optionBranch') }
+ let(:rugged_response_branch_name) { 'branch' }
+ let(:rugged_response_is_branch) { true }
+
+ it { is_expected.to eq('optionBranch') }
+ end
context 'with a valid current branch' do
let(:rugged_response_branch_name) { 'branch' }
|
:green_heart: Update specs
|
diff --git a/Classes/RobertLemke/Plugin/Blog/Controller/CommentController.php b/Classes/RobertLemke/Plugin/Blog/Controller/CommentController.php
index <HASH>..<HASH> 100644
--- a/Classes/RobertLemke/Plugin/Blog/Controller/CommentController.php
+++ b/Classes/RobertLemke/Plugin/Blog/Controller/CommentController.php
@@ -61,6 +61,10 @@ class CommentController extends ActionController
$this->throwStatus(400, 'Your comment was NOT created - it was too short.');
}
+ $newComment->setProperty('text', filter_var($newComment->getProperty('text'), FILTER_SANITIZE_STRIPPED));
+ $newComment->setProperty('author', filter_var($newComment->getProperty('author'), FILTER_SANITIZE_STRIPPED));
+ $newComment->setProperty('emailAddress', filter_var($newComment->getProperty('emailAddress'), FILTER_SANITIZE_STRIPPED));
+
$commentNode = $postNode->getNode('comments')->createNodeFromTemplate($newComment, uniqid('comment-'));
$commentNode->setProperty('spam', false);
$commentNode->setProperty('datePublished', new \DateTime());
|
BUGFIX: Fixes an XSS issue in the comment form
This fixes an issue with the comment form which accepts unvalidated
user input and can result in XSS exploitations.
Resolves #<I>
|
diff --git a/src/Functional/HStringWalk.php b/src/Functional/HStringWalk.php
index <HASH>..<HASH> 100644
--- a/src/Functional/HStringWalk.php
+++ b/src/Functional/HStringWalk.php
@@ -9,7 +9,7 @@ class HStringWalk
* @param HString &$hString
* @param callable $func
*/
- public static function walk(HString &$hString, callable $func)
+ public static function walk(HString $hString, callable $func)
{
$size = $hString->count();
|
Remove object alias since objects are always passed by reference
|
diff --git a/tangelo/tangelo/server.py b/tangelo/tangelo/server.py
index <HASH>..<HASH> 100644
--- a/tangelo/tangelo/server.py
+++ b/tangelo/tangelo/server.py
@@ -430,6 +430,8 @@ class Tangelo(object):
tangelo.http_status(501, "Error Importing Service")
tangelo.content_type("application/json")
result = tangelo.util.traceback_report(error="Could not import module %s" % (tangelo.request_path()))
+
+ tangelo.log_warning("SERVICE", "Could not import service module %s:\n%s" % (tangelo.request_path(), "\n".join(result["traceback"])))
else:
# Try to run the service - either it's in a function called
# "run()", or else it's in a REST API consisting of at least one of
|
Reporting traceback when module *loading* fails, in addition to when module *execution* fails
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -10,7 +10,7 @@ const {BrowserWindow} = electron;
var util = require('util');
var colors = require('colors');
var EventEmitter = require('events');
-var exec = require('child-process-promise').exec;
+var spawn = require('child-process-promise').spawn;
var DEFAULT_WINDOW = { width: 1024, height: 728, show: false };
var NOOP = function(){};
@@ -55,7 +55,7 @@ function electronify(cfg) {
}
// start child process
- exec(cfg.command, cfg.options)
+ spawn(cfg.command, cfg.options)
.then(function (result) {
debug('Command completed.');
|
Change exec to spawn
`exec` will cause the main process to crash if there is too much data.
|
diff --git a/src/Common/ExtendedPsrLoggerWrapper.php b/src/Common/ExtendedPsrLoggerWrapper.php
index <HASH>..<HASH> 100644
--- a/src/Common/ExtendedPsrLoggerWrapper.php
+++ b/src/Common/ExtendedPsrLoggerWrapper.php
@@ -99,6 +99,7 @@ class ExtendedPsrLoggerWrapper extends AbstractLogger implements ExtendedLogger
try {
$result = call_user_func($fn, $this);
} catch(Exception $e) {
+ // Simulate try...finally
}
$this->captionTrail->removeCaption($coupon);
$this->context = $oldContext;
@@ -125,6 +126,7 @@ class ExtendedPsrLoggerWrapper extends AbstractLogger implements ExtendedLogger
try {
$result = call_user_func($fn, $this);
} catch(Exception $e) {
+ // Simulate try...finally
}
$this->logger = $previousLogger;
if($e !== null) {
|
- Fixed two scrutinizer inspection results: "Consider adding a comment why this CATCH block is empty."
|
diff --git a/lib/pancakes.mongo.adapter.js b/lib/pancakes.mongo.adapter.js
index <HASH>..<HASH> 100644
--- a/lib/pancakes.mongo.adapter.js
+++ b/lib/pancakes.mongo.adapter.js
@@ -53,7 +53,10 @@ MongoAdapter.modelCache = {};
*/
MongoAdapter.connect = function connect(dbUri, debugFlag, mongos) {
var deferred = Q.defer();
- var opts = {};
+ var opts = {
+ server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
+ replset: { socketOptions: { keepAlive: 1, connectTimeoutMS : 30000 } }
+ };
if (mongos) {
opts.mongos = true;
|
Adding socket options for mongo connection
|
diff --git a/bigchaindb/util.py b/bigchaindb/util.py
index <HASH>..<HASH> 100644
--- a/bigchaindb/util.py
+++ b/bigchaindb/util.py
@@ -45,8 +45,10 @@ def pool(builder, size, timeout=None):
size: the size of the pool.
Returns:
- A context manager that can be used with ``with``.
+ A context manager that can be used with the ``with``
+ statement.
"""
+
lock = threading.Lock()
local_pool = queue.Queue()
current_size = 0
@@ -54,16 +56,26 @@ def pool(builder, size, timeout=None):
@contextlib.contextmanager
def pooled():
nonlocal current_size
- if current_size == size:
- instance = local_pool.get(timeout=timeout)
- else:
+ instance = None
+
+ # If we still have free slots, then we have room to create new
+ # instances.
+ if current_size < size:
with lock:
- if current_size == size:
- instance = local_pool.get(timeout=timeout)
- else:
+ # We need to check again if we have slots available, since
+ # the situation might be different after acquiring the lock
+ if current_size < size:
current_size += 1
instance = builder()
+
+ # Watchout: current_size can be equal to size if the previous part of
+ # the function has been executed, that's why we need to check if the
+ # instance is None.
+ if instance is None and current_size == size:
+ instance = local_pool.get(timeout=timeout)
+
yield instance
+
local_pool.put(instance)
return pooled
|
Reorganize the code for the context manager
There was probably a deadlock in the previous version.
|
diff --git a/lib/node/base.rb b/lib/node/base.rb
index <HASH>..<HASH> 100644
--- a/lib/node/base.rb
+++ b/lib/node/base.rb
@@ -12,6 +12,13 @@ module Bcome::Node
INVENTORY_KEY = "inventory"
COLLECTION_KEY = "collection"
+ def self.const_missing(constant)
+ ## Hook for direct access to node level resources by constant name where
+ ## cd ServerName should yield the same outcome as cd "ServerName"
+ set_context = ::IRB.CurrentContext.workspace.main
+ return (resource = set_context.resource_for_identifier(constant.to_s)) ? constant.to_s : super
+ end
+
def initialize(params)
@raw_view_data = params[:view_data]
@parent = params[:parent]
diff --git a/lib/node/estate.rb b/lib/node/estate.rb
index <HASH>..<HASH> 100644
--- a/lib/node/estate.rb
+++ b/lib/node/estate.rb
@@ -19,6 +19,7 @@ module Bcome::Node
def to_s
"estate"
end
+
end
def load_resources
|
can now cd into a resource if it would otherwise be a constance e.g. cd FooBar
|
diff --git a/moa/src/main/java/moa/tasks/EvaluateMultipleClusterings.java b/moa/src/main/java/moa/tasks/EvaluateMultipleClusterings.java
index <HASH>..<HASH> 100644
--- a/moa/src/main/java/moa/tasks/EvaluateMultipleClusterings.java
+++ b/moa/src/main/java/moa/tasks/EvaluateMultipleClusterings.java
@@ -142,7 +142,7 @@ public class EvaluateMultipleClusterings extends AuxiliarMainTask {
this.task.setMeasures(measureCollection);
- System.out.println("Evaluation #"+i+" of "+this.numStreamsOption.getValue()+
+ System.out.println("Evaluation #"+(i+1)+" of "+this.numStreamsOption.getValue()+
": "+this.task.getCLICreationString(this.task.getClass()));
//Run task
|
Corrected status printout in EvaluateMultipleClusterings.
|
diff --git a/packages/babel-runtime/scripts/build-dist.js b/packages/babel-runtime/scripts/build-dist.js
index <HASH>..<HASH> 100644
--- a/packages/babel-runtime/scripts/build-dist.js
+++ b/packages/babel-runtime/scripts/build-dist.js
@@ -134,14 +134,6 @@ for (const modules of ["commonjs", false]) {
`${dirname}${helperName}.js`,
buildHelper(helperName, modules, builtin)
);
-
- // compat
- var helperAlias = kebabCase(helperName);
- var content = !modules
- ? `export { default } from \"./${helperName}.js\";`
- : "module.exports = require(\"./" + helperName + ".js\");";
- writeFile(`${dirname}_${helperAlias}.js`, content);
- if (helperAlias !== helperName) writeFile(`${dirname}${helperAlias}.js`, content);
}
}
}
|
removed unused alias in babel-runtime (#<I>)
|
diff --git a/StubsController.php b/StubsController.php
index <HASH>..<HASH> 100644
--- a/StubsController.php
+++ b/StubsController.php
@@ -112,6 +112,25 @@ TPL;
foreach ($components as $name => $classes) {
$classes = implode('|', array_unique($classes));
$stubs .= "\n * @property {$classes} \$$name";
+ if (in_array($name, [
+ 'db',
+ 'log',
+ 'cache',
+ 'formatter',
+ 'request',
+ 'response',
+ 'errorHandler',
+ 'view',
+ 'urlManager',
+ 'i18n',
+ 'authManager',
+ 'assetManager',
+ 'security',
+ 'session',
+ 'user',
+ ])) {
+ $stubs .= "\n * @method {$classes} get" . ucfirst($name) . "()";
+ }
}
$content = str_replace('{stubs}', $stubs, $this->getTemplate());
|
Added stubs to methods getRequest(), getUser() and other. (#<I>)
|
diff --git a/kite-data/kite-data-core/src/main/java/org/kitesdk/data/partition/ListFieldPartitioner.java b/kite-data/kite-data-core/src/main/java/org/kitesdk/data/partition/ListFieldPartitioner.java
index <HASH>..<HASH> 100644
--- a/kite-data/kite-data-core/src/main/java/org/kitesdk/data/partition/ListFieldPartitioner.java
+++ b/kite-data/kite-data-core/src/main/java/org/kitesdk/data/partition/ListFieldPartitioner.java
@@ -37,15 +37,12 @@ public class ListFieldPartitioner<S> extends FieldPartitioner<S, Integer> {
}
private static <S> int cardinality(List<Set<S>> values) {
- int c = 0;
- for (Set<S> set : values) {
- c += set.size();
- }
- return c;
+ return values.size(); // the number of sets
}
@Override
public Integer apply(S value) {
+ // find the index of the set to which value belongs
for (int i = 0; i < values.size(); i++) {
if (values.get(i).contains(value)) {
return i;
|
CDK-<I>: Fix ListFieldPartitioner cardinality.
|
diff --git a/IPython/html/widgets/widget.py b/IPython/html/widgets/widget.py
index <HASH>..<HASH> 100644
--- a/IPython/html/widgets/widget.py
+++ b/IPython/html/widgets/widget.py
@@ -84,14 +84,22 @@ class BaseWidget(LoggingConfigurable):
removed from the frontend."""
self._close_communication()
-
+ _keys = ['default_view_name']
+
# Properties
@property
def keys(self):
- keys = ['default_view_name']
- keys.extend(self._keys)
+ """Lazily accumulate _keys from all superclasses and cache them in this class"""
+ keys=[]
+ for c in self.__class__.mro():
+ if hasattr(c, '_keys'):
+ keys.extend(getattr(c,'_keys'))
+ else:
+ break
+ # cache so future lookups are fast
+ self.__class__.x = keys
return keys
-
+
@property
def comm(self):
if self._comm is None:
@@ -346,12 +354,7 @@ class Widget(BaseWidget):
# Private/protected declarations
_css = Dict() # Internal CSS property dict
- # Properties
- @property
- def keys(self):
- keys = ['visible', '_css']
- keys.extend(super(Widget, self).keys)
- return keys
+ _keys = ['visible', '_css']
def get_css(self, key, selector=""):
"""Get a CSS property of the widget. Note, this function does not
|
Make the widget keys property traverse the superclasses and accumulate the _keys attributes.
This caches the result, overwriting the property.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.