diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/src/Product/Product.php b/src/Product/Product.php
index <HASH>..<HASH> 100644
--- a/src/Product/Product.php
+++ b/src/Product/Product.php
@@ -8,7 +8,7 @@ class Product
* @var ProductId
*/
private $productId;
-
+
/**
* @var ProductAttributeList
*/
@@ -45,18 +45,14 @@ class Product
*/
public function getAllValuesOfAttribute($attributeCode)
{
- $values = [];
-
try {
- $productAttributes = $this->attributeList->getAttributesWithCode($attributeCode);
- foreach ($productAttributes as $productAttribute) {
- $values[] = $productAttribute->getValue();
- }
+ return array_map(function (ProductAttribute $productAttribute) {
+ return $productAttribute->getValue();
+ }, $this->attributeList->getAttributesWithCode($attributeCode));
+
} catch (ProductAttributeNotFoundException $e) {
/* TODO: Log */
return [''];
}
-
- return $values;
}
} | Issue #<I>: Make loop code more declarative using array_map |
diff --git a/galois_amd64.go b/galois_amd64.go
index <HASH>..<HASH> 100644
--- a/galois_amd64.go
+++ b/galois_amd64.go
@@ -1,4 +1,5 @@
//+build !noasm
+//+build !appengine
// Copyright 2015, Klaus Post, see LICENSE for details.
diff --git a/galois_amd64.s b/galois_amd64.s
index <HASH>..<HASH> 100644
--- a/galois_amd64.s
+++ b/galois_amd64.s
@@ -1,4 +1,4 @@
-//+build !noasm
+//+build !noasm !appengine
// Copyright 2015, Klaus Post, see LICENSE for details.
diff --git a/galois_noasm.go b/galois_noasm.go
index <HASH>..<HASH> 100644
--- a/galois_noasm.go
+++ b/galois_noasm.go
@@ -1,4 +1,4 @@
-//+build !amd64 noasm
+//+build !amd64 noasm appengine
// Copyright 2015, Klaus Post, see LICENSE for details. | Don't use assembler on app engine. |
diff --git a/ELiDE/ELiDE/board/board.py b/ELiDE/ELiDE/board/board.py
index <HASH>..<HASH> 100644
--- a/ELiDE/ELiDE/board/board.py
+++ b/ELiDE/ELiDE/board/board.py
@@ -258,7 +258,7 @@ class Board(RelativeLayout):
self.selection = None
self.keep_selection = False
touch.ungrab(self)
- return True
+ return
def on_parent(self, *args):
if not self.parent or hasattr(self, '_parented'): | Make Board let scrolling happen if it doesn't have a reason to stop it |
diff --git a/lib/kuniri/core/configuration/language_available.rb b/lib/kuniri/core/configuration/language_available.rb
index <HASH>..<HASH> 100644
--- a/lib/kuniri/core/configuration/language_available.rb
+++ b/lib/kuniri/core/configuration/language_available.rb
@@ -7,6 +7,6 @@
module Configuration
# Handling the languages available in the system.
class LanguageAvailable
- LANGUAGES = %w(ruby python cplusplus c).freeze # Put here new language.
+ LANGUAGES = %w[ruby python cplusplus c].freeze # Put here new language.
end
end
diff --git a/lib/kuniri/core/configuration/log_available.rb b/lib/kuniri/core/configuration/log_available.rb
index <HASH>..<HASH> 100644
--- a/lib/kuniri/core/configuration/log_available.rb
+++ b/lib/kuniri/core/configuration/log_available.rb
@@ -7,6 +7,6 @@
module Configuration
# Configuration for the monitor available.
class LogAvailable
- LOG = %w(html txt).freeze # List with log types.
+ LOG = %w[html txt].freeze # List with log types.
end
end | use [] instead of () in %w-literals |
diff --git a/django_fsm/signals.py b/django_fsm/signals.py
index <HASH>..<HASH> 100644
--- a/django_fsm/signals.py
+++ b/django_fsm/signals.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from django.dispatch import Signal
-pre_transition = Signal(providing_args=['instance', 'name', 'source', 'target'])
-post_transition = Signal(providing_args=['instance', 'name', 'source', 'target', 'exception'])
+pre_transition = Signal()
+post_transition = Signal() | mRemoved providing_args kwarg from Signal constructor. |
diff --git a/lib/perfectqueue/engine.rb b/lib/perfectqueue/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/perfectqueue/engine.rb
+++ b/lib/perfectqueue/engine.rb
@@ -56,7 +56,7 @@ module PerfectQueue
@processors << @processor_class.new(@runner, @processors.size+1, config)
end
elsif extra < 0
- -extra.times do
+ (-extra).times do
c = @processors.shift
c.stop(immediate)
c.join | - is weaker than .; needs parenthesis |
diff --git a/test/callback.js b/test/callback.js
index <HASH>..<HASH> 100644
--- a/test/callback.js
+++ b/test/callback.js
@@ -181,7 +181,12 @@ describe('Callback', function () {
process.removeAllListeners('uncaughtException')
process.once('uncaughtException', function (e) {
assert(/ffi/.test(e.message))
- listeners.forEach(process.emit.bind(process, 'uncaughtException'))
+
+ // re-add Mocha's listeners
+ listeners.forEach(function (fn) {
+ process.on('uncaughtException', fn)
+ })
+
done()
}) | test: properly re-add Mocha's uncaught listeners |
diff --git a/bin/eg-generator.js b/bin/eg-generator.js
index <HASH>..<HASH> 100644
--- a/bin/eg-generator.js
+++ b/bin/eg-generator.js
@@ -1,10 +1,6 @@
const Generator = require('yeoman-generator');
const config = require('../lib/config');
-Generator.prototype.stdout = function () {
- // eslint-disable-next-line no-console
- console.log.apply(arguments);
-};
module.exports = class EgGenerator extends Generator {
constructor (args, opts) {
super(args, opts);
@@ -33,6 +29,11 @@ module.exports = class EgGenerator extends Generator {
this._configuration = configuration;
}
+ stdout (...args) {
+ // eslint-disable-next-line no-console
+ console.log.apply(console, args);
+ }
+
createSubCommand (name) {
const generatorName = `${this.constructor.namespace}:${name}`;
return this.env.create(generatorName)._configuration; | Fixing stdout on CLI generators. (#<I>) |
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -8,6 +8,8 @@ const { createCompiledModule, Module } = require("./compiler/compile/module");
const { Memory } = require("./interpreter/runtime/values/memory");
const { Table } = require("./interpreter/runtime/values/table");
const { checkEndianness } = require("./check-endianness");
+const { traverse } = require("./compiler/AST/traverse");
+const t = require("./compiler/AST/index");
const _debug = {
parseWATF(content: string, cb: (ast: Program) => void) {
@@ -24,7 +26,10 @@ const _debug = {
const ast = parseBinary(content);
cb(ast);
- }
+ },
+
+ traverse,
+ t
};
const WebAssembly = { | feat: expose ast types and traverse |
diff --git a/plugins/net.js b/plugins/net.js
index <HASH>..<HASH> 100644
--- a/plugins/net.js
+++ b/plugins/net.js
@@ -89,7 +89,7 @@ module.exports = function (opts) {
stringify: function (scope) {
scope = scope || 'device'
if(!isScoped(scope)) return
- var _host = (scope == 'public' && opts.external) || scopes.host(scope)
+ var _host = opts.host || (scope == 'public' && opts.external) || scopes.host(scope)
if(!_host) return null
return ['net', _host, port].join(':')
}
diff --git a/plugins/ws.js b/plugins/ws.js
index <HASH>..<HASH> 100644
--- a/plugins/ws.js
+++ b/plugins/ws.js
@@ -109,7 +109,7 @@ module.exports = function (opts) {
else
port = opts.port
- var host = (scope == 'public' && opts.external) || scopes.host(scope)
+ var host = opts.host || (scope == 'public' && opts.external) || scopes.host(scope)
//if a public scope was requested, but a public ip is not available, return
if(!host) return null | Fix `stringify()` in net and ws to respect host
Previously we were disregarding the `host` setting for all configs
except in cases where `scope === 'public' && `opts.external != null`.
This resolves the error by first checking whether `opts.host` is defined
before falling back to automatic detection methods. |
diff --git a/quilt/cli/parser.py b/quilt/cli/parser.py
index <HASH>..<HASH> 100644
--- a/quilt/cli/parser.py
+++ b/quilt/cli/parser.py
@@ -43,8 +43,8 @@ import six
def get_declared_instances_list(bases, attrs, collect_cls, instance_attr):
- instances = [(name, attrs.pop(name)) for name, obj in attrs.items() if
- isinstance(obj, collect_cls)]
+ instances = [(name, attrs.pop(name)) for name, obj in attrs.copy().items()
+ if isinstance(obj, collect_cls)]
instances.sort(key=lambda x: x[1].creation_counter)
for base in bases[::-1]:
if hasattr(base, instance_attr): | Fix iterating over attrs in python 3
It's not possible to change attrs in iteration loop with python3. |
diff --git a/h2o-algos/src/main/java/hex/tree/DRealHistogram.java b/h2o-algos/src/main/java/hex/tree/DRealHistogram.java
index <HASH>..<HASH> 100644
--- a/h2o-algos/src/main/java/hex/tree/DRealHistogram.java
+++ b/h2o-algos/src/main/java/hex/tree/DRealHistogram.java
@@ -25,7 +25,7 @@ public class DRealHistogram extends DHistogram<DRealHistogram> {
}
@Override public double var (int b) {
double n = _bins[b];
- if( n==0 ) return 0;
+ if( n<=1 ) return 0;
return (_ssqs[b] - _sums[b]*_sums[b]/n)/(n-1);
} | PUBDEV-<I>: Fix variance computation for DRealHistogram when there's only 1 count (N=1), was dividing by 0 during 1/N * 1/(N-1) |
diff --git a/src/rezplugins/shell/_utils/powershell_base.py b/src/rezplugins/shell/_utils/powershell_base.py
index <HASH>..<HASH> 100644
--- a/src/rezplugins/shell/_utils/powershell_base.py
+++ b/src/rezplugins/shell/_utils/powershell_base.py
@@ -3,11 +3,13 @@ import re
from subprocess import PIPE
from rez.config import config
+from rez.vendor.six import six
from rez.rex import RexExecutor, OutputStyle, EscapedString
from rez.shells import Shell
from rez.system import system
from rez.utils.platform_ import platform_
from rez.utils.execution import Popen
+from rez.util import shlex_join
class PowerShellBase(Shell):
@@ -305,3 +307,11 @@ class PowerShellBase(Shell):
@classmethod
def line_terminator(cls):
return "\n"
+
+ @classmethod
+ def join(cls, command):
+ if isinstance(command, six.string_types):
+ return command
+
+ # add call operator in case executable gets quotes applied
+ return "& " + shlex_join(command) | fix for powershell in cases where the executable command string gets quoted |
diff --git a/plugin.php b/plugin.php
index <HASH>..<HASH> 100644
--- a/plugin.php
+++ b/plugin.php
@@ -4,7 +4,7 @@
* Description: JSON-based REST API for WordPress, developed as part of GSoC 2013.
* Author: WP REST API Team
* Author URI: http://wp-api.org
- * Version: 2.0-beta1.1
+ * Version: 2.0-beta2
* Plugin URI: https://github.com/WP-API/WP-API
* License: GPL2+
*/
@@ -14,7 +14,7 @@
*
* @var string
*/
-define( 'REST_API_VERSION', '2.0-beta1.1' );
+define( 'REST_API_VERSION', '2.0-beta2' );
/**
* Include our files for the API. | Bump plugin version to <I>-beta2 |
diff --git a/tests/phpunit/Parsoid/Html2Wt/DOMDiffTest.php b/tests/phpunit/Parsoid/Html2Wt/DOMDiffTest.php
index <HASH>..<HASH> 100644
--- a/tests/phpunit/Parsoid/Html2Wt/DOMDiffTest.php
+++ b/tests/phpunit/Parsoid/Html2Wt/DOMDiffTest.php
@@ -54,7 +54,7 @@ class DOMDiffTest extends TestCase {
// precisely here. And, we need to revisit whether that
// page id comparison is still needed / useful.
$data = DOMDataUtils::getNodeData( $node );
- $markers = $data->parsoid_diff->diff;
+ $markers = $data->parsoid_diff->diff ?? [];
$this->assertCount( count( $spec['markers'] ), $markers,
'number of markers does not match' );
@@ -80,7 +80,9 @@ class DOMDiffTest extends TestCase {
'desc' => 'ignore attribute order in a node',
'orig' => '<font size="1" class="x">foo</font>',
'edit' => '<font class="x" size="1">foo</font>',
- 'specs' => []
+ 'specs' => [
+ [ 'selector' => 'font', 'markers' => [] ],
+ ]
]
],
[ | Fix complaint that test did not perform any assertions
Change-Id: I<I>c<I>edcc3a0c5cda5dc<I>c8c<I>d1 |
diff --git a/command/agent/agent.go b/command/agent/agent.go
index <HASH>..<HASH> 100644
--- a/command/agent/agent.go
+++ b/command/agent/agent.go
@@ -199,8 +199,8 @@ func (a *Agent) clientConfig() (*clientconfig.Config, error) {
}
conf.MaxKillTimeout = dur
}
- conf.ClientMaxPort = a.config.Client.ClientMaxPort
- conf.ClientMinPort = a.config.Client.ClientMinPort
+ conf.ClientMaxPort = uint(a.config.Client.ClientMaxPort)
+ conf.ClientMinPort = uint(a.config.Client.ClientMinPort)
// Setup the node
conf.Node = new(structs.Node)
diff --git a/command/agent/config.go b/command/agent/config.go
index <HASH>..<HASH> 100644
--- a/command/agent/config.go
+++ b/command/agent/config.go
@@ -162,11 +162,11 @@ type ClientConfig struct {
// ClientMaxPort is the upper range of the ports that the client uses for
// communicating with plugin subsystems
- ClientMaxPort uint `hcl:"client_max_port"`
+ ClientMaxPort int `hcl:"client_max_port"`
// ClientMinPort is the lower range of the ports that the client uses for
// communicating with plugin subsystems
- ClientMinPort uint `hcl:"client_min_port"`
+ ClientMinPort int `hcl:"client_min_port"`
}
// ServerConfig is configuration specific to the server mode | Fixed an issue around parsing client max and min ports |
diff --git a/xkcd.py b/xkcd.py
index <HASH>..<HASH> 100644
--- a/xkcd.py
+++ b/xkcd.py
@@ -91,7 +91,6 @@ class WhatIfArchiveParser(HTMLParser.HTMLParser):
for pair in attrs:
if pair[0] == "href":
link = pair[1]
- print link
# If we fail to find a link for whatever reason or if the parsing fails,
# fail to generate a comic.
try:
@@ -99,15 +98,12 @@ class WhatIfArchiveParser(HTMLParser.HTMLParser):
num = int(num)
except:
num = -1
- print num
self.currentWhatIf.number = num
self.currentWhatIf.link = "http:" + link
def handle_data(self, data):
# Some cruder parsing to pick out the data.
if self.parsingWhatIf:
- if self.seenATag == 1:
- print(data)
if self.seenATag == 2:
self.currentWhatIf.title = data | Remove some debugging print statements. |
diff --git a/utils/jsonmessage.go b/utils/jsonmessage.go
index <HASH>..<HASH> 100644
--- a/utils/jsonmessage.go
+++ b/utils/jsonmessage.go
@@ -52,7 +52,7 @@ func (p *JSONProgress) String() string {
}
numbersBox = fmt.Sprintf("%8v/%v", current, total)
- if p.Start > 0 && percentage < 50 {
+ if p.Current > 0 && p.Start > 0 && percentage < 50 {
fromStart := time.Now().UTC().Sub(time.Unix(int64(p.Start), 0))
perEntry := fromStart / time.Duration(p.Current)
left := time.Duration(p.Total-p.Current) * perEntry | fix divide by zero error
Docker-DCO-<I>- |
diff --git a/angr/analyses/sse.py b/angr/analyses/sse.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/sse.py
+++ b/angr/analyses/sse.py
@@ -47,7 +47,7 @@ class CallTracingFilter(object):
addr = call_target_state.se.exactly_int(ip)
except (SimValueError, SimSolverModeError):
self._skipped_targets.add(-1)
- l.debug('Rejecting target 0x%x', addr)
+ l.debug('Rejecting target %s - cannot be concretized', ip)
return True
# Is it in our blacklist?
@@ -300,9 +300,7 @@ class SSE(Analysis):
# Stash all possible paths that we should merge later
for merge_point_addr, merge_point_looping_times in merge_points:
- path_group.stash(filter_func=
- lambda p: (p.addr == merge_point_addr), # and
- # p.addr_backtrace.count(merge_point_addr) == self._loop_unrolling_limit + 1),
+ path_group.stash_addr(merge_point_addr,
to_stash="_merge_%x_%d" % (merge_point_addr, merge_point_looping_times)
) | Better logging. Switch to PathGrou.stash_addr(). |
diff --git a/tests/Go/Core/GoAspectContainerTest.php b/tests/Go/Core/GoAspectContainerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Go/Core/GoAspectContainerTest.php
+++ b/tests/Go/Core/GoAspectContainerTest.php
@@ -16,8 +16,9 @@ class GoAspectContainerTest extends TestCase
protected function setUp()
{
- //$this->markTestIncomplete("Temporary disabled");
$this->container = new GoAspectContainer();
+ $this->container->set('kernel.options', array());
+ $this->container->set('kernel.interceptFunctions', false);
}
/** | Fix test by injecting system options into container |
diff --git a/glitch/glitch.py b/glitch/glitch.py
index <HASH>..<HASH> 100644
--- a/glitch/glitch.py
+++ b/glitch/glitch.py
@@ -32,6 +32,7 @@ import base64
import random
import string
import docopt
+import os
class Glitch:
def __init__(self):
@@ -58,6 +59,8 @@ class Glitch:
with open(glitchfile, 'wb') as f:
g = self.machine(mode, graphictext, hard)
f.write(g)
+ if os.path.getsize(glitchfile) == 0:
+ os.remove(glitchfile)
def prepare_glitchfile(self, infile, mode, times, maximum):
mode = self.glitch_mode[mode]
@@ -112,7 +115,10 @@ class Glitch:
'''Decrease: 任意の箇所のバイト列を 削除する
'''
gf = infile[31:]
- index = random.randint(len(gf)-1, 31)
+ try:
+ index = random.randint(len(gf)-1, 31)
+ except ValueError:
+ return infile
gf = gf[:index] + gf[index+1:]
return infile[:31] + gf | Add: Remove realy break image file and support of decrease error. |
diff --git a/src/schema.js b/src/schema.js
index <HASH>..<HASH> 100644
--- a/src/schema.js
+++ b/src/schema.js
@@ -194,8 +194,6 @@ class Attribute {
// Marks
-let warnedAboutInclusive = false
-
// ::- Like nodes, marks (which are associated with nodes to signify
// things like emphasis or being part of a link) are tagged with type
// objects, which are instantiated once per `Schema`.
@@ -213,14 +211,6 @@ class MarkType {
// The spec on which the type is based.
this.spec = spec
- if (spec.inclusiveRight === false && spec.inclusive == null) {
- spec.inclusive = false
- if (!warnedAboutInclusive && typeof console != "undefined" && console.warn) {
- warnedAboutInclusive = true
- console.warn("MarkSpec.inclusiveRight is now called MarkSpec.inclusive")
- }
- }
-
this.attrs = initAttrs(spec.attrs)
this.rank = rank | Drop backwards-compat support for inclusiveRight |
diff --git a/lib/grit.rb b/lib/grit.rb
index <HASH>..<HASH> 100644
--- a/lib/grit.rb
+++ b/lib/grit.rb
@@ -7,6 +7,7 @@ require 'time'
# stdlib
require 'timeout'
require 'logger'
+require 'digest/sha1'
if defined? RUBY_ENGINE && RUBY_ENGINE == 'jruby'
require 'open3'
@@ -17,7 +18,6 @@ end
# third party
require 'rubygems'
require 'mime/types'
-require 'digest/sha1'
# internal requires
require 'grit/lazy' | digest is in stdlib |
diff --git a/src/OData/Client.php b/src/OData/Client.php
index <HASH>..<HASH> 100644
--- a/src/OData/Client.php
+++ b/src/OData/Client.php
@@ -3,7 +3,7 @@
namespace Kily\Tools1C\OData;
use Psr\Http\Message\ResponseInterface;
-use GuzzleHttp\Exception\TransferException;
+use GuzzleHttp\Exception\BadResponseException;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Client as Guzzle;
@@ -193,8 +193,8 @@ class Client implements \ArrayAccess
try {
$resp = $this->client->request($method,$request_str,$options);
$this->request_ok = true;
- } catch(TransferException $e) {
- if($e instanceof TransferException) {
+ } catch(BadResponseException $e) {
+ if($e instanceof BadResponseException) {
if($e->hasResponse() && ($resp = $e->getResponse()) ) {
$this->http_code = $resp->getStatusCode();
$this->http_message = $resp->getReasonPhrase(); | fix(guzzle): that fixes #<I> issue |
diff --git a/src/collectors/memcached/test/testmemcached.py b/src/collectors/memcached/test/testmemcached.py
index <HASH>..<HASH> 100644
--- a/src/collectors/memcached/test/testmemcached.py
+++ b/src/collectors/memcached/test/testmemcached.py
@@ -5,6 +5,7 @@
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
+from mock import MagicMock
from mock import Mock
from mock import patch
@@ -27,6 +28,15 @@ class TestMemcachedCollector(CollectorTestCase):
def test_import(self):
self.assertTrue(MemcachedCollector)
+ @patch('socket.socket')
+ def test_get_raw_stats_works_across_packet_boundaries(self, socket_mock):
+ socket_instance = MagicMock()
+ socket_mock.return_value = socket_instance
+ stats_packets = ['stat foo 1\r\n', 'END\r\n']
+ socket_instance.recv.side_effect = stats_packets
+ stats = self.collector.get_raw_stats('', None)
+ self.assertEqual(stats, ''.join(stats_packets))
+
@patch.object(Collector, 'publish')
def test_should_work_with_real_data(self, publish_mock):
patch_raw_stats = patch.object( | Add test for stats packets across boundaries. |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -41,3 +41,4 @@ setup(name="untwisted",
+ | Fixing setup.py version. |
diff --git a/cmd/init.go b/cmd/init.go
index <HASH>..<HASH> 100644
--- a/cmd/init.go
+++ b/cmd/init.go
@@ -40,7 +40,7 @@ func newInitCmd() *initCmd {
return err
}
defer gitignore.Close()
- if _, err := gitignore.WriteString("dist/\n"); err != nil {
+ if _, err := gitignore.WriteString("\ndist/\n"); err != nil {
return err
}
diff --git a/cmd/init_test.go b/cmd/init_test.go
index <HASH>..<HASH> 100644
--- a/cmd/init_test.go
+++ b/cmd/init_test.go
@@ -32,7 +32,7 @@ func TestInitGitIgnoreExists(t *testing.T) {
bts, err := os.ReadFile(".gitignore")
require.NoError(t, err)
- require.Equal(t, "mybinary\ndist/\n", string(bts))
+ require.Equal(t, "mybinary\n\ndist/\n", string(bts))
}
func TestInitFileExists(t *testing.T) { | fix: gitignore patching needs leading newline (#<I>) |
diff --git a/pylast/__init__.py b/pylast/__init__.py
index <HASH>..<HASH> 100644
--- a/pylast/__init__.py
+++ b/pylast/__init__.py
@@ -2052,11 +2052,6 @@ class Track(_Opus):
self._request(self.ws_prefix + '.unlove')
- def ban(self):
- """Ban this track from ever playing on the radio. """
-
- self._request(self.ws_prefix + '.ban')
-
def get_similar(self):
"""
Returns similar tracks for this track on the network, | Remove dead Last.fm track ban |
diff --git a/hwt/pyUtils/arrayQuery.py b/hwt/pyUtils/arrayQuery.py
index <HASH>..<HASH> 100755
--- a/hwt/pyUtils/arrayQuery.py
+++ b/hwt/pyUtils/arrayQuery.py
@@ -1,4 +1,5 @@
# select = map, groupBy = itertools.groupby
+from collections import deque
from itertools import zip_longest
from math import inf
from types import GeneratorType
@@ -117,7 +118,7 @@ def flatten(iterables, level=inf):
:param level: maximum depth of flattening
"""
if level >= 0 and isinstance(iterables, (list, tuple, GeneratorType,
- map, zip)):
+ map, zip, set, deque)):
level -= 1
for i in iterables:
yield from flatten(i, level=level) | arrayQuery.flatten support for set, deque |
diff --git a/install/prebuild-ci.js b/install/prebuild-ci.js
index <HASH>..<HASH> 100644
--- a/install/prebuild-ci.js
+++ b/install/prebuild-ci.js
@@ -2,8 +2,8 @@
const { execFileSync } = require('child_process');
-const { prebuild_upload: hasToken, APPVEYOR_REPO_TAG_NAME, TRAVIS_TAG } = process.env;
+const { prebuild_upload: hasToken, APPVEYOR_REPO_TAG, TRAVIS_TAG } = process.env;
-if (hasToken && (APPVEYOR_REPO_TAG_NAME || TRAVIS_TAG)) {
+if (hasToken && (Boolean(APPVEYOR_REPO_TAG) || TRAVIS_TAG)) {
execFileSync('prebuild', ['--runtime', 'napi', '--target', '3'], { stdio: 'inherit' });
} | CI: workaround Appveyor ignoring v-prefixed tag names |
diff --git a/unitest-restful.py b/unitest-restful.py
index <HASH>..<HASH> 100755
--- a/unitest-restful.py
+++ b/unitest-restful.py
@@ -91,7 +91,7 @@ class TestGlances(unittest.TestCase):
req = requests.get("%s/%s" % (URL, p))
self.assertTrue(req.ok)
if p in ('uptime', 'now'):
- self.assertIsInstance(req.json(), str)
+ self.assertIsInstance(req.json(), unicode)
elif p in ('fs', 'monitor', 'percpu', 'sensors', 'alert', 'processlist',
'diskio', 'hddtemp', 'batpercent', 'network'):
self.assertIsInstance(req.json(), list) | Correct an issue with test_<I>_plugins in Unitest for the Restful API (str instead od unicode) |
diff --git a/bika/lims/skins/bika/bika_widgets/recordswidget.js b/bika/lims/skins/bika/bika_widgets/recordswidget.js
index <HASH>..<HASH> 100644
--- a/bika/lims/skins/bika/bika_widgets/recordswidget.js
+++ b/bika/lims/skins/bika/bika_widgets/recordswidget.js
@@ -44,15 +44,11 @@ jQuery(function($){
recordswidget_lookups();
$('[combogrid_options]').live('focus', function(){
- cgo = $(this).attr('combogrid_options');
- if(cgo==''){
- return;
- }
- // For inputs with combogrids, we want them to clear when focused
- $(this).val('');
- // We also want to clear all colModel->subfield completions
var options = $.parseJSON($(this).attr('combogrid_options'));
if(options != '' && options != undefined && options != null){
+ // For inputs with combogrids, we want them to clear when focused
+ $(this).val('');
+ // We also want to clear all colModel->subfield completions
var fieldName = $(this).attr('name').split(".")[0];
var key = $(this).attr('name').split(".")[1].split(":")[0];
var colModel = $.parseJSON($(this).attr('combogrid_options')).colModel; | Recordswidget doesn't always need to blank fields on focus |
diff --git a/build/build-utils.js b/build/build-utils.js
index <HASH>..<HASH> 100644
--- a/build/build-utils.js
+++ b/build/build-utils.js
@@ -169,7 +169,13 @@ function mkdirs(dir) {
if (components.length === 0) {
throw new Error("mkdirs must be called with at least one path component");
}
- let soFar = ".";
+ let soFar;
+ if (components[0].length === 0) {
+ soFar = "/";
+ components.shift();
+ } else {
+ soFar = ".";
+ }
for (const c of components) {
soFar = path.join(soFar, c);
try { | Support absolute paths in mkdirs in build-utils, too |
diff --git a/inc/metadata/namespace.php b/inc/metadata/namespace.php
index <HASH>..<HASH> 100644
--- a/inc/metadata/namespace.php
+++ b/inc/metadata/namespace.php
@@ -574,8 +574,8 @@ function section_information_to_schema( $section_information, $book_information
];
}
- if ( ! isset( $section_information['pb_section_license'] ) ) {
- if ( isset( $book_information['pb_book_license'] ) ) {
+ if ( empty( $section_information['pb_section_license'] ) ) {
+ if ( ! empty( $book_information['pb_book_license'] ) ) {
$section_information['pb_section_license'] = $book_information['pb_book_license'];
} else {
$section_information['pb_section_license'] = 'all-rights-reserved';
@@ -583,6 +583,11 @@ function section_information_to_schema( $section_information, $book_information
}
$licensing = new Licensing;
+
+ if ( ! $licensing->isSupportedType( $section_information['pb_section_license'] ) ) {
+ $section_information['pb_section_license'] = 'all-rights-reserved';
+ }
+
$section_schema['license'] = [
'@type' => 'CreativeWork',
'url' => $licensing->getUrlForLicense( $section_information['pb_section_license'] ), | Handle empty/garbage license values (#<I>)
* Handle situations where license has been set to empty string.
* Correct garbage license. |
diff --git a/lib/stream-reader.js b/lib/stream-reader.js
index <HASH>..<HASH> 100644
--- a/lib/stream-reader.js
+++ b/lib/stream-reader.js
@@ -14,7 +14,7 @@ export default class CodeMirrorStreamReader extends StreamReader {
* @param {CodeMirror.Pos} [pos]
* @param {CodeMirror.Range} [limit]
*/
- constructor(buffer, pos, limit) {
+ constructor(editor, pos, limit) {
super();
const CodeMirror = editor.constructor;
this.editor = editor; | Fixed param name in stream reader constructor |
diff --git a/test/dashboard_controller_test.rb b/test/dashboard_controller_test.rb
index <HASH>..<HASH> 100644
--- a/test/dashboard_controller_test.rb
+++ b/test/dashboard_controller_test.rb
@@ -26,7 +26,7 @@ class DashboardControllerTest < ActionDispatch::IntegrationTest
get '/rails/db/import'
assert_equal 200, status
- get '//rails/db/data-table'
+ get '/rails/db/data-table'
assert_equal 200, status
end | working on ajax, data-tables, autocomplete |
diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php
index <HASH>..<HASH> 100644
--- a/cake/tests/cases/libs/validation.test.php
+++ b/cake/tests/cases/libs/validation.test.php
@@ -2201,12 +2201,5 @@ class ValidationTest extends CakeTestCase {
$this->assertTrue(Validation::userDefined('333', $validator, 'customValidate'));
}
- // function testFile() {
- // $this->assertTrue(Validation::file(WWW_ROOT . 'img' . DS . 'cake.icon.gif'));
- // $this->assertTrue(Validation::file(WWW_ROOT. 'favicon.ico'));
- // $this->assertTrue(Validation::file(WWW_ROOT. 'index.php'));
- // $this->assertTrue(Validation::file(WWW_ROOT. 'css' . DS . 'cake.generic.css'));
- // $this->assertTrue(Validation::file(TEST_CAKE_CORE_INCLUDE_PATH. 'VERSION.txt'));
- // }
}
?>
\ No newline at end of file | Removing outcommented code. |
diff --git a/lib/veewee/provider/core/box/exec.rb b/lib/veewee/provider/core/box/exec.rb
index <HASH>..<HASH> 100644
--- a/lib/veewee/provider/core/box/exec.rb
+++ b/lib/veewee/provider/core/box/exec.rb
@@ -9,7 +9,7 @@ module Veewee
end
def winrm_command_string
- "knife winrm -m #{self.ip_address}-P #{winrm_options[:port]} -x #{definition.winrm_user}" +
+ "knife winrm -m #{self.ip_address} -P #{winrm_options[:port]} -x #{definition.winrm_user}" +
" -P #{definition.winrm_password} COMMAND"
end | I'm not sure if winrm_command_string is used, but it had a typo. |
diff --git a/lambda_decorators.py b/lambda_decorators.py
index <HASH>..<HASH> 100644
--- a/lambda_decorators.py
+++ b/lambda_decorators.py
@@ -265,14 +265,14 @@ def after(func):
>>> # to create a reusable decorator
>>> @after
- ... def teapot(retval):
- ... retval['statusCode'] = 418
+ ... def gnu_terry_pratchett(retval):
+ ... retval.setdefault('Headers', {})['X-Clacks-Overhead'] = 'GNU Terry Pratchett'
... return retval
- >>> @teapot
+ >>> @gnu_terry_pratchett
... def handler(event, context):
- ... return {}
+ ... return {'body': ''}
>>> handler({}, object())
- {'statusCode': 418}
+ {'body': '', 'Headers': {'X-Clacks-Overhead': 'GNU Terry Pratchett'}}
"""
class AfterDecorator(LambdaDecorator):
def after(self, retval): | gnu terry pratchet, why not |
diff --git a/MAVProxy/modules/mavproxy_arm.py b/MAVProxy/modules/mavproxy_arm.py
index <HASH>..<HASH> 100644
--- a/MAVProxy/modules/mavproxy_arm.py
+++ b/MAVProxy/modules/mavproxy_arm.py
@@ -92,7 +92,21 @@ class ArmModule(mp_module.MPModule):
return
if args[0] == "throttle":
- self.master.arducopter_arm()
+ p2 = 0
+ if len(args) == 2 and args[1] == 'force':
+ p2 = 2989
+ self.master.mav.command_long_send(
+ self.target_system, # target_system
+ self.target_component,
+ mavutil.mavlink.MAV_CMD_COMPONENT_ARM_DISARM, # command
+ 0, # confirmation
+ 1, # param1 (1 to indicate arm)
+ p2, # param2 (all other params meaningless)
+ 0, # param3
+ 0, # param4
+ 0, # param5
+ 0, # param6
+ 0) # param7
return
if args[0] == "safetyon": | Understand 'arm throttle force' to force ArduPilot arming |
diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cases/api_spec.rb
+++ b/spec/cases/api_spec.rb
@@ -19,6 +19,11 @@ describe LinkedIn::Api do
stub_request(:get, "https://api.linkedin.com/v1/people/id=123").to_return(:body => "{}")
client.profile(:id => 123).should be_an_instance_of(LinkedIn::Mash)
end
+
+ it "should be able to view the picture urls" do
+ stub_request(:get, "https://api.linkedin.com/v1/people/~/picture-urls::(original)").to_return(:body => "{}")
+ client.picture_urls.should be_an_instance_of(LinkedIn::Mash)
+ end
it "should be able to view connections" do
stub_request(:get, "https://api.linkedin.com/v1/people/~/connections").to_return(:body => "{}") | Add tests for view picture urls |
diff --git a/assemblerflow/templates/metaspades.py b/assemblerflow/templates/metaspades.py
index <HASH>..<HASH> 100644
--- a/assemblerflow/templates/metaspades.py
+++ b/assemblerflow/templates/metaspades.py
@@ -208,8 +208,8 @@ def main(sample_id, fastq_pair, max_len, kmer):
# Get spades version for output name
info = __get_version_spades()
- assembly_file = "{}_metaspades{}.fasta".format(
- sample_id, info["version"].replace(".", ""))
+ assembly_file = "{}_metaspades.fasta".format(
+ sample_id)
os.rename("contigs.fasta", assembly_file)
logger.info("Setting main assembly file to: {}".format(assembly_file)) | metaspades.py: changed outputfile name (missing version - removed due to not being correctly parsed) |
diff --git a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureEnvironment.java b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureEnvironment.java
index <HASH>..<HASH> 100644
--- a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureEnvironment.java
+++ b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureEnvironment.java
@@ -89,7 +89,7 @@ public final class AzureEnvironment {
"https://login.microsoftonline.de/",
"https://management.core.cloudapi.de/",
true,
- "https://management.microsoftazure.de");
+ "https://management.microsoftazure.de/");
/**
* Gets the base URL of the management service. | ensuring trailing slash for urls |
diff --git a/tests/test_etcd3.py b/tests/test_etcd3.py
index <HASH>..<HASH> 100644
--- a/tests/test_etcd3.py
+++ b/tests/test_etcd3.py
@@ -207,6 +207,7 @@ class TestEtcd3(object):
etcd.put(key, 'this is a lease', lease=lease)
assert lease.keys == [utils.to_bytes(key)]
assert etcd.get(key) == b'this is a lease'
+ assert lease.remaining_ttl <= lease.granted_ttl
# wait for the lease to expire
time.sleep(lease.granted_ttl + 2) | Make assertion about Lease.remaining_ttl |
diff --git a/tests/Components/ORM/Base.php b/tests/Components/ORM/Base.php
index <HASH>..<HASH> 100644
--- a/tests/Components/ORM/Base.php
+++ b/tests/Components/ORM/Base.php
@@ -28,7 +28,7 @@ class Base extends \Parable\Tests\Base
protected function skipIfSqliteNotAvailable()
{
- if (!extension_loaded('sqlite33')) {
+ if (!extension_loaded('sqlite3')) {
$this->markTestSkipped('sqlite3 is not available');
}
} | Of course, leaving the debug 'sqlite<I>' check in is a bad idea. |
diff --git a/src/test/java/com/box/sdk/EventStreamTest.java b/src/test/java/com/box/sdk/EventStreamTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/box/sdk/EventStreamTest.java
+++ b/src/test/java/com/box/sdk/EventStreamTest.java
@@ -57,8 +57,14 @@ public class EventStreamTest {
boolean createdEventFound = false;
boolean deletedEventFound = false;
- while (!createdEventFound || !deletedEventFound) {
+ int timeouts = 0;
+ while ( timeouts < 3 && (!createdEventFound || !deletedEventFound)) {
BoxEvent event = observedEvents.poll(1, TimeUnit.MINUTES);
+ if( null == event) {
+ timeouts++;
+ System.out.println("Time outs: " + timeouts);
+ continue;
+ }
BoxResource.Info sourceInfo = event.getSourceInfo();
// Some events may not have sourceInfo
if (sourceInfo == null) { | Fix event stream to handle no events in the stream |
diff --git a/test/unit/api/Users.test.js b/test/unit/api/Users.test.js
index <HASH>..<HASH> 100644
--- a/test/unit/api/Users.test.js
+++ b/test/unit/api/Users.test.js
@@ -11,9 +11,11 @@ module.exports = function (container, assert, sinon) {
config = {
api_secret: '1234'
};
+
options = {
- stuff: 'stuff'
+ user: 123
};
+
cb = function () {
};
@@ -39,6 +41,17 @@ module.exports = function (container, assert, sinon) {
availableOptions: ['user', 'user:username']
}, options, config, cb), 'util.executeApiMethod should have been called with the correct arguments');
});
+
+ it('should handle a string user argument', function () {
+ users.listPosts({user: 'foo'}, cb);
+ assert.isTrue(executeApiMethod.calledWithExactly({
+ resource: 'users',
+ name: 'listPosts',
+ method: 'GET',
+ requiredOptions: ['api_secret'],
+ availableOptions: ['user', 'user:username']
+ }, {'user:username': 'foo'}, config, cb), 'util.executeApiMethod should have been called with the correct arguments');
+ });
});
};
}; | Add test for user -> user:username |
diff --git a/libraries/mako/Event.php b/libraries/mako/Event.php
index <HASH>..<HASH> 100644
--- a/libraries/mako/Event.php
+++ b/libraries/mako/Event.php
@@ -44,7 +44,7 @@ class Event
//---------------------------------------------
/**
- * Adds an event to the queue.
+ * Adds an event listener to the queue.
*
* @access public
* @param string Event name
@@ -57,7 +57,7 @@ class Event
}
/**
- * Returns TRUE if an event is registered and FALSE if not.
+ * Returns TRUE if an event listener is registered for the event and FALSE if not.
*
* @access public
* @param string Event name
@@ -70,6 +70,18 @@ class Event
}
/**
+ * Clears all event listeners for an event.
+ *
+ * @access public
+ * @param string Event name
+ **/
+
+ public static function clear($name)
+ {
+ unset(static::$events[$name]);
+ }
+
+ /**
* Runs all callbacks for an event and returns an array
* contaning the return values of each callback.
* | It is now possible to clear event listeners for an event. |
diff --git a/lib/plugin.js b/lib/plugin.js
index <HASH>..<HASH> 100644
--- a/lib/plugin.js
+++ b/lib/plugin.js
@@ -216,8 +216,11 @@ class SVGSpritePlugin {
beforeHtmlGeneration(compilation) {
const itemsBySprite = this.map.groupItemsBySpriteFilename();
+ const filenamePrefix = this.rules.publicPath
+ ? this.rules.publicPath.replace(/^\//, '')
+ : '';
const sprites = Object.keys(itemsBySprite).reduce((acc, filename) => {
- acc[filename] = compilation.assets[filename].source();
+ acc[filenamePrefix + filename] = compilation.assets[filenamePrefix + filename].source();
return acc;
}, {}); | Fix the bug of publicPath
Once the publicPath is set and is not equal to / , an error will be report with "TypeError: Cannot read property 'source' of undefined", Because the assets map have not contain the value of publicPath. |
diff --git a/comments-bundle/src/Resources/contao/Comments.php b/comments-bundle/src/Resources/contao/Comments.php
index <HASH>..<HASH> 100644
--- a/comments-bundle/src/Resources/contao/Comments.php
+++ b/comments-bundle/src/Resources/contao/Comments.php
@@ -66,8 +66,6 @@ class Comments extends Frontend
// Initialize the pagination menu
$objPagination = new Pagination($objTotal->count, $objConfig->perPage);
- $objPagination->setFormat($strFormat);
-
$objTemplate->pagination = $objPagination->generate("\n ");
}
@@ -92,7 +90,6 @@ class Comments extends Frontend
}
$objPartial = new FrontendTemplate($objConfig->template);
- $objPartial->setFormat($strFormat);
while ($objComments->next())
{
@@ -193,7 +190,6 @@ class Comments extends Frontend
$arrField['eval']['required'] = $arrField['eval']['mandatory'];
$objWidget = new $strClass($this->prepareForWidget($arrField, $arrField['name'], $arrField['value']));
- $objWidget->setFormat($strFormat);
// Validate the widget
if ($this->Input->post('FORM_SUBMIT') == $strFormId) | [Comments] Refactoring the new template system so it works without setFormat() |
diff --git a/Classes/Base.php b/Classes/Base.php
index <HASH>..<HASH> 100644
--- a/Classes/Base.php
+++ b/Classes/Base.php
@@ -148,6 +148,9 @@ class Base
$fsm = new \Aimeos\MW\Filesystem\Manager\Standard( $config );
$context->setFilesystemManager( $fsm );
+ $mq = new \Aimeos\MW\MQueue\Manager\Standard( $config );
+ $context->setMessageQueueManager( $mq );
+
$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context );
$context->setLogger( $logger );
diff --git a/Resources/Private/Config/resource.php b/Resources/Private/Config/resource.php
index <HASH>..<HASH> 100644
--- a/Resources/Private/Config/resource.php
+++ b/Resources/Private/Config/resource.php
@@ -29,4 +29,8 @@ return array(
'basedir' => PATH_site . 'uploads/tx_aimeos/.secure',
'tempdir' => PATH_site . 'typo3temp',
),
+ 'mq' => array(
+ 'adapter' => 'Standard',
+ 'db' => 'db',
+ ),
); | Added message queue manager to context object |
diff --git a/lib/hako/schedulers/ecs_definition_comparator.rb b/lib/hako/schedulers/ecs_definition_comparator.rb
index <HASH>..<HASH> 100644
--- a/lib/hako/schedulers/ecs_definition_comparator.rb
+++ b/lib/hako/schedulers/ecs_definition_comparator.rb
@@ -45,6 +45,7 @@ module Hako
struct.member(:linux_parameters, Schema::Nullable.new(linux_parameters_schema))
struct.member(:readonly_root_filesystem, Schema::Nullable.new(Schema::Boolean.new))
struct.member(:docker_security_options, Schema::Nullable.new(Schema::UnorderedArray.new(Schema::String.new)))
+ struct.member(:system_controls, Schema::Nullable.new(system_controls_schema))
end
end
@@ -170,6 +171,13 @@ module Hako
struct.member(:condition, Schema::String.new)
end
end
+
+ def system_controls_schema
+ Schema::Structure.new.tap do |struct|
+ struct.member(:namespace, Schema::String.new)
+ struct.member(:value, Schema::String.new)
+ end
+ end
end
end
end | Add system_controls member to ECS definition schema |
diff --git a/pack.js b/pack.js
index <HASH>..<HASH> 100644
--- a/pack.js
+++ b/pack.js
@@ -63,6 +63,12 @@ function compressName(buf, offset, nameMap, name, callback) {
// The top 2-bits must be set as a flag indicating its a pointer
pointer |= 0xc000;
+ if ((buf.length - offset) < 2) {
+ callback('buffer not large enough to write label pointer for name [' +
+ name + ']');
+ return;
+ }
+
buf.writeUInt16BE(pointer, offset + bytes);
bytes += 2;
@@ -83,6 +89,9 @@ function compressName(buf, offset, nameMap, name, callback) {
if (label.length > 64) {
callback('Label [' + label + '] is more than 64 characters long.');
return;
+ } else if ((buf.length - offset) < (1 + label.length)) {
+ callback('buffer not large enough to write name [' + name + ']');
+ return;
}
// Write the length of the label out in a single octet. The top 2-bits | Add buffer overrun checks and flag as a callback error. |
diff --git a/src/org/jgroups/Channel.java b/src/org/jgroups/Channel.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/Channel.java
+++ b/src/org/jgroups/Channel.java
@@ -1,4 +1,4 @@
-// $Id: Channel.java,v 1.35 2007/10/01 11:48:59 vlada Exp $
+// $Id: Channel.java,v 1.36 2007/10/16 16:24:38 belaban Exp $
package org.jgroups;
@@ -116,7 +116,7 @@ public abstract class Channel implements Transport {
/** Shuts down the channel without disconnecting if connected, stops all the threads */
- abstract protected void shutdown();
+ abstract public void shutdown();
/** | made Channel.shutdown() public |
diff --git a/sacred/commands.py b/sacred/commands.py
index <HASH>..<HASH> 100644
--- a/sacred/commands.py
+++ b/sacred/commands.py
@@ -5,6 +5,7 @@
import pprint
import pydoc
import re
+import sys
from collections import namedtuple, OrderedDict
from colorama import Fore, Style
@@ -58,9 +59,14 @@ def _non_unicode_repr(objekt, context, maxlevels, level):
E.g.: 'John' instead of u'John'.
"""
- repr_string, isreadable, isrecursive = pprint._safe_repr(
- objekt, context, maxlevels, level
- )
+ if sys.version_info[0] == 3 and sys.version_info[1] >= 8:
+ repr_string, isreadable, isrecursive = pprint._safe_repr(
+ objekt, context, maxlevels, level, sort_dicts=None
+ )
+ else:
+ repr_string, isreadable, isrecursive = pprint._safe_repr(
+ objekt, context, maxlevels, level
+ )
if repr_string.startswith('u"') or repr_string.startswith("u'"):
repr_string = repr_string[1:]
return repr_string, isreadable, isrecursive | Fix #<I> (#<I>) |
diff --git a/lib/clitasks/story.rb b/lib/clitasks/story.rb
index <HASH>..<HASH> 100644
--- a/lib/clitasks/story.rb
+++ b/lib/clitasks/story.rb
@@ -9,7 +9,7 @@ module CliTasks
end
def id
- @id ||= File.basename(file).sub(/[.]rb$/, '')
+ @id ||= File.basename(file, '.rb')
end
def tags
diff --git a/stories/index/20140524235849.rb b/stories/index/20140524235849.rb
index <HASH>..<HASH> 100644
--- a/stories/index/20140524235849.rb
+++ b/stories/index/20140524235849.rb
@@ -1,5 +1,5 @@
story %q(change how a story's id is retrieved) do
- status started
+ status finished
points 1
created_by 'unixsuperhero'
assigned_to :unassigned | change how story id is composed |
diff --git a/src/main/java/com/smartsheet/api/models/enums/WidgetType.java b/src/main/java/com/smartsheet/api/models/enums/WidgetType.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/smartsheet/api/models/enums/WidgetType.java
+++ b/src/main/java/com/smartsheet/api/models/enums/WidgetType.java
@@ -48,5 +48,9 @@ public enum WidgetType {
/**
* ImageWidgetContent object
*/
- IMAGE
+ IMAGE,
+ /**
+ * same as RichTextWidgetContent object
+ */
+ TITLE
} | add TITLE as a valid WidgetType |
diff --git a/h5netcdf/core.py b/h5netcdf/core.py
index <HASH>..<HASH> 100644
--- a/h5netcdf/core.py
+++ b/h5netcdf/core.py
@@ -379,6 +379,10 @@ class Group(Mapping):
def parent(self):
return self._parent
+ def flush(self):
+ self._root.flush()
+ sync = flush
+
@property
def groups(self):
return Frozen(self._groups)
diff --git a/h5netcdf/tests/test_h5netcdf.py b/h5netcdf/tests/test_h5netcdf.py
index <HASH>..<HASH> 100644
--- a/h5netcdf/tests/test_h5netcdf.py
+++ b/h5netcdf/tests/test_h5netcdf.py
@@ -135,9 +135,11 @@ def write_h5netcdf(tmp_netcdf):
g.dimensions['y'] = 10
g.create_variable('y_var', ('y',), float)
+ g.flush()
ds.dimensions['mismatched_dim'] = 1
ds.create_variable('mismatched_dim', dtype=int)
+ ds.flush()
dt = h5py.special_dtype(vlen=unicode)
v = ds.create_variable('var_len_str', ('x',), dtype=dt) | Add flush/sync to core.Group |
diff --git a/openpnm/utils/Project.py b/openpnm/utils/Project.py
index <HASH>..<HASH> 100644
--- a/openpnm/utils/Project.py
+++ b/openpnm/utils/Project.py
@@ -115,7 +115,42 @@ class Project(list):
purge_object
"""
- self.purge_object(obj)
+ self.purge_object(obj, deep=False)
+
+ def pop(self, index):
+ r"""
+ The object at the given index is removed from the list and returned.
+
+ Notes
+ -----
+ This method uses ``purge_object`` to perform the actual removal of the
+ object. It is reommended to just use that directly instead.
+
+ See Also
+ --------
+ purge_object
+
+ """
+ obj = self[index]
+ self.purge_object(obj, deep=False)
+ return obj
+
+ def insert(self, index, obj):
+ r"""
+ Inserts the supplied object at the specified index in the Project list
+
+ Notes
+ -----
+ The order of the objects in an OpenPNM Project lists do not matter, so
+ it is recommended to just use ``append`` instead.
+
+ See Also
+ --------
+ append
+ extend
+
+ """
+ self.extend(obj)
def clear(self, objtype=[]):
r""" | completing subclassing of project list builtins |
diff --git a/lib/WebSocketConnection.js b/lib/WebSocketConnection.js
index <HASH>..<HASH> 100644
--- a/lib/WebSocketConnection.js
+++ b/lib/WebSocketConnection.js
@@ -348,7 +348,7 @@ WebSocketConnection.prototype.handleSocketError = function(error) {
if (utils.eventEmitterListenerCount(this, 'error') > 0) {
this.emit('error', error);
}
- this.socket.destroy(error);
+ this.socket.destroy();
this._debug.printOutput();
}; | Fix infinite loop in error handling. (#<I>)
Fix #<I> |
diff --git a/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyResultIterator.java b/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyResultIterator.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyResultIterator.java
+++ b/core/src/main/java/me/prettyprint/cassandra/service/template/ColumnFamilyResultIterator.java
@@ -26,19 +26,23 @@ public class ColumnFamilyResultIterator implements Iterator<ColumnFamilyResult<?
this.res = res;
}
- public boolean hasNext()
- {
- boolean retval = false;
- if (isStart)
- {
- retval = res.hasResults();
- }
- else
- {
- retval = res.hasNext();
- }
- return retval;
- }
+ public boolean hasNext()
+ {
+ boolean retval = false;
+ if (isStart)
+ {
+ if(res.hasResults() || res.hasNext())
+ {
+ retval = true;
+ }
+ }
+ else
+ {
+ retval = res.hasNext();
+ }
+ return retval;
+ }
+
public ColumnFamilyResult<?, ?> getRes()
{ | Fix bug in hasNext when no result for a key is returned |
diff --git a/tests/test_geometry.py b/tests/test_geometry.py
index <HASH>..<HASH> 100644
--- a/tests/test_geometry.py
+++ b/tests/test_geometry.py
@@ -87,6 +87,15 @@ class TestBBox(TestSentinelHub):
self.assertEqual(bbox.get_lower_left(), (46.07, 13.23))
self.assertEqual(bbox.get_crs(), CRS.WGS84)
+ def test_bbox_from_shapely(self):
+ bbox_list = [
+ BBox(shapely.geometry.LineString([(0, 0), (1, 1)]), CRS.WGS84),
+ BBox(shapely.geometry.LinearRing([(1, 0), (1, 1), (0, 0)]), CRS.WGS84),
+ BBox(shapely.geometry.Polygon([(1, 0), (1, 1), (0, 0)]), CRS.WGS84)
+ ]
+ for bbox in bbox_list:
+ self.assertEqual(bbox, BBox((0, 0, 1, 1), CRS.WGS84))
+
def test_bbox_to_str(self):
x1, y1, x2, y2 = 45.0, 12.0, 47.0, 14.0
crs = CRS.WGS84 | added unit test for parsing shapely objects |
diff --git a/test/d3-funnel/d3-funnel.js b/test/d3-funnel/d3-funnel.js
index <HASH>..<HASH> 100644
--- a/test/d3-funnel/d3-funnel.js
+++ b/test/d3-funnel/d3-funnel.js
@@ -45,6 +45,17 @@ describe('D3Funnel', function () {
funnel.draw(['One dimensional', 2], {});
}, Error, 'Funnel data is not valid.');
});
+
+ it('should draw as many blocks as there are elements', function () {
+ getFunnel().draw([
+ ['Node A', 1],
+ ['Node B', 2],
+ ['Node C', 3],
+ ['Node D', 4],
+ ]);
+
+ assert.equal(4, getLength(getSvg().selectAll('path')));
+ });
});
describe('destroy', function () { | Add test for one-to-one block drawing |
diff --git a/spec/how_bad/analyzer_spec.rb b/spec/how_bad/analyzer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/how_bad/analyzer_spec.rb
+++ b/spec/how_bad/analyzer_spec.rb
@@ -6,5 +6,29 @@ describe HowBad::Analyzer do
let(:fetcher_results) { HowBad::Fetcher::Results.new(issues, pulls) }
-
+ subject { HowBad::Analyzer.new }
+
+ context '#num_with_label' do
+ it 'returns a Hash mapping labels to the number of issues or pulls with that label' do
+ result = subject.num_with_label(issues)
+
+ expect(result).to eq(TODO)
+ end
+ end
+
+ context '#average_age_for' do
+ it 'returns the average age for the provided issues or pulls' do
+ result = subject.average_age_for(issues)
+
+ expect(result).to eq(TODO)
+ end
+ end
+
+ context '#oldest_age_for' do
+ it 'returns the oldest age for the provided issues or pulls' do
+ result = subject.average_age_for(issues)
+
+ expect(result).to eq(TODO)
+ end
+ end
end | Beginning of specs for Analyzer. |
diff --git a/lib/util/toplist.js b/lib/util/toplist.js
index <HASH>..<HASH> 100644
--- a/lib/util/toplist.js
+++ b/lib/util/toplist.js
@@ -46,10 +46,18 @@ module.exports = {
},
getLargestPages: function(pages, limit) {
+
pages.sort(function(page, thatPage) {
- return thatPage.yslow.pageWeight.v - page.yslow.pageWeight.v;
+
+ // if YSlow fails but we collect other data
+ // we have the page object but no YSlow
+ if (thatPage.yslow && page.yslow) {
+ return thatPage.yslow.pageWeight.v - page.yslow.pageWeight.v;
+ }
+ return 0;
});
+
return pages.slice(0, limit < pages.length ? limit : pages.length); | safe check for pages without yslow |
diff --git a/includes/class-plugin.php b/includes/class-plugin.php
index <HASH>..<HASH> 100644
--- a/includes/class-plugin.php
+++ b/includes/class-plugin.php
@@ -402,7 +402,7 @@ class Plugin {
$dropin = get_plugin_data( WP_CONTENT_DIR . '/object-cache.php' );
$plugin = get_plugin_data( WP_REDIS_PLUGIN_PATH . '/includes/object-cache.php' );
- return $dropin['PluginURI'] === $plugin['PluginURI'];
+ return apply_filters('redis_cache_validate_object_cache_dropin',$dropin['PluginURI'] === $plugin['PluginURI'],$dropin['PluginURI'], $plugin['PluginURI']);
}
/** | Adding a filter to Rhubarb\RedisCache\Plugin::validate_object_cache_dropin |
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -33,7 +33,7 @@ class multicolour extends Map {
.set("stashes", new Map())
// Set the environment we're in.
- .set("env", process.env.NODE_ENV || "dev")
+ .set("env", process.env.NODE_ENV || "development")
// Where is the package.
const package_path = require("path").resolve("package.json")
@@ -111,7 +111,7 @@ class multicolour extends Map {
this.set("blueprints", files)
// Set up the DB.
- this.use(require("./lib/db")(this))
+ this.use(require("./lib/db"))
return this
} | Fix registration signature call for database generator and fixed incorrect environment default |
diff --git a/src/main/java/com/synopsys/integration/bdio/model/Forge.java b/src/main/java/com/synopsys/integration/bdio/model/Forge.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/synopsys/integration/bdio/model/Forge.java
+++ b/src/main/java/com/synopsys/integration/bdio/model/Forge.java
@@ -30,10 +30,9 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-import com.synopsys.integration.util.Stringable;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+import com.synopsys.integration.util.Stringable;
public class Forge extends Stringable {
// forges that use the slash as the separator | refactor(import): Cleaned up unused imports. |
diff --git a/lib/canned_soap/version.rb b/lib/canned_soap/version.rb
index <HASH>..<HASH> 100644
--- a/lib/canned_soap/version.rb
+++ b/lib/canned_soap/version.rb
@@ -1,3 +1,3 @@
module CannedSoap
- VERSION = "0.1.0"
+ VERSION = "0.1.1"
end | bumped to <I> |
diff --git a/heatmiserV3/heatmiser.py b/heatmiserV3/heatmiser.py
index <HASH>..<HASH> 100644
--- a/heatmiserV3/heatmiser.py
+++ b/heatmiserV3/heatmiser.py
@@ -69,11 +69,10 @@ class HeatmiserThermostat(object):
def __init__(self, address, model, uh1):
self.address = address
self.model = model
- with open("./config.yml", "r") as stream:
- try:
- self.config = yaml.load(stream)[model]
- except yaml.YAMLError as exc:
- logging.info("The YAML file is invalid: %s", exc)
+ try:
+ self.config = yaml.safe_load(config_yml)[model]
+ except yaml.YAMLError as exc:
+ logging.info("The YAML file is invalid: %s", exc)
self.conn = uh1.registerThermostat(self)
self.dcb = ""
self.read_dcb()
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup
setup(
name='heatmiserV3',
packages=['heatmiserV3'], # this must be the same as the name above
- version='1.1.7',
+ version='1.1.8',
description='A library to interact with Heatmiser Themostats using V3',
author='Andy Loughran',
author_email='andy@zrmt.com', | Updated to <I> and handled config properly |
diff --git a/cmd/describe.go b/cmd/describe.go
index <HASH>..<HASH> 100644
--- a/cmd/describe.go
+++ b/cmd/describe.go
@@ -144,8 +144,8 @@ func printPackage(pkg *pack.Package, printSymbols bool, printExports bool, print
fmt.Printf("%vdependencies [", tab)
if pkg.Dependencies != nil && len(*pkg.Dependencies) > 0 {
fmt.Printf("\n")
- for _, dep := range *pkg.Dependencies {
- fmt.Printf("%v\"%v\"\n", tab+tab, dep)
+ for _, dep := range pack.StableDependencies(*pkg.Dependencies) {
+ fmt.Printf("%v%v: \"%v\"\n", tab+tab, dep, (*pkg.Dependencies)[dep])
}
fmt.Printf("%v", tab)
} | Print the dependency key and value during describe |
diff --git a/indra/assemblers/pysb_assembler.py b/indra/assemblers/pysb_assembler.py
index <HASH>..<HASH> 100644
--- a/indra/assemblers/pysb_assembler.py
+++ b/indra/assemblers/pysb_assembler.py
@@ -827,7 +827,7 @@ class PysbAssembler(object):
set_base_initial_condition(self.model, m, init_round)
monomers_found.append(m.name)
else:
- set_base_initial_condition(self.model, m, 100.0)
+ set_base_initial_condition(self.model, m, 1000.0)
monomers_notfound.append(m.name)
logger.info('Monomers set to %s context' % cell_type)
logger.info('--------------------------------') | Fix increase default initial amount in set context |
diff --git a/bcbio/pipeline/qcsummary.py b/bcbio/pipeline/qcsummary.py
index <HASH>..<HASH> 100644
--- a/bcbio/pipeline/qcsummary.py
+++ b/bcbio/pipeline/qcsummary.py
@@ -84,10 +84,11 @@ def get_qc_tools(data):
for tool in ["qualimap", "qualimap_full"]]):
to_run.append("qualimap")
if analysis.startswith("rna-seq"):
- if gtf.is_qualimap_compatible(dd.get_gtf_file(data)):
- to_run.append("qualimap_rnaseq")
- else:
- logger.debug("GTF not compatible with Qualimap, skipping.")
+ if "qualimap" not in dd.get_tools_off(data):
+ if gtf.is_qualimap_compatible(dd.get_gtf_file(data)):
+ to_run.append("qualimap_rnaseq")
+ else:
+ logger.debug("GTF not compatible with Qualimap, skipping.")
if analysis.startswith("smallrna-seq"):
to_run.append("small-rna")
if not analysis.startswith("smallrna-seq"): | In the RNA-seq pipeline skip qualimap_rnaseq if qualimap was turned off. |
diff --git a/pymatgen/io/vasp/sets.py b/pymatgen/io/vasp/sets.py
index <HASH>..<HASH> 100644
--- a/pymatgen/io/vasp/sets.py
+++ b/pymatgen/io/vasp/sets.py
@@ -2692,7 +2692,7 @@ class MVLNPTMDSet(MITMDSet):
# NPT-AIMD default settings
defaults = {
- "IALGO": 48,
+ "ALGO": "Fast",
"ISIF": 3,
"LANGEVIN_GAMMA": [10] * structure.ntypesp,
"LANGEVIN_GAMMA_L": 1, | Update MVLNPTMDSet in sets.py
Replaced the IALGO tag with ALGO as recommended in the vasp documentation <URL> |
diff --git a/storage/metric/operation.go b/storage/metric/operation.go
index <HASH>..<HASH> 100644
--- a/storage/metric/operation.go
+++ b/storage/metric/operation.go
@@ -215,7 +215,10 @@ func (g *getValuesAlongRangeOp) ExtractSamples(in []model.SamplePair) (out []mod
return !in[i].Timestamp.Before(g.from)
})
if firstIdx == len(in) {
- // No samples at or after operator start time.
+ // No samples at or after operator start time. This can only happen if we
+ // try applying the operator to a time after the last recorded sample. In
+ // this case, we're finished.
+ g.from = g.through.Add(1)
return
}
@@ -228,7 +231,10 @@ func (g *getValuesAlongRangeOp) ExtractSamples(in []model.SamplePair) (out []mod
}
lastSampleTime := in[lastIdx-1].Timestamp
- g.from = lastSampleTime.Add(time.Duration(1))
+ // Sample times are stored with a maximum time resolution of one second, so
+ // we have to add exactly that to target the next chunk on the next op
+ // iteration.
+ g.from = lastSampleTime.Add(time.Second)
return in[firstIdx:lastIdx]
} | Fix two bugs in range op time advancement. |
diff --git a/lib/node-notifier.js b/lib/node-notifier.js
index <HASH>..<HASH> 100644
--- a/lib/node-notifier.js
+++ b/lib/node-notifier.js
@@ -46,7 +46,7 @@ var Notifier = function () {
}
, command = function (options, cb) {
- var notifyApp = exec(notifier, options, function (error, stdout, stderr) {
+ var notifyApp = exec(notifier + ' ' + options.join(' '), function (error, stdout, stderr) {
if (error !== null) {
return cb(error);
} | Fixed options passed in to exec |
diff --git a/faker/utils/distribution.py b/faker/utils/distribution.py
index <HASH>..<HASH> 100644
--- a/faker/utils/distribution.py
+++ b/faker/utils/distribution.py
@@ -1,6 +1,7 @@
# coding=utf-8
import bisect
+from sys import version_info
from faker.generator import random
def random_sample():
@@ -17,10 +18,13 @@ def cumsum(it):
def choice_distribution(a, p):
assert len(a) == len(p)
- cdf = list(cumsum(p))
- normal = cdf[-1]
- cdf2 = [float(i) / float(normal) for i in cdf]
- uniform_sample = random_sample()
- idx = bisect.bisect_right(cdf2, uniform_sample)
-
- return a[idx]
+ if version_info.major >= 3 and version_info.minor >= 6:
+ from random import choices
+ return choices(a, weights=p)[0]
+ else:
+ cdf = list(cumsum(p))
+ normal = cdf[-1]
+ cdf2 = [float(i) / float(normal) for i in cdf]
+ uniform_sample = random_sample()
+ idx = bisect.bisect_right(cdf2, uniform_sample)
+ return a[idx] | Use random.choices when available for better performance |
diff --git a/apps/editing-toolkit/editing-toolkit-plugin/help-center/src/config.js b/apps/editing-toolkit/editing-toolkit-plugin/help-center/src/config.js
index <HASH>..<HASH> 100644
--- a/apps/editing-toolkit/editing-toolkit-plugin/help-center/src/config.js
+++ b/apps/editing-toolkit/editing-toolkit-plugin/help-center/src/config.js
@@ -4,7 +4,7 @@ window.configData = {
google_analytics_key: 'UA-10673494-15',
client_slug: 'browser',
twemoji_cdn_url: 'https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/',
- happychat_url: 'https://happychat-io-staging.go-vip.co/customer',
+ happychat_url: 'https://happychat.io/customer',
site_filter: [],
sections: {},
enable_all_sections: false,
@@ -19,7 +19,7 @@ window.configData = {
signup_url: '/',
discover_blog_id: 53424024,
discover_feed_id: 41325786,
- directly_rtm_widget_environment: 'sandbox',
+ directly_rtm_widget_environment: 'production',
directly_rtm_widget_ids: {
sandbox: '8a2968fc57d1e2f40157f42bf2d43160',
production: '8a12a3ca5a21a619015a47e492b02cfc', | Set config values to production (#<I>) |
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -604,7 +604,7 @@ class Chef
# @api private
#
def run_ohai
- filter = Chef::Config[:minimal_ohai] ? %w{fqdn machinename hostname platform platform_version ohai_time os os_version} : nil
+ filter = Chef::Config[:minimal_ohai] ? %w{fqdn machinename hostname platform platform_version ohai_time os os_version init_package} : nil
ohai.all_plugins(filter)
events.ohai_completed(node)
rescue Ohai::Exceptions::CriticalPluginFailure => e
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -38,7 +38,7 @@ describe Chef::Client do
end
it "runs ohai with only the minimum required plugins" do
- expected_filter = %w{fqdn machinename hostname platform platform_version ohai_time os os_version}
+ expected_filter = %w{fqdn machinename hostname platform platform_version ohai_time os os_version init_package}
expect(ohai_system).to receive(:all_plugins).with(expected_filter)
client.run_ohai
end | minimal_ohai: Add init_package plugin as a required plugin
This is a pretty critical bit of data and we're using it for decisions
in the timezone resource now. |
diff --git a/examples/python/helloworld/greeter_client_with_options.py b/examples/python/helloworld/greeter_client_with_options.py
index <HASH>..<HASH> 100644
--- a/examples/python/helloworld/greeter_client_with_options.py
+++ b/examples/python/helloworld/greeter_client_with_options.py
@@ -31,7 +31,7 @@ def run():
target='localhost:50051',
options=[('grpc.lb_policy_name', 'pick_first'),
('grpc.enable_retries', 0),
- ('grpc.keepalive_timeout_ms', 10)]) as channel:
+ ('grpc.keepalive_timeout_ms', 10000)]) as channel:
stub = helloworld_pb2_grpc.GreeterStub(channel)
# timeout in second
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'), timeout=1) | Update keepalive timeout: <I> -> <I> |
diff --git a/src/utils/pluginOptions.js b/src/utils/pluginOptions.js
index <HASH>..<HASH> 100644
--- a/src/utils/pluginOptions.js
+++ b/src/utils/pluginOptions.js
@@ -6,7 +6,7 @@ const defaultSettings = {
const defaultMethods = ['debug', 'error', 'exception', 'info', 'log', 'warn'];
-// this should deep merge in the furture when we are dealing with more than just flags
+// this should deep merge in the future when we are dealing with more than just flags
const mergeOptions = options => {
const sanitizedOptions = Object.keys(options || {})
.filter(key => Object.keys(defaultSettings).includes(key)) | chore(docs): update typo |
diff --git a/resources/lang/zh-CN/cachet.php b/resources/lang/zh-CN/cachet.php
index <HASH>..<HASH> 100644
--- a/resources/lang/zh-CN/cachet.php
+++ b/resources/lang/zh-CN/cachet.php
@@ -53,7 +53,7 @@ return [
// Service Status
'service' => [
- 'good' => '[0,1] 系统工作正常|[2,*] 所有系统工作正常',
+ 'good' => '[0,1]System operational|[2,*]All systems are operational',
'bad' => '[0,1] 系统出现了问题|[2,*] 一些系统出现了问题',
'major' => '[0,1] 系统出现重大故障|[2,*] 一些系统出现重大故障',
], | New translations cachet.php (Chinese Simplified) |
diff --git a/Integration/TrustedFormIntegration.php b/Integration/TrustedFormIntegration.php
index <HASH>..<HASH> 100644
--- a/Integration/TrustedFormIntegration.php
+++ b/Integration/TrustedFormIntegration.php
@@ -108,7 +108,8 @@ class TrustedFormIntegration extends AbstractEnhancerIntegration
],
];
- for ($try = 0; $try < 3; ++$try) {
+ $tryLimit = 5;
+ for ($try = 1; $try < $tryLimit; ++$try) {
$response = $this->makeRequest($trustedFormClaim, $parameters, 'post', $settings);
if (!$response || !isset($response->body)) {
$this->logger->error( | [ENG-<I>] Increase TrustedForm retry count from 3/5. |
diff --git a/client/mocknetconn_test.go b/client/mocknetconn_test.go
index <HASH>..<HASH> 100644
--- a/client/mocknetconn_test.go
+++ b/client/mocknetconn_test.go
@@ -24,7 +24,7 @@ type mockNetConn struct {
rc chan bool
closed bool
- rt, wt int64
+ rt, wt time.Time
}
func MockNetConn(t *testing.T) *mockNetConn {
@@ -143,18 +143,18 @@ func (m *mockNetConn) RemoteAddr() net.Addr {
return &net.IPAddr{net.IPv4(127, 0, 0, 1)}
}
-func (m *mockNetConn) SetTimeout(ns int64) error {
- m.rt = ns
- m.wt = ns
+func (m *mockNetConn) SetDeadline(t time.Time) error {
+ m.rt = t
+ m.wt = t
return nil
}
-func (m *mockNetConn) SetReadTimeout(ns int64) error {
- m.rt = ns
+func (m *mockNetConn) SetReadDeadline(t time.Time) error {
+ m.rt = t
return nil
}
-func (m *mockNetConn) SetWriteTimeout(ns int64) error {
- m.wt = ns
+func (m *mockNetConn) SetWriteDeadline(t time.Time) error {
+ m.wt = t
return nil
} | Mock net.Conn needs updating for interface changes. |
diff --git a/src/Extension/SimpleExtension.php b/src/Extension/SimpleExtension.php
index <HASH>..<HASH> 100644
--- a/src/Extension/SimpleExtension.php
+++ b/src/Extension/SimpleExtension.php
@@ -34,7 +34,7 @@ abstract class SimpleExtension extends AbstractExtension implements ServiceProvi
$this->extendMenuService();
$this->extendAssetServices();
$this->extendNutService();
- $this->addTranslations();
+ $this->extendTranslatorService();
$this->registerServices($app);
} | Renamed function in TranslationTrait.
(cherry picked from commit a<I>cc8e) |
diff --git a/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java b/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java
index <HASH>..<HASH> 100644
--- a/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java
+++ b/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java
@@ -180,6 +180,10 @@ public class GraphHopperServlet extends GHBaseServlet
Map<String, Object> map = routeSerializer.toJSON(ghRsp, calcPoints, pointsEncoded,
enableElevation, enableInstructions);
+ Object infoMap = map.get("info");
+ if (infoMap != null)
+ ((Map) infoMap).put("took", Math.round(took * 1000));
+
if (ghRsp.hasErrors())
writeJsonError(httpRes, SC_BAD_REQUEST, new JSONObject(map));
else
@@ -199,7 +203,7 @@ public class GraphHopperServlet extends GHBaseServlet
res.setContentType("application/xml");
else
res.setContentType("application/gpx+xml");
-
+
String trackName = getParam(req, "trackname", "GraphHopper Track");
res.setHeader("Content-Disposition", "attachment;filename=" + "GraphHopper.gpx");
long time = getLongParam(req, "millis", System.currentTimeMillis()); | roll back 'removing took', #<I> |
diff --git a/master/buildbot/status/web/console.py b/master/buildbot/status/web/console.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/status/web/console.py
+++ b/master/buildbot/status/web/console.py
@@ -291,15 +291,6 @@ class ConsoleStatusResource(HtmlResource):
# We want to display this builder.
tags = builder.getTags() or ["default"]
-
- # Strip the category to keep only the text before the first |.
- # This is a hack to support the chromium usecase where they have
- # multiple tags for each slave. We use only the first one.
- # TODO(nsylvain): Create another way to specify "display category"
- # in master.cfg.
- if len(tags)==1:
- tags = tags[0].split('|')
-
for tag in tags:
# Append this builder to the dictionary of builders.
builderList.setdefault(tag, []).append(builderName) | console.py: remove a purported chromium workaround from <I>
It's not clear what this code was intended to do and not sure if it should even still work like that |
diff --git a/tests/smbo/TransferTest.php b/tests/smbo/TransferTest.php
index <HASH>..<HASH> 100644
--- a/tests/smbo/TransferTest.php
+++ b/tests/smbo/TransferTest.php
@@ -24,6 +24,9 @@ class TransferTest extends SMBOTestCase
$this->assertEquals(100, $boi->reload()['balance']);
$data = $t->export(['id', 'transfer_document_id']);
+ usort($data, function($e1, $e2) {
+ return ($e1['id'] < $e2['id'] ? -1 : 1);
+ });
$this->assertEquals([
['id' => '1', 'transfer_document_id' => '2'],
['id' => '2', 'transfer_document_id' => '1'], | Sort array before compare - not doing this, made testTransfer() fail on some occasions |
diff --git a/src/app/Traits/InCents.php b/src/app/Traits/InCents.php
index <HASH>..<HASH> 100644
--- a/src/app/Traits/InCents.php
+++ b/src/app/Traits/InCents.php
@@ -2,6 +2,7 @@
namespace LaravelEnso\Helpers\app\Traits;
+use Illuminate\Database\Eloquent\Relations\Pivot;
use LogicException;
use LaravelEnso\Helpers\app\Classes\Decimals;
@@ -14,6 +15,9 @@ trait InCents
public static function bootInCents()
{
self::retrieved(function ($model) {
+
+ \Log::debug('retrieved '. get_class($model));
+
$model->inCents = true;
});
@@ -24,7 +28,7 @@ trait InCents
public function inCents(bool $mode = true)
{
- if ($this->inCents === null) {
+ if ($this->inCents === null && ! $this instanceof Pivot) {
if (collect($this->getDirty())->keys()
->intersect($this->centAttributes)->isNotEmpty()) {
throw new LogicException( | updates in cents to handle Pivot models |
diff --git a/cs-mail/src/main/java/io/cloudslang/content/mail/services/GetMailMessage.java b/cs-mail/src/main/java/io/cloudslang/content/mail/services/GetMailMessage.java
index <HASH>..<HASH> 100644
--- a/cs-mail/src/main/java/io/cloudslang/content/mail/services/GetMailMessage.java
+++ b/cs-mail/src/main/java/io/cloudslang/content/mail/services/GetMailMessage.java
@@ -222,7 +222,10 @@ public class GetMailMessage {
}
}
- message.getFolder().close(true);
+ try {
+ message.getFolder().close(true);
+ } catch (Throwable ignore) {
+ }
result.put(RETURN_CODE, SUCCESS_RETURN_CODE);
} catch (Exception e) { | FIX GetMailMessage (#<I>)
* FIX GetMailMessage
Fix operation to be able to retrieve larger file than 4 MB |
diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/helpers.php
+++ b/src/Illuminate/Foundation/helpers.php
@@ -781,7 +781,7 @@ if (! function_exists('trans')) {
* @param string $id
* @param array $replace
* @param string $locale
- * @return \Illuminate\Contracts\Translation\Translator|string
+ * @return \Illuminate\Contracts\Translation\Translator|string|array|null
*/
function trans($id = null, $replace = [], $locale = null)
{ | trans helper return type doc (#<I>)
Matching the return types for the `trans` method in the Translator class. |
diff --git a/spec/main-spec.js b/spec/main-spec.js
index <HASH>..<HASH> 100644
--- a/spec/main-spec.js
+++ b/spec/main-spec.js
@@ -100,4 +100,31 @@ describe('RangePool', function() {
expect(workerSecond.startIndex).toBe(525)
expect(workerSecond.limitIndex).toBe(999)
})
+
+ it('re-uses old unfinished died workers even if that means one', function() {
+ const pool = new RangePool(90)
+ const workerA = pool.createWorker()
+ workerA.advance(50)
+ workerA.dispose()
+ expect(workerA.isActive()).toBe(false)
+ const workerB = pool.createWorker()
+ expect(workerA).toBe(workerB)
+ expect(workerB.isActive()).toBe(true)
+ })
+
+ it('re-uses old unfinished died workers no matter how many', function() {
+ const pool = new RangePool(50)
+ const workerA = pool.createWorker()
+ workerA.advance(5)
+ const workerB = pool.createWorker()
+ workerB.advance(5)
+ const workerC = pool.createWorker()
+ expect(workerC.isActive()).toBe(true)
+ workerC.dispose()
+ expect(workerC.isActive()).toBe(false)
+ const workerD = pool.createWorker()
+ expect(workerD).toBe(workerC)
+ expect(workerD.isActive()).toBe(true)
+ expect(workerC.isActive()).toBe(true)
+ })
}) | :new: Add specs for new range behavior |
diff --git a/app/values/timeline/event.rb b/app/values/timeline/event.rb
index <HASH>..<HASH> 100644
--- a/app/values/timeline/event.rb
+++ b/app/values/timeline/event.rb
@@ -8,6 +8,14 @@ module Timeline
end
end
+ def title
+ I18n.t("classes.#{self.class.name.underscore}")
+ end
+
+ def description
+ self.inspect
+ end
+
def <=>(other)
happened_at <=> other.happened_at
end | Added default title and description methods on Timeline::Event. |
diff --git a/fs/fsio.py b/fs/fsio.py
index <HASH>..<HASH> 100644
--- a/fs/fsio.py
+++ b/fs/fsio.py
@@ -35,13 +35,13 @@ def write_file(filepath, contents, ftype = 'w'):
output_handle.write(contents)
output_handle.close()
-def open_temp_file(path, ftype = 'w'):
- F, fname = tempfile.mkstemp(dir = path)
+def open_temp_file(path, ftype = 'w', suffix = '', prefix = ''):
+ F, fname = tempfile.mkstemp(dir = path, suffix = suffix, prefix = prefix)
output_handle = os.fdopen(F, ftype)
return output_handle, fname
-def write_temp_file(path, contents, ftype = 'w'):
- output_handle, fname = open_temp_file(path, ftype = ftype)
+def write_temp_file(path, contents, ftype = 'w', suffix = '', prefix = ''):
+ output_handle, fname = open_temp_file(path, ftype = ftype, suffix = suffix, prefix = prefix)
output_handle.write(contents)
output_handle.close()
return fname | Adding prefix and suffix options to temporary file wrappers around mkstemp. |
diff --git a/p2p/security/tls/extension.go b/p2p/security/tls/extension.go
index <HASH>..<HASH> 100644
--- a/p2p/security/tls/extension.go
+++ b/p2p/security/tls/extension.go
@@ -1,7 +1,6 @@
package libp2ptls
-// TODO: get an assigment for a valid OID
-var extensionPrefix = []int{1, 3, 6, 1, 4, 1, 123456789}
+var extensionPrefix = []int{1, 3, 6, 1, 4, 1, 53594}
// getPrefixedExtensionID returns an Object Identifier
// that can be used in x509 Certificates.
diff --git a/p2p/security/tls/extension_test.go b/p2p/security/tls/extension_test.go
index <HASH>..<HASH> 100644
--- a/p2p/security/tls/extension_test.go
+++ b/p2p/security/tls/extension_test.go
@@ -7,7 +7,7 @@ import (
var _ = Describe("Extensions", func() {
It("generates a prefixed extension ID", func() {
- Expect(getPrefixedExtensionID([]int{13, 37})).To(Equal([]int{1, 3, 6, 1, 4, 1, 123456789, 13, 37}))
+ Expect(getPrefixedExtensionID([]int{13, 37})).To(Equal([]int{1, 3, 6, 1, 4, 1, 53594, 13, 37}))
})
It("compares extension IDs", func() { | use the new Protocol Labs PEN for the certificate extension |
diff --git a/pygal/test/test_graph.py b/pygal/test/test_graph.py
index <HASH>..<HASH> 100644
--- a/pygal/test/test_graph.py
+++ b/pygal/test/test_graph.py
@@ -20,6 +20,7 @@ import os
import pygal
import uuid
import sys
+from pygal import i18n
from pygal.util import cut
from pygal._compat import u
from pygal.test import pytest_generate_tests, make_data
@@ -69,6 +70,8 @@ def test_metadata(Chart):
v = range(7)
if Chart == pygal.XY:
v = list(map(lambda x: (x, x + 1), v))
+ elif Chart == pygal.Worldmap:
+ v = list(map(lambda x: x, i18n.COUNTRIES))
chart.add('Serie with metadata', [
v[0],
diff --git a/pygal/util.py b/pygal/util.py
index <HASH>..<HASH> 100644
--- a/pygal/util.py
+++ b/pygal/util.py
@@ -346,6 +346,7 @@ def prepare_values(raw, config, cls):
(width - len(raw_values)) * [None] # aligning values
if len(raw_values) < width else [])):
if isinstance(raw_value, dict):
+ raw_value = dict(raw_value)
value = raw_value.pop('value', None)
metadata[index] = raw_value
else: | Fixes tests on the worldmap |
diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
index <HASH>..<HASH> 100644
--- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
+++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
@@ -155,6 +155,16 @@ class LaravelLogViewer
return null;
}
+ if (!is_readable($this->file)) {
+ return [[
+ 'context' => '',
+ 'level' => '',
+ 'date' => null,
+ 'text' => 'Log file "' . $this->file . '" not readable',
+ 'stack' => '',
+ ]];
+ }
+
$file = app('files')->get($this->file);
preg_match_all($this->pattern->getPattern('logs'), $file, $headings); | Check that file is readable (#<I>) |
diff --git a/java/src/org/openqa/selenium/remote/Browser.java b/java/src/org/openqa/selenium/remote/Browser.java
index <HASH>..<HASH> 100644
--- a/java/src/org/openqa/selenium/remote/Browser.java
+++ b/java/src/org/openqa/selenium/remote/Browser.java
@@ -72,4 +72,8 @@ public interface Browser {
return browserName().equals(browserName) || "Safari".equals(browserName);
}
};
+
+ default String toJson() {
+ return browserName();
+ }
} | Add a `toJson` method to `Browser` so it becomes easier to use in Capabilities |
diff --git a/app/serializers/shipit/stack_serializer.rb b/app/serializers/shipit/stack_serializer.rb
index <HASH>..<HASH> 100644
--- a/app/serializers/shipit/stack_serializer.rb
+++ b/app/serializers/shipit/stack_serializer.rb
@@ -3,7 +3,7 @@ module Shipit
include ConditionalAttributes
has_one :lock_author
- attributes :id, :repo_owner, :repo_name, :environment, :html_url, :url, :tasks_url, :deploy_spec,
+ attributes :id, :repo_owner, :repo_name, :environment, :html_url, :url, :tasks_url, :deploy_url, :deploy_spec,
:undeployed_commits_count, :is_locked, :lock_reason, :continuous_deployment, :created_at, :updated_at
def url | Publish Stack#deploy_url in API and hooks |
diff --git a/lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php b/lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php
index <HASH>..<HASH> 100644
--- a/lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php
+++ b/lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php
@@ -124,6 +124,7 @@ class LayoutResolverQueryHandler extends QueryHandler
->addOrderBy('rd.priority', 'DESC');
$this->applyStatusCondition($query, Rule::STATUS_PUBLISHED, 'r.status');
+ $this->applyStatusCondition($query, Rule::STATUS_PUBLISHED, 'rt.status');
if (!isset($this->targetHandlers[$targetType])) {
throw new RuntimeException( | Fix layout resolver matching using all statuses for targets |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.