hash
stringlengths 40
40
| diff
stringlengths 131
26.7k
| message
stringlengths 7
694
| project
stringlengths 5
67
| split
stringclasses 1
value | diff_languages
stringlengths 2
24
|
---|---|---|---|---|---|
0e959c4d22f89d92a6d9b7134011d90fa26104d6
|
diff --git a/python/vaex/export.py b/python/vaex/export.py
index <HASH>..<HASH> 100644
--- a/python/vaex/export.py
+++ b/python/vaex/export.py
@@ -1,12 +1,19 @@
__author__ = 'maartenbreddels'
import numpy as np
-import h5py
+import os
from . import logging
import vaex
import vaex.utils
import vaex.execution
import vaex.io.colfits
+
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+try:
+ import h5py
+except:
+ if not on_rtd:
+ raise
#from vaex.dataset import DatasetLocal
logger = logging.getLogger("vaex.export")
|
ignore failed import on rtd
|
vaexio_vaex
|
train
|
py
|
1c893ff8aa295731d433305824a035c22b7c451f
|
diff --git a/exp/callback/init.go b/exp/callback/init.go
index <HASH>..<HASH> 100644
--- a/exp/callback/init.go
+++ b/exp/callback/init.go
@@ -23,10 +23,23 @@ func init() {
}
// Func holds a pointer to the C callback function.
-// It can be used by converting it to a function pointer
-// with type void (*callback)(void (*f)(void*), void *arg);
// When called, it calls the provided function f in a
-// a Go context.
+// a Go context with the given argument.
+//
+// It can be used by first converting it to a function pointer
+// and then calling from C.
+// Here is an example that sets up the callback function:
+// //static void (*callback)(void (*f)(void*), void *arg);
+// //void setCallback(void *c){
+// // callback = c;
+// //}
+// import "C"
+// import "rog-go.googlecode.com/hg/exp/callback"
+//
+// func init() {
+// C.setCallback(callback.Func)
+// }
+//
var Func = callbackFunc
var callbackFunc = unsafe.Pointer(C.callbackFunc())
|
update doc comments for callback.
|
rogpeppe_godef
|
train
|
go
|
e69fa6ccbbb57d44135afbc59f075699c56d3f71
|
diff --git a/mock_test.go b/mock_test.go
index <HASH>..<HASH> 100644
--- a/mock_test.go
+++ b/mock_test.go
@@ -1,4 +1,4 @@
-package serf
+package serfer
import (
"github.com/hashicorp/serf/serf"
@@ -6,6 +6,17 @@ import (
"github.com/stretchr/testify/mock"
)
+// MockEventHandler mocks a basic Event handler.
+type MockEventHandler struct {
+ mock.Mock
+}
+
+// HandleEvent processes member events.
+func (m *MockEventHandler) HandleEvent(e serf.Event) {
+ m.Called(e)
+ return
+}
+
// MockMemberEventHandler mocks MemberEvent handlers.
type MockMemberEventHandler struct {
mock.Mock
|
Add MockEventHandler and rename package
|
blacklabeldata_serfer
|
train
|
go
|
9cf3ae8a40b8235dd36eff1b5e8d07c0edf2cd87
|
diff --git a/Test/Integration/Collection/CollectionTestBase.php b/Test/Integration/Collection/CollectionTestBase.php
index <HASH>..<HASH> 100644
--- a/Test/Integration/Collection/CollectionTestBase.php
+++ b/Test/Integration/Collection/CollectionTestBase.php
@@ -39,7 +39,7 @@ class CollectionTestBase extends KernelTestBase {
// Create a module list service, using our subclass that lets us hack in
// the discovery.
$module_list = new TestModuleExtensionList(
- $this->container->get('app.root'),
+ $this->container->getParameter('app.root'),
'module',
$this->container->get('cache.default'),
$this->container->get('info_parser'),
|
Updated for deprecated Drupal service.
|
drupal-code-builder_drupal-code-builder
|
train
|
php
|
423288d2feda4d1a80edf55b4b065293dfd3f8f0
|
diff --git a/src/Psalm/Internal/Type/NegatedAssertionReconciler.php b/src/Psalm/Internal/Type/NegatedAssertionReconciler.php
index <HASH>..<HASH> 100644
--- a/src/Psalm/Internal/Type/NegatedAssertionReconciler.php
+++ b/src/Psalm/Internal/Type/NegatedAssertionReconciler.php
@@ -869,14 +869,16 @@ class NegatedAssertionReconciler extends Reconciler
|| $existing_var_type->hasScalar();
foreach ($existing_var_type->getTypes() as $type) {
- if (!$type->isNumericType()) {
- $non_numeric_types[] = $type;
- } elseif ($type instanceof TTemplateParam) {
+ if ($type instanceof TTemplateParam) {
if (!$type->as->hasNumeric()) {
+ if ($type->as->hasMixed()) {
+ $did_remove_type = true;
+ }
+
$non_numeric_types[] = $type;
}
-
- $did_remove_type = true;
+ } elseif (!$type->isNumericType()) {
+ $non_numeric_types[] = $type;
} else {
$did_remove_type = true;
}
|
Fix negations of templated numeric
|
vimeo_psalm
|
train
|
php
|
11d2e7480995154d4fbbaa2d007aabb05e978499
|
diff --git a/desktop/ui/src/main/java/org/datacleaner/windows/CreateTableDialog.java b/desktop/ui/src/main/java/org/datacleaner/windows/CreateTableDialog.java
index <HASH>..<HASH> 100644
--- a/desktop/ui/src/main/java/org/datacleaner/windows/CreateTableDialog.java
+++ b/desktop/ui/src/main/java/org/datacleaner/windows/CreateTableDialog.java
@@ -221,7 +221,7 @@ public class CreateTableDialog extends AbstractDialog {
}
});
- final JButton removeAllColumnsButton = WidgetFactory.createSmallButton("Remove all column",
+ final JButton removeAllColumnsButton = WidgetFactory.createSmallButton("Remove all columns",
IconUtils.ACTION_REMOVE);
removeAllColumnsButton.setForeground(WidgetUtils.ADDITIONAL_COLOR_RED_BRIGHT);
removeAllColumnsButton.addActionListener(new ActionListener() {
|
Added "s" to column in the button label
|
datacleaner_DataCleaner
|
train
|
java
|
4f89832a8dde2d5a49da3c2a07be9224f3273542
|
diff --git a/andes/core/service.py b/andes/core/service.py
index <HASH>..<HASH> 100644
--- a/andes/core/service.py
+++ b/andes/core/service.py
@@ -80,6 +80,9 @@ class BaseService(object):
"""
return self.__class__.__name__
+ def __repr__(self):
+ return f'{self.class_name}: {self.owner.class_name}.{self.name}'
+
class ConstService(BaseService):
"""
diff --git a/andes/core/var.py b/andes/core/var.py
index <HASH>..<HASH> 100644
--- a/andes/core/var.py
+++ b/andes/core/var.py
@@ -133,7 +133,7 @@ class BaseVar(object):
if span:
span = ' [' + span + ']'
- return f'{self.__class__.__name__}, {self.owner.__class__.__name__}.{self.name}{span}'
+ return f'{self.__class__.__name__}: {self.owner.__class__.__name__}.{self.name}{span}'
def set_address(self, addr: ndarray, contiguous=False):
"""
|
Added __repr__ for service
|
cuihantao_andes
|
train
|
py,py
|
b34fb3b7b63100aded28ed055cf712a9aabe1db5
|
diff --git a/src/Sink.php b/src/Sink.php
index <HASH>..<HASH> 100644
--- a/src/Sink.php
+++ b/src/Sink.php
@@ -2,7 +2,6 @@
namespace ksmz\nana;
-use Closure;
use ksmz\nana\Exceptions\NonExistentClientException;
use ksmz\nana\Exceptions\ClientAlreadyRegisteredException;
@@ -25,7 +24,7 @@ class Sink
*
* @throws \ksmz\nana\Exceptions\ClientAlreadyRegisteredException
*/
- public static function register(string $name = 'default', $config)
+ public static function register(string $name, $config)
{
if (\array_key_exists($name, static::$faucets)) {
throw new ClientAlreadyRegisteredException("[{$name}] is already exists in the sink.");
|
Apply fixes from StyleCI (#2)
|
matical_nana
|
train
|
php
|
0ae462fb80b8a95e38af08d894ea9ecf9e45f2e7
|
diff --git a/params/version.go b/params/version.go
index <HASH>..<HASH> 100644
--- a/params/version.go
+++ b/params/version.go
@@ -21,10 +21,10 @@ import (
)
const (
- VersionMajor = 1 // Major version component of the current release
- VersionMinor = 8 // Minor version component of the current release
- VersionPatch = 16 // Patch version component of the current release
- VersionMeta = "stable" // Version metadata to append to the version string
+ VersionMajor = 1 // Major version component of the current release
+ VersionMinor = 8 // Minor version component of the current release
+ VersionPatch = 17 // Patch version component of the current release
+ VersionMeta = "unstable" // Version metadata to append to the version string
)
// Version holds the textual version string.
diff --git a/swarm/version/version.go b/swarm/version/version.go
index <HASH>..<HASH> 100644
--- a/swarm/version/version.go
+++ b/swarm/version/version.go
@@ -21,10 +21,10 @@ import (
)
const (
- VersionMajor = 0 // Major version component of the current release
- VersionMinor = 3 // Minor version component of the current release
- VersionPatch = 4 // Patch version component of the current release
- VersionMeta = "stable" // Version metadata to append to the version string
+ VersionMajor = 0 // Major version component of the current release
+ VersionMinor = 3 // Minor version component of the current release
+ VersionPatch = 5 // Patch version component of the current release
+ VersionMeta = "unstable" // Version metadata to append to the version string
)
// Version holds the textual version string.
|
params, swarm: begin Geth <I>, Swarm <I> cycle
|
ethereum_go-ethereum
|
train
|
go,go
|
5b304e5026e2af16eb1307cab9874368b2adea1a
|
diff --git a/lib/vagrant-vbguest/installers/linux.rb b/lib/vagrant-vbguest/installers/linux.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant-vbguest/installers/linux.rb
+++ b/lib/vagrant-vbguest/installers/linux.rb
@@ -62,6 +62,13 @@ module VagrantVbguest
vm.channel.test('lsmod | grep vboxsf', opts, &block)
end
+ # This overrides {VagrantVbguest::Installers::Base#guest_version}
+ # to also query the `VBoxService` on the host system (if available)
+ # for it's version.
+ # In some scenarios the results of the VirtualBox driver and the
+ # additions installed on the host may differ. If this happens, we
+ # assume, that the host binaries are right and yield a warning message.
+ #
# @return [String] The version code of the VirtualBox Guest Additions
# available on the guest, or `nil` if none installed.
def guest_version(reload = false)
|
Add more docs to the overridden `guest_version` method of the generic linux installer
|
dotless-de_vagrant-vbguest
|
train
|
rb
|
92a2363804ed7c6048094e15b51dd1779ecbc590
|
diff --git a/interop/interop_client.js b/interop/interop_client.js
index <HASH>..<HASH> 100644
--- a/interop/interop_client.js
+++ b/interop/interop_client.js
@@ -318,8 +318,8 @@ var test_cases = {
empty_stream: emptyStream,
cancel_after_begin: cancelAfterBegin,
cancel_after_first_response: cancelAfterFirstResponse,
- compute_engine_creds: _.partial(authTest, AUTH_USER),
- service_account_creds: _.partial(authTest, COMPUTE_ENGINE_USER)
+ compute_engine_creds: _.partial(authTest, COMPUTE_ENGINE_USER),
+ service_account_creds: _.partial(authTest, AUTH_USER)
};
/**
|
Reversed accidentally swapped test cases
|
grpc_grpc-node
|
train
|
js
|
19929820a9ef1ba52a3d4eb3dfe15744455b5f48
|
diff --git a/pipenv/environments.py b/pipenv/environments.py
index <HASH>..<HASH> 100644
--- a/pipenv/environments.py
+++ b/pipenv/environments.py
@@ -35,8 +35,7 @@ PIPENV_YES = bool(os.environ.get('PIPENV_YES'))
PIPENV_MAX_SUBPROCESS = int(os.environ.get('PIPENV_MAX_SUBPROCESS', '8'))
# User-configurable max-depth for Pipfile searching.
-# Note: +1 because of a temporary bug in Pipenv.
-PIPENV_MAX_DEPTH = int(os.environ.get('PIPENV_MAX_DEPTH', '3')) + 1
+PIPENV_MAX_DEPTH = int(os.environ.get('PIPENV_MAX_DEPTH', '3'))
# Tells Pipenv to use the virtualenv-provided pip instead.
PIPENV_VIRTUALENV = None
|
remove PIPENV_MAX_DEPTH workaround
|
pypa_pipenv
|
train
|
py
|
436bf593b977f76cb23a813d0fed1d0e880a9677
|
diff --git a/malcolm/assemblyutil.py b/malcolm/assemblyutil.py
index <HASH>..<HASH> 100644
--- a/malcolm/assemblyutil.py
+++ b/malcolm/assemblyutil.py
@@ -225,7 +225,7 @@ def call_with_map(ob, name, d, *args):
ob = getattr(ob, n)
if d and "name" not in ob.MethodMeta.takes.elements and "name" in d:
- d = d.copy()
+ d = dict(d)
d.pop("name")
params = ob.MethodMeta.prepare_input_map(d)
args += (params,)
|
ruamel.ordereddict doesn't support copying, us a normal one
|
dls-controls_pymalcolm
|
train
|
py
|
c3d649f6abe39f121ecedc9ea2e269152899fda6
|
diff --git a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java
index <HASH>..<HASH> 100644
--- a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java
+++ b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java
@@ -179,6 +179,10 @@ final class CameraConfigurationManager {
CameraConfigurationUtils.setMetering(parameters);
}
+ //SetRecordingHint to true also a workaround for low framerate on Nexus 4
+ //https://stackoverflow.com/questions/14131900/extreme-camera-lag-on-nexus-4
+ parameters.setRecordingHint(true);
+
}
parameters.setPreviewSize(bestPreviewSize.x, bestPreviewSize.y);
|
Added a workaround for low framerate issue on Nexus 4 (#<I>)
* Added a workaround for low framerate issue on Nexus 4
* Move setRecordingHint to general camera configuration
* change the location of setRecordingHint
|
zxing_zxing
|
train
|
java
|
6234787515e2f0ece40b6408722ff0b42824038e
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -61,8 +61,14 @@ master_doc = "index"
# General information about the project.
project = "Adafruit seesaw Library"
+creation_year = "2017"
current_year = str(datetime.datetime.now().year)
-copyright = current_year + " Dean Miller"
+year_duration = (
+ current_year
+ if current_year == creation_year
+ else creation_year + " - " + current_year
+)
+copyright = year_duration + " Dean Miller"
author = "Dean Miller"
# The version info for the project you're documenting, acts as replacement for
|
Use year duration range for copyright attribution
|
adafruit_Adafruit_CircuitPython_seesaw
|
train
|
py
|
1102e282fd495bc07b0a3251d39e2746a3a087ff
|
diff --git a/tests/test_sqs/test_sqs.py b/tests/test_sqs/test_sqs.py
index <HASH>..<HASH> 100644
--- a/tests/test_sqs/test_sqs.py
+++ b/tests/test_sqs/test_sqs.py
@@ -1517,9 +1517,9 @@ def test_message_becomes_inflight_when_received():
@mock_sqs
def test_message_becomes_inflight_when_received_boto3():
- sqs = boto3.resource("sqs", region_name="us-east-1")
+ sqs = boto3.resource("sqs", region_name="eu-west-1")
queue = sqs.create_queue(
- QueueName=str(uuid4())[0:6], Attributes={"VisibilityTimeout ": "1"}
+ QueueName=str(uuid4())[0:6], Attributes={"VisibilityTimeout ": "2"}
)
queue.attributes["ApproximateNumberOfMessages"].should.equal("0")
@@ -1537,7 +1537,7 @@ def test_message_becomes_inflight_when_received_boto3():
queue.attributes["ApproximateNumberOfMessages"].should.equal("0")
# Wait
- time.sleep(2)
+ time.sleep(3)
queue.reload()
queue.attributes["ApproximateNumberOfMessages"].should.equal("1")
|
SQS - try circumvent test errors (#<I>)
|
spulec_moto
|
train
|
py
|
c2ecfb1681afba731f2077ce241cf22fa0075106
|
diff --git a/lib/credit_card_validations/detector.rb b/lib/credit_card_validations/detector.rb
index <HASH>..<HASH> 100644
--- a/lib/credit_card_validations/detector.rb
+++ b/lib/credit_card_validations/detector.rb
@@ -59,6 +59,7 @@ module CreditCardValidations
valid?(:#{brand})
end
BOOLEAN_RULE
+ rules[brand]
end
end
|
add_rule method now returns current brand rules
|
Fivell_credit_card_validations
|
train
|
rb
|
29375320ad81ea673119863f7bc9e5fb3d2fe887
|
diff --git a/src/PosInfo.js b/src/PosInfo.js
index <HASH>..<HASH> 100644
--- a/src/PosInfo.js
+++ b/src/PosInfo.js
@@ -31,9 +31,13 @@ PosInfo.prototype = {
shouldUseMemoizedResult: function(memoRec) {
var involvedApplications = memoRec.involvedApplications;
- for (var memoKey in involvedApplications) {
- if (involvedApplications[memoKey] && this.activeApplications[memoKey]) {
- return false;
+ if (involvedApplications != null) {
+ var keys = Object.keys(involvedApplications);
+ for (var i = 0; i < keys.length; ++i) {
+ var memoKey = keys[i];
+ if (involvedApplications[memoKey] && this.activeApplications[memoKey]) {
+ return false;
+ }
}
}
return true;
|
Remove for-in loop in PosInfo -- has significant effect on perf.
for-in loops can cause deoptimization in V8, and removing this
particular one results in almost a <I>% speedup in parsing the Ohm
source code with the grammar in examples/es5/.
|
harc_ohm
|
train
|
js
|
f9f67008ce2b9106766fc1b4b0b70122885e79f5
|
diff --git a/spec/unit/veritas/relation/header/union_spec.rb b/spec/unit/veritas/relation/header/union_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/veritas/relation/header/union_spec.rb
+++ b/spec/unit/veritas/relation/header/union_spec.rb
@@ -10,7 +10,7 @@ require File.expand_path('../../../../../spec_helper', __FILE__)
@other = Relation::Header.new([ @attribute2 ])
end
- subject { @header.union(@other) }
+ subject { @header.send(method, @other) }
it { should be_kind_of(Relation::Header) }
diff --git a/spec/unit/veritas/relation/intersect_spec.rb b/spec/unit/veritas/relation/intersect_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/veritas/relation/intersect_spec.rb
+++ b/spec/unit/veritas/relation/intersect_spec.rb
@@ -9,7 +9,7 @@ require File.expand_path('../../../../spec_helper', __FILE__)
@other = Relation.new(header, [ [ 2 ] ])
end
- subject { @relation.intersect(@other) }
+ subject { @relation.send(method, @other) }
it { should be_kind_of(Algebra::Intersection) }
|
Updated specs to ensure proper coverage for aliases
|
dkubb_axiom
|
train
|
rb,rb
|
78f1baaff0690edfc174c1b81c754ac1285ce789
|
diff --git a/lib/radiant.rb b/lib/radiant.rb
index <HASH>..<HASH> 100644
--- a/lib/radiant.rb
+++ b/lib/radiant.rb
@@ -6,7 +6,7 @@ unless defined? Radiant::Version
Major = '1'
Minor = '1'
Tiny = '0'
- Patch = 'alpha' # set to nil for normal release
+ Patch = 'beta' # set to nil for normal release
class << self
def to_s
|
bump to beta to prepare for some changes
|
radiant_radiant
|
train
|
rb
|
fc24103c5d1cdf405263163253a11e8dd8b2a227
|
diff --git a/code/template/filter/block.php b/code/template/filter/block.php
index <HASH>..<HASH> 100644
--- a/code/template/filter/block.php
+++ b/code/template/filter/block.php
@@ -313,8 +313,14 @@ class KTemplateFilterBlock extends KTemplateFilterDecorator
}
}
- $str = 'return ' . implode(' ', $words) . ';';
- $result = eval($str);
+ //Use the stream buffer to evaluate the condition
+ $str = '<?php return ' . implode(' ', $words) .';';
+
+ $buffer = $this->getObject('filesystem.stream.factory')->createStream('nooku-buffer://temp', 'w+b');
+ $buffer->truncate(0);
+ $buffer->write($str);
+
+ $result = include $buffer->getPath();
return $result;
}
|
re #<I> - Use a stream buffer to evaluate the block condition
|
timble_kodekit
|
train
|
php
|
4efa0754f57b466d6399f19c3cbb19fd70eaa1b2
|
diff --git a/lib/state_machine.rb b/lib/state_machine.rb
index <HASH>..<HASH> 100644
--- a/lib/state_machine.rb
+++ b/lib/state_machine.rb
@@ -47,7 +47,7 @@ module StateMachine
# result, you will not be able to access any class methods unless you refer
# to them directly (i.e. specifying the class name).
#
- # For examples on the types of configured state machines and blocks, see
+ # For examples on the types of state machine configurations and blocks, see
# the section below.
#
# == Examples
@@ -256,7 +256,7 @@ module StateMachine
#
# class Vehicle
# include DataMapper::Resource
- # property :id, Integer, :serial => true
+ # property :id, Serial
#
# state_machine :initial => :parked do
# event :ignite do
diff --git a/lib/state_machine/machine_collection.rb b/lib/state_machine/machine_collection.rb
index <HASH>..<HASH> 100644
--- a/lib/state_machine/machine_collection.rb
+++ b/lib/state_machine/machine_collection.rb
@@ -58,7 +58,7 @@ module StateMachine
#
# class Vehicle
# include DataMapper::Resource
- # property :id, Integer, :serial => true
+ # property :id, Serial
#
# state_machine :initial => :parked do
# event :ignite do
|
Update DataMapper examples in docs to use non-deprecated Serial property definitions
|
pluginaweek_state_machine
|
train
|
rb,rb
|
540a7452a5096321ae4079736e1b2ccc59720641
|
diff --git a/app/index.js b/app/index.js
index <HASH>..<HASH> 100644
--- a/app/index.js
+++ b/app/index.js
@@ -1,7 +1,7 @@
import React from 'react';
import { render } from 'react-dom';
import Dock from 'react-dock';
-import DevTools from 'remotedev-app';
+import DevTools from 'remotedev-app/lib';
render(
<Dock position="right" isVisible>
|
Fix remotedev-app lib path
|
jhen0409_remotedev-rn-debugger
|
train
|
js
|
644525eb9cce026e1dae538ef78d6eb3b5ffa779
|
diff --git a/gosu-core/src/main/java/gw/internal/gosu/parser/GosuParser.java b/gosu-core/src/main/java/gw/internal/gosu/parser/GosuParser.java
index <HASH>..<HASH> 100644
--- a/gosu-core/src/main/java/gw/internal/gosu/parser/GosuParser.java
+++ b/gosu-core/src/main/java/gw/internal/gosu/parser/GosuParser.java
@@ -10947,11 +10947,17 @@ public final class GosuParser extends ParserBase implements IGosuParser
verify( switchStmt, match( null, ":", SourceCodeTokenizer.TT_OPERATOR ), Res.MSG_EXPECTING_CASE_COLON );
verify( switchStmt, switchStmt.getDefaultStatements() == null, Res.MSG_MULTIPLE_DEFAULT_CLAUSES_NOT_PERMITTED );
-
- List<Statement> defaultStatements = new ArrayList<Statement>();
- parseStatementsAndDetectUnreachable( defaultStatements );
- switchStmt.setDefaultStatements( defaultStatements );
-
+ _symTable.pushScope();
+ try
+ {
+ List<Statement> defaultStatements = new ArrayList<Statement>();
+ parseStatementsAndDetectUnreachable( defaultStatements );
+ switchStmt.setDefaultStatements( defaultStatements );
+ }
+ finally
+ {
+ _symTable.popScope();
+ }
return true;
}
|
Fix scoping of local variables in default clause of a switch statement (PL-<I>)
|
gosu-lang_gosu-lang
|
train
|
java
|
ac5836e8dd5c73486179e5b9c3c0469a53c8b22a
|
diff --git a/lib/static/scripts/mumoro.js b/lib/static/scripts/mumoro.js
index <HASH>..<HASH> 100644
--- a/lib/static/scripts/mumoro.js
+++ b/lib/static/scripts/mumoro.js
@@ -133,6 +133,7 @@ function transformToDurationString(v) {
//Initialise the 'map' object
function init() {
+ adjustDivsToResolution();
document.getElementById('startAdr').value = initialStartText;
document.getElementById('endAdr').value = initialDestText;
cacheStart = "";
@@ -490,6 +491,12 @@ function centerToMap(start,dest) {
map.zoomToExtent( new OpenLayers.Bounds( left, bottom, right, top ) );
}
+function adjustDivsToResolution() {
+ hmap = $(window).height() / 32;
+ hmap = hmap * 23;
+ $("#map").height(hmap);
+}
+
function LonLatToPoint(ll) {
return new OpenLayers.Geometry.Point(ll.lon,ll.lat);
}
|
Recall js function for screen resolution calculations
|
Tristramg_mumoro
|
train
|
js
|
f56fa579fa560ebd62341a936618950a617d2d1f
|
diff --git a/DrdPlus/Codes/Theurgist/DemonCode.php b/DrdPlus/Codes/Theurgist/DemonCode.php
index <HASH>..<HASH> 100644
--- a/DrdPlus/Codes/Theurgist/DemonCode.php
+++ b/DrdPlus/Codes/Theurgist/DemonCode.php
@@ -67,7 +67,7 @@ class DemonCode extends AbstractTheurgistCode
self::CRON => 'kron',
self::DEMON_OF_MOVEMENT => 'démon pohybu',
self::WARDEN => 'správce',
- self::DEMON_OF_MUSIC => 'démon huudbý',
+ self::DEMON_OF_MUSIC => 'démon hudby',
self::DEMON_DEFENDER => 'démon obránce',
self::DEMON_GAMBLER => 'démon hazardér',
self::DEMON_OF_TIRELESSNESS => 'démon neúnavnosti',
|
Fixed czech name of the demon of music
|
drdplusinfo_drdplus-codes
|
train
|
php
|
b56f70a39a8b4f40ed537ce9768d205e3d29aa46
|
diff --git a/flaskext/mongoalchemy.py b/flaskext/mongoalchemy.py
index <HASH>..<HASH> 100644
--- a/flaskext/mongoalchemy.py
+++ b/flaskext/mongoalchemy.py
@@ -10,12 +10,12 @@
"""
from __future__ import absolute_import
-from mongoalchemy.document import Document
+from mongoalchemy import document
from mongoalchemy import session
from mongoalchemy import fields
def _include_mongoalchemy(obj):
- for module in session, fields:
+ for module in session, fields, document:
for key in dir(module):
if not hasattr(obj, key):
setattr(obj, key, getattr(module, key))
@@ -43,8 +43,6 @@ class MongoAlchemy(object):
"""
def __init__(self, app=None):
- self.Document = Document
-
_include_mongoalchemy(self)
if app is not None:
|
Some refatctoring based on present tests
|
cobrateam_flask-mongoalchemy
|
train
|
py
|
429965e48034c3920038de044dfb4416f302c67d
|
diff --git a/bokeh/mpl.py b/bokeh/mpl.py
index <HASH>..<HASH> 100644
--- a/bokeh/mpl.py
+++ b/bokeh/mpl.py
@@ -1,4 +1,3 @@
-from webutils import get_json
import numpy as np
import logging
import urlparse
@@ -14,6 +13,7 @@ import pandas
from exceptions import DataIntegrityException
from bokeh import protocol
+from bokeh.utils import get_json
log = logging.getLogger(__name__)
colors = [
diff --git a/bokeh/utils.py b/bokeh/utils.py
index <HASH>..<HASH> 100644
--- a/bokeh/utils.py
+++ b/bokeh/utils.py
@@ -1,3 +1,13 @@
import urlparse
def urljoin(*args):
return reduce(urlparse.urljoin, args)
+
+def get_json(request):
+ """request from requests library handles backwards compatability for
+ requests < 1.0
+ """
+ if hasattr(request.json, '__call__'):
+ return request.json()
+ else:
+ return request.json
+
|
Moving get_json() into utils.py, for consolidation
|
bokeh_bokeh
|
train
|
py,py
|
16f916374ecee6e5f48ba464ad0388bca3ec00e6
|
diff --git a/outline/manager.js b/outline/manager.js
index <HASH>..<HASH> 100644
--- a/outline/manager.js
+++ b/outline/manager.js
@@ -271,10 +271,12 @@ module.exports = function (doc) {
return predicateTD
} // outlinePredicateTD
-/** Render Tabbed set of home app panes
+/**
+ * Render Tabbed set of home app panes
+ *
* @param {Object} [options] A set of options you can provide
* @param {string} [options.selectedTab] To open a specific dashboard pane
- * @returns Promise<{Element}> - the div
+ * @returns Promise<{Element}> - the div that holds the dashboard
*/
async function globalAppTabs (options = {}) {
console.log('globalAppTabs @@')
@@ -369,8 +371,8 @@ module.exports = function (doc) {
this.getDashboardItems = getDashboardItems
/**
+ * Call this method to show the global dashboard.
*
- * @param {HTMLElement} container The element that the dashboard should append dashboard to
* @param {Object} [options] A set of options that can be passed
* @param {string} [options.pane] To open a specific dashboard pane
* @returns {Promise<void>}
@@ -424,6 +426,8 @@ module.exports = function (doc) {
/**
* Get element with id or create a new on the fly with that id
+ *
+ * @param {string} id The ID of the element you want to get or create
* @returns {HTMLElement}
*/
function getOrCreateContainer (id) {
|
Fixing up a bit on JSDocs parts related to latest changes
|
solid_solid-panes
|
train
|
js
|
85275be12afdbb2e9c2391f3dbe293b62a259ce1
|
diff --git a/src/listeners.js b/src/listeners.js
index <HASH>..<HASH> 100644
--- a/src/listeners.js
+++ b/src/listeners.js
@@ -378,7 +378,7 @@ export default class ListenerGenerator
scope: () => {
return this.scope || getScope(this.el);
},
- prettyName: getDataAttribute(this.el, 'as'),
+ prettyName: getDataAttribute(this.el, 'as') || this.el.title,
context,
getter,
listeners: this
|
add element.title as a fallback for pretty names closes #<I>
|
baianat_vee-validate
|
train
|
js
|
52888f193d95d7c93962351a25a88c6f886b3250
|
diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Repository/PlatformRepository.php
+++ b/src/Composer/Repository/PlatformRepository.php
@@ -26,7 +26,11 @@ class PlatformRepository extends ArrayRepository
{
parent::initialize();
- $version = BasePackage::parseVersion(PHP_VERSION);
+ try {
+ $version = BasePackage::parseVersion(PHP_VERSION);
+ } catch (\UnexpectedValueException $e) {
+ $version = BasePackage::parseVersion(preg_replace('#^(.+?)(-.+)?#', '$1', PHP_VERSION));
+ }
// TODO mark as type platform and create a special installer that skips it + one that throws an exception
$php = new MemoryPackage('php', $version['version'], $version['type']);
|
Fix version parsing of PHP on some linux distros
|
mothership-ec_composer
|
train
|
php
|
f255464bf41aee37e2461fb277a074f4863d4aa6
|
diff --git a/client/restarts.go b/client/restarts.go
index <HASH>..<HASH> 100644
--- a/client/restarts.go
+++ b/client/restarts.go
@@ -132,9 +132,15 @@ func (r *RestartTracker) handleStartError() (string, time.Duration) {
}
if r.count > r.policy.Attempts {
- r.reason = fmt.Sprintf("Exceeded allowed attempts %d in interval %v",
- r.policy.Attempts, r.policy.Interval)
- return structs.TaskNotRestarting, 0
+ if r.policy.Mode == structs.RestartPolicyModeFail {
+ r.reason = fmt.Sprintf(
+ `Exceeded allowed atttempts %d in interval %v and mode is "fail"`,
+ r.policy.Attempts, r.policy.Interval)
+ return structs.TaskNotRestarting, 0
+ } else {
+ r.reason = ReasonDelay
+ return structs.TaskRestarting, r.getDelay()
+ }
}
r.reason = ReasonWithinPolicy
|
if policy mode is delay, do not fail for multiple startup failures, delay instead
|
hashicorp_nomad
|
train
|
go
|
c1af91aa76736cf21827d0dd6d847d525646971e
|
diff --git a/src/Command/Service/RedisCliCommand.php b/src/Command/Service/RedisCliCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/Service/RedisCliCommand.php
+++ b/src/Command/Service/RedisCliCommand.php
@@ -70,6 +70,10 @@ class RedisCliCommand extends CommandBase
/** @var \Platformsh\Cli\Service\Shell $shell */
$shell = $this->getService('shell');
+ $this->stdErr->writeln(
+ sprintf('Connecting to Redis service via relationship <info>%s</info> on <info>%s</info>', $service['_relationship_name'], $sshUrl)
+ );
+
return $shell->executeSimple($sshCommand);
}
}
|
Expose redis relationship/URL explicitly
|
platformsh_platformsh-cli
|
train
|
php
|
24cd9c5e0c837b3b97b315e5b77544642b02ef00
|
diff --git a/lib/raven/event.rb b/lib/raven/event.rb
index <HASH>..<HASH> 100644
--- a/lib/raven/event.rb
+++ b/lib/raven/event.rb
@@ -59,10 +59,7 @@ module Raven
return unless configuration.exception_class_allowed?(exc)
new(options) do |evt|
- evt.message = "#{exc.class}: #{exc.message}"
-
evt.add_exception_interface(exc)
-
yield evt if block
end
end
|
feat: remove message duplicate (#<I>)
We currently send both message and exception. That causes data to render pretty ugly: <URL>
|
getsentry_raven-ruby
|
train
|
rb
|
d1e74951e83439c9cb2f003e6c2ed99b44d8ddb0
|
diff --git a/admin/jqadm/src/Admin/JQAdm/Customer/Standard.php b/admin/jqadm/src/Admin/JQAdm/Customer/Standard.php
index <HASH>..<HASH> 100644
--- a/admin/jqadm/src/Admin/JQAdm/Customer/Standard.php
+++ b/admin/jqadm/src/Admin/JQAdm/Customer/Standard.php
@@ -510,7 +510,8 @@ class Standard
protected function getGroupItems()
{
$list = [];
- $isAdmin = $this->getView()->access( ['super', 'admin'] );
+ $isSuper = $this->getView()->access( ['super'] );
+ $isAdmin = $this->getView()->access( ['admin'] );
$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/group' );
$search = $manager->createSearch();
@@ -518,7 +519,11 @@ class Standard
foreach( $manager->searchItems( $search ) as $groupId => $groupItem )
{
- if( $isAdmin == false && in_array( $groupItem->getCode(), ['super', 'admin', 'editor', 'viewer'] ) ) {
+ if( $isSuper == false && in_array( $groupItem->getCode(), ['super', 'admin'] ) ) {
+ continue;
+ }
+
+ if( $isAdmin == false && in_array( $groupItem->getCode(), ['super', 'admin', 'editor'] ) ) {
continue;
}
|
Don't allow admins to add the "admin" group to other users
|
aimeos_ai-admin-jqadm
|
train
|
php
|
ee6ebedb66edc09b5881e2a5fe65a65e8d46a17a
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -35,4 +35,5 @@ setup(
classifiers=CLASSIFIERS,
install_requires=['Django>=1.4', 'django-prices>=0.6.1', 'prices>=1.0.0-beta'],
platforms=['any'],
+ tests_require=['mock==1.0.1', 'pytest'],
zip_safe=False)
|
Restore tests_require to setup.py
|
mirumee_django-prices-openexchangerates
|
train
|
py
|
f8d8f0f6eff8cae1f1eeb82e23c50bc9db7e9fb5
|
diff --git a/qbit-core/src/main/java/io/advantageous/qbit/http/HttpServer.java b/qbit-core/src/main/java/io/advantageous/qbit/http/HttpServer.java
index <HASH>..<HASH> 100644
--- a/qbit-core/src/main/java/io/advantageous/qbit/http/HttpServer.java
+++ b/qbit-core/src/main/java/io/advantageous/qbit/http/HttpServer.java
@@ -7,6 +7,7 @@ import java.util.function.Consumer;
* @author rhightower
*/
public interface HttpServer {
+
void setWebSocketMessageConsumer(Consumer<WebSocketMessage> webSocketMessageConsumer);
void setHttpRequestConsumer(Consumer<HttpRequest> httpRequestConsumer);
|
HttpServer timeout.. not really working but sample works
|
advantageous_qbit
|
train
|
java
|
9225e7ef463ffde23c1f22488e71e03e41b1a000
|
diff --git a/fabfile.py b/fabfile.py
index <HASH>..<HASH> 100644
--- a/fabfile.py
+++ b/fabfile.py
@@ -85,6 +85,12 @@ def test_backend(backend, domain, config_path=''):
if str(e) != jid1:
error('UserNotFound from get_last_activity did not match "%s": "%s"' % (jid1, str(e)))
try:
+ ret = backend.set_last_activity(username1, domain)
+ error('set_last_activity did not raise UserNotFound: %s' % ret)
+ except UserNotFound as e:
+ if str(e) != jid1:
+ error('UserNotFound from set_last_activity did not match "%s": "%s"' % (jid1, str(e)))
+ try:
backend.set_password(username1, domain, password1)
error('set_password() did not raise UserNotFound.')
except UserNotFound as e:
|
also test set_last_activity for unknown user
|
mathiasertl_xmpp-backends
|
train
|
py
|
bc39c5526ec6807992e2a17acc971e943dae3eff
|
diff --git a/tcconfig/_const.py b/tcconfig/_const.py
index <HASH>..<HASH> 100644
--- a/tcconfig/_const.py
+++ b/tcconfig/_const.py
@@ -12,6 +12,7 @@ VERSION = "0.7.2"
ANYWHERE_NETWORK = "0.0.0.0/0"
KILO_SIZE = 1000
+LIST_MANGLE_TABLE_COMMAND = "iptables -t mangle --line-numbers -L"
class Tc(object):
diff --git a/tcconfig/_iptables.py b/tcconfig/_iptables.py
index <HASH>..<HASH> 100644
--- a/tcconfig/_iptables.py
+++ b/tcconfig/_iptables.py
@@ -14,7 +14,10 @@ import typepy
from typepy.type import Integer
from ._common import sanitize_network
-from ._const import ANYWHERE_NETWORK
+from ._const import (
+ ANYWHERE_NETWORK,
+ LIST_MANGLE_TABLE_COMMAND,
+)
from ._logger import logger
from ._split_line_list import split_line_list
@@ -146,7 +149,7 @@ class IptablesMangleController(object):
@classmethod
def get_iptables(cls):
- proc = SubprocessRunner("iptables -t mangle --line-numbers -L")
+ proc = SubprocessRunner(LIST_MANGLE_TABLE_COMMAND)
if proc.run() != 0:
raise RuntimeError(proc.stderr)
|
Add a constant variable that listing iptables mangle table command
|
thombashi_tcconfig
|
train
|
py,py
|
704429c745c1224961209c5d537c7aaf0801cc4f
|
diff --git a/src/toil/batchSystems/gridengine.py b/src/toil/batchSystems/gridengine.py
index <HASH>..<HASH> 100644
--- a/src/toil/batchSystems/gridengine.py
+++ b/src/toil/batchSystems/gridengine.py
@@ -60,7 +60,7 @@ class GridEngineBatchSystem(AbstractGridEngineBatchSystem):
def submitJob(self, subLine):
process = subprocess.Popen(subLine, stdout=subprocess.PIPE)
- result = int(process.stdout.readline().strip().split('.')[0])
+ result = int(process.stdout.readline().strip())
return result
def getJobExitCode(self, sgeJobID):
|
Removed split
Split was causing white character to return.
|
DataBiosphere_toil
|
train
|
py
|
a3ed9663eef85456f076a203f806b62640ddea55
|
diff --git a/lib/mobility/backend/active_record/hstore/query_methods.rb b/lib/mobility/backend/active_record/hstore/query_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/mobility/backend/active_record/hstore/query_methods.rb
+++ b/lib/mobility/backend/active_record/hstore/query_methods.rb
@@ -25,7 +25,7 @@ module Mobility
ops ? ops.and(op) : op
}
- opts.empty? ? where(i18n_query) : super(opts, *rest).where(i18n_query)
+ opts.empty? ? super(i18n_query) : super(opts, *rest).where(i18n_query)
else
super(opts, *rest)
end
diff --git a/lib/mobility/backend/active_record/jsonb/query_methods.rb b/lib/mobility/backend/active_record/jsonb/query_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/mobility/backend/active_record/jsonb/query_methods.rb
+++ b/lib/mobility/backend/active_record/jsonb/query_methods.rb
@@ -26,7 +26,7 @@ module Mobility
ops ? ops.and(op) : op
}
- opts.empty? ? where(i18n_query) : super(opts, *rest).where(i18n_query)
+ opts.empty? ? super(i18n_query) : super(opts, *rest).where(i18n_query)
else
super(opts, *rest)
end
|
Use super in jsonb/hstore query methods
|
shioyama_mobility
|
train
|
rb,rb
|
0f23287ceb0d177bca603ee80b78f4aefb45bc60
|
diff --git a/impl_template.go b/impl_template.go
index <HASH>..<HASH> 100644
--- a/impl_template.go
+++ b/impl_template.go
@@ -21,7 +21,7 @@ type {{$typename}}Storage interface {
}
func New{{.TypeName}}DB(db gorm.DB) *{{.TypeName}}DB {
- return &{{.TypeName}}DB{{{.ModelLower}}.{{.TypeName}}DB{Db: db}}
+ return &{{.TypeName}}DB{ {{.ModelLower}}.{{.TypeName}}DB{Db: db} }
}
type {{.TypeName}} struct {
|
move to map for pks
|
goadesign_gorma
|
train
|
go
|
e6f10ec582c44f4c6fc2a6bfa655e9f57cf695d4
|
diff --git a/lib/setup.php b/lib/setup.php
index <HASH>..<HASH> 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -53,9 +53,6 @@
$CFG->wordlist = "$CFG->libdir/wordlist.txt";
$CFG->javascript = "$CFG->libdir/javascript.php";
- $CFG->stylesheet = "$CFG->wwwroot/theme/$CFG->theme/styles.php";
- $CFG->header = "$CFG->dirroot/theme/$CFG->theme/header.html";
- $CFG->footer = "$CFG->dirroot/theme/$CFG->theme/footer.html";
$CFG->moddata = "moddata";
@@ -66,6 +63,10 @@
}
require("$CFG->dirroot/theme/$CFG->theme/config.php");
+ $CFG->stylesheet = "$CFG->wwwroot/theme/$CFG->theme/styles.php";
+ $CFG->header = "$CFG->dirroot/theme/$CFG->theme/header.html";
+ $CFG->footer = "$CFG->dirroot/theme/$CFG->theme/footer.html";
+
/// Reference code to remove magic quotes from everything ... just in case.
|
Theme not working for brand-new setup.
|
moodle_moodle
|
train
|
php
|
351ee4c408cd618ed9f207a4e38b100d9656278f
|
diff --git a/FlowCal/plot.py b/FlowCal/plot.py
index <HASH>..<HASH> 100644
--- a/FlowCal/plot.py
+++ b/FlowCal/plot.py
@@ -605,6 +605,9 @@ class _LogicleLocator(matplotlib.ticker.Locator):
# Subticks not requested
ticklocs = major_ticklocs
+ # Remove ticks outside requested range
+ ticklocs = [t for t in ticklocs if (t >= vmin) and (t <= vmax)]
+
return self.raise_if_exceeds(np.array(ticklocs))
|
Added line to filter out ticks outside range in _LogicleLocator.tick_values().
|
taborlab_FlowCal
|
train
|
py
|
9de6cdddfdfbc6c88cbbca248c51341ffa5aff8a
|
diff --git a/script/translate.go b/script/translate.go
index <HASH>..<HASH> 100644
--- a/script/translate.go
+++ b/script/translate.go
@@ -24,7 +24,7 @@ var attrRe = regexp.MustCompile(`\{\{'([^']+)'\s+\|\s+translate\}\}`)
// exceptions to the untranslated text warning
var noStringRe = regexp.MustCompile(
- `^((\W*\{\{.*?\}\} ?.?\W*)+(\.stignore)?|[^a-zA-Z]+.?[^a-zA-Z]*|Twitter|JS\W?|DEV|https?://\S+)$`)
+ `^((\W*\{\{.*?\}\} ?.?\/?.?(bps)?\W*)+(\.stignore)?|[^a-zA-Z]+.?[^a-zA-Z]*|[kMGT]?B|Twitter|JS\W?|DEV|https?://\S+)$`)
// exceptions to the untranslated text warning specific to aboutModalView.html
var aboutRe = regexp.MustCompile(`^([^/]+/[^/]+|(The Go Pro|Font Awesome ).+)$`)
@@ -40,7 +40,6 @@ func generalNode(n *html.Node, filename string) {
for _, a := range n.Attr {
if a.Key == "translate" {
translate = true
- break
} else if a.Key == "id" && (a.Val == "contributor-list" ||
a.Val == "copyright-notices") {
// Don't translate a list of names and
|
script: Ignore units and allow translated strings as translate-values
GitHub-Pull-Request: <URL>
|
syncthing_syncthing
|
train
|
go
|
b33557890fa25b4ba863ab1d8db70b554fff6aae
|
diff --git a/class/SelectBuilder.php b/class/SelectBuilder.php
index <HASH>..<HASH> 100644
--- a/class/SelectBuilder.php
+++ b/class/SelectBuilder.php
@@ -79,7 +79,7 @@ class SelectBuilder extends FlupdoBuilder
'sqlCalcFoundRows' => array('setFlag', 'SQL_CALC_FOUND_ROWS', 'SQL_CALC_FOUND_ROWS'),
// From and joins
- 'from' => array('replace', 'FROM'),
+ 'from' => array('add', 'FROM'),
'join' => array('addJoin', 'JOIN', 'JOIN'),
'innerJoin' => array('addJoin', 'JOIN', 'INNER JOIN'),
'crossJoin' => array('addJoin', 'JOIN', 'CROSS JOIN'),
|
Use 'add' operation for FROM buffer
|
smalldb_flupdo
|
train
|
php
|
d337c1bb9d2f5fae9149d422e56cedbcfca15787
|
diff --git a/util.js b/util.js
index <HASH>..<HASH> 100644
--- a/util.js
+++ b/util.js
@@ -268,7 +268,7 @@ function callAsynchronousChain(options, cb) {
func(data, recursiveCallback);
}
} catch (err) {
- console.log("util.async caught error:", err.stack);
+ console.log("util.async caught error:", err, err.stack);
_finally(err);
}
}
@@ -585,6 +585,10 @@ util.prototype = function(that) {
return Object.getPrototypeOf ? Object.getPrototypeOf(that) : that.__proto__;
}
+util.callstack = function() {
+ try { throw new Error(); } catch (err) { return err.stack.slice(1); };
+}
+
if (typeof exports !== 'undefined') {
module.exports = util;
} else {
|
Add a logging helper that gives the callstack.
|
substance_util
|
train
|
js
|
783ca4b4da96751c8b35d930c16bf83a106ea131
|
diff --git a/Extensions/Core.php b/Extensions/Core.php
index <HASH>..<HASH> 100644
--- a/Extensions/Core.php
+++ b/Extensions/Core.php
@@ -134,7 +134,7 @@ class Core extends Extension
//other
new ConcatenationOperator(10),
new PropertyAccessOperator(16),
- new FilterOperator(16),
+ new FilterOperator(11),
new RangeOperator(9),
new ExclusiveRangeOperator(9),
);
|
Lower the precedence of FilterOperator
|
bugadani_Minty
|
train
|
php
|
1c21d030038f511b24adc7fcc0b3c82283bfdd19
|
diff --git a/ginga/Control.py b/ginga/Control.py
index <HASH>..<HASH> 100644
--- a/ginga/Control.py
+++ b/ginga/Control.py
@@ -976,7 +976,7 @@ class GingaControl(Callback.Callbacks):
def get_channelNames(self):
with self.lock:
- return [ self.channel[key].name for key in self.channel.keys() ]
+ return self.channelNames
def scale2text(self, scalefactor):
if scalefactor >= 1.0:
diff --git a/ginga/qtw/Widgets.py b/ginga/qtw/Widgets.py
index <HASH>..<HASH> 100644
--- a/ginga/qtw/Widgets.py
+++ b/ginga/qtw/Widgets.py
@@ -291,6 +291,7 @@ class ComboBox(WidgetBase):
super(ComboBox, self).__init__()
self.widget = QtHelp.ComboBox()
+ self.widget.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
self.widget.setEditable(editable)
self.widget.activated.connect(self._cb_redirect)
|
Fix for Qt ComboBox auto-adjust
- and a fix for channels control in Operations plugin
|
ejeschke_ginga
|
train
|
py,py
|
43100fbfe41c07b5d53e7f621df828f5ba5104e8
|
diff --git a/src/ComposedFocusMixin.js b/src/ComposedFocusMixin.js
index <HASH>..<HASH> 100644
--- a/src/ComposedFocusMixin.js
+++ b/src/ComposedFocusMixin.js
@@ -72,10 +72,7 @@ function closestFocusableAncestor(element) {
return focusTarget;
}
// Slot elements have a tabindex of 0 (which is weird); we ignore them.
- // The check for `delegatesFocus` is used to allow cooperation with
- // DelegateFocusMixin.
- if (!(element instanceof HTMLSlotElement) &&
- (element.tabIndex >= 0 || element.delegatesFocus)) {
+ if (element.tabIndex >= 0 && !(element instanceof HTMLSlotElement)) {
// Found an enabled component that wants the focus.
return element;
}
|
ComposedFocusMixin shouldn't need to check for presence of DelegateFocusMixin.
|
elix_elix
|
train
|
js
|
aa0536fcf984e36588adba758ab57507d0b66bb3
|
diff --git a/h2o-algos/src/main/java/hex/deeplearning/DeepLearningTask2.java b/h2o-algos/src/main/java/hex/deeplearning/DeepLearningTask2.java
index <HASH>..<HASH> 100644
--- a/h2o-algos/src/main/java/hex/deeplearning/DeepLearningTask2.java
+++ b/h2o-algos/src/main/java/hex/deeplearning/DeepLearningTask2.java
@@ -46,6 +46,7 @@ public class DeepLearningTask2 extends MRTask<DeepLearningTask2> {
@Override
public void setupLocal() {
_res = new DeepLearningTask(_jobKey, _model_info, _sync_fraction);
+ _res.addToPendingCount(1);
_res.setCompleter(this);
_res.asyncExec(0, _fr, true /*run_local*/);
}
|
PUBDEV-9: Fix DeepLearningTask2, different behavior than h2o.
|
h2oai_h2o-3
|
train
|
java
|
7f9aea41b0c928bf9bc0293457b718c15d15beec
|
diff --git a/src/js/mep-player.js b/src/js/mep-player.js
index <HASH>..<HASH> 100644
--- a/src/js/mep-player.js
+++ b/src/js/mep-player.js
@@ -890,13 +890,6 @@
}
- // special case for big play button so it doesn't go over the controls area
- var playLayer = t.layers.find('.mejs-overlay-play'),
- playButton = playLayer.find('.mejs-overlay-button');
-
- playLayer.height(t.container.height() - t.controls.height());
- playButton.css('margin-top', '-' + (playButton.height()/2 - t.controls.height()/2).toString() + 'px' );
-
},
setControlsSize: function() {
|
Fix #<I> Play button and loading animation not aligned.
Remove code that tries to dynamically modify the CSS height of mejs-overlay-play and mejs-overlay-button.
According to the comment, that code is intended for "special case for big play button so it doesn't go over the controls area". However, the code fails to achieve that: even with that code removed, the initial vertical position of the play button remains unchanged. Plus, it fixes the bug mentioned above.
|
mediaelement_mediaelement
|
train
|
js
|
8fdbeef8f5b42022101f13f632429d05dfc0712e
|
diff --git a/lib/driver.js b/lib/driver.js
index <HASH>..<HASH> 100644
--- a/lib/driver.js
+++ b/lib/driver.js
@@ -54,6 +54,7 @@ const NO_PROXY = [
['POST', new RegExp('^/session/[^/]+/appium/device/is_locked')],
['POST', new RegExp('^/session/[^/]+/appium/device/lock')],
['POST', new RegExp('^/session/[^/]+/appium/device/pull_file')],
+ ['POST', new RegExp('^/session/[^/]+/appium/device/pull_folder')],
['POST', new RegExp('^/session/[^/]+/appium/device/push_file')],
['POST', new RegExp('^/session/[^/]+/appium/device/remove_app')],
['POST', new RegExp('^/session/[^/]+/appium/device/terminate_app')],
|
add pull folder (#<I>)
|
appium_appium-espresso-driver
|
train
|
js
|
7a938fc1a2c9370ce9c3dcf5678eff653818612e
|
diff --git a/pug/miner/views.py b/pug/miner/views.py
index <HASH>..<HASH> 100644
--- a/pug/miner/views.py
+++ b/pug/miner/views.py
@@ -280,7 +280,7 @@ import re
re_model_instance_dot = re.compile('__|[.]+')
-def follow_double_underscores(obj, excel_dialect=True, field_name=None):
+def follow_double_underscores(obj, field_name=None, excel_dialect=True):
'''Like getattr(obj, field_name) only follows model relationships through "__" or "." as link separators'''
if not obj:
return obj
|
need to add new keyword arguments to the end!
|
hobson_pug
|
train
|
py
|
fcac95eadfca8ad6c3449045143162ee3827d4a7
|
diff --git a/js/driver/virtio/index.js b/js/driver/virtio/index.js
index <HASH>..<HASH> 100644
--- a/js/driver/virtio/index.js
+++ b/js/driver/virtio/index.js
@@ -41,4 +41,3 @@ function testDeviceId(deviceId) {
}
runtime.pci.addDriver(0x1af4, testDeviceId, driver);
-runtime.pci.addDriver(0x1af4, testDeviceId, driver);
|
do not add virtio driver twice
|
runtimejs_runtime
|
train
|
js
|
0df4fcd05fd066a10607fab7d9e0b29b0239fef7
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,7 @@ tests_require = [
'nose',
]
-if sys.version_info <= (2, 6):
+if sys.version_info < (2, 7):
install_requires.extend([
'argparse',
'ordereddict',
|
Change in setup.py, sys.version_info < (2, 7)
|
fedora-infra_fedmsg_meta_fedora_infrastructure
|
train
|
py
|
6f7723b84c794b836761db2dc4f662ce588c6129
|
diff --git a/lib/podio/models/email_subscription_setting.rb b/lib/podio/models/email_subscription_setting.rb
index <HASH>..<HASH> 100644
--- a/lib/podio/models/email_subscription_setting.rb
+++ b/lib/podio/models/email_subscription_setting.rb
@@ -29,6 +29,12 @@ class Podio::EmailSubscriptionSetting < ActivePodio::Base
req.url("/email/group/", {})
}.body
end
+
+ def find_for_user(user_id, client_type)
+ member Podio.connection.get { |req|
+ req.url("/user/#{user_id}/setting/#{client_type}/", {})
+ }.body
+ end
# @see https://developers.podio.com/doc/email/update-groups-333981
def update_groups(options)
|
Method for getting subscriptions for a user
|
podio_podio-rb
|
train
|
rb
|
0f5f18a87d52c5fa77bc9223b3bd89fd7d9c6e02
|
diff --git a/tests/reactor-tests.js b/tests/reactor-tests.js
index <HASH>..<HASH> 100644
--- a/tests/reactor-tests.js
+++ b/tests/reactor-tests.js
@@ -254,7 +254,6 @@ describe('Reactor', () => {
},
handleReset(state) {
- debugger
return state
}
})
@@ -287,7 +286,6 @@ describe('Reactor', () => {
var item = { foo: 'bar' }
reactor.dispatch('addItem', item)
- debugger
expect(reactor.evaluateToJS(['persistent'])).toEqual([item])
reactor.reset()
|
Remove debuggers in reactor-tests
|
optimizely_nuclear-js
|
train
|
js
|
8f6e2c2270ee339de07f1775728d5eb280149b53
|
diff --git a/core/src/main/java/com/google/net/stubby/Status.java b/core/src/main/java/com/google/net/stubby/Status.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/google/net/stubby/Status.java
+++ b/core/src/main/java/com/google/net/stubby/Status.java
@@ -139,7 +139,7 @@ public final class Status {
public int value() {
return value;
}
-
+
private Status status() {
return STATUS_LIST.get(value);
}
@@ -169,9 +169,9 @@ public final class Status {
public static final Status NOT_FOUND = Code.NOT_FOUND.status();
public static final Status ALREADY_EXISTS = Code.ALREADY_EXISTS.status();
public static final Status PERMISSION_DENIED = Code.PERMISSION_DENIED.status();
- public static final Status UNAUTHENTICATED = Code.PERMISSION_DENIED.status();
+ public static final Status UNAUTHENTICATED = Code.UNAUTHENTICATED.status();
public static final Status RESOURCE_EXHAUSTED = Code.RESOURCE_EXHAUSTED.status();
- public static final Status FAILED_PRECONDITION =
+ public static final Status FAILED_PRECONDITION =
Code.FAILED_PRECONDITION.status();
public static final Status ABORTED = Code.ABORTED.status();
public static final Status OUT_OF_RANGE = Code.OUT_OF_RANGE.status();
|
Fix UNAUTHENTICATED status to point in Java Status class to point to correct code.
-------------
Created by MOE: <URL>
|
grpc_grpc-java
|
train
|
java
|
4ab3dfabac626055afab86bee325f1d75e410efc
|
diff --git a/src/Ant/ChateaClient/Client/Api.php b/src/Ant/ChateaClient/Client/Api.php
index <HASH>..<HASH> 100755
--- a/src/Ant/ChateaClient/Client/Api.php
+++ b/src/Ant/ChateaClient/Client/Api.php
@@ -2912,7 +2912,7 @@ class Api implements ApiInterface
}
public function whoami()
{
- return $this->showUser($user_id);
+ return $this->me();
}
/**
|
Fixed Api::whoami method
|
antwebes_ChateaClientLib
|
train
|
php
|
a2f33f23f68dad65196c93285e4476f283e84e22
|
diff --git a/core/rigid_transformations.py b/core/rigid_transformations.py
index <HASH>..<HASH> 100644
--- a/core/rigid_transformations.py
+++ b/core/rigid_transformations.py
@@ -699,6 +699,19 @@ class RigidTransform(object):
from_frame=from_frame,
to_frame=to_frame)
+ def __eq__(self, other):
+ if isinstance(other, self.__class__):
+ return hash(self) == hash(other)
+ return False
+
+ def __ne__(self, other):
+ if isinstance(other, self.__class__):
+ return not self.__eq__(other)
+ return NotImplemented
+
+ def __hash__(self):
+ return hash(str(self.__dict__))
+
class SimilarityTransform(RigidTransform):
""" A Similarity Transformation from one frame to another (rigid transformation + scaling)
"""
|
supporint qe ne and hash overrides for rigidtransforms
|
BerkeleyAutomation_autolab_core
|
train
|
py
|
f33803308f492b81aadf0d14edb64bddfc940b43
|
diff --git a/ara/server/__main__.py b/ara/server/__main__.py
index <HASH>..<HASH> 100644
--- a/ara/server/__main__.py
+++ b/ara/server/__main__.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (c) 2019 Red Hat, Inc.
#
# This file is part of ARA Records Ansible.
|
server: set python shebang to python3 instead of python
The server works exclusively with python3.
Change-Id: I<I>de0fcc0e<I>c<I>dee<I>d0e<I>c<I>
|
ansible-community_ara
|
train
|
py
|
44e679e619737299f856eab8f5a16de9a42a10fd
|
diff --git a/api/models/index.js b/api/models/index.js
index <HASH>..<HASH> 100644
--- a/api/models/index.js
+++ b/api/models/index.js
@@ -33,7 +33,12 @@ var _createModel = function(modelName) {
var _createModelProperties = function(modelName, modelProperties) {
models[modelName].prototype._instantiate = function instantiateModel(instanceProperties) {
+ // for (var propertyName in instanceProperties) {
+ // // TODO check that each instance property is present in modelProperties
+ // }
+
for (var propertyName in modelProperties) {
+ // TODO check that instanceProperties fullfill "type" & "required" in modelProperties
var modelProperty = modelProperties[propertyName],
valueModel = instanceProperties[propertyName]
if (typeof valueModel == 'object') {
@@ -60,3 +65,12 @@ var rootModels = {
"Text": RootModel,
"Number": RootModel
}
+
+/* TODO
+ - add on, observe and promise to RootModel
+ - have Text and Number extend RootModel with set
+ - have Set and List extend RootModel and publish on('add') and on('remove')
+ - to implement on/observe/promise, climb the parent models to create the observation chain
+ - call fin.create in initializer
+ - add fin.transact
+*/
\ No newline at end of file
|
Add TODO list for next steps. Now: time to sleep
|
marcuswestin_fin
|
train
|
js
|
a6152fb86181dbc461cc5917afce3860e020e144
|
diff --git a/src/ValuSo/Feature/CommandTrait.php b/src/ValuSo/Feature/CommandTrait.php
index <HASH>..<HASH> 100644
--- a/src/ValuSo/Feature/CommandTrait.php
+++ b/src/ValuSo/Feature/CommandTrait.php
@@ -47,6 +47,6 @@ trait CommandTrait
*/
public function getCommand()
{
- return $this->getCommandStack()->getIterator()->top();
+ return $this->getCommandStack()->top();
}
}
\ No newline at end of file
|
Fixes "Call to undefined method SplStack::getIterator()"
|
valu-digital_valuso
|
train
|
php
|
c834df4471ce1681e7ca31be7884fef7c7c2696b
|
diff --git a/test/containers-helper.js b/test/containers-helper.js
index <HASH>..<HASH> 100644
--- a/test/containers-helper.js
+++ b/test/containers-helper.js
@@ -34,7 +34,30 @@ exports.startRedisServers = function(n, callback) {
var client = redis.createClient(server.port, server.host);
client.on('error', function() {});
clients.push(client);
- client.flushall(next);
+
+ // Retry flushall to Redis for a total of about 4 seconds
+ // with timeouts of 16 ms, 32 ms, 64 ms .. 2048 ms
+ var retryCount = 0;
+ var flushallRetryHandler = function(err) {
+ if (err) {
+ retryCount++;
+ if (retryCount > 8 ) {
+ next(new Error('Unable to find started redis N=' + n + '. Last error: ' + err ));
+ }
+ else {
+ setTimeout(
+ function() {
+ client.flushall(flushallRetryHandler);
+ },
+ Math.pow(2, retryCount+3)
+ );
+ }
+ }
+ else {
+ next();
+ }
+ };
+ client.flushall(flushallRetryHandler);
});
});
}, function(err) {
|
Fixed test errors caused by slowly initializing redis dockers
|
lakka_redlock-nodejs
|
train
|
js
|
94ed016508b2b900c3bf387b2720b0510378e4b4
|
diff --git a/src/Slim/Http/ExtendedRequest.php b/src/Slim/Http/ExtendedRequest.php
index <HASH>..<HASH> 100644
--- a/src/Slim/Http/ExtendedRequest.php
+++ b/src/Slim/Http/ExtendedRequest.php
@@ -280,6 +280,26 @@ class ExtendedRequest extends Request
}
/**
+ * Get Request URI.
+ *
+ * Note: This method is not part of the PSR-7 standard.
+ *
+ * @param array $params
+ *
+ * @return string
+ */
+ public function getRequestTargetWithParams($params)
+ {
+ $target = $this->getFullPath();
+
+ if ($params) {
+ $target .= '?' . http_build_query($params);
+ }
+
+ return $target;
+ }
+
+ /**
* Get "HTTP_USER_AGENT" header.
*
* Note: This method is not part of the PSR-7 standard.
|
Added ExtendedRequest::getRequestTargetWithParams()
|
ansas_php-component
|
train
|
php
|
7fd64c95b51636d831443900f6adebb9c4651cc5
|
diff --git a/src/passes/LuminancePass.js b/src/passes/LuminancePass.js
index <HASH>..<HASH> 100644
--- a/src/passes/LuminancePass.js
+++ b/src/passes/LuminancePass.js
@@ -59,6 +59,7 @@ export class LuminancePass extends Pass {
* The resolution.
*
* @type {Resizer}
+ * @deprecated Use getResolution() instead.
*/
this.resolution = new Resizer(this, width, height);
@@ -91,6 +92,18 @@ export class LuminancePass extends Pass {
}
/**
+ * Returns the resolution settings.
+ *
+ * @return {Resolution} The resolution.
+ */
+
+ getResolution() {
+
+ return this.resolution;
+
+ }
+
+ /**
* Renders the luminance.
*
* @param {WebGLRenderer} renderer - The renderer.
|
Deprecate resolution
Replaced by getResolution().
|
vanruesc_postprocessing
|
train
|
js
|
2bbbae2028aa94c472483099db07e44005837266
|
diff --git a/lottie/src/main/java/com/airbnb/lottie/BaseStrokeContent.java b/lottie/src/main/java/com/airbnb/lottie/BaseStrokeContent.java
index <HASH>..<HASH> 100644
--- a/lottie/src/main/java/com/airbnb/lottie/BaseStrokeContent.java
+++ b/lottie/src/main/java/com/airbnb/lottie/BaseStrokeContent.java
@@ -203,7 +203,7 @@ abstract class BaseStrokeContent implements DrawingContent, BaseKeyframeAnimatio
for (int i = 0; i < pathGroups.size(); i++) {
PathGroup pathGroup = pathGroups.get(i);
for (int j = 0; j < pathGroup.paths.size(); j++) {
- path.addPath(pathGroup.paths.get(i).getPath(), parentMatrix);
+ path.addPath(pathGroup.paths.get(j).getPath(), parentMatrix);
}
}
path.computeBounds(rect, false);
|
Use the proper PathGroup when calculating stroke bounds
Fixes #<I>
|
airbnb_lottie-android
|
train
|
java
|
0ad8405d159137655688781eea1e169e6b4083c4
|
diff --git a/tests/test_sftp.py b/tests/test_sftp.py
index <HASH>..<HASH> 100755
--- a/tests/test_sftp.py
+++ b/tests/test_sftp.py
@@ -304,7 +304,7 @@ class SFTPTest (unittest.TestCase):
sftp.utime(FOLDER + '/special', (atime, mtime))
stat = sftp.stat(FOLDER + '/special')
self.assertEqual(stat.st_mtime, mtime)
- if sys.platform != 'win32':
+ if sys.platform not in ('win32', 'cygwin'):
self.assertEqual(stat.st_atime, atime)
# can't really test chown, since we'd have to know a valid uid.
@@ -345,7 +345,7 @@ class SFTPTest (unittest.TestCase):
f.utime((atime, mtime))
stat = f.stat()
self.assertEqual(stat.st_mtime, mtime)
- if sys.platform != 'win32':
+ if sys.platform not in ('win32', 'cygwin'):
self.assertEqual(stat.st_atime, atime)
# can't really test chown, since we'd have to know a valid uid.
|
[project @ <EMAIL><I>-f1cab2a<I>bf]
fix new cygwin test failures reported by alexander
|
bitprophet_ssh
|
train
|
py
|
dd43134fc62a50807f66cf9dcca77cc90c11500e
|
diff --git a/http-server/src/test/java/io/airlift/http/server/TestHttpServerProvider.java b/http-server/src/test/java/io/airlift/http/server/TestHttpServerProvider.java
index <HASH>..<HASH> 100644
--- a/http-server/src/test/java/io/airlift/http/server/TestHttpServerProvider.java
+++ b/http-server/src/test/java/io/airlift/http/server/TestHttpServerProvider.java
@@ -402,7 +402,7 @@ public class TestHttpServerProvider
server.stop();
try {
- future.get(1, TimeUnit.SECONDS);
+ future.get(5, TimeUnit.SECONDS);
fail("expected exception");
}
catch (ExecutionException e) {
|
Increase timeout for HTTP server stop test
|
airlift_airlift
|
train
|
java
|
d607d9e217e4f4d831f8fe80ac55155a8b16b588
|
diff --git a/src/web/UrlManager.php b/src/web/UrlManager.php
index <HASH>..<HASH> 100644
--- a/src/web/UrlManager.php
+++ b/src/web/UrlManager.php
@@ -42,6 +42,10 @@ class UrlManager extends \yii\web\UrlManager
$route[0] = substr($route[0], $length);
}
+ if ($route[0] === false || $route[0] == '/') {
+ $route[0] = '';
+ }
+
return $route;
}
|
fixed issue with composition removing on request parsing.
|
luyadev_luya
|
train
|
php
|
6361fb9e817005fbe656dee6332eb882089548fc
|
diff --git a/src/Model.php b/src/Model.php
index <HASH>..<HASH> 100644
--- a/src/Model.php
+++ b/src/Model.php
@@ -1,6 +1,7 @@
<?php
namespace Bolt;
+ use Bolt\Exceptions\Output;
use Bolt\Interfaces\Connection;
abstract class Model extends Base
@@ -39,7 +40,7 @@
if ($data === false)
{
- return false;
+ throw new Output($this->className(false) . " not found", 404);
}
$this->populate($data);
@@ -61,7 +62,7 @@
if ($data === false)
{
- return false;
+ throw new Output("Error saving " . $this->className(false), 500);
}
if ($data !== true)
|
Throw exceptions on load/save errors in model
|
irwtdvoys_bolt-mvc
|
train
|
php
|
a4d1add77da2653fb5e7e78641f2a517057ad81f
|
diff --git a/tests/src/test/java/alluxio/client/cli/fs/command/CopyToLocalCommandIntegrationTest.java b/tests/src/test/java/alluxio/client/cli/fs/command/CopyToLocalCommandIntegrationTest.java
index <HASH>..<HASH> 100644
--- a/tests/src/test/java/alluxio/client/cli/fs/command/CopyToLocalCommandIntegrationTest.java
+++ b/tests/src/test/java/alluxio/client/cli/fs/command/CopyToLocalCommandIntegrationTest.java
@@ -62,7 +62,8 @@ public final class CopyToLocalCommandIntegrationTest extends AbstractFileSystemS
@Test
public void copyToLocalLarge() throws Exception {
- copyToLocalWithBytes(SIZE_BYTES);
+ // Divide by 2 to avoid issues with async eviction.
+ copyToLocalWithBytes(SIZE_BYTES / 2);
}
@Test
|
Deflake copyToLocalLarge (#<I>)
|
Alluxio_alluxio
|
train
|
java
|
fec2aa74e7443bad8663be9205d58774029631b8
|
diff --git a/leveldb/db_compaction.go b/leveldb/db_compaction.go
index <HASH>..<HASH> 100644
--- a/leveldb/db_compaction.go
+++ b/leveldb/db_compaction.go
@@ -289,7 +289,7 @@ func (db *DB) memCompaction() {
close(resumeC)
resumeC = nil
case <-db.closeC:
- return
+ db.compactionExitTransact()
}
var (
@@ -338,7 +338,7 @@ func (db *DB) memCompaction() {
case <-resumeC:
close(resumeC)
case <-db.closeC:
- return
+ db.compactionExitTransact()
}
}
|
leveldb: DB.memCompaction should raise errCompactionTransactExiting panic when canceled due to DB being closed #<I>
|
syndtr_goleveldb
|
train
|
go
|
16814648a0cbd619d63c2db418b599cfe4193df7
|
diff --git a/Kwc/Root/Category/Generator.php b/Kwc/Root/Category/Generator.php
index <HASH>..<HASH> 100644
--- a/Kwc/Root/Category/Generator.php
+++ b/Kwc/Root/Category/Generator.php
@@ -345,6 +345,10 @@ class Kwc_Root_Category_Generator extends Kwf_Component_Generator_Abstract
{
$page = $this->_getPageData($id);
+ if ($parentData && isset($page['parent_id']) && $page['parent_id'] != $parentData->id) {
+ $parentData = null;
+ }
+
if (!$parentData || ($parentData->componentClass == $this->_class && $page['parent_id'])) {
$parentData = $page['parent_id'];
}
|
Doublecheck parentData and reset if necessary
Because of page-history it's possible that pageData is returned
even though the parentData is not valid. Without this commit the
"wrong" parentData was set and the exactMatch-value in Kwf_Setup
was not set to false.
|
koala-framework_koala-framework
|
train
|
php
|
9c935a8cd6ac39bb2fff2bb17c89dd9d1221dd67
|
diff --git a/webapi_tests/telephony/test_telephony_outgoing.py b/webapi_tests/telephony/test_telephony_outgoing.py
index <HASH>..<HASH> 100644
--- a/webapi_tests/telephony/test_telephony_outgoing.py
+++ b/webapi_tests/telephony/test_telephony_outgoing.py
@@ -24,6 +24,10 @@ class TestTelephonyOutgoing(TestCase, TelephonyTestCommon):
.. _`WebTelephony API`: https://developer.mozilla.org/en-US/docs/Web/Guide/API/Telephony
"""
+ def __init__(self, *args, **kwargs):
+ TestCase.__init__(self, *args, **kwargs)
+ TelephonyTestCommon.__init__(self)
+
def setUp(self):
self.addCleanup(self.clean_up)
super(TestTelephonyOutgoing, self).setUp()
@@ -50,3 +54,4 @@ class TestTelephonyOutgoing(TestCase, TelephonyTestCommon):
def clean_up(self):
# re-enable the default dialer manager
self.enable_dialer()
+ self.active_call_list = []
|
Bug <I> - Develop more semi-auto tests for the Telephony WebAPI.
Added init function to telephony outgoing test
|
mozilla-b2g_fxos-certsuite
|
train
|
py
|
b8ccf8a48ff989b7fadafb6dbf7c33541323506f
|
diff --git a/lib/Random.js b/lib/Random.js
index <HASH>..<HASH> 100644
--- a/lib/Random.js
+++ b/lib/Random.js
@@ -10,15 +10,16 @@ Random.seed = function(s) {
};
Random.float = function(min, max) {
- if (typeof max == 'undefined') {
- min = 1;
+ if (arguments.length == 0) {
+ min = 0;
+ max = 1;
}
- if (typeof max == 'undefined') {
+ else if (arguments.length == 1) {
max = min;
min = 0;
}
return min + (max - min) * Math.random();
-};
+}
Random.int = function(min, max) {
return Math.floor(Random.randomFloat(min, max));
|
Fixed bug with float(min, max) params
If there was only min given the max was assigned 1 instead of min
|
pex-gl_pex-random
|
train
|
js
|
0abab017144718e95491fc85a0a261141567a5d3
|
diff --git a/CHANGELOG.md b/CHANGELOG.md
index <HASH>..<HASH> 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.2.1 - 2012-2-26
+
+- fix SQL dialect issue in brick type filter
+
## 1.2.0 - 2012-2-25
- set custom buttons on redactor editor
diff --git a/app/models/kuhsaft/brick_type.rb b/app/models/kuhsaft/brick_type.rb
index <HASH>..<HASH> 100644
--- a/app/models/kuhsaft/brick_type.rb
+++ b/app/models/kuhsaft/brick_type.rb
@@ -2,7 +2,7 @@ module Kuhsaft
class BrickType < ActiveRecord::Base
attr_accessible :disabled, :class_name, :group
scope :grouped, order('`group`, `id` asc')
- scope :enabled, where('disabled IS NOT "false"')
+ scope :enabled, where('disabled != ?', false)
scope :constrained, lambda { |list| where(:class_name => list) }
end
end
diff --git a/lib/kuhsaft/version.rb b/lib/kuhsaft/version.rb
index <HASH>..<HASH> 100644
--- a/lib/kuhsaft/version.rb
+++ b/lib/kuhsaft/version.rb
@@ -1,3 +1,3 @@
module Kuhsaft
- VERSION = "1.2.0"
+ VERSION = "1.2.1"
end
|
make brick_type_filter SQL work with mysql
|
brandleadership_kuhsaft
|
train
|
md,rb,rb
|
7e906898aa8a4ea9e13abe9255e65d45267a9ec6
|
diff --git a/spec/build_queue_spec.rb b/spec/build_queue_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/build_queue_spec.rb
+++ b/spec/build_queue_spec.rb
@@ -32,6 +32,11 @@ describe Juicy::BuildQueue do
@builds.collect(&:pid).should == [1, 2, 3, 4, 5, 6]
end
+ ##TODO
+ #it "Should remove a given build by id" do
+ #end
+
+
end
class Juicy::BuildQueue #{{{ Test injection
|
todo purge by id
|
richo_juici
|
train
|
rb
|
4f524867e84ef07791a36fecac113aa6be0a24ad
|
diff --git a/src/Requests/Generator.php b/src/Requests/Generator.php
index <HASH>..<HASH> 100644
--- a/src/Requests/Generator.php
+++ b/src/Requests/Generator.php
@@ -47,7 +47,10 @@ class Generator
$key = $this->configuration->getSigningKey();
$request = $request->withHeader('X-SIGNED-ID', (string) Uuid::uuid4());
- $request = $request->withHeader('X-SIGNED-TIMESTAMP', (string) Carbon::now());
+ $request = $request->withHeader(
+ 'X-SIGNED-TIMESTAMP',
+ Carbon::now()->format('Y-m-d H:i:s')
+ );
$signature = new Signature(new Payload($request), $algorithm, $key);
|
Hardcode the timestamp format to match the one we'll verify against
|
SoapBox_SignedRequests
|
train
|
php
|
ef6dd536d16a265fa2e9942de58ad31756a43cd9
|
diff --git a/obdalib/obdalib-core/src/main/java/it/unibz/krdb/obda/utils/LookupTable.java b/obdalib/obdalib-core/src/main/java/it/unibz/krdb/obda/utils/LookupTable.java
index <HASH>..<HASH> 100644
--- a/obdalib/obdalib-core/src/main/java/it/unibz/krdb/obda/utils/LookupTable.java
+++ b/obdalib/obdalib-core/src/main/java/it/unibz/krdb/obda/utils/LookupTable.java
@@ -189,9 +189,17 @@ public class LookupTable {
*/
private boolean exist(String entry) {
final String sourceEntry = entry.toLowerCase();
- return log.containsKey(sourceEntry);
+ return (log.containsKey(trim(sourceEntry)) || log.containsKey(sourceEntry));
}
+ private String trim(String string) {
+
+ while (string.startsWith("\"") && string.endsWith("\"")) {
+
+ string = string.substring(1, string.length() - 1);
+ }
+ return string;
+ }
/*
* Utility method to add an entry in the lookup table. Input string will be
* written in lower case.
@@ -256,7 +264,7 @@ public class LookupTable {
* be written in lower case.
*/
private Integer getEntry(String entry) {
- return log.get(entry.toLowerCase());
+ return log.get(trim(entry.toLowerCase()));
}
/*
|
Fix lookup table to trim quotes from column names
|
ontop_ontop
|
train
|
java
|
dfd5170dd678dd225fcedb2a1c9123324b48516f
|
diff --git a/src/ossos-pipeline/ossos/gui/logger.py b/src/ossos-pipeline/ossos/gui/logger.py
index <HASH>..<HASH> 100644
--- a/src/ossos-pipeline/ossos/gui/logger.py
+++ b/src/ossos-pipeline/ossos/gui/logger.py
@@ -23,4 +23,5 @@ _logger.setLevel(OSSOS_DEBUG_LEVEL)
debug = _logger.debug
info = _logger.info
warning = _logger.warning
+error = _logger.error
critical = _logger.critical
|
added an ERROR logger.
|
OSSOS_MOP
|
train
|
py
|
cfb281229e875a76889f8d5c5894cdc0882b076e
|
diff --git a/test/minitest/deprecation_toolkit_plugin_test.rb b/test/minitest/deprecation_toolkit_plugin_test.rb
index <HASH>..<HASH> 100644
--- a/test/minitest/deprecation_toolkit_plugin_test.rb
+++ b/test/minitest/deprecation_toolkit_plugin_test.rb
@@ -19,12 +19,12 @@ module Minitest
test ".plugin_deprecation_toolkit_init set the behavior to `Record` when `record_deprecations` options is true" do
begin
- @previous_behavior = DeprecationToolkit::Configuration.behavior
+ previous_behavior = DeprecationToolkit::Configuration.behavior
Minitest.plugin_deprecation_toolkit_init(record_deprecations: true)
assert_equal DeprecationToolkit::Behaviors::Record, DeprecationToolkit::Configuration.behavior
ensure
- DeprecationToolkit::Configuration.behavior = @previous_behavior
+ DeprecationToolkit::Configuration.behavior = previous_behavior
end
end
|
No need to store this in an instance variable
|
Shopify_deprecation_toolkit
|
train
|
rb
|
c460ad0ab245888e724a7a226d31cfd139948fe0
|
diff --git a/src/components/GraphEdge/GraphEdge.js b/src/components/GraphEdge/GraphEdge.js
index <HASH>..<HASH> 100644
--- a/src/components/GraphEdge/GraphEdge.js
+++ b/src/components/GraphEdge/GraphEdge.js
@@ -290,7 +290,7 @@ GraphEdge.defaultProps = {
isDotted: false,
isAnimated: false,
contrastMode: false,
- graphEdgeRef: noop,
+ graphEdgeRef: undefined,
onMouseEnter: noop,
onMouseLeave: noop,
};
diff --git a/src/components/GraphNode/GraphNode.js b/src/components/GraphNode/GraphNode.js
index <HASH>..<HASH> 100644
--- a/src/components/GraphNode/GraphNode.js
+++ b/src/components/GraphNode/GraphNode.js
@@ -172,7 +172,7 @@ GraphNode.defaultProps = {
cursorType: 'pointer',
renderPrependedInfo: noop,
renderAppendedInfo: noop,
- graphNodeRef: noop,
+ graphNodeRef: undefined,
onMouseEnter: noop,
onMouseLeave: noop,
onClick: noop,
|
Replaced noop ref callback defaults with undefined.
|
weaveworks_ui-components
|
train
|
js,js
|
f610a0cc67d6f62a6f4db2b74cfba81b59f3bb47
|
diff --git a/correctingInterval.js b/correctingInterval.js
index <HASH>..<HASH> 100644
--- a/correctingInterval.js
+++ b/correctingInterval.js
@@ -17,9 +17,14 @@
var numIntervals = 0,
intervals = {};
+ // Polyfill Date.now
+ var now = Date.now || function() {
+ return new Date().valueOf();
+ };
+
var setCorrectingInterval = function(func, delay) {
var id = numIntervals++,
- planned = Date.now() + delay;
+ planned = now() + delay;
// Normalize func as function
switch (typeof func) {
@@ -40,7 +45,7 @@
if (intervals[id]) {
planned += delay;
- intervals[id] = setTimeout(tick, planned - Date.now());
+ intervals[id] = setTimeout(tick, planned - now());
}
}
|
Re-implement Date.now polyfill
For browsers lacking support for ECMAScript 5
|
aduth_correctingInterval
|
train
|
js
|
c77d23f96aa3d9db6db3022652043bc94998627a
|
diff --git a/eZ/Publish/Core/Repository/Helper/ContentTypeDomainMapper.php b/eZ/Publish/Core/Repository/Helper/ContentTypeDomainMapper.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/Repository/Helper/ContentTypeDomainMapper.php
+++ b/eZ/Publish/Core/Repository/Helper/ContentTypeDomainMapper.php
@@ -236,7 +236,7 @@ class ContentTypeDomainMapper
'isRequired' => $spiFieldDefinition->isRequired,
'isInfoCollector' => $spiFieldDefinition->isInfoCollector,
'defaultValue' => $fieldType->fromPersistenceValue($spiFieldDefinition->defaultValue),
- 'isSearchable' => $spiFieldDefinition->isSearchable,
+ 'isSearchable' => !$fieldType->isSearchable() ? false : $spiFieldDefinition->isSearchable,
'fieldSettings' => (array)$spiFieldDefinition->fieldTypeConstraints->fieldSettings,
'validatorConfiguration' => (array)$spiFieldDefinition->fieldTypeConstraints->validators,
)
|
Fix EZP-<I>: Force isSearchable::false on FieldDefinitions of a type that is not searchable
|
ezsystems_ezpublish-kernel
|
train
|
php
|
7e38db0ce5c3d5db87b8739de5d1473bba3c5714
|
diff --git a/src/Helper/WsHelper.php b/src/Helper/WsHelper.php
index <HASH>..<HASH> 100644
--- a/src/Helper/WsHelper.php
+++ b/src/Helper/WsHelper.php
@@ -21,6 +21,7 @@ class WsHelper
public const OPCODE_BINARY = 0x02;
public const OPCODE_CLOSE = 0x08;
public const OPCODE_PING = 0x09;
+ public const OPCODE_PONG = 0x10;
/**
* Generate WebSocket sign.(for server)
diff --git a/src/WebSocketServer.php b/src/WebSocketServer.php
index <HASH>..<HASH> 100644
--- a/src/WebSocketServer.php
+++ b/src/WebSocketServer.php
@@ -37,8 +37,8 @@ class WebSocketServer extends Server
/**
* Send data to client by frame object.
- *
* NOTICE: require swoole version >= 4.2.0
+ *
* @param Frame $frame
* @return bool
*/
|
remove load Functions.php file from composer.json
|
swoft-cloud_swoft-websocket-server
|
train
|
php,php
|
450b46e9ca18706b5741287aadc822666b481179
|
diff --git a/pkg/fs/fs.go b/pkg/fs/fs.go
index <HASH>..<HASH> 100644
--- a/pkg/fs/fs.go
+++ b/pkg/fs/fs.go
@@ -304,6 +304,7 @@ func (fs *CamliFileSystem) Statfs(req *fuse.StatfsRequest, res *fuse.StatfsRespo
// Make some stuff up, just to see if it makes "lsof" happy.
res.Blocks = 1 << 35
res.Bfree = 1 << 34
+ res.Bavail = 1 << 34
res.Files = 1 << 29
res.Ffree = 1 << 28
res.Namelen = 2048
|
fs: actually claim to have free space
Change-Id: Ia1aac8f<I>d<I>b<I>a<I>fc<I>c<I>c4b
|
perkeep_perkeep
|
train
|
go
|
dccd49b7560daf65c1c76864251deddd5d027184
|
diff --git a/driver_beagle_fs.go b/driver_beagle_fs.go
index <HASH>..<HASH> 100644
--- a/driver_beagle_fs.go
+++ b/driver_beagle_fs.go
@@ -100,16 +100,26 @@ func (op *BeagleBoneFSOpenPin) gpioGetValue() (int, error) {
// Set the value, Expects HIGH or LOW
func (op *BeagleBoneFSOpenPin) gpioSetValue(value int) error {
+ if op.valueFile == nil {
+ fmt.Printf("value file no set\n")
+ return errors.New("value file is not defined")
+ }
+
+ // Seek the start of the value file before writing. This is sufficient for the driver to accept a new value.
_, e := op.valueFile.Seek(0, 0)
if e != nil {
return e
}
+ // Write a 1 or 0.
+ // @todo investigate if we'd get better performance if we have precalculated []byte values with 0 and 1, and
+ // use write directly instead of WriteString. Probably only marginal.
if value == 0 {
op.valueFile.WriteString("0")
} else {
op.valueFile.WriteString("1")
}
+
return nil
}
|
error check write on BB FS driver
|
mrmorphic_hwio
|
train
|
go
|
c7a35e1b0175fa59eb8b9d094b8eb7ad0e102a83
|
diff --git a/lib/components/state-resources/remove-docs-by-doc-id/index.js b/lib/components/state-resources/remove-docs-by-doc-id/index.js
index <HASH>..<HASH> 100644
--- a/lib/components/state-resources/remove-docs-by-doc-id/index.js
+++ b/lib/components/state-resources/remove-docs-by-doc-id/index.js
@@ -18,9 +18,9 @@ class RemoveDocsByDocId {
const query = docIds.map(docId => `docId:${docId}`)
- debug(`Deleting docs where ${query.join(' AND ')}`)
+ debug(`Deleting docs where ${query.join(' OR ')}`)
- this.solrClient.deleteByQuery(query.join(' AND '), (err, obj) => {
+ this.solrClient.deleteByQuery(query.join(' OR '), (err, obj) => {
if (err) {
return context.sendTaskFailure({ error: 'RemoveDocsByDocIdFail', cause: err })
}
|
fix: remove docs by id, or rather than and
|
wmfs_tymly-solr-plugin
|
train
|
js
|
58c8be04a0f05ee08770742e436f65b243c38b28
|
diff --git a/lxd/device/device_utils_network.go b/lxd/device/device_utils_network.go
index <HASH>..<HASH> 100644
--- a/lxd/device/device_utils_network.go
+++ b/lxd/device/device_utils_network.go
@@ -516,29 +516,3 @@ func networkValidVLANList(value string) error {
return nil
}
-
-// networkParsePortRange validates a port range in the form n-n.
-func networkParsePortRange(r string) (int64, int64, error) {
- entries := strings.Split(r, "-")
- if len(entries) > 2 {
- return -1, -1, fmt.Errorf("Invalid port range %s", r)
- }
-
- base, err := strconv.ParseInt(entries[0], 10, 64)
- if err != nil {
- return -1, -1, err
- }
-
- size := int64(1)
- if len(entries) > 1 {
- size, err = strconv.ParseInt(entries[1], 10, 64)
- if err != nil {
- return -1, -1, err
- }
-
- size -= base
- size++
- }
-
- return base, size, nil
-}
|
lxd/device/device/utils/network: Removes networkParsePortRange
|
lxc_lxd
|
train
|
go
|
b255f40430f61f68844ce0fb12472c1ca1cbd03d
|
diff --git a/libraries/lithium/test/Unit.php b/libraries/lithium/test/Unit.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/test/Unit.php
+++ b/libraries/lithium/test/Unit.php
@@ -321,7 +321,7 @@ class Unit extends \lithium\core\Object {
}
/**
- * Tests a for result that does NOT match the expected regular expression pattern
+ * Checks that the regular expression `$expected` is not matched in the result.
*
* @param mixed $expected
* @param mixed $result
@@ -332,7 +332,7 @@ class Unit extends \lithium\core\Object {
}
/**
- * Tests a for result match in the expected regular expression pattern
+ * Checks that the regular expression `$expected` is matched in the result.
*
* @param mixed $expected
* @param mixed $result
|
Reverting my changes, that occured at the same time as coder documented them.
|
UnionOfRAD_framework
|
train
|
php
|
6f090aed8c95b219952943ba613182b039cf3daa
|
diff --git a/src/YoutubeDl.php b/src/YoutubeDl.php
index <HASH>..<HASH> 100644
--- a/src/YoutubeDl.php
+++ b/src/YoutubeDl.php
@@ -397,6 +397,12 @@ class YoutubeDl
*/
protected function jsonDecode($data)
{
- return json_decode($data, true);
+ $decode = json_decode($data, true);
+
+ if (JSON_ERROR_NONE !== json_last_error()) {
+ throw new \RuntimeException('Response can\'t be decoded: ' . $data);
+ }
+
+ return $decode;
}
}
|
throw runtime exception if data cannot be decoded
|
norkunas_youtube-dl-php
|
train
|
php
|
5e1c553329b1828120c02c2c700c3b02be99ed98
|
diff --git a/src/d3-funnel/d3-funnel.js b/src/d3-funnel/d3-funnel.js
index <HASH>..<HASH> 100644
--- a/src/d3-funnel/d3-funnel.js
+++ b/src/d3-funnel/d3-funnel.js
@@ -1,4 +1,4 @@
-(function(global) {
+(function(global, d3) {
/* global d3 */
/* jshint bitwise: false */
@@ -688,4 +688,4 @@
global.D3Funnel = D3Funnel;
-})(window);
+})(window, d3);
|
Specify d3 dependency in self-execution
|
jakezatecky_d3-funnel
|
train
|
js
|
6b3be584ec9777bbadf5db4e13db74d59a5ab534
|
diff --git a/mwreverts/about.py b/mwreverts/about.py
index <HASH>..<HASH> 100644
--- a/mwreverts/about.py
+++ b/mwreverts/about.py
@@ -1,5 +1,5 @@
__name__ = "mwreverts"
-__version__ = "0.1.4"
+__version__ = "0.1.5"
__author__ = "Aaron Halfaker"
__author_email__ = "aaron.halfaker@gmail.com"
__description__ = "A set of utilities for detecting reverts in MediaWiki " + \
|
Increments version to <I>
|
mediawiki-utilities_python-mwreverts
|
train
|
py
|
9a03116899b78b9d5c191fe3fad224c9b7ac7ddb
|
diff --git a/lib/cli/resolve-input.js b/lib/cli/resolve-input.js
index <HASH>..<HASH> 100644
--- a/lib/cli/resolve-input.js
+++ b/lib/cli/resolve-input.js
@@ -62,7 +62,7 @@ module.exports = memoizee((commandsSchema = require('./commands-schema')) => {
}
// Unlikely scenario, where after applying the command schema different command resolves
// It can happen only in cases where e.g. for "sls deploy --force function -f foo"
- // we intially assume "deploy" command, while after applying "deploy" command schema it's
+ // we initially assume "deploy" command, while after applying "deploy" command schema it's
// actually a "deploy function" command that resolves
command = resolvedCommand;
commandSchema = commandsSchema.get(resolvedCommand);
|
chore: Fix typo in `resolve-input.js` (#<I>)
intially -> initially
|
serverless_serverless
|
train
|
js
|
c42bec36ad58b3f670a5202d8701158280e26a43
|
diff --git a/lib/minicron/cli.rb b/lib/minicron/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/minicron/cli.rb
+++ b/lib/minicron/cli.rb
@@ -20,8 +20,8 @@ module Minicron
#
# @param opts [Hash] The Commander provided options hash
def self.parse_config(opts)
- # Parse the --config file options if it was passed
- Minicron.parse_file_config(opts.config) if opts.config
+ # Parse the file config
+ Minicron.parse_file_config(opts.config)
# Parse the cli options
Minicron.parse_config_hash(
|
Revert as per #<I>
|
jamesrwhite_minicron
|
train
|
rb
|
c20ae3b486bc9f063c885ece0f5e92fbe137bfae
|
diff --git a/src/geshi.php b/src/geshi.php
index <HASH>..<HASH> 100644
--- a/src/geshi.php
+++ b/src/geshi.php
@@ -1735,9 +1735,10 @@ class GeSHi
$result .= @htmlspecialchars($part, ENT_COMPAT, $this->encoding);
}
// Close the <span> that surrounds the block
- if ($this->strict_mode && $this->lexic_permissions['SCRIPT']) {
+ // Removed since the only time this is used is for php and it doesn't need a </span>
+ /*if ($this->strict_mode && $this->lexic_permissions['SCRIPT']) {
$result .= '</span>';
- }
+ }*/
} else {
// Else not a block to highlight
$result .= @htmlspecialchars($part, ENT_COMPAT, $this->encoding);
|
Commented out code that adds </span> for strict mode, since the </span> is never needed.
|
GeSHi_geshi-1.0
|
train
|
php
|
7d69089de45d70fb479acdb2965e2a16ce1e70b2
|
diff --git a/pages/WriteReview/components/ReviewForm/style.js b/pages/WriteReview/components/ReviewForm/style.js
index <HASH>..<HASH> 100644
--- a/pages/WriteReview/components/ReviewForm/style.js
+++ b/pages/WriteReview/components/ReviewForm/style.js
@@ -9,7 +9,7 @@ import { css } from 'glamor';
import variables from 'Styles/variables';
const container = css({
- margin: `${variables.gap.large}px ${variables.gap.big}px ${variables.gap.big}px`,
+ margin: `${variables.gap.big}px`,
}).toString();
export default {
diff --git a/styles/variables.js b/styles/variables.js
index <HASH>..<HASH> 100644
--- a/styles/variables.js
+++ b/styles/variables.js
@@ -5,7 +5,6 @@ export default {
gap: {
small: 8,
big: 16,
- large: 24,
},
navigator: {
height: 56,
|
CON-<I>: Users can write new reviews
- adjust styling of write review form
|
shopgate_pwa
|
train
|
js,js
|
ca319818fc7be7a011895c17cc0d7a77f7d2e41a
|
diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php
index <HASH>..<HASH> 100644
--- a/blocks/moodleblock.class.php
+++ b/blocks/moodleblock.class.php
@@ -49,15 +49,20 @@ class MoodleBlock {
return $this->get_content();
}
function print_block() {
- // Wrap it up, in case we have buttons too
+ // Wrap the title in a floating DIV, in case we have edit controls to display
+ // These controls will always be wrapped on a right-floating DIV
$title = '<div style="float: left;">'.$this->title.'</div>';
if($this->edit_controls !== NULL) {
$title .= $this->edit_controls;
}
+
$this->get_content();
switch($this->content_type) {
case BLOCK_TYPE_TEXT:
+ if(empty($this->content->text)) {
+ break;
+ }
if ($this->edit_controls !== NULL || !$this->hide_header()) {
print_side_block($title, $this->content->text, NULL, NULL, $this->content->footer);
} else {
@@ -65,6 +70,9 @@ class MoodleBlock {
}
break;
case BLOCK_TYPE_LIST:
+ if(empty($this->content->items)) {
+ break;
+ }
if ($this->edit_controls !== NULL || !$this->hide_header()) {
print_side_block($title, '', $this->content->items, $this->content->icons, $this->content->footer);
} else {
|
Don't display blocks that have no content at all. I 'm not sure if this
could cause any confusion, but it solves the problem with the admin block
being displayed to guests.
The thought about a "display only to X and Y kinds of users" feature came
to mind, but maybe that would be more confusing than useful.
|
moodle_moodle
|
train
|
php
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.