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
|
---|---|---|---|---|---|
f70dcaf29617db4eded6305c0c42bd8fbd6bc968 | diff --git a/src/interpreter.js b/src/interpreter.js
index <HASH>..<HASH> 100644
--- a/src/interpreter.js
+++ b/src/interpreter.js
@@ -100,8 +100,8 @@
var fn = resolve({
ref: interpretAst(Isla.Parser.extract(ast, "invocation", 0), env)
}, env);
- var param = interpretAst(Isla.Parser.extract(ast, "invocation", 1),
- env).val;
+ var param = resolve(interpretAst(Isla.Parser.extract(ast, "invocation", 1),
+ env).val, env);
var returnVal = fn(env, param);
return nreturn(env.ctx, returnVal);
}) | Resolve param before passing to fn. | maryrosecook_isla | train | js |
0189bcde0f04eeae0d90acda460317c1d1cbb939 | diff --git a/hdf5storage/utilities.py b/hdf5storage/utilities.py
index <HASH>..<HASH> 100644
--- a/hdf5storage/utilities.py
+++ b/hdf5storage/utilities.py
@@ -587,10 +587,20 @@ def decode_complex(data, complex_names=(None, None)):
cnames[1] = s
# If the real and imaginary fields were found, construct the complex
- # form from the fields. Otherwise, return what we were given because
- # it isn't in the right form.
+ # form from the fields. Now, in the case that one part is NaN but
+ # the other is not, simply adding the real and complex parts
+ # together will set both to NaN; so the ones where one and only one
+ # component is NaN have to be set manually using the complex
+ # function. Otherwise, return what we were given because it isn't in
+ # the right form.
if cnames[0] is not None and cnames[1] is not None:
- return data[cnames[0]] + 1j*data[cnames[1]]
+ cdata = data[cnames[0]] + 1j*data[cnames[1]]
+ for index in np.flatnonzero(np.isnan(data[cnames[0]]) \
+ ^ np.isnan(data[cnames[1]])):
+ cdata.ravel()[index] = complex( \
+ data[cnames[0]].ravel()[index], \
+ data[cnames[1]].ravel()[index])
+ return cdata
else:
return data | Fixed bug when reading complex numbers where one part is NaN but the other is not. | frejanordsiek_hdf5storage | train | py |
c96101654d59ae0cf9839ea5af597d707801f640 | diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php
index <HASH>..<HASH> 100644
--- a/code/controllers/CMSMain.php
+++ b/code/controllers/CMSMain.php
@@ -700,6 +700,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$columns->setFieldCasting(array(
'Created' => 'Date->Ago',
'LastEdited' => 'Date->Ago',
+ 'getTreeTitle' => 'HTMLText'
));
$controller = $this; | BUG <I>e2efb<I>d broke the Page ListView. | silverstripe_silverstripe-siteconfig | train | php |
5a5770ec2fc119bab7007794d3bc87b55528b4fe | diff --git a/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java b/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
index <HASH>..<HASH> 100644
--- a/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
+++ b/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
@@ -799,7 +799,6 @@ public abstract class AbstractCacheableLockManager implements CacheableLockManag
for (LockData lockData : locks)
{
removeLock(lockData.getNodeIdentifier());
- doRemove(lockData);
}
} | EXOJCR-<I>: support cache migration from <I>.x to <I>.x | exoplatform_jcr | train | java |
6e237081e9f3b5d552363b9621e284ad702f9450 | diff --git a/CalendarFXView/src/main/java/impl/com/calendarfx/view/page/PageBaseSkin.java b/CalendarFXView/src/main/java/impl/com/calendarfx/view/page/PageBaseSkin.java
index <HASH>..<HASH> 100644
--- a/CalendarFXView/src/main/java/impl/com/calendarfx/view/page/PageBaseSkin.java
+++ b/CalendarFXView/src/main/java/impl/com/calendarfx/view/page/PageBaseSkin.java
@@ -20,6 +20,7 @@ import com.calendarfx.view.Messages;
import com.calendarfx.view.page.PageBase;
import impl.com.calendarfx.view.NavigateDateView;
import javafx.geometry.Insets;
+import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.SkinBase;
import javafx.scene.layout.BorderPane;
@@ -54,6 +55,8 @@ public abstract class PageBaseSkin<C extends PageBase> extends SkinBase<C> {
BorderPane.setMargin(navigateDateButton, new Insets(10));
BorderPane.setMargin(dateText, new Insets(10));
+ BorderPane.setAlignment(navigateDateButton, Pos.CENTER_LEFT);
+ BorderPane.setAlignment(dateText, Pos.CENTER_RIGHT);
headerPane = new BorderPane();
headerPane.getStyleClass().add("header"); | Slightly changed position of navigation elements (back, forward, today) and date label. | dlemmermann_CalendarFX | train | java |
97fc559b23b8932ec6d0425b93a29af2df488e2c | diff --git a/src/Picqer/Financials/Moneybird/Entities/PurchaseInvoice.php b/src/Picqer/Financials/Moneybird/Entities/PurchaseInvoice.php
index <HASH>..<HASH> 100644
--- a/src/Picqer/Financials/Moneybird/Entities/PurchaseInvoice.php
+++ b/src/Picqer/Financials/Moneybird/Entities/PurchaseInvoice.php
@@ -77,7 +77,7 @@ class PurchaseInvoice extends Model
* Register a payment for the current purchase invoice
*
* @param PurchaseInvoicePayment $purchaseInvoicePayment (payment_date and price are required)
- * @return mixed
+ * @return $this
* @throws ApiException
*/
public function registerPayment(PurchaseInvoicePayment $purchaseInvoicePayment) | Update PurchaseInvoice.php
Updated DocBlock | picqer_moneybird-php-client | train | php |
0781163558bb459a538115cd5b7a57708defb56a | diff --git a/openquake/engine/settings.py b/openquake/engine/settings.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/settings.py
+++ b/openquake/engine/settings.py
@@ -53,7 +53,7 @@ def _db_cfg(db_name):
NAME=DB_SECTION.get('name', 'openquake'),
USER=DB_SECTION.get('%s_user' % db_name, 'openquake'),
PASSWORD=DB_SECTION.get('%s_password' % db_name, ''),
- HOST=DB_SECTION.get('host', ''),
+ HOST=DB_SECTION.get('host', 'localhost'),
PORT=DB_SECTION.get('port', '5432'),
)
@@ -72,8 +72,8 @@ DATABASES['default'] = {
'NAME': DB_SECTION.get('name', 'openquake'),
'USER': DB_SECTION.get('%s_user' % DEFAULT_USER, 'oq_admin'),
'PASSWORD': DB_SECTION.get('%s_password' % DEFAULT_USER, 'openquake'),
- 'HOST': '',
- 'PORT': '5432',
+ 'HOST' : DB_SECTION.get('host', 'localhost'),
+ 'PORT' : DB_SECTION.get('port', '5432'),
}
DATABASE_ROUTERS = ['openquake.engine.db.routers.OQRouter'] | Change the 'default' Django db setting to use cfg settings.
In this way we always use only one method to connect to PostgreSQL (via TCP) instead of mixing TCP and sockets | gem_oq-engine | train | py |
2a8a5893d1a4d7e1fa2e1bf4050e90a0fe4e4593 | diff --git a/colorclass/windows.py b/colorclass/windows.py
index <HASH>..<HASH> 100644
--- a/colorclass/windows.py
+++ b/colorclass/windows.py
@@ -321,15 +321,9 @@ class Windows(object):
return changed
@staticmethod
- def is_enabled(both=False):
- """Return True if either stderr or stdout has colors enabled.
-
- :param bool both: Return True if both stderr or stdout have colors enabled.
- """
- if both:
- return hasattr(sys.stderr, '_original_stream') and hasattr(sys.stdout, '_original_stream')
- else:
- return hasattr(sys.stderr, '_original_stream') or hasattr(sys.stdout, '_original_stream')
+ def is_enabled():
+ """Return True if either stderr or stdout has colors enabled."""
+ return hasattr(sys.stderr, '_original_stream') or hasattr(sys.stdout, '_original_stream')
@classmethod
def enable(cls, auto_colors=False, reset_atexit=False): | Revert is_enabled().
Reverting to current release code. No longer need "both" keyword arg. | Robpol86_colorclass | train | py |
6085e6e622b92b2ca9cca4df7401a3a53e357296 | diff --git a/mungers/submit-queue.go b/mungers/submit-queue.go
index <HASH>..<HASH> 100644
--- a/mungers/submit-queue.go
+++ b/mungers/submit-queue.go
@@ -1014,9 +1014,14 @@ func (sq *SubmitQueue) doGithubE2EAndMerge(obj *github.MungeObject) bool {
return true
}
- maySkipTest := sq.interruptedObj != nil && !sq.interruptedObj.hasSHAChanged()
+ interruptedObj := sq.interruptedObj
sq.interruptedObj = nil
- if maySkipTest {
+ if interruptedObj != nil {
+ if interruptedObj.hasSHAChanged() {
+ // This PR will have to be rested.
+ // Make sure we don't have higher priority first.
+ return false
+ }
glog.Infof("Skipping retest since head and base sha match previous attempt!")
atomic.AddInt32(&sq.retestsAvoided, 1)
} else { | Get new PR if interrupted PR has changed
If the interrupted PR has changed, it means we will need to re-test
it. Make sure that we don't test this PR if we have any other higher
priority PR to test first. This is done by going trough the loop on more
time without removing the interrupted PR from the list. | kubernetes_test-infra | train | go |
0b6e917675014714bc7df63d6338320657ceb3aa | diff --git a/alert_windows.go b/alert_windows.go
index <HASH>..<HASH> 100644
--- a/alert_windows.go
+++ b/alert_windows.go
@@ -8,7 +8,14 @@ import (
// Alert displays a desktop notification and plays a default system sound.
func Alert(title, message, appIcon string) error {
- note := toastNotification(title, message, pathAbs(appIcon))
- note.Audio = toast.Default
- return note.Push()
+ if isWindows10 {
+ note := toastNotification(title, message, pathAbs(appIcon))
+ note.Audio = toast.Default
+ return note.Push()
+ }
+
+ if err := Notify(title, message, appIcon); err != nil {
+ return err
+ }
+ return Beep(DefaultFreq, DefaultDuration)
} | Show alert if Windows version is not <I> | gen2brain_beeep | train | go |
b84de61b13b2e2c90d35de6cac821dfe3f1aadf3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -30,7 +30,7 @@ setup(
'coveralls = coveralls.cli:main',
],
},
- install_requires=['PyYAML>=3.10', 'docopt>=0.6.1', 'coverage>=3.6', 'requests>=1.0.0'],
+ install_requires=['PyYAML>=3.10', 'docopt>=0.6.1', 'coverage>=3.6,<4.0', 'requests>=1.0.0'],
tests_require=['mock', 'pytest', 'sh>=1.08'],
cmdclass={'test': PyTest},
classifiers=[ | Add upper version contraint for the coverage depedency (coverage <I> breaks coveralls). | coveralls-clients_coveralls-python | train | py |
39646ab222a80d2a28af2e893afc24376f7acd3f | diff --git a/src/Hodor/Daemon/SupervisordManager.php b/src/Hodor/Daemon/SupervisordManager.php
index <HASH>..<HASH> 100644
--- a/src/Hodor/Daemon/SupervisordManager.php
+++ b/src/Hodor/Daemon/SupervisordManager.php
@@ -33,7 +33,10 @@ class SupervisordManager implements ManagerInterface
$config_contents .= $this->generateProgramText($program) . "\n";
}
- if (!file_put_contents($config_path, $config_contents)) {
+ if (!is_writable(dirname($config_path))
+ || (file_exists($config_path) && !is_writable($config_path))
+ || false === file_put_contents($config_path, $config_contents)
+ ) {
throw new Exception("Could not write to config file '{$config_path}'.\n");
}
} | Fix exception throwing in SupervisordManager#setupDaemon()
file_put_contents() will throw a PHP warning if the file is
not writable, so the exception will not be thrown in cases
where the error handler exits on error. Checking to see if
the file is writable before writing the file will prevent
these warnings. | lightster_hodor | train | php |
588688baa7e9b43bed8d417f4cda17884ba9a434 | diff --git a/fabfile.py b/fabfile.py
index <HASH>..<HASH> 100644
--- a/fabfile.py
+++ b/fabfile.py
@@ -187,15 +187,19 @@ def release(ctx):
# Build and publish package
pkgbuild(ctx)
- pathname = f'dist/{project_name}-{version.__version__}.tar.gz'
-
- local(ctx, f'twine upload -u {pypi_auth["user"]} -p {pypi_auth["pass"]} {pathname}')
+ pkgupload(ctx)
# Remove temporary files
clean(ctx)
@task
+def pkgupload(ctx):
+ pathname = f'dist/{project_name}-{version.__version__}.tar.gz'
+ local(ctx, 'twine upload -u "{}" -p "{}" "{}"'.format(pypi_auth["user"], pypi_auth["pass"], pathname))
+
+
+@task
def pkgbuild(ctx):
"""
Build package in docker container | fixed issue due to zsh escaping | elehcimd_pynb | train | py |
f3da469eb717ca10773b81a1b58f9ea61c263a2c | diff --git a/src/main/java/reactor/ipc/netty/channel/PooledClientContextHandler.java b/src/main/java/reactor/ipc/netty/channel/PooledClientContextHandler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/reactor/ipc/netty/channel/PooledClientContextHandler.java
+++ b/src/main/java/reactor/ipc/netty/channel/PooledClientContextHandler.java
@@ -190,9 +190,9 @@ final class PooledClientContextHandler<CHANNEL extends Channel>
if (!c.isActive()) {
if (log.isDebugEnabled()) {
- log.debug(format(c, "Immediately aborted pooled channel, re-acquiring new channel"));
+ log.debug(format(c, "Immediately aborted pooled channel"));
}
- setFuture(pool.acquire());
+// setFuture(pool.acquire());
return;
} | Do not re-acquire (loss of original listener) - leave aborted return | reactor_reactor-netty | train | java |
cffe94e8e5307bcaa41229c265c1e5c803929c6e | diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/component/StatelessEJBComponent.java b/ejb3/src/main/java/org/jboss/as/ejb3/component/StatelessEJBComponent.java
index <HASH>..<HASH> 100644
--- a/ejb3/src/main/java/org/jboss/as/ejb3/component/StatelessEJBComponent.java
+++ b/ejb3/src/main/java/org/jboss/as/ejb3/component/StatelessEJBComponent.java
@@ -61,7 +61,8 @@ public class StatelessEJBComponent extends AbstractComponent {
@Override
protected AbstractComponentInstance constructComponentInstance(Object instance) {
- throw new RuntimeException("NYI: org.jboss.as.ejb3.component.StatelessEJBComponent.constructComponentInstance");
+ // TODO: Implement this!
+ return null;
}
@Override | Bring in the latest from upstream and fix the compilation issues | wildfly_wildfly | train | java |
055efb9cf064bd5959b9c76c9b5202bff74c1855 | diff --git a/design/root_test.go b/design/root_test.go
index <HASH>..<HASH> 100644
--- a/design/root_test.go
+++ b/design/root_test.go
@@ -20,7 +20,7 @@ func TestRootExprValidate(t *testing.T) {
Errors: []error{},
},
},
- "not result type": {
+ "missing api declaration": {
api: nil,
expected: &eval.ValidationErrors{
Errors: []error{fmt.Errorf("Missing API declaration")}, | Fix a test case for design.RootExpr.Validate() (#<I>) | goadesign_goa | train | go |
52a5f78b4e9fd391fbe630db42ecef4af2dd7822 | diff --git a/httpagentparser/__init__.py b/httpagentparser/__init__.py
index <HASH>..<HASH> 100644
--- a/httpagentparser/__init__.py
+++ b/httpagentparser/__init__.py
@@ -172,6 +172,14 @@ class Linux(OS):
def getVersion(self, agent): pass
+class Blackberry(OS):
+ look_for = 'BlackBerry'
+ prefs = dict(dist=["BlackberryPlaybook"], flavor=None)
+ def getVersion(self, agent): pass
+
+class BlackberryPlaybook(Dist):
+ look_for = 'PlayBook'
+ def getVersion(self, agent): pass
class Macintosh(OS):
look_for = 'Macintosh' | Blackberry: Added detection for phone and tablet (Playbook) | shon_httpagentparser | train | py |
5a8cbbb369261e6ace97f8e2115504ec61595e30 | diff --git a/rails_event_store_active_record/spec/event_repository_spec.rb b/rails_event_store_active_record/spec/event_repository_spec.rb
index <HASH>..<HASH> 100644
--- a/rails_event_store_active_record/spec/event_repository_spec.rb
+++ b/rails_event_store_active_record/spec/event_repository_spec.rb
@@ -129,6 +129,8 @@ module RailsEventStoreActiveRecord
)
repository = EventRepository.new
expect(repository.read_all_streams_forward(:head, 3).map(&:event_id)).to eq([u1,u2,u3])
+ expect(repository.read_events_forward("all", :head, 3).map(&:event_id)).to eq([u1,u2,u3])
+ expect(repository.read_stream_events_forward("all").map(&:event_id)).to eq([u1,u2,u3])
end
specify "explicit ORDER BY position" do | Unstable order of read events from GLOBAL_STREAM.
When reading via dedicated reader for traversing all streams we sort
event records by "id" only.
For traversing particular stream we primarily sort by "position", in
addition to "id".
We allow explicitly passing "all" stream to traverse this particular
stream and this is where discrepancy in resulting order appears.
Not sure if RDBMS beyond sqlite are affected. | RailsEventStore_rails_event_store | train | rb |
9b64399684ded345e1006a0b5d54f94f5f44f121 | diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/validations/uniqueness.rb
+++ b/activerecord/lib/active_record/validations/uniqueness.rb
@@ -173,10 +173,17 @@ module ActiveRecord
# This technique is also known as optimistic concurrency control:
# http://en.wikipedia.org/wiki/Optimistic_concurrency_control
#
- # Active Record currently provides no way to distinguish unique
- # index constraint errors from other types of database errors, so you
- # will have to parse the (database-specific) exception message to detect
- # such a case.
+ # The bundled ActiveRecord::ConnectionAdapters distinguish unique index
+ # constraint errors from other types of database errors by throwing an
+ # ActiveRecord::RecordNotUnique exception.
+ # For other adapters you will have to parse the (database-specific) exception
+ # message to detect such a case.
+ # The following bundled adapters throw the ActiveRecord::RecordNotUnique exception:
+ # * ActiveRecord::ConnectionAdapters::MysqlAdapter
+ # * ActiveRecord::ConnectionAdapters::Mysql2Adapter
+ # * ActiveRecord::ConnectionAdapters::SQLiteAdapter
+ # * ActiveRecord::ConnectionAdapters::SQLite3Adapter
+ # * ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
#
def validates_uniqueness_of(*attr_names)
validates_with UniquenessValidator, _merge_attributes(attr_names) | Adjust unique constraint comment to include info about the RecordNotUnique exception | rails_rails | train | rb |
4c89124683e58ad56a625b75b7bc73b3ac4826d8 | diff --git a/demo/src/main/java/com/bluelinelabs/conductor/demo/changehandler/CircularRevealChangeHandler.java b/demo/src/main/java/com/bluelinelabs/conductor/demo/changehandler/CircularRevealChangeHandler.java
index <HASH>..<HASH> 100644
--- a/demo/src/main/java/com/bluelinelabs/conductor/demo/changehandler/CircularRevealChangeHandler.java
+++ b/demo/src/main/java/com/bluelinelabs/conductor/demo/changehandler/CircularRevealChangeHandler.java
@@ -51,7 +51,7 @@ public class CircularRevealChangeHandler extends AnimatorChangeHandler {
* @param removesFromViewOnPush If true, the view being replaced will be removed from the view hierarchy on pushes
*/
public CircularRevealChangeHandler(@NonNull View fromView, @NonNull View containerView, boolean removesFromViewOnPush) {
- this(fromView, containerView, DEFAULT_ANIMATION_DURATION, true);
+ this(fromView, containerView, DEFAULT_ANIMATION_DURATION, removesFromViewOnPush);
}
/** | Update CircularRevealChangeHandler to not ignore removesFromViewOnPush (#<I>) | bluelinelabs_Conductor | train | java |
51da7bad8c537a19e4352bc1b310c7458bc9e3aa | diff --git a/src/ol/format/gml/gmlbase.js b/src/ol/format/gml/gmlbase.js
index <HASH>..<HASH> 100644
--- a/src/ol/format/gml/gmlbase.js
+++ b/src/ol/format/gml/gmlbase.js
@@ -170,8 +170,11 @@ ol.format.GMLBase.prototype.readFeature_ = function(node, objectStack) {
}
values[ol.xml.getLocalName(n)] = value;
} else {
- geometryName = ol.xml.getLocalName(n);
- values[geometryName] = this.readGeometryElement(n, objectStack);
+ // boundedBy is an extent and must not be considered as a geometry
+ if (n.localName !== 'boundedBy') {
+ geometryName = ol.xml.getLocalName(n);
+ }
+ values[ol.xml.getLocalName(n)] = this.readGeometryElement(n, objectStack);
}
}
var feature = new ol.Feature(values); | Element boundedBy must not be set as geometry field on GML reading | openlayers_openlayers | train | js |
a8dd03e3798d7695a10915f6c13d6f608cd05d80 | diff --git a/pylivetrader/backend/alpaca.py b/pylivetrader/backend/alpaca.py
index <HASH>..<HASH> 100644
--- a/pylivetrader/backend/alpaca.py
+++ b/pylivetrader/backend/alpaca.py
@@ -446,7 +446,7 @@ class Backend(BaseBackend):
return
def get_last_traded_dt(self, asset):
- trade = self._api.get_last_trade(asset.symbol)
+ trade = self._api.get_latest_trade(asset.symbol)
return trade.timestamp
def get_spot_value(
@@ -496,7 +496,7 @@ class Backend(BaseBackend):
@skip_http_error((404, 504))
def fetch(symbol):
- return self._api.get_last_trade(symbol)
+ return self._api.get_latest_trade(symbol)
return parallelize(fetch)(symbols) | Remove remaining usages of data v1 | alpacahq_pylivetrader | train | py |
d8db09d4c2628d6bf087db45ee82066a7d1ff690 | diff --git a/scripts/synchronize_test_cases.py b/scripts/synchronize_test_cases.py
index <HASH>..<HASH> 100755
--- a/scripts/synchronize_test_cases.py
+++ b/scripts/synchronize_test_cases.py
@@ -20,7 +20,7 @@ class Synchronize(object):
'test_case': 'test_case',
'test_case_item': 'test_case/{test_case_id}',
'testable': 'testable',
- 'project_info': 'project/{project_id}'}
+ 'project_info': 'p/{project_id}/info'}
@staticmethod
def _get_config(section): | fix project_info route for json view | ucsb-cs_submit | train | py |
eb1475839e07beb69d7f7031b377c1f814938f08 | diff --git a/concrete/src/Http/Middleware/ThumbnailMiddleware.php b/concrete/src/Http/Middleware/ThumbnailMiddleware.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Http/Middleware/ThumbnailMiddleware.php
+++ b/concrete/src/Http/Middleware/ThumbnailMiddleware.php
@@ -73,8 +73,7 @@ class ThumbnailMiddleware implements MiddlewareInterface, ApplicationAwareInterf
// if the thumbnail generator is async, we do not use the thumbnail middleware.
if ($this->app->isInstalled() && $this->config->get('concrete.misc.basic_thumbnailer_generation_strategy') == 'now') {
- if ($response->getStatusCode() == 200) {
- /* @var Connection $database */
+ if ($response && $response->getStatusCode() == 200) {
try {
$database = $this->getConnection();
} catch (\InvalidArgumentException $e) { | Fix checking response status code in ThumbnailMiddleware | concrete5_concrete5 | train | php |
e1aeef1cb436eb19febd145116e708818f04fd88 | diff --git a/lib/OTP.php b/lib/OTP.php
index <HASH>..<HASH> 100644
--- a/lib/OTP.php
+++ b/lib/OTP.php
@@ -72,23 +72,6 @@ abstract class OTP implements OTPInterface
}
/**
- * @param string $value
- *
- * @return boolean
- */
- protected function hasSemicolon($value)
- {
- $semicolons = array(':', '%3A', '%3a');
- foreach ($semicolons as $semicolon) {
- if (false !== strpos($value, $semicolon)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
* @return string
*
* @throws \Exception | hasSemiColon removed | Spomky-Labs_otphp | train | php |
6bb85bbbee2a4cd7e725728fc33b5f4cca3484a6 | diff --git a/package.json b/package.json
index <HASH>..<HASH> 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "quasar-framework",
- "version": "0.12.1",
+ "version": "0.13.0",
"description": "Simultaneously build desktop/mobile SPA websites & phone/tablet apps with VueJS",
"main": "dist/quasar.common.js",
"jsnext:main": "dist/quasar.es6.js",
diff --git a/src/index.es6.js b/src/index.es6.js
index <HASH>..<HASH> 100644
--- a/src/index.es6.js
+++ b/src/index.es6.js
@@ -23,7 +23,7 @@ import Utils from './utils'
import { LocalStorage, SessionStorage } from './features/web-storage'
let Quasar = {
- version: '0.12.1',
+ version: '0.13.0',
install,
start,
theme
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -23,7 +23,7 @@ import Utils from './utils'
import { LocalStorage, SessionStorage } from './features/web-storage'
let Quasar = {
- version: '0.12.1',
+ version: '0.13.0',
install,
start,
theme, | chore: Bump future version to <I> (instead of <I>) due to so many novelties | quasarframework_quasar | train | json,js,js |
ac648cda456aeb5ac5922e52f7d9346b23ad8755 | diff --git a/ccmlib/node.py b/ccmlib/node.py
index <HASH>..<HASH> 100644
--- a/ccmlib/node.py
+++ b/ccmlib/node.py
@@ -274,7 +274,9 @@ class Node():
the log is watched from the beginning.
"""
tofind = nodes if isinstance(nodes, list) else [nodes]
- tofind = [ "%s is now dead" % node.address() for node in tofind ]
+ version = self.cluster.version()
+ deadstr = "DOWN" if version >= '1.2.4' else "dead"
+ tofind = [ "%s is now %s" % (node.address(), deadstr) for node in tofind ]
self.watch_log_for(tofind, from_mark=from_mark, timeout=timeout)
def watch_log_for_alive(self, nodes, from_mark=None, timeout=60): | Fix log detection post-<I> | riptano_ccm | train | py |
4eafabc2a663a5c2a0b7eb49e524530bd82f9edb | diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php
index <HASH>..<HASH> 100644
--- a/lib/db/upgrade.php
+++ b/lib/db/upgrade.php
@@ -586,6 +586,10 @@ function xmldb_main_upgrade($oldversion) {
$table->add_key('sourcecmid', XMLDB_KEY_FOREIGN, array('sourcecmid'), 'course_modules', array('id'));
$table->add_key('gradeitemid', XMLDB_KEY_FOREIGN, array('gradeitemid'), 'grade_items', array('id'));
+ if (!$dbman->table_exists($table)) {
+ $dbman->create_table($table);
+ }
+
// Main savepoint reached
upgrade_main_savepoint(true, 2012051100.03);
} | MDL-<I> core_condition: Rebase with integration removed add table function | moodle_moodle | train | php |
06e1c8fdc97f2722ab869b10eb4cf6fdb6efdbb1 | diff --git a/lib/mongo/server/monitor.rb b/lib/mongo/server/monitor.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/server/monitor.rb
+++ b/lib/mongo/server/monitor.rb
@@ -139,16 +139,20 @@ module Mongo
RTT_WEIGHT_FACTOR * new_rtt + (1 - RTT_WEIGHT_FACTOR) * (@last_round_trip_time || new_rtt)
end
+ def calculate_average_round_trip_time(start)
+ @last_round_trip_time = average_round_trip_time(start)
+ end
+
def ismaster
@mutex.synchronize do
start = Time.now
begin
result = connection.dispatch([ ISMASTER ]).documents[0]
- return result, @last_round_trip_time = average_round_trip_time(start)
+ return result, calculate_average_round_trip_time(start)
rescue Exception => e
log_debug([ e.message ])
connection.disconnect!
- return {}, average_round_trip_time(start)
+ return {}, calculate_average_round_trip_time(start)
end
end
end | Separate setting variable and calculating the average | mongodb_mongo-ruby-driver | train | rb |
1084fbb3140e05601bc05ceaa45df55e68ffd637 | diff --git a/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/webservice/WSDLImporterTest.java b/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/webservice/WSDLImporterTest.java
index <HASH>..<HASH> 100644
--- a/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/webservice/WSDLImporterTest.java
+++ b/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/webservice/WSDLImporterTest.java
@@ -47,7 +47,6 @@ public class WSDLImporterTest {
List<Structure> structures = new ArrayList<Structure>(importer.getStructures());
Collections.sort(structures, new Comparator<Structure>() {
- @Override
public int compare(Structure o1, Structure o2) {
return o1.getId().compareTo(o2.getId());
}
@@ -56,7 +55,6 @@ public class WSDLImporterTest {
List<WSOperation> operations = new ArrayList<WSOperation>(importer.getOperations());
Collections.sort(operations, new Comparator<WSOperation>() {
- @Override
public int compare(WSOperation o1, WSOperation o2) {
return o1.getName().compareTo(o2.getName());
} | Removed @Overrides, since Eclipse doesnt like them | Activiti_Activiti | train | java |
c04a43c2a11f5830df744d05bd0bbe7bc3ad25b8 | diff --git a/src/styles/text/feature_label.js b/src/styles/text/feature_label.js
index <HASH>..<HASH> 100644
--- a/src/styles/text/feature_label.js
+++ b/src/styles/text/feature_label.js
@@ -27,6 +27,7 @@ export default class FeatureLabel {
if (rule.font.stroke && rule.font.stroke.color) {
style.stroke = Utils.toCanvasColor(StyleParser.parseColor(rule.font.stroke.color));
style.stroke_width = rule.font.stroke.width || default_font_style.stroke.width;
+ style.stroke_width = style.stroke_width && parseFloat(style.stroke_width);
}
// Font properties are modeled after CSS names: | text: can include 'px' units when setting stroke width | tangrams_tangram | train | js |
efb9d411bc887909f8588c9c7191d8fe09ede7d9 | diff --git a/salt/scripts.py b/salt/scripts.py
index <HASH>..<HASH> 100644
--- a/salt/scripts.py
+++ b/salt/scripts.py
@@ -70,7 +70,9 @@ def minion_process(queue):
# check pid alive (Unix only trick!)
os.kill(parent_pid, 0)
except OSError:
- sys.exit(999)
+ # forcibly exit, regular sys.exit raises an exception-- which
+ # isn't sufficient in a thread
+ os._exit(999)
if not salt.utils.is_windows():
thread = threading.Thread(target=suicide_when_without_parent, args=(os.getppid(),))
thread.start() | Fix suicide_when_without_parent
If you call sys.exit within a thread it raises SystemExit-- which inside of a thread just exits the thread. This os._exit() will *actually* allow the thread to cause the process to exit | saltstack_salt | train | py |
726b9e216c29ea93f78a2ab8a4eed8bc081fe6a4 | diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -4,7 +4,7 @@ package ipfs
var CurrentCommit string
// CurrentVersionNumber is the current application's version literal
-const CurrentVersionNumber = "0.11.0-dev"
+const CurrentVersionNumber = "0.11.0-rc1"
const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/" | Release <I>-rc1 | ipfs_go-ipfs | train | go |
68952efc5b59618b5d660f34f834aa2a2ff533df | diff --git a/test/repository.spec.js b/test/repository.spec.js
index <HASH>..<HASH> 100644
--- a/test/repository.spec.js
+++ b/test/repository.spec.js
@@ -255,7 +255,7 @@ describe('Repository', function() {
it('should show repo collaborators', function(done) {
remoteRepo.getCollaborators(assertSuccessful(done, function(err, collaborators) {
if (!(collaborators instanceof Array)) {
- console.log(collaborator); // eslint-disable-line
+ console.log(collaborators); // eslint-disable-line
}
expect(collaborators).to.be.an.array();
expect(collaborators).to.have.length(1); | chore: fix loggining to determine why collaborators test fails sometimes | github-tools_github | train | js |
09704eaff28f76bc2d97febc99fbd57de576c608 | diff --git a/seed_identity_store/settings.py b/seed_identity_store/settings.py
index <HASH>..<HASH> 100644
--- a/seed_identity_store/settings.py
+++ b/seed_identity_store/settings.py
@@ -220,6 +220,7 @@ CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_IGNORE_RESULT = True
+CELERYD_MAX_TASKS_PER_CHILD = 1000
djcelery.setup_loader() | Added max tasks per worker celery setting | praekeltfoundation_seed-identity-store | train | py |
6afe9ba8d9fb18e228a888fe846fa0a1d2c0ad7d | diff --git a/otherfile/font_wizard.py b/otherfile/font_wizard.py
index <HASH>..<HASH> 100644
--- a/otherfile/font_wizard.py
+++ b/otherfile/font_wizard.py
@@ -83,6 +83,20 @@ if __name__ == "__main__":
print(Error4)
sys.exit()
if len(font_dic) == 95:
+ font_name = input("Please enter font name (string) : ")
+ #TODO: Check if name is unique.
+ text_dic_file = open("../art/text_dic3.py", "a+")
+ text_dic_file.write("\n")
+ text_dic_file.write(font_name + " = {\n")
+ letter_index = 0
+ for letter in Letters + " ":
+ text_dic_file.write(" " + "'" + letter + "': '" + font_dic[letter] + "'")
+ if letter_index < 94:
+ text_dic_file.write(",\n")
+ else:
+ text_dic_file.write("}\n")
+ letter_index += 1
+ text_dic_file.close()
print("Done!")
print("Font dictionary : \n")
print(font_dic) | add : fonts automatically addition to text_dic addded.#<I> | sepandhaghighi_art | train | py |
5abaf86609f4d05e8fbf6871520d952b82918387 | diff --git a/resource_aws_vpn_gateway.go b/resource_aws_vpn_gateway.go
index <HASH>..<HASH> 100644
--- a/resource_aws_vpn_gateway.go
+++ b/resource_aws_vpn_gateway.go
@@ -25,13 +25,6 @@ func resourceAwsVpnGateway() *schema.Resource {
ForceNew: true,
},
- "type": &schema.Schema{
- Type: schema.TypeString,
- Default: "ipsec.1",
- Optional: true,
- ForceNew: true,
- },
-
"vpc_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
@@ -48,7 +41,7 @@ func resourceAwsVpnGatewayCreate(d *schema.ResourceData, meta interface{}) error
createOpts := &ec2.CreateVPNGatewayRequest{
AvailabilityZone: aws.String(d.Get("availability_zone").(string)),
- Type: aws.String(d.Get("type").(string)),
+ Type: aws.String("ipsec.1"),
}
// Create the VPN gateway
@@ -88,7 +81,6 @@ func resourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error {
d.Set("vpc_id", vpnGateway.VPCAttachments[0].VPCID)
}
d.Set("availability_zone", vpnGateway.AvailabilityZone)
- d.Set("type", vpnGateway.Type)
d.Set("tags", tagsToMapSDK(vpnGateway.Tags))
return nil | Hardcode type parameter value.
Current AWS documentation says there's only one type of VPN gateway for
now. | terraform-providers_terraform-provider-aws | train | go |
8e2796cded713090341e97000d0db9fa20e385d0 | diff --git a/core/src/com/google/inject/Binder.java b/core/src/com/google/inject/Binder.java
index <HASH>..<HASH> 100644
--- a/core/src/com/google/inject/Binder.java
+++ b/core/src/com/google/inject/Binder.java
@@ -189,9 +189,9 @@ public interface Binder {
* eligible for interception if:
*
* <ul>
- * <li>Guice created the instance the method is on
- * <li>Neither the enclosing type nor the method is final
- * <li>And the method is package-private, protected, or public
+ * <li>Guice created the instance the method is on
+ * <li>Neither the enclosing type nor the method is final
+ * <li>And the method is package-private, protected, or public
* </ul>
*
* @param classMatcher matches classes the interceptor should apply to. For example: {@code | Prevent external Google code from implementing the Binder interface.
-------------
Created by MOE: <URL> | google_guice | train | java |
c2ce0606900517e98f5dbfbd7d03f91424bc5867 | diff --git a/secretservice/secretservice.go b/secretservice/secretservice.go
index <HASH>..<HASH> 100644
--- a/secretservice/secretservice.go
+++ b/secretservice/secretservice.go
@@ -73,6 +73,7 @@ func NewService() (*SecretService, error) {
}
signalCh := make(chan *dbus.Signal, 16)
conn.Signal(signalCh)
+ _ = conn.AddMatchSignal(dbus.WithMatchOption("org.freedesktop.Secret.Prompt", "Completed"))
return &SecretService{conn: conn, signalCh: signalCh, sessionOpenTimeout: DefaultSessionOpenTimeout}, nil
} | add signal match (#<I>) | keybase_go-keychain | train | go |
3ba30b339c6efc99638b56a8f9bd30d817bb1873 | diff --git a/lib/cequel/uuids.rb b/lib/cequel/uuids.rb
index <HASH>..<HASH> 100644
--- a/lib/cequel/uuids.rb
+++ b/lib/cequel/uuids.rb
@@ -22,7 +22,8 @@ module Cequel
timeuuid_generator.from_time(value)
elsif value.is_a?(DateTime)
timeuuid_generator.from_time(Time.at(value.to_f))
- else Type::Timeuuid.instance.cast(value)
+ else
+ Type::Timeuuid.instance.cast(value)
end
end | Make if/else chain more consistent | cequel_cequel | train | rb |
619965bd7c7c6526903ad36a7f09d7ac14e98e55 | diff --git a/packages/@vue/cli-plugin-pwa/ui.js b/packages/@vue/cli-plugin-pwa/ui.js
index <HASH>..<HASH> 100644
--- a/packages/@vue/cli-plugin-pwa/ui.js
+++ b/packages/@vue/cli-plugin-pwa/ui.js
@@ -29,7 +29,7 @@ module.exports = api => {
type: 'list',
message: 'org.vue.pwa.config.pwa.workboxPluginMode.message',
description: 'org.vue.pwa.config.pwa.workboxPluginMode.description',
- link: 'https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#which_plugin_to_use',
+ link: 'https://developer.chrome.com/docs/workbox/modules/workbox-webpack-plugin/#which-plugin-to-use',
default: 'GenerateSW',
value: data.vue && data.vue.pwa && data.vue.pwa.workboxPluginMode,
choices: [ | docs: fix <I> links | vuejs_vue-cli | train | js |
f2e29f7ef52abd467864a4af4b2f584344131114 | diff --git a/passwords/validators.py b/passwords/validators.py
index <HASH>..<HASH> 100644
--- a/passwords/validators.py
+++ b/passwords/validators.py
@@ -6,10 +6,7 @@ import re
from django.conf import settings
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
-try:
- from django.utils.encoding import smart_text
-except ImportError: # django < 1.4.2
- from django.utils.encoding import smart_unicode as smart_text
+from django.utils.encoding import smart_str
COMMON_SEQUENCES = [
@@ -191,10 +188,10 @@ class DictionaryValidator(BaseSimilarityValidator):
f.close()
if DICT_FILESIZE < 1000000:
with open(dictionary) as dictionary:
- DICT_CACHE = [smart_text(x.strip()) for x in dictionary.readlines()]
+ DICT_CACHE = [smart_str(x.strip()) for x in dictionary.readlines()]
return DICT_CACHE
with open(dictionary) as dictionary:
- return [smart_text(x.strip()) for x in dictionary.readlines()]
+ return [smart_str(x.strip()) for x in dictionary.readlines()]
class CommonSequenceValidator(BaseSimilarityValidator): | more django 4.x fixes | dstufft_django-passwords | train | py |
04631c0521dbc48397bb96000620bb09b66828f4 | diff --git a/pystache/template.py b/pystache/template.py
index <HASH>..<HASH> 100644
--- a/pystache/template.py
+++ b/pystache/template.py
@@ -138,9 +138,9 @@ class Template(object):
if match is None:
break
- section, section_name, inner = match.group(0, 1, 2)
- section_name = section_name.strip()
- it = self.context.get(section_name, None)
+ section, section_key, inner = match.group(0, 1, 2)
+ section_key = section_key.strip()
+ it = self.context.get(section_key, None)
replacer = ''
# Callable | Renamed section_name to section_key. | defunkt_pystache | train | py |
db3b52ecdaf56229ead5e4f83a08d39c36d9179f | diff --git a/lib/cache.js b/lib/cache.js
index <HASH>..<HASH> 100644
--- a/lib/cache.js
+++ b/lib/cache.js
@@ -87,7 +87,7 @@ Cache.prototype.flush = function (cb) {
async.whilst(function () {
return next
}, function (done) {
- if (it.value.modified) {
+ if (it.value && it.value.modified) {
it.value.modified = false
it.value.val = it.value.val.serialize()
self._trie.put(Buffer.from(it.key, 'hex'), it.value.val, function () { | Fix #<I> by checking it.value is valid | ethereumjs_ethereumjs-vm | train | js |
61743f2cacbd0b5968e0810d1e53181fc3abe087 | diff --git a/libs/live.php b/libs/live.php
index <HASH>..<HASH> 100644
--- a/libs/live.php
+++ b/libs/live.php
@@ -30,7 +30,10 @@
if (is_file($docs_path . "/index.md")) return $docs_path . "/index.md";
else {
if (empty($options['languages'])) return $base_doc;
- else return $base_doc[array_keys($base_doc)[0]];
+ else {
+ $t = array_keys($base_doc);
+ return $base_doc[$t[0]];
+ }
}
} else {
$url = explode("/", $url); | Fix incompatibility issue with PHP < <I> | dauxio_daux.io | train | php |
ef11721ea46406aaeb664f215a56064b827f8e04 | diff --git a/lib/addressable/uri.rb b/lib/addressable/uri.rb
index <HASH>..<HASH> 100644
--- a/lib/addressable/uri.rb
+++ b/lib/addressable/uri.rb
@@ -182,15 +182,15 @@ module Addressable
:scheme => "http"
}.merge(hints)
case uri
- when /^http:\/+/
+ when /^http:\//
uri.sub!(/^http:\/+/, "http://")
- when /^https:\/+/
+ when /^https:\//
uri.sub!(/^https:\/+/, "https://")
- when /^feed:\/+http:\/+/
+ when /^feed:\/+http:\//
uri.sub!(/^feed:\/+http:\/+/, "feed:http://")
- when /^feed:\/+/
+ when /^feed:\//
uri.sub!(/^feed:\/+/, "feed://")
- when /^file:\/+/
+ when /^file:\//
uri.sub!(/^file:\/+/, "file:///")
when /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/
uri.sub!(/^/, hints[:scheme] + "://") | remove extraneous repetition in regexes
While we're looking at unnecessary repetitions, a match against `/a+/` also
matches against `/a/`, and the latter is simpler, so just use that. | sporkmonger_addressable | train | rb |
e21d126516e6030364dd7b03f0831d56253f110a | diff --git a/physt/plotting/matplotlib.py b/physt/plotting/matplotlib.py
index <HASH>..<HASH> 100644
--- a/physt/plotting/matplotlib.py
+++ b/physt/plotting/matplotlib.py
@@ -950,7 +950,7 @@ def _apply_xy_lims(ax: Axes, h: Union[Histogram1D, Histogram2D], data: np.ndarra
if xlim[0] <= 0:
raise RuntimeError(
"Cannot use logarithmic scale for non-positive bins.")
- ax.set_xlim(xlim)
+ ax.set_xlim(*xlim)
if xscale:
ax.set_xscale(xscale) | Fix: xlim in matplotlib
Error suggested by PyCharm | janpipek_physt | train | py |
4cb207d2464a78952d36b15e0929a52c68d70fdd | diff --git a/lib/nimbus/configuration.rb b/lib/nimbus/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/nimbus/configuration.rb
+++ b/lib/nimbus/configuration.rb
@@ -188,6 +188,8 @@ module Nimbus
rescue ArgumentError => e
raise Nimbus::WrongFormatFileError, "It was not posible to parse the random forest file (#{@forest_file}): \r\n#{e.message} "
end
+ else
+ raise Nimbus::InputFileError, "Forest file not found (#{@forest_file})"
end
forest = Nimbus::Forest.new self
forest.trees = trees | Raise exception if forest file not found | xuanxu_nimbus | train | rb |
70de3ae609496fc4e55f918dbaaba62a211319f9 | diff --git a/kernel/classes/ezcache.php b/kernel/classes/ezcache.php
index <HASH>..<HASH> 100644
--- a/kernel/classes/ezcache.php
+++ b/kernel/classes/ezcache.php
@@ -157,7 +157,7 @@ class eZCache
array( 'name' => ezpI18n::tr( 'kernel/cache', 'Design base cache' ),
'id' => 'design_base',
'tag' => array( 'template' ),
- 'enabled' => true,
+ 'enabled' => $ini->variable( 'DesignSettings', 'DesignLocationCache' ) == 'enabled',
'path' => false,
'function' => array( 'eZCache', 'clearDesignBaseCache' ) ),
/**
@@ -752,7 +752,14 @@ class eZCache
$cachePath = eZSys::cacheDirectory();
$fileHandler = eZClusterFileHandler::instance();
- $fileHandler->fileDeleteByWildcard( $cachePath . '/' . eZTemplateDesignResource::DESIGN_BASE_CACHE_NAME . '*' );
+ if ( !$fileHandler instanceof eZDBFileHandler )
+ {
+ // design base cache is disabled with eZDBFileHandler cluster
+ // handler, see eZTemplateDesignResource::allDesignBases()
+ $fileHandler->fileDelete(
+ $cachePath, eZTemplateDesignResource::DESIGN_BASE_CACHE_NAME
+ );
+ }
}
/** | Fixed #<I>: Clearing the design base cache causes timeouts | ezsystems_ezpublish-legacy | train | php |
8d2ad416fe5b597b62ff5594e88e1053eb540412 | diff --git a/contribs/gmf/src/services/permalink.js b/contribs/gmf/src/services/permalink.js
index <HASH>..<HASH> 100644
--- a/contribs/gmf/src/services/permalink.js
+++ b/contribs/gmf/src/services/permalink.js
@@ -2,6 +2,7 @@ goog.provide('gmf.Permalink');
goog.require('gmf');
goog.require('gmf.Themes');
+goog.require('gmf.TreeManager');
goog.require('ngeo.BackgroundEventType');
goog.require('ngeo.BackgroundLayerMgr');
goog.require('ngeo.Debounce'); | Add missing require in gmf.Permalink | camptocamp_ngeo | train | js |
33d767099d8fde7d231e2e026de495b959740de4 | diff --git a/code/model/DNEnvironment.php b/code/model/DNEnvironment.php
index <HASH>..<HASH> 100644
--- a/code/model/DNEnvironment.php
+++ b/code/model/DNEnvironment.php
@@ -974,8 +974,14 @@ PHP
* Write the pipeline config file to filesystem
*/
protected function writePipelineFile() {
- if($this->config()->get('allow_web_editing') && $this->PipelineConfig) {
- file_put_contents($this->getPipelineFilename(), $this->PipelineConfig);
+ if(!$this->config()->get('allow_web_editing')) return;
+ $path = $this->getPipelineFilename();
+ if($this->PipelineConfig) {
+ // Update file
+ file_put_contents($path, $this->PipelineConfig);
+ } elseif($this->isChanged('PipelineConfig') && file_exists($path)) {
+ // Remove file if deleted
+ unlink($path);
}
} | BUG Pipelines can now be removed | silverstripe-archive_deploynaut | train | php |
32dc067b63ba7be9a63ec8b2d56d8c8fe20f87f1 | diff --git a/src/com/turn/ttorrent/client/Announce.java b/src/com/turn/ttorrent/client/Announce.java
index <HASH>..<HASH> 100644
--- a/src/com/turn/ttorrent/client/Announce.java
+++ b/src/com/turn/ttorrent/client/Announce.java
@@ -304,7 +304,7 @@ public class Announce implements Runnable, AnnounceResponseListener {
this.stop(true);
} catch (IOException ioe) {
logger.warn("Error reading response from tracker: {}",
- ioe.getMessage(), ioe);
+ ioe.getMessage());
} finally {
if (result != null && result.containsKey("failure reason")) {
try { | Cleaned up tracker announce responses errors | mpetazzoni_ttorrent | train | java |
13cd93379ea06a4cff0c0cf25d680f0b91b5bef2 | diff --git a/src/main/java/uk/co/real_logic/agrona/concurrent/CountersManager.java b/src/main/java/uk/co/real_logic/agrona/concurrent/CountersManager.java
index <HASH>..<HASH> 100644
--- a/src/main/java/uk/co/real_logic/agrona/concurrent/CountersManager.java
+++ b/src/main/java/uk/co/real_logic/agrona/concurrent/CountersManager.java
@@ -180,7 +180,7 @@ public class CountersManager extends CountersReader
public void free(final int counterId)
{
metaDataBuffer.putIntOrdered(metaDataOffset(counterId), RECORD_RECLAIMED);
- freeList.push(counterId);
+ freeList.add(counterId);
}
/**
@@ -201,7 +201,7 @@ public class CountersManager extends CountersReader
return ++idHighWaterMark;
}
- final int counterId = freeList.pop();
+ final int counterId = freeList.remove();
valuesBuffer.putLongOrdered(counterOffset(counterId), 0L);
return counterId; | [Java] Reuse counters on queued basis rather than a stack to better cope with bad clients using them too long. | real-logic_agrona | train | java |
223089e756eda8e7a6f808678c6c73a943f35dce | diff --git a/lib/TabList.js b/lib/TabList.js
index <HASH>..<HASH> 100644
--- a/lib/TabList.js
+++ b/lib/TabList.js
@@ -17,7 +17,7 @@ const LAYOUT_ANIMATION_CONFIG = LayoutAnimation.create(
LayoutAnimation.Properties.opacity
)
-export default class TabList extends React.Component {
+export default class TabList extends React.PureComponent {
static propTypes = {
tabs: PropTypes.array,
renderTab: PropTypes.func.isRequired, | Make TabList pure to prevent unnecessary rerenders | timomeh_react-native-material-bottom-navigation | train | js |
d668fa262216a6dc5d0ea759853ff9ffb1c09579 | diff --git a/ccmlib/node.py b/ccmlib/node.py
index <HASH>..<HASH> 100644
--- a/ccmlib/node.py
+++ b/ccmlib/node.py
@@ -999,6 +999,8 @@ class Node():
now = common.now_ms()
if (now - start > 500):
raise Exception('Timed out waiting for dirty_pid file.')
+ else:
+ time.sleep(.001)
with open(self.get_path() + "/dirty_pid.tmp", 'r') as f:
found = False
@@ -1025,7 +1027,7 @@ class Node():
raise Exception('Node: %s Failed to find pid in ' +
self.get_path() +
'/dirty_pid.tmp. Manually kill it and check logs - ccm will be out of sync.')
- except IOError as e:
+ except:
raise Exception('Attempted to find dirty_pid.tmp output from modified cassandra.bat in path: ' + self.get_path() + ' and failed on node: ' + self.name)
def _update_pid(self, process): | making polling on dirty_pid a little less aggressive | riptano_ccm | train | py |
ece9b120a905cf90f2a611a0cada54c6fb82728c | diff --git a/lib/socket.js b/lib/socket.js
index <HASH>..<HASH> 100644
--- a/lib/socket.js
+++ b/lib/socket.js
@@ -50,7 +50,7 @@ var readyStates = {
* @api public
*/
-function Socket (manager, id, nsp, readonly) {
+function Socket (manager, id, nsp, readable) {
this.id = id;
this.namespace = nsp;
this.manager = manager;
@@ -58,7 +58,7 @@ function Socket (manager, id, nsp, readonly) {
this.rs = 1;
this.packets = 0;
- if (!readonly)
+ if (readable)
this.store.on('message:' + id, function () {
}); | Changed; allow for writeonly sockets (used to permit a specific socket to message
another socket, or group of sockets). | socketio_socket.io | train | js |
9f7e55b3466c30e4a98bd8a6f2636493b24cd309 | diff --git a/code/Model/UserDefinedForm.php b/code/Model/UserDefinedForm.php
index <HASH>..<HASH> 100755
--- a/code/Model/UserDefinedForm.php
+++ b/code/Model/UserDefinedForm.php
@@ -29,8 +29,8 @@ class UserDefinedForm extends Page
*/
private static $table_name = 'UserDefinedForm';
- public function getControllerName()
- {
- return UserDefinedFormController::class;
- }
+ /**
+ * @var string
+ */
+ private static $controller_name = UserDefinedFormController::class;
} | Use controller_name static config instead of method for better inheritance | silverstripe_silverstripe-userforms | train | php |
cbb2aefbda3792e5d8feeb3a3b1bd9df9b402627 | diff --git a/dist/xublit-io.js b/dist/xublit-io.js
index <HASH>..<HASH> 100644
--- a/dist/xublit-io.js
+++ b/dist/xublit-io.js
@@ -1,6 +1,6 @@
/**
* Server-side application framework for Node.js
- * @version v1.0.0-rc.1
+ * @version v1.0.0-rc.2
* @link https://github.com/xublit/xublit-io#readme
* @license MIT License, http://www.opensource.org/licenses/MIT
*/ | release <I>-rc<I> | xublit_xublit-io | train | js |
f1fc002c1aef9b4e871c808fc5ddacdeb1a5cd94 | diff --git a/lib/http.js b/lib/http.js
index <HASH>..<HASH> 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -572,9 +572,9 @@ Object.defineProperty(Server.prototype, 'timeout', {
// `server` to `this` since that means a listener. Instead, we forward the subscriptions.
Server.prototype.on = function on(event, listener) {
if ((event === 'upgrade') || (event === 'timeout')) {
- this._server.on(event, listener && listener.bind(this));
+ return this._server.on(event, listener && listener.bind(this));
} else {
- EventEmitter.prototype.on.call(this, event, listener);
+ return EventEmitter.prototype.on.call(this, event, listener);
}
}; | Server.on returns instance of server to allow chaining.
(and to be conform with http and https API, see <URL>) | kaazing_http2.js | train | js |
67be5a298ed8213828a5b7178482e048a004d3b2 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -8,16 +8,18 @@ var fs = require('fs');
var path = require('path');
var spawn = require('child_process').spawn;
-var CLI_MODULE_PATH = path.resolve(
- process.cwd(),
- 'node_modules',
- 'react-native',
- 'cli'
-);
+var CLI_MODULE_PATH = function() {
+ return path.resolve(
+ process.cwd(),
+ 'node_modules',
+ 'react-native',
+ 'cli'
+ );
+};
var cli;
try {
- cli = require(CLI_MODULE_PATH);
+ cli = require(CLI_MODULE_PATH());
} catch(e) {}
if (cli) {
@@ -66,7 +68,10 @@ function init(name) {
var packageJson = {
name: projectName,
version: '0.0.1',
- private: true
+ private: true,
+ scripts: {
+ start: "react-native start"
+ }
};
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson));
process.chdir(root);
@@ -77,7 +82,7 @@ function init(name) {
process.exit(1);
}
- var cli = require(CLI_MODULE_PATH);
+ var cli = require(CLI_MODULE_PATH());
cli.init(root, projectName);
});
} | Fix few paths for react-native cli scripts | react-native-community_cli | train | js |
56cde613f6412f34b2a360078d23aeea3e45fc1b | diff --git a/src/dependencies.js b/src/dependencies.js
index <HASH>..<HASH> 100644
--- a/src/dependencies.js
+++ b/src/dependencies.js
@@ -60,9 +60,16 @@ var _require = (function() {
}
var initialize = function() {
- if (window['WebSocket'] === undefined) {
+ if (window['WebSocket']) {
+ // Initialize function in the case that we have native WebSocket support
+ return function() {
+ Pusher.Transport = window['WebSocket'];
+ Pusher.TransportType = 'native';
+ Pusher.ready();
+ }
+ } else {
+ // Initialize function for fallback case
return function() {
- // This runs after flashfallback.js has loaded
if (window['WebSocket']) {
// window['WebSocket'] is a flash emulation of WebSocket
Pusher.Transport = window['WebSocket'];
@@ -80,12 +87,6 @@ var _require = (function() {
Pusher.ready();
}
}
- } else {
- return function() {
- Pusher.Transport = window['WebSocket'];
- Pusher.TransportType = 'native';
- Pusher.ready();
- }
}
}(); | Reorder lines - let's have nice case first | pusher_pusher-js | train | js |
53331e19af7223fad8c80ea47307a287cdac987c | diff --git a/src/WorkerPool.php b/src/WorkerPool.php
index <HASH>..<HASH> 100644
--- a/src/WorkerPool.php
+++ b/src/WorkerPool.php
@@ -203,7 +203,7 @@ class WorkerPool implements \Iterator, \Countable {
/**
* Disables the semaphore feature in the workerpool
- *
+ *
* Attention: You will lose the possibility to synchronize worker processes
*
* @throws \QXS\WorkerPool\WorkerPoolException in case the WorkerPool has already been created
@@ -476,7 +476,8 @@ class WorkerPool implements \Iterator, \Countable {
if ($this->respawnAutomatically = $respawn) {
pcntl_signal(SIGALRM, array($this, 'signalHandler'));
pcntl_alarm(1);
- }
+ }
+ return $this;
}
private function respawnIfRequired() { | Fix null when calling by fluent interface | qxsch_WorkerPool | train | php |
f812f1d81e558a88d4199cd6298c478bbedf0e05 | diff --git a/SwatDB/SwatDBRecordsetWrapper.php b/SwatDB/SwatDBRecordsetWrapper.php
index <HASH>..<HASH> 100644
--- a/SwatDB/SwatDBRecordsetWrapper.php
+++ b/SwatDB/SwatDBRecordsetWrapper.php
@@ -434,14 +434,17 @@ abstract class SwatDBRecordsetWrapper extends SwatObject
$this->removed_objects[] = $this->objects[$offset];
$this->objects[$offset] = $value;
} else {
+ $index_field = $this->index_field;
+
// update object index field value
- $value->{$this->index_field} = $offset;
+ $value->{$index_field} = $offset;
// find and replace ordinally indexed objects
- $keys = array_keys($this->objects, $value, true);
- foreach ($keys as $key) {
- $this->removed_objects[] = $this->objects[$key];
- $this->objects[$key] = $value;
+ foreach ($this->objects as $key => $object) {
+ if ($object->{$index_field} === $value->{$index_field}) {
+ $this->removed_objects[] = $object;
+ $this->objects[$key] = $value;
+ }
}
// add object to indexed array | Fix setting record at offset index
Old code would never have worked as array_keys() with a new object as a value would always return an empty array and would never replace the object in the ordinal indexed array. | silverorange_swat | train | php |
eb7764f0db7ff0e3102370b522dd24d56b966145 | diff --git a/lib/components/client-factory.js b/lib/components/client-factory.js
index <HASH>..<HASH> 100644
--- a/lib/components/client-factory.js
+++ b/lib/components/client-factory.js
@@ -119,7 +119,7 @@ ClientFactory.prototype.getClientAs = function(userId, request) {
userId: userId || this._botUserId, // NB: no clobber so we don't set ?user_id=BOT
queryParams: queryParams,
scheduler: this._clientSchedulerBuilder(),
- localTimeoutMs: 1000 * 60 * 5, // Time out CS-API calls after 5mins
+ localTimeoutMs: 1000 * 60 * 2, // Time out CS-API calls after 2mins
};
client = this._sdk.createClient(clientOpts);
client._http.opts._reqId = reqId; // FIXME gut wrenching | Decrease timer to 2m as 5m was a bit excessive | matrix-org_matrix-appservice-bridge | train | js |
76cc8e8567f3c76ffd819017c86e158ad8479935 | diff --git a/spec/support/aws_example_group.rb b/spec/support/aws_example_group.rb
index <HASH>..<HASH> 100644
--- a/spec/support/aws_example_group.rb
+++ b/spec/support/aws_example_group.rb
@@ -39,10 +39,9 @@ module AwsSystemExampleGroup
"#{ASSETS_DIR}/aws/aws_configuration_template.yml.erb"
end
- def run(cmd, options = {:return_output => true})
- r = true
+ def run(cmd, options = {})
Bundler.with_clean_env do
- options[:return_output] ? (r=`#{cmd}`) : system(cmd)
+ r=`#{cmd}`
unless $?.success?
err_msg = "Couldn't run '#{cmd}' from #{Dir.pwd}, failed with exit status #{$?.to_i}" | even more output from failed commands in CI | cloudfoundry_bosh | train | rb |
739dd62f19eafa91a6cab20680707a67b7ccdf1d | diff --git a/src/fieldwork/validators/CheckboxFieldValidator.php b/src/fieldwork/validators/CheckboxFieldValidator.php
index <HASH>..<HASH> 100644
--- a/src/fieldwork/validators/CheckboxFieldValidator.php
+++ b/src/fieldwork/validators/CheckboxFieldValidator.php
@@ -22,7 +22,7 @@ class CheckboxFieldValidator extends FieldValidator
public function isValid ($value)
{
- return $this->checked = ($value == 'on');
+ return $this->checked === ($value === 'on');
}
public function describeObject () | Fix bug with checkbox sanitizer | sgtlambda_fieldwork | train | php |
ec78b64baf92f67d367d949f0696aab45f01a12e | diff --git a/infile.go b/infile.go
index <HASH>..<HASH> 100644
--- a/infile.go
+++ b/infile.go
@@ -12,7 +12,6 @@ import (
"fmt"
"io"
"os"
- "path"
"strings"
)
@@ -87,11 +86,10 @@ func (mc *mysqlConn) handleInFileRequest(name string) (err error) {
var rdr io.Reader
var data []byte
- // The server might return an an absolute path. See issue #355.
- base := path.Base(name)
+ if idx := strings.Index(name, "Reader::"); idx == 0 || (idx > 0 && name[idx-1] == '/') { // io.Reader
+ // The server might return an an absolute path. See issue #355.
+ name = name[idx+8:]
- if strings.HasPrefix(base, "Reader::") { // io.Reader
- name = base[8:]
if handler, inMap := readerRegister[name]; inMap {
rdr = handler()
if rdr != nil { | infile: Allow '/' in Reader name | go-sql-driver_mysql | train | go |
a9d8fc6d48e6c823c501dd834170d6d175b4b818 | diff --git a/core/ScheduledTime.php b/core/ScheduledTime.php
index <HASH>..<HASH> 100644
--- a/core/ScheduledTime.php
+++ b/core/ScheduledTime.php
@@ -74,6 +74,33 @@ abstract class ScheduledTime
}
/**
+ * This method takes the websites timezone into consideration when scheduling a task.
+ * @param int $idSite
+ * @param string $period Eg 'day', 'week', 'month'
+ * @return Daily|Monthly|Weekly
+ * @throws \Exception
+ * @ignore
+ */
+ static public function getScheduledTimeForSite($idSite, $period)
+ {
+ $arbitraryDateInUTC = Date::factory('2011-01-01');
+ $midnightInSiteTimezone = date(
+ 'H',
+ Date::factory(
+ $arbitraryDateInUTC,
+ Site::getTimezoneFor($idSite)
+ )->getTimestamp()
+ );
+
+ $hourInUTC = (24 - $midnightInSiteTimezone) % 24;
+
+ $schedule = self::getScheduledTimeForPeriod($period);
+ $schedule->setHour($hourInUTC);
+
+ return $schedule;
+ }
+
+ /**
* Returns the system time used by subclasses to compute schedulings.
* This method has been introduced so unit tests can override the current system time.
* @return int | refs #<I> added method to create a scheduled time depending on the websites timezone | matomo-org_matomo | train | php |
570cc9112abd468b75f7f94758d776d915e9f82a | diff --git a/src/test/java/net/openhft/chronicle/map/MemoryLeaksTest.java b/src/test/java/net/openhft/chronicle/map/MemoryLeaksTest.java
index <HASH>..<HASH> 100755
--- a/src/test/java/net/openhft/chronicle/map/MemoryLeaksTest.java
+++ b/src/test/java/net/openhft/chronicle/map/MemoryLeaksTest.java
@@ -41,7 +41,6 @@ import java.util.stream.Collectors;
import static org.junit.Assert.assertEquals;
@RunWith(Parameterized.class)
-@Ignore("Long running")
public class MemoryLeaksTest {
/** | Ensure HeapBytesStore has final fields for correct visibility, <URL> | OpenHFT_Chronicle-Map | train | java |
06717bac1d29a4392721abdd7b43c5de6696d33b | diff --git a/tds.go b/tds.go
index <HASH>..<HASH> 100644
--- a/tds.go
+++ b/tds.go
@@ -762,7 +762,7 @@ func connect(params map[string]string) (res *tdsSession, err error) {
var conn net.Conn
if len(ips) == 1 {
d := createDialer(p)
- addr := fmt.Sprintf("%s:%d", ips[0], p.port)
+ addr := net.JoinHostPort(ips[0].String(), strconv.Itoa(int(p.port)))
conn, err = d.Dial("tcp", addr)
} else {
@@ -772,7 +772,7 @@ func connect(params map[string]string) (res *tdsSession, err error) {
for _, ip := range ips {
go func(ip net.IP) {
d := createDialer(p)
- addr := fmt.Sprintf("[%s]:%d", ip, p.port)
+ addr := net.JoinHostPort(ip.String(), strconv.Itoa(int(p.port)))
conn, err := d.Dial("tcp", addr)
if err == nil {
connChan <- conn | use net.JoinHostPort to concatenate ip address and port | denisenkom_go-mssqldb | train | go |
2c9efd12da9c9d789034af40c9e6f0f70bff5f7a | diff --git a/tests/index.php b/tests/index.php
index <HASH>..<HASH> 100644
--- a/tests/index.php
+++ b/tests/index.php
@@ -10,11 +10,6 @@
\error_reporting(\E_ALL);
\ini_set('display_errors', 'stdout');
-// enable assertions
-\ini_set('assert.active', 1);
-@\ini_set('zend.assertions', 1);
-\ini_set('assert.exception', 1);
-
\header('Content-Type: text/plain; charset=utf-8');
require __DIR__ . '/../vendor/autoload.php'; | Do not try to enable PHP assertions anymore (that are no longer used) | delight-im_PHP-Str | train | php |
2f27fdb9cf4334634fa38fda92c8ebae4868fac2 | diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index <HASH>..<HASH> 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -180,10 +180,9 @@ def with_argument_list(func: Callable[[Statement], Optional[bool]],
shlex.split().
:param func: do_* method this decorator is wrapping
- preserve_quotes: if True, then argument quotes will not be stripped
+ :param preserve_quotes: if True, then argument quotes will not be stripped
:return: function that gets passed a list of argument strings
"""
- """"""
import functools
@functools.wraps(func) | Fixed messed up GitHub auto-commit from PR suggestion | python-cmd2_cmd2 | train | py |
30fd6bd57ca0b12b21ca2bebf0c7c0f55f757324 | diff --git a/js/kucoin.js b/js/kucoin.js
index <HASH>..<HASH> 100644
--- a/js/kucoin.js
+++ b/js/kucoin.js
@@ -20,7 +20,7 @@ module.exports = class kucoin extends Exchange {
'has': {
'CORS': false,
'fetchTickers': true,
- 'fetchOHLCV': true, // see the method implementation below
+ 'fetchOHLCV': false, // see the method implementation below
'fetchOrder': false,
'fetchOrders': true,
'fetchClosedOrders': true, | kucoin: switching off OHLCV (accessed from different url) | ccxt_ccxt | train | js |
598556d6f76098527079c455c843bded094d10ba | diff --git a/cairocffi/__init__.py b/cairocffi/__init__.py
index <HASH>..<HASH> 100644
--- a/cairocffi/__init__.py
+++ b/cairocffi/__init__.py
@@ -17,7 +17,10 @@ from . import constants
from .compat import FileNotFoundError
-VERSION = '0.4.2'
+VERSION = '0.4.3'
+# pycairo compat:
+version = VERSION
+version_info = version.split('.')
def dlopen(ffi, *names): | Add version and version_info for pycairo compat
Possible fix for #<I> | Kozea_cairocffi | train | py |
e2a1c2472a4c46e0be470792441a79c4af415165 | diff --git a/lib/cinch/plugins/news.rb b/lib/cinch/plugins/news.rb
index <HASH>..<HASH> 100644
--- a/lib/cinch/plugins/news.rb
+++ b/lib/cinch/plugins/news.rb
@@ -1,3 +1,7 @@
+# @author Richard Banks <[email protected]>
+
+# Feel free to join us in #Lobby on irc://rawr.sinsira.net where you can test this gem and get help!
+
require 'cinch'
require 'ostruct'
require 'open-uri' | Added comments
Added author and where you can go for help | tayjaybabee_cinch-news | train | rb |
b33979a086ea4b8f4f997529a0c33980d7c64e70 | diff --git a/hive/src/itest/java/org/elasticsearch/hadoop/integration/hive/AbstractHiveExtraTests.java b/hive/src/itest/java/org/elasticsearch/hadoop/integration/hive/AbstractHiveExtraTests.java
index <HASH>..<HASH> 100644
--- a/hive/src/itest/java/org/elasticsearch/hadoop/integration/hive/AbstractHiveExtraTests.java
+++ b/hive/src/itest/java/org/elasticsearch/hadoop/integration/hive/AbstractHiveExtraTests.java
@@ -44,8 +44,11 @@ public class AbstractHiveExtraTests {
@Test
public void testQuery() throws Exception {
- RestUtils.bulkData("cars/transactions", "cars-bulk.txt");
- RestUtils.refresh("cars");
+ if (!RestUtils.exists("cars/transactions")) {
+ RestUtils.bulkData("cars/transactions", "cars-bulk.txt");
+ RestUtils.refresh("cars");
+ }
+
String drop = "DROP TABLE IF EXISTS cars2";
String create = "CREATE EXTERNAL TABLE cars2 (" | Fix duplicated data in test
(cherry picked from commit fb<I>ea<I>ce<I>b<I>dbe1cfb<I>f9b3) | elastic_elasticsearch-hadoop | train | java |
50baba9aceca47b9ea51b5ff49d8263bee1a998d | diff --git a/src/includes/page-type/class-papi-page-type.php b/src/includes/page-type/class-papi-page-type.php
index <HASH>..<HASH> 100644
--- a/src/includes/page-type/class-papi-page-type.php
+++ b/src/includes/page-type/class-papi-page-type.php
@@ -220,7 +220,8 @@ class Papi_Page_Type extends Papi_Page_Type_Meta {
}
foreach ( $boxes as $box ) {
- foreach ( $box[1] as $property ) {
+ $properties = isset( $box[1][0]->properties ) ? $box[1][0]->properties : $box[1];
+ foreach ( $properties as $property ) {
$property = papi_get_property_type( $property );
if ( ! papi_is_property( $property ) ) { | Fixed so tabs properties works in get_property | wp-papi_papi | train | php |
643787af4f7a42b6ab8016aa02d6e223381ad317 | diff --git a/scripts/build_wikidata.js b/scripts/build_wikidata.js
index <HASH>..<HASH> 100644
--- a/scripts/build_wikidata.js
+++ b/scripts/build_wikidata.js
@@ -276,10 +276,15 @@ function processEntities(result) {
target.dissolutions = [];
- // P18 - Image (use this for flags)
- // P154 - Logo Image
- const imageProp = (meta.what === 'flag' ? 'P18' : 'P154');
- let imageFile = getClaimValue(entity, imageProp);
+ let imageFile;
+ if (meta.what === 'flag') {
+ // P18 - Image (use this for flags)
+ imageFile = getClaimValue(entity, 'P18');
+ } else {
+ // P154 - Logo Image
+ // P8972 - Small Logo or Icon
+ imageFile = getClaimValue(entity, 'P8972') || getClaimValue(entity, 'P154');
+ }
if (imageFile) {
const re = /\.svg$/i;
if (re.test(imageFile)) { | Fetch P<I> "small logo or icon" if available
(closes #<I>) | osmlab_name-suggestion-index | train | js |
25ae2493b746bc8c3d7f657a9d52e6831da430e0 | diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php
index <HASH>..<HASH> 100644
--- a/tests/VideoDownloadTest.php
+++ b/tests/VideoDownloadTest.php
@@ -226,7 +226,7 @@ class VideoDownloadTest extends TestCase
{
return [
[
- 'https://twitter.com/verge/status/813055465324056576/video/1', 'best',
+ 'https://twitter.com/verge/status/813055465324056576/video/1', 'hls-2176',
'The_Verge_-_This_tiny_origami_robot_can_self-fold_and_complete_tasks-813055465324056576',
'mp4',
'video.twimg.com', | Force HLS format for M3U tests | Rudloff_alltube | train | php |
2a6b2ad543c661c446e0c08cf3eef12df3bc5eac | diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go
index <HASH>..<HASH> 100644
--- a/cmd/minikube/cmd/start.go
+++ b/cmd/minikube/cmd/start.go
@@ -192,6 +192,7 @@ func runStart(cmd *cobra.Command, args []string) {
} else {
// With "none", images are persistently stored in Docker, so internal caching isn't necessary.
viper.Set(cacheImages, false)
+ config.KubernetesConfig.ShouldLoadCachedImages = false
}
// Now that the ISO is downloaded, pull images in the background while the VM boots. | Disable unnecessary load image from cache for none driver
since we are not are not saving the images in the cache, there is not much trying to load from the cache either. | kubernetes_minikube | train | go |
b55173a06faaf157a071b0365b49b72f7e36039c | diff --git a/test/new-server/cli-set-serverSpec.js b/test/new-server/cli-set-serverSpec.js
index <HASH>..<HASH> 100644
--- a/test/new-server/cli-set-serverSpec.js
+++ b/test/new-server/cli-set-serverSpec.js
@@ -25,8 +25,13 @@ describe("When a Server arg is given on command line", function () {
it("should set the base dir as current for server if not given", function () {
+ argv.ghostMode = false;
var config = setup.getConfig(defaultConfig, argv);
expect(config.server.baseDir).toBe("./");
+
+ // _todo extract to it's own test
+ expect(config.ghostMode).toBe(false);
+
});
it("should set the base dir if given", function () { | Add tests for disabling ghostMode | BrowserSync_browser-sync | train | js |
ab889528f12fd61afe2cbf835052b988abeaa6fc | diff --git a/keysmith/__main__.py b/keysmith/__main__.py
index <HASH>..<HASH> 100644
--- a/keysmith/__main__.py
+++ b/keysmith/__main__.py
@@ -3,6 +3,7 @@
import argparse
import math
import string
+import sys
import pkg_resources
@@ -58,8 +59,12 @@ def main(args=None):
'printable': string.printable,
}.get(args.population)
if seq is None:
- with open(args.population, 'r') as f:
- seq = f.read().splitlines()
+ try:
+ with open(args.population, 'r') as f:
+ seq = f.read().splitlines()
+ except OSError as ex:
+ print(ex, file=sys.stderr)
+ return 1
key = keysmith.key(seq=seq, nteeth=args.nteeth, delimiter=args.delimiter)
print(key)
@@ -72,6 +77,8 @@ def main(args=None):
bits=round(math.log(len(seq), 2) * args.nteeth, 2),
))
+ return 0
+
if __name__ == '__main__':
- main()
+ sys.exit(main()) | Add some error-handling for OSError | dmtucker_keysmith | train | py |
d73857e7e219c85a8ebbb7bc1a18ce3ce063fce9 | diff --git a/lib/sp/duh/jsonapi/service.rb b/lib/sp/duh/jsonapi/service.rb
index <HASH>..<HASH> 100644
--- a/lib/sp/duh/jsonapi/service.rb
+++ b/lib/sp/duh/jsonapi/service.rb
@@ -24,11 +24,12 @@ module SP
@protocol = value.to_sym
end
- def initialize(pg_connection, url)
+ def initialize(pg_connection, url, adapter = SP::Duh::JSONAPI::Adapters::Db)
@pg_connection = pg_connection
@url = url
protocol = :db
@configuration = Configuration.new(pg_connection, url)
+ SP::Duh::JSONAPI::Model::Base.adapter = @adapter = adapter.new(self)
end
def setup
@@ -40,6 +41,8 @@ module SP
configuration.setup()
end
+ def adapter ; @adapter ; end
+
private
def create_jsonapi_function | Service is responsible to configure the database adapter. | vpfpinho_sp-duh | train | rb |
11d1f34c4f2b5b50b6ffd4a2590b7d98075ebc50 | diff --git a/lib/util.js b/lib/util.js
index <HASH>..<HASH> 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -84,6 +84,21 @@ exports.writeFile = function(path, content) {
});
};
+exports.writeFileIfDiffers = function(path, content) {
+ return QFS.exists(path)
+ .then(function(exists) {
+ if (exists) {
+ return QFS.read(path, { charset: 'utf8' } ).then(function(current) {
+ return current !== content;
+ });
+ }
+ return true;
+ })
+ .then(function(rewrite) {
+ if (rewrite) return QFS.write(path, Array.isArray(content) ? content.join('') : content, { charset: 'utf8' });
+ });
+};
+
exports.readFile = function(path) {
return QFS.read(path, { charset: 'utf8' });
}; | issue #<I>: writeFileIfDiffers() added | bem-archive_bem-tools | train | js |
6c9ceb0635f63332298f2f2ef438b4e5bdb8e30f | diff --git a/addon/components/course-leadership-expanded.js b/addon/components/course-leadership-expanded.js
index <HASH>..<HASH> 100644
--- a/addon/components/course-leadership-expanded.js
+++ b/addon/components/course-leadership-expanded.js
@@ -5,8 +5,8 @@ import { timeout } from 'ember-concurrency';
import { dropTask } from 'ember-concurrency-decorators';
export default class CourseLeadershipExpandedComponent extends Component {
- @tracked directors = null;
- @tracked administrators = null;
+ @tracked directors = [];
+ @tracked administrators = [];
get isCollapsible() {
const administratorIds = this.args.course.hasMany('administrators').ids();
const directorIds = this.args.course.hasMany('directors').ids(); | init director/admins as arrays. | ilios_common | train | js |
b3a727a9f88cbec48767dca8222c066347ed77a8 | diff --git a/karaage/usage/migrations/0003_remove_unknown.py b/karaage/usage/migrations/0003_remove_unknown.py
index <HASH>..<HASH> 100644
--- a/karaage/usage/migrations/0003_remove_unknown.py
+++ b/karaage/usage/migrations/0003_remove_unknown.py
@@ -2,7 +2,7 @@
import datetime
from south.db import db
from south.v2 import DataMigration
-from django.db import models
+from django.db import models, connection
class Migration(DataMigration):
@@ -15,6 +15,10 @@ class Migration(DataMigration):
)
def forwards(self, orm):
+ cursor = connection.cursor()
+ # Skip migration if there is no auth_user table
+ if 'auth_user' not in connection.introspection.get_table_list(cursor):
+ return
try:
unknown_user = orm['people.Person'].objects.get(username='unknown_user')
except orm['people.Person'].DoesNotExist: | Fix auth_user assumption.
This migration is broken on new installs, because the authentication
table structure has changed in the global configuration, and
django-south does not support tracking these changes.
Thanks Russell Sim for the patch.
Change-Id: Ic<I>bb<I>a<I>be<I>a8e1d<I>fddca<I>a<I>ab0 | Karaage-Cluster_karaage | train | py |
5bd40a447a217a83996a2499a2f02ece2e95c246 | diff --git a/vcr/request.py b/vcr/request.py
index <HASH>..<HASH> 100644
--- a/vcr/request.py
+++ b/vcr/request.py
@@ -37,6 +37,10 @@ class Request(object):
def body(self):
return StringIO.StringIO(self._body) if self._was_file else self._body
+ @body.setter
+ def body(self, value):
+ self._body = value
+
def add_header(self, key, value):
# see class docstring for an explanation
if isinstance(value, (tuple, list)): | Add setter to body on vcr's request. | kevin1024_vcrpy | train | py |
f1751db33bd889733925599a50e8711bb0a831d3 | diff --git a/java/src/main/java/gherkin/TagExpression.java b/java/src/main/java/gherkin/TagExpression.java
index <HASH>..<HASH> 100644
--- a/java/src/main/java/gherkin/TagExpression.java
+++ b/java/src/main/java/gherkin/TagExpression.java
@@ -26,6 +26,10 @@ public class TagExpression {
return limits;
}
+ public boolean isEmpty() {
+ return and.isEmpty();
+ }
+
private void add(String[] tags) {
Or or = new Or();
for (String tag : tags) {
diff --git a/spec/gherkin/tag_expression_spec.rb b/spec/gherkin/tag_expression_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/gherkin/tag_expression_spec.rb
+++ b/spec/gherkin/tag_expression_spec.rb
@@ -7,12 +7,16 @@ module Gherkin
def tag(name)
Formatter::Model::Tag.new(name, 0)
end
-
+
context "no tags" do
before(:each) do
@e = Gherkin::TagExpression.new([])
end
+ it 'should be empty' do
+ @e.should be_empty
+ end
+
it "should match @foo" do
@e.eval([tag('@foo')]).should == true
end
@@ -139,4 +143,4 @@ module Gherkin
end
end
end
-end
\ No newline at end of file
+end | jruby impltementation of TagExpression.empty? added | cucumber-attic_gherkin2 | train | java,rb |
02fd041588b6d764ed9345cf41ee46e9dff1e764 | diff --git a/lib/cares.js b/lib/cares.js
index <HASH>..<HASH> 100644
--- a/lib/cares.js
+++ b/lib/cares.js
@@ -98,6 +98,7 @@ var dummy = function() {};
function resolver(bindingName, resolver_instance, name, options_, callback_) {
+ var deferred = Q.defer();
var options, callback;
if (!isString(name)) {
throw new Error('Name must be a string');
@@ -128,8 +129,11 @@ function resolver(bindingName, resolver_instance, name, options_, callback_) {
params.push(arguments[i]);
}
callback.apply(this, params);
+ deferred.resolve.apply(this, params.slice(1));
} else {
- callback(errnoException(err.status, err.errorno, err.message, bindingName));
+ var error = errnoException(err.status, err.errorno, err.message, bindingName);
+ callback(error);
+ deferred.reject(error);
}
}
@@ -140,7 +144,7 @@ function resolver(bindingName, resolver_instance, name, options_, callback_) {
}
callback.immediately = true;
- return err;
+ return deferred.promise;
};
var resolveMap = {}; | Returning a promise object from internal function `resolver`. | royalpinto_node-cares | train | js |
1932b06cd6e2cd52c571d843380e3d50bbd5fe69 | diff --git a/Net/Socket.php b/Net/Socket.php
index <HASH>..<HASH> 100644
--- a/Net/Socket.php
+++ b/Net/Socket.php
@@ -158,10 +158,8 @@ class Net_Socket extends PEAR
$errstr = '';
if (function_exists('error_clear_last')) {
- $useOldErrorHandling = false;
error_clear_last();
} else {
- $useOldErrorHandling = true;
$old_track_errors = @ini_set('track_errors', 1);
}
@@ -194,7 +192,7 @@ class Net_Socket extends PEAR
if (!$fp) {
if ($errno === 0 && !strlen($errstr)) {
$errstr = '';
- if ($useOldErrorHandling) {
+ if (isset($old_track_errors)) {
$errstr = $php_errormsg ?: '';
@ini_set('track_errors', $old_track_errors);
} else {
@@ -208,7 +206,7 @@ class Net_Socket extends PEAR
return $this->raiseError($errstr, $errno);
}
- if ($useOldErrorHandling) {
+ if (isset($old_track_errors)) {
@ini_set('track_errors', $old_track_errors);
} | use the existence of $old_track_errors as the old/new handling flag | pear_Net_Socket | train | php |
d93263e16a03f52af342bb3f59001231e3c7ee42 | diff --git a/ui/src/components/btn/QBtn.js b/ui/src/components/btn/QBtn.js
index <HASH>..<HASH> 100644
--- a/ui/src/components/btn/QBtn.js
+++ b/ui/src/components/btn/QBtn.js
@@ -14,7 +14,10 @@ export default Vue.extend({
mixins: [ BtnMixin ],
props: {
- percentage: Number,
+ percentage: {
+ type: Number,
+ validator: v => v >= 0 && v <= 100
+ },
darkPercentage: Boolean
}, | feat(QBtn) validate 'percentage' prop (#<I>)
* validate QBtn percentage prop
* Update QBtn.js | quasarframework_quasar | train | js |
8caa78362f844b5c53f72feff0888810a0f12001 | diff --git a/lib/db.js b/lib/db.js
index <HASH>..<HASH> 100644
--- a/lib/db.js
+++ b/lib/db.js
@@ -16,7 +16,7 @@ exports.db_setup = function(app, db, next) {
// Open the connection, then call connect_cb
if (db.type == 'mysql') {
app.db = mysql.createConnection(db);
- app.db.connect(connect_cb);
+ connect_cb();
} else if (db.type == 'sqlite') {
sqlite.open(db.file, db, connect_cb);
} else { | Database in MySQL mode does not connect on startup anymore | defeo_was_framework | train | js |
8c0d6c8ac6a0bb4fc7c75f21213f0ff5ed90e8c5 | diff --git a/go/libkb/loaduser.go b/go/libkb/loaduser.go
index <HASH>..<HASH> 100644
--- a/go/libkb/loaduser.go
+++ b/go/libkb/loaduser.go
@@ -176,7 +176,7 @@ func LoadUser(arg LoadUserArg) (ret *User, err error) {
var emsg string
if arg.Self {
- emsg = "You don't have a public key; try `keybase push` if you have a key; or `keybase gen` if you don't"
+ emsg = "You don't have a public key; try `keybase push` if you have a key; or `keybase pgp gen` if you don't"
}
err = NoKeyError{emsg}
} | Fix wrong error message
should tell you to use keybase pgp gen instead of keybase gen | keybase_client | train | go |
5de4bc3588bd08f168638f38b4b09180471b6795 | diff --git a/networkapiclient/Pool.py b/networkapiclient/Pool.py
index <HASH>..<HASH> 100644
--- a/networkapiclient/Pool.py
+++ b/networkapiclient/Pool.py
@@ -228,3 +228,41 @@ class Pool(ApiGenericClient):
uri = "api/pools/create/"
return self.post(uri, data)
+
+ def enable(self, ids):
+ """
+ Enable Pool Members Running Script
+
+ :param ids: List of ids
+
+ :return: None on success
+
+ :raise ValidationException: Id(s) inválido(s)
+ :raise NetworkAPIException: Falha ao acessar fonte de dados
+ """
+
+ data = dict()
+ data["ids"] = ids
+
+ uri = "api/pools/enable/"
+
+ return self.post(uri, data)
+
+ def disable(self, ids):
+ """
+ Disable Pool Members Running Script
+
+ :param ids: List of ids
+
+ :return: None on success
+
+ :raise ValidationException: Id(s) inválido(s)
+ :raise NetworkAPIException: Falha ao acessar fonte de dados
+ """
+
+ data = dict()
+ data["ids"] = ids
+
+ uri = "api/pools/disable/"
+
+ return self.post(uri, data) | Add "enable pool member"
Add "disable pool member" | globocom_GloboNetworkAPI-client-python | train | py |
801e9c18ae1f88feba0032fb6180dd7a4136ff8d | diff --git a/lib/active_fulfillment.rb b/lib/active_fulfillment.rb
index <HASH>..<HASH> 100644
--- a/lib/active_fulfillment.rb
+++ b/lib/active_fulfillment.rb
@@ -34,6 +34,7 @@ require 'active_support/core_ext/class/inheritable_attributes'
require 'active_support/core_ext/class/delegating_attributes'
require 'active_support/core_ext/time/calculations'
require 'active_support/core_ext/numeric/time'
+require 'active_support/core_ext/enumerable'
begin
require 'active_support/core_ext/time/acts_like'
rescue LoadError | Add require ActiveSupport's enumerable extensions | Shopify_active_fulfillment | train | rb |
e17e7aebaab02401c03080894ade9e6d5446e77a | diff --git a/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/post/OServerCommandPostCommand.java b/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/post/OServerCommandPostCommand.java
index <HASH>..<HASH> 100755
--- a/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/post/OServerCommandPostCommand.java
+++ b/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/post/OServerCommandPostCommand.java
@@ -167,11 +167,11 @@ public class OServerCommandPostCommand extends OServerCommandAuthenticatedDbAbst
protected OResultSet executeStatement(String language, String text, Object params, ODatabaseDocument db) {
OResultSet result;
if (params instanceof Map) {
- result = db.command(text, (Map) params);
+ result = db.execute(language, text, (Map) params);
} else if (params instanceof Object[]) {
- result = db.command(text, (Object[]) params);
+ result = db.execute(language, text, (Object[]) params);
} else {
- result = db.command(text, params);
+ result = db.execute(language, text, params);
}
return result;
} | fix for make sure that http command support multiple languages | orientechnologies_orientdb | train | java |
a33d2726bce182ed62a5ee21a3d53a50d12a71f1 | 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
@@ -227,6 +227,7 @@ func (g *getValuesAlongRangeOp) ExtractSamples(in []model.SamplePair) (out []mod
return in[i].Timestamp.After(g.through)
})
if lastIdx == firstIdx {
+ g.from = g.through.Add(1)
return
} | Mark range op as consumed if it receives no data points in range. | prometheus_prometheus | train | go |
f928d34fe9a2b374a1bf698540b42c16f28688e7 | diff --git a/src/Jig/JigRender.php b/src/Jig/JigRender.php
index <HASH>..<HASH> 100644
--- a/src/Jig/JigRender.php
+++ b/src/Jig/JigRender.php
@@ -16,6 +16,7 @@ class JigRender {
const COMPILE_ALWAYS = 'COMPILE_ALWAYS';
const COMPILE_CHECK_EXISTS = 'COMPILE_CHECK_EXISTS';
const COMPILE_CHECK_MTIME = 'COMPILE_CHECK_MTIME';
+ const COMPILE_NEVER = 'COMPILE_NEVER';
/**
* @var ViewModel
@@ -94,6 +95,9 @@ class JigRender {
return $proxiedClassName;
}
+ function renderTemplateFromStringWithSameView($templateString, $objectID) {
+ return $this->renderTemplateFromString($templateString, $objectID, $this->viewModel);
+ }
/**
* Renders
@@ -269,6 +273,10 @@ class JigRender {
* @throws JigException
*/
function checkTemplateCompiled($templateFilename, $proxied = false) {
+ if ($this->jigConfig->compileCheck == JigRender::COMPILE_CHECK_MTIME) {
+ return;
+ }
+
$className = $this->jigConverter->getNamespacedClassNameFromFileName($templateFilename, $proxied);
if ($this->jigConfig->compileCheck == JigRender::COMPILE_CHECK_EXISTS) {
if (class_exists($className) == true) { | Added ability to disable template compiling. Added hack to allow deployment. | Danack_Jig | train | php |
e41f8c4c71f104000be9380e3dcdc90508bc948c | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -125,7 +125,7 @@ module.exports = class Consulite {
try {
const { payload } = await this._wreck.get(`/v1/health/service/${name}?passing&near=agent`);
if (!payload || !payload.length) {
- return callback(new Error(`Service ${name} couldn't be found`));
+ throw `Service ${name} couldn't be found`;
}
const hosts = payload.map((host) => { | Use throw in try/catch block | joyent_node-consulite | train | js |
4228625ab8980f361546a1761b21373a4666861e | diff --git a/twitteroauth/twitteroauth.php b/twitteroauth/twitteroauth.php
index <HASH>..<HASH> 100644
--- a/twitteroauth/twitteroauth.php
+++ b/twitteroauth/twitteroauth.php
@@ -50,7 +50,7 @@ class TwitterOAuth {
/**
* Debug helpers
*/
- function lastStatusCode() { return $this->http_status; }
+ function lastStatusCode() { return $this->http_code }
function lastAPICall() { return $this->last_api_call; }
/** | Fixed mention of `http_status`, which doesn't exist.
`TwitterOAuth::http_status` does not exist, while `TwitterOAuth::http_code` does. So `TwitterOAuth::lastStatusCode()` was returning nothing, no matter what happened. | abraham_twitteroauth | train | php |
Subsets and Splits