patch
stringlengths
17
31.2k
y
int64
1
1
oldf
stringlengths
0
2.21M
idx
int64
1
1
id
int64
4.29k
68.4k
msg
stringlengths
8
843
proj
stringclasses
212 values
lang
stringclasses
9 values
@@ -683,5 +683,17 @@ describe('model', function() { yield User.collection.drop(); }); }); + it('should do a dryRun feat-10316', function() { + return co(function*() { + const userSchema = new mongoose.Schema({ username: String }, { password: String }, { email: String }); + use...
1
'use strict'; /** * Test dependencies. */ const start = require('./common'); const assert = require('assert'); const co = require('co'); const random = require('../lib/utils').random; const mongoose = start.mongoose; const Schema = mongoose.Schema; const ObjectId = Schema.Types.ObjectId; describe('model', functi...
1
14,640
Add a `yield User.init()` here to wait for all indexes to finish building
Automattic-mongoose
js
@@ -11,6 +11,8 @@ #include <ifaddrs.h> #include <arpa/inet.h> +DEFINE_string(local_ip, "", "local ip"); + namespace nebula { namespace network {
1
/* Copyright (c) 2018 - present, VE Software Inc. All rights reserved * * This source code is licensed under Apache 2.0 License * (found in the LICENSE.Apache file in the root directory) */ #include "base/Base.h" #include "network/NetworkUtils.h" #include "fs/FileUtils.h" #include <netdb.h> #include <ifaddrs.h> #...
1
14,359
I don't think this belongs here. If the application can take a local_ip as input, the application should take care of it, not in this common library
vesoft-inc-nebula
cpp
@@ -524,6 +524,17 @@ class Theme return ThemeData::forTheme($this); } + /** + * Remove data specific to this theme + * @return bool + */ + public function removeCustomData() + { + if ($this->hasCustomData()) { + return $this->getCustomData()->delete(); + } +...
1
<?php namespace Cms\Classes; use App; use Url; use File; use Yaml; use Lang; use Cache; use Event; use Config; use Exception; use SystemException; use DirectoryIterator; use ApplicationException; use Cms\Models\ThemeData; use System\Models\Parameter; use October\Rain\Halcyon\Datasource\DbDatasource; use October\Rain\H...
1
16,444
@DanHarrin please add a `return true` at the bottom of this method, as the docblock indicates a boolean return value.
octobercms-october
php
@@ -25,7 +25,7 @@ import org.apache.lucene.index.SlowImpactsEnum; /** Expert: A <code>Scorer</code> for documents matching a <code>Term</code>. */ -final class TermScorer extends Scorer { +public final class TermScorer extends Scorer { private final PostingsEnum postingsEnum; private final ImpactsEnum impact...
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
1
38,046
This is used in o.a.l.sandbox.search.BM25FQuery.
apache-lucene-solr
java
@@ -41,7 +41,8 @@ public class XYShapeBoundingBoxQuery extends ShapeQuery { @Override protected PointValues.Relation relateRangeBBoxToQuery(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle) { - return...
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
1
30,189
Shouldn't this work as well for Disjoint?
apache-lucene-solr
java
@@ -50,6 +50,9 @@ class TestCase(unittest.TestCase): for nm, fn in Descriptors._descList: try: v = fn(m) + except RuntimeError: + # 3D descriptors fail since the mol has no conformers + pass except Exception: import traceback traceback.p...
1
# # Copyright (C) 2007-2017 Greg Landrum # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ General descriptor testing code """ from __future__...
1
16,633
Same here. This was included to quiet the test for the 3D descriptors. As we removed them, this exception handling is no longer required
rdkit-rdkit
cpp
@@ -26,6 +26,7 @@ #include "lbann/utils/lbann_library.hpp" #include "lbann/callbacks/callback_checkpoint.hpp" +#include "lbann/data_store/data_store_jag.hpp" namespace lbann {
1
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2014-2016, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory. // Written by the LBANN Research Team (B. Van Essen, et al.) listed in // the CONTRIBUTORS file. <lbann-dev@l...
1
14,089
Why do you need to load a specific data reader in lbann_library?
LLNL-lbann
cpp
@@ -31,10 +31,10 @@ namespace Nethermind.Runner.Ethereum.Steps _context = context; } - public ValueTask Execute() + public Task Execute() { _context.ChainSpec.Bootnodes = _context.ChainSpec.Bootnodes?.Where(n => !n.NodeId?.Equals(_context.NodeKey.PublicKey) ??...
1
// Copyright (c) 2018 Demerzel Solutions Limited // This file is part of the Nethermind library. // // The Nethermind library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of...
1
23,188
why not ValueTask?
NethermindEth-nethermind
.cs
@@ -422,7 +422,7 @@ func (r *ReconcileClusterDeployment) reconcile(request reconcile.Request, cd *hi return reconcile.Result{Requeue: true}, nil } - if cd.Status.InstallerImage == nil { + if !cd.Status.Installed && (cd.Status.InstallerImage == nil || cd.Status.CLIImage == nil) { return r.resolveInstallerImage...
1
package clusterdeployment import ( "context" "fmt" "os" "reflect" "regexp" "strconv" "time" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" routev1 "github.com/openshift/api/route/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" ap...
1
7,518
I'm nervous about this line, I don't want to go regenerate a bunch of imageset jobs for clusters that are old, already installed, but don't have a CLIImage set (which they wouldn't because they're old) Adding the Installed guard is meant to address this. Otherwise this *should* recreate the imageset job due to the code...
openshift-hive
go
@@ -303,7 +303,8 @@ public class HadoopTables implements Tables, Configurable { } Map<String, String> properties = propertiesBuilder.build(); - TableMetadata metadata = tableMetadata(schema, spec, sortOrder, properties, location); + + TableMetadata metadata = TableMetadata.newTableMetadata(sch...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
31,360
Is it necessary to change this file? Doesn't `tableMetadata` call `newTableMetadata`?
apache-iceberg
java
@@ -78,12 +78,6 @@ func TestCatchupOverGossip(t *testing.T) { t.Parallel() // ledger node upgraded version, fetcher node upgraded version runCatchupOverGossip(t, false, false) - // ledger node older version, fetcher node upgraded version - runCatchupOverGossip(t, true, false) - // ledger node upgraded older versi...
1
// Copyright (C) 2019-2021 Algorand, Inc. // This file is part of go-algorand // // go-algorand is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) ...
1
41,734
I think that I have a better proposal for this test - improve it so that it would know how to read the list of SupportedProtocolVersions and dynamically use these. The motivation here is that I expect to have another network version soon, and this test seems to be a good test case for that.
algorand-go-algorand
go
@@ -89,10 +89,13 @@ public class HiveCatalog extends BaseMetastoreCatalog implements Closeable, Supp try { List<String> tables = clients.run(client -> client.getAllTables(database)); - return tables.stream() + List<TableIdentifier> tableIdentifiers = tables.stream() .map(t -> TableIde...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
23,816
What is the purpose of this debug message? I'm not sure how it would help.
apache-iceberg
java
@@ -25,7 +25,6 @@ import ( "time" "kythe.io/kythe/go/extractors/bazel" - "kythe.io/kythe/go/extractors/bazel/extutil" ) var (
1
/* * Copyright 2017 The Kythe Authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
1
12,215
Is there a corresponding BUILD dependency to prune?
kythe-kythe
go
@@ -2066,7 +2066,14 @@ func testSignedURL(t *testing.T, newHarness HarnessMaker) { } getURLNoParamsURL.RawQuery = "" getURLNoParams := getURLNoParamsURL.String() - putURL, err := b.SignedURL(ctx, key, &blob.SignedURLOptions{Method: http.MethodPut}) + const ( + goodContentType = "text/plain" + badContentType = ...
1
// Copyright 2018 The Go Cloud Development Kit Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
1
19,785
The "good" and "bad" descriptions confused me a bit. Maybe `allowedContentType` and `disallowedContentType`? Not sure if that's better.
google-go-cloud
go
@@ -273,7 +273,7 @@ public class HttpCommandExecutor implements CommandExecutor, NeedsLocalLogs { } if (!GET_ALL_SESSIONS.equals(command.getName()) && !NEW_SESSION.equals(command.getName())) { - throw new SessionNotFoundException("Session ID is null"); + throw new SessionNotFoundE...
1
/* Copyright 2007-2011 Selenium committers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
1
10,691
It would be better to just change RWD to throw IllegalStateException if you attempt to execute a command after quit (unless it's a second call to quit())
SeleniumHQ-selenium
py
@@ -106,11 +106,11 @@ func TestServerRoutesWithAuthAndBCrypt(t *testing.T) { srvB := RunServer(optsB) defer srvB.Shutdown() - urlA := fmt.Sprintf("nats://%s:%d/", optsA.Host, optsA.Port) - urlB := fmt.Sprintf("nats://%s:%d/", optsB.Host, optsB.Port) + urlA := fmt.Sprintf("nats://%s:%s@%s:%d/", optsA.Username, opt...
1
// Copyright 2013-2016 Apcera Inc. All rights reserved. package server import ( "fmt" "net" "net/url" "reflect" "strconv" "testing" "time" "github.com/nats-io/go-nats" ) func TestRouteConfig(t *testing.T) { opts, err := ProcessConfigFile("./configs/cluster.conf") if err != nil { t.Fatalf("Received an er...
1
6,888
You may want to have a look at `func checkClusterFormed(t *testing.T, servers ...*Server)` in this file that I created some time ago. It will timeout at 5 seconds, but will return as soon as cluster is ready.
nats-io-nats-server
go
@@ -662,8 +662,14 @@ static void push_cb (flux_t *h, flux_msg_handler_t *mh, aggregate_sink (h, ag); rc = 0; done: - if (flux_respond (h, msg, rc < 0 ? saved_errno : 0, NULL) < 0) - flux_log_error (h, "aggregator.push: flux_respond"); + if (rc < 0) { + if (flux_respond_error (h, msg, ...
1
/************************************************************\ * Copyright 2016 Lawrence Livermore National Security, LLC * (c.f. AUTHORS, NOTICE.LLNS, COPYING) * * This file is part of the Flux resource manager framework. * For details, see https://github.com/flux-framework. * * SPDX-License-Identifier: LGPL-3....
1
23,214
I see a few places where this blob of code is required due to the removal of `errnum` parameter from `flux_respond` -- trading 2 lines of code for 8. The improvement to the function seems like a good idea, but I wonder if we need a convenience macro or function to do it the old way? You went through and made all the ch...
flux-framework-flux-core
c
@@ -23,9 +23,9 @@ */ import { appendNotificationsCount, - sendAnalyticsTrackingEvent, getQueryParameter, } from './util/standalone'; +import { trackEvent } from './util/tracking'; // Set webpackPublicPath on-the-fly. if ( global.googlesitekitAdminbar && global.googlesitekitAdminbar.publicPath ) {
1
/** * Admin bar loader. * * Site Kit by Google, Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Un...
1
26,125
I know it's not related to your change, but it's a bit odd that this import uses a relative path rather than the ones setup by webpack. Might be nice to change this one in case we refactor those paths in the future; this one wouldn't get caught in any kind of find+replace.
google-site-kit-wp
js
@@ -86,7 +86,8 @@ func (c *Config) Start() { for _, schedule := range c.Scheduler.Schedules { helper.ControllerWg.Add(1) - go schedule.ExecuteSchedule(c.ActionManager.Actions, c.Converter.DataRead, c.Device.ID) + newSchedule := schedule + go newSchedule.ExecuteSchedule(c.ActionManager.Actions, c.Converter.Dat...
1
/* Copyright 2019 The KubeEdge Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
1
15,017
Good catch, and if we don't declare the newSchedule here, will the last schedule be executed in multi goroutine?
kubeedge-kubeedge
go
@@ -879,6 +879,7 @@ partial class Build .Concat(includeSecurity) .Select(x => Solution.GetProject(x)) .Where(project => + project != null && (project, project.TryGetTargetFrameworks()) switch { _ whe...
1
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Runtime.InteropServices; using System.Text.Json; using System.Text.RegularExpressions; using Nuke.Common; using Nuke.Common.IO; using Nuke.Common.ProjectModel; using Nuke.Common.Tooling; using Nuke.Common....
1
24,717
`project` should never be null here, unless we have projects that aren't in the solution? Which we shouldn't have
DataDog-dd-trace-dotnet
.cs
@@ -1,13 +1,18 @@ #include "extractor/graph_compressor.hpp" #include "extractor/compressed_edge_container.hpp" -#include "extractor/restriction_map.hpp" +#include "extractor/restriction.hpp" +#include "extractor/restriction_compressor.hpp" + #include "util/dynamic_graph.hpp" #include "util/node_based_graph.hpp" ...
1
#include "extractor/graph_compressor.hpp" #include "extractor/compressed_edge_container.hpp" #include "extractor/restriction_map.hpp" #include "util/dynamic_graph.hpp" #include "util/node_based_graph.hpp" #include "util/percent.hpp" #include "util/log.hpp" namespace osrm { namespace extractor { void GraphCompressor...
1
22,206
Simple `for` loop instead of `for_each` would help here by making it more readable.
Project-OSRM-osrm-backend
cpp
@@ -96,6 +96,8 @@ namespace thread_role case nano::thread_role::name::signature_checking: thread_role_name_string = "Signature check"; break; + case nano::thread_role::name::confirmation_height_processing: + thread_role_name_string = "Conf height"; } /*
1
#include <iostream> #include <nano/lib/utility.hpp> namespace nano { seq_con_info_composite::seq_con_info_composite (const std::string & name) : name (name) { } bool seq_con_info_composite::is_composite () const { return true; } void seq_con_info_composite::add_component (std::unique_ptr<seq_con_info_component> chi...
1
15,262
Looks like this falls through, should break.
nanocurrency-nano-node
cpp
@@ -73,6 +73,7 @@ class ManifestListWriter implements FileAppender<ManifestFile> { .schema(ManifestFile.schema()) .named("manifest_file") .meta(meta) + .overwrite(false) .build(); } catch (IOException e) {
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
14,727
Let's default manifest lists and manifests to overwrite. These use UUID-based file names and should never conflict.
apache-iceberg
java
@@ -135,6 +135,9 @@ confspec = ConfigObj(StringIO( audioCoordinates_maxPitch = integer(default=880) reportMouseShapeChanges = boolean(default=false) +[speechView] + showSpeechViewerAtStartup = boolean(default=false) + #Keyboard settings [keyboard] useCapsLockAsNVDAModifierKey = boolean(default=false)
1
"""Manages NVDA configuration. """ import globalVars import _winreg import ctypes import ctypes.wintypes import os import sys from cStringIO import StringIO import itertools import contextlib from collections import OrderedDict from configobj import ConfigObj, ConfigObjError from validate import Validat...
1
18,205
Please rename [speechView] to [speechViewer].
nvaccess-nvda
py
@@ -20,6 +20,12 @@ type CpuUsage struct { // Total CPU time consumed per core. // Units: nanoseconds. PercpuUsage []uint64 `json:"percpu_usage,omitempty"` + // CPU time consumed per core in kernel mode + // Units: nanoseconds. + PercpuUsageInKernelmode []uint64 `json:"percpu_usage_in_kernelmode"` + // CPU time co...
1
// +build linux package cgroups type ThrottlingData struct { // Number of periods with throttling active Periods uint64 `json:"periods,omitempty"` // Number of periods when the container hit its throttling limit. ThrottledPeriods uint64 `json:"throttled_periods,omitempty"` // Aggregate time the container was thr...
1
18,787
I would use shorter yet still descriptive names, e.g. `KernelPerCpu` and `UserPerCpu`.
opencontainers-runc
go
@@ -5017,7 +5017,7 @@ def print_record(recID, format='hb', ot='', ln=CFG_SITE_LANG, decompress=zlib.de display_claim_this_paper = False can_edit_record = False - if check_user_can_edit_record(user_info, recID): + if not (format.lower().startswith('t')) and check_user_can_edit_record(user_info, re...
1
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation;...
1
16,890
if we are seeking for the content of only one field from metadata, no need to check whether a user could edit record or not
inveniosoftware-invenio
py
@@ -25,3 +25,4 @@ class ChromeRemoteConnection(RemoteConnection): self._commands["launchApp"] = ('POST', '/session/$sessionId/chromium/launch_app') self._commands["setNetworkConditions"] = ('POST', '/session/$sessionId/chromium/network_conditions') self._commands["getNetworkConditions"] = ('G...
1
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
1
15,524
Should this be camelCase to match the above commands? I am not the expert here so maybe Lucas or David can chime in.
SeleniumHQ-selenium
py
@@ -254,7 +254,8 @@ namespace Datadog.Trace.ClrProfiler.Integrations scope = tracer.StartActive(ValidateOperationName, serviceName: serviceName); var span = scope.Span; span.Type = SpanTypes.GraphQL; - + span.SetTag(Tags.SpanKind, SpanKinds.Server); + ...
1
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Datadog.Trace.ClrProfiler.Emit; using Datadog.Trace.ClrProfiler.Helpers; using Datadog.Trace.Logging; namespace Datadog.Trace.ClrProfiler.Integrations { /// <summary> /// Tracing integratio...
1
16,084
This is also missing in CreateScopeFromExecuteAsync. Can you add that there too?
DataDog-dd-trace-dotnet
.cs
@@ -30,9 +30,12 @@ public class DateUtils { } String date = input.trim().replace('/', '-').replaceAll("( ){2,}+", " "); + // remove colon from timezone to avoid differences between Android and Java SimpleDateFormat + date = date.replaceAll("([+-]\\d\\d):(\\d\\d)$", "$1$2"); + ...
1
package de.danoeh.antennapod.core.util; import android.content.Context; import android.util.Log; import org.apache.commons.lang3.StringUtils; import java.text.DateFormat; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCal...
1
18,089
I hope that this does not break anything... Probably needs detailed beta tests.
AntennaPod-AntennaPod
java
@@ -1518,6 +1518,17 @@ module RSpec::Core end end + describe 'recording spec start time (for measuring load)' do + it 'returns a time' do + expect(config.start_time).to be_an_instance_of ::Time + end + + it 'is configurable' do + config.start_time = 42 + expect(confi...
1
require 'spec_helper' require 'tmpdir' module RSpec::Core RSpec.describe Configuration do let(:config) { Configuration.new } let(:exclusion_filter) { config.exclusion_filter.rules } let(:inclusion_filter) { config.inclusion_filter.rules } describe '#deprecation_stream' do it 'defaults to sta...
1
12,268
@JonRowe in what scenario do you see this being manually set?
rspec-rspec-core
rb
@@ -307,6 +307,10 @@ void nano::block_processor::process_live (nano::block_hash const & hash_a, std:: election.election->try_generate_votes (block_a->hash ()); } } + else + { + node.active.check_inactive_votes_cache_election (block_a); + } // Announce block contents to the network if (origin_a == nano::...
1
#include <nano/lib/threading.hpp> #include <nano/lib/timer.hpp> #include <nano/node/blockprocessor.hpp> #include <nano/node/election.hpp> #include <nano/node/node.hpp> #include <nano/node/websocket.hpp> #include <nano/secure/blockstore.hpp> #include <boost/format.hpp> std::chrono::milliseconds constexpr nano::block_p...
1
16,492
I think the work "trigger" makes more sense than "check" because this is taking an action based on status.
nanocurrency-nano-node
cpp
@@ -41,7 +41,7 @@ public class AuthHandlerBoot implements BootListener { RSAKeypair4Auth.INSTANCE.setPrivateKey(rsaKeyPairEntry.getPrivateKey()); RSAKeypair4Auth.INSTANCE.setPublicKey(rsaKeyPairEntry.getPublicKey()); RSAKeypair4Auth.INSTANCE.setPublicKeyEncoded(rsaKeyPairEntry.getPublicKeyEncoded()...
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
1
12,441
add a configuration , default put public key in Microservice, if the configuration is set, then put in Instance.
apache-servicecomb-java-chassis
java
@@ -20,8 +20,8 @@ import com.google.common.collect.ImmutableList; public interface OutputView { public enum Kind { - ASSIGNMENT, COMMENT, + DEFINITION, LOOP, PRINT }
1
/* Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
1
25,976
WDYT about the idea above of making these all verbs that correspond to the input spec?
googleapis-gapic-generator
java
@@ -77,7 +77,7 @@ import static com.fsck.k9.mail.K9MailLib.PUSH_WAKE_LOCK_TIMEOUT; * </pre> */ public class ImapStore extends RemoteStore { - public static final String STORE_TYPE = "IMAP"; + public static final ServerSettings.Type STORE_TYPE = ServerSettings.Type.IMAP; private static final int IDLE_R...
1
package com.fsck.k9.mail.store.imap; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharacterCodingException; import java.nio.charset.C...
1
12,972
With the introduction of the enum(s) the constants in the store classes should be removed.
k9mail-k-9
java
@@ -455,6 +455,12 @@ static CALI_BPF_INLINE int calico_tc(struct __sk_buff *skb) } } + // Drop packets with IP options + if (ip_header->ihl > 5) { + fwd.reason = CALI_REASON_IP_OPTIONS; + CALI_DEBUG("Drop packets with IP options\n"); + goto deny; + } // Setting all of these up-front to keep the verifier hap...
1
// Project Calico BPF dataplane programs. // Copyright (c) 2020 Tigera, Inc. All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at...
1
17,829
I would say `!= 5`; A packet with <5 would be malformed.
projectcalico-felix
go
@@ -60,7 +60,7 @@ func New(selector export.AggregationSelector, exporter export.Exporter, opts ... c.Timeout = c.Period } - integrator := simple.New(selector, c.Stateful) + integrator := simple.New(selector, exporter) impl := sdk.NewAccumulator( integrator, sdk.WithResource(c.Resource),
1
// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
1
12,659
I think you missed removing `Stateful` from `push/config.go`
open-telemetry-opentelemetry-go
go
@@ -29,7 +29,7 @@ namespace Nethermind.Db.Databases { } - protected override void UpdateReadMetrics() => Metrics.EthRequestsDbReads++; - protected override void UpdateWriteMetrics() => Metrics.EthRequestsDbWrites++; + protected internal override void UpdateReadMetrics() => Metri...
1
// Copyright (c) 2018 Demerzel Solutions Limited // This file is part of the Nethermind library. // // The Nethermind library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of ...
1
23,304
why would you make it internal? if so then at least protected internal
NethermindEth-nethermind
.cs
@@ -502,6 +502,18 @@ class TestHttps2Http(tservers.ReverseProxTest): class TestTransparent(tservers.TransparentProxTest, CommonMixin, TcpMixin): ssl = False + def test_tcp_stream_modify(self): + self.master.load_script( + tutils.test_data.path("scripts/tcp_stream_modify.py")) + + sel...
1
import os import socket import time from OpenSSL import SSL from netlib.exceptions import HttpReadDisconnect, HttpException from netlib.tcp import Address import netlib.tutils from netlib import tcp, http, socks from netlib.certutils import SSLCert from netlib.http import authentication, CONTENT_MISSING, http1 from ne...
1
10,941
We should check if the response (`d`) contains bar as response, screw the log. :smile:
mitmproxy-mitmproxy
py
@@ -538,7 +538,7 @@ void GPUTreeLearner::AllocateGPUMemory() { } // data transfer time std::chrono::duration<double, std::milli> end_time = std::chrono::steady_clock::now() - start_time; - Log::Info("%d dense feature groups (%.2f MB) transfered to GPU in %f secs. %d sparse feature groups", + Log::Info("%d d...
1
#ifdef USE_GPU #include "gpu_tree_learner.h" #include "../io/dense_bin.hpp" #include "../io/dense_nbits_bin.hpp" #include <LightGBM/utils/array_args.h> #include <LightGBM/network.h> #include <LightGBM/bin.h> #include <algorithm> #include <vector> #define GPU_DEBUG 0 namespace LightGBM { GPUTreeLearner::GPUTreeLea...
1
19,627
@Laurae2 good call. This is the only one I found (with `git grep transfered`)
microsoft-LightGBM
cpp
@@ -1805,7 +1805,7 @@ class VariablesChecker(BaseChecker): """ if ( node.frame().parent == defstmt - and node.statement(future=True) not in node.frame().body + and node.statement(future=True) == node.frame() ): # Check if used as type annotation...
1
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2009 Mads Kiilerich <mads@kiilerich.com> # Copyright (c) 2010 Daniel Harding <dharding@gmail.com> # Copyright (c) 2011-2014, 2017 Google, Inc. # Copyright (c) 2012 FELD Boris <lothiraldan@gmail.com> # Copyright (c) 2013-2020 Cla...
1
19,142
I don't understand how this work, could you explain ?
PyCQA-pylint
py
@@ -183,7 +183,7 @@ analyze_callee_regs_usage(dcontext_t *dcontext, callee_info_t *ci) /* XXX implement bitset for optimisation */ memset(ci->reg_used, 0, sizeof(bool) * NUM_GP_REGS); ci->num_simd_used = 0; - memset(ci->simd_used, 0, sizeof(bool) * NUM_SIMD_REGS); + memset(ci->simd_used, 0, sizeof(...
1
/* ********************************************************** * Copyright (c) 2016-2018 ARM Limited. All rights reserved. * **********************************************************/ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following c...
1
15,569
The abbreviation for "context" used extensively inside DR is "cxt", not "ctx", so s/MCTX/MCXT/.
DynamoRIO-dynamorio
c
@@ -13,5 +13,5 @@ return [ */ 'failed' => 'یہ تفصیلات ہمارے ریکارڈ سے مطابقت نہیں رکھتیں۔', - 'throttle' => 'لاگ اِن کرنے کی بہت زیادہ کوششیں۔ براہِ مہربانی :seconds سیکنڈ میں دوبارہ کوشش کریں۔', + 'throttle' => 'لاگ اِن کرنے کی بہت زیادہ کوششیں۔ براہِ مہربانی کچھ سیکنڈ میں دوبارہ کوشش کریں۔', ];
1
<?php return [ /* |-------------------------------------------------------------------------- | Authentication Language Lines |-------------------------------------------------------------------------- | | The following language lines are used during authentication for various | messages th...
1
6,990
here is `:seconds` missing again
Laravel-Lang-lang
php
@@ -40,6 +40,7 @@ public class WebSocketConfiguration { private String authenticationCredentialsFile; private List<String> hostsAllowlist = Arrays.asList("localhost", "127.0.0.1"); private File authenticationPublicKeyFile; + private String authenticationAlgorithm = null; private long timeoutSec; private...
1
/* * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing...
1
26,569
initializing to null makes me uncomfortable. let's have a default value
hyperledger-besu
java
@@ -1129,6 +1129,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http } else if (ch == BytePercentage) { + if (pathStart == -1) + { + ...
1
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.IO.Pipelines; using System.IO.Pipelines.Text.Pri...
1
11,691
This is the `GET % HTTP/1.1` scenario right?
aspnet-KestrelHttpServer
.cs
@@ -1,6 +1,7 @@ <?php namespace Backend\FormWidgets; use App; +use Backend\Facades\BackendAuth; use File; use Event; use Lang;
1
<?php namespace Backend\FormWidgets; use App; use File; use Event; use Lang; use Request; use Backend\Classes\FormWidgetBase; use Backend\Models\EditorSetting; /** * Rich Editor * Renders a rich content editor field. * * @package october\backend * @author Alexey Bobkov, Samuel Georges */ class RichEditor extend...
1
12,669
No need to use the fully qualified path the BackendAuth facade, just `use BackendAuth` is fine.
octobercms-october
php
@@ -357,6 +357,11 @@ bool nano::send_block::valid_predecessor (nano::block const & block_a) const return result; } +nano::epoch nano::send_block::epoch () const +{ + return nano::epoch::epoch_0; +} + nano::block_type nano::send_block::type () const { return nano::block_type::send;
1
#include <nano/crypto_lib/random_pool.hpp> #include <nano/lib/blocks.hpp> #include <nano/lib/memory.hpp> #include <nano/lib/numbers.hpp> #include <nano/lib/utility.hpp> #include <boost/endian/conversion.hpp> #include <boost/pool/pool_alloc.hpp> /** Compare blocks, first by type, then content. This is an optimization ...
1
15,908
Because it's similar for send/open/change/receive types, then probably it can be just common `nano::epoch nano::block::epoch () const` with override for state_block (like nano::block::link (), account (), representative ())
nanocurrency-nano-node
cpp
@@ -1,5 +1,6 @@ // This is the API that JS files loaded from the webview can see const webviewApiPromises_ = {}; +let cb_ = () => {}; // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars const webviewApi = {
1
// This is the API that JS files loaded from the webview can see const webviewApiPromises_ = {}; // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars const webviewApi = { postMessage: function(message) { const messageId = `userWebview_${Date.now()}${Math.random()}`; const promise = new P...
1
18,374
Please give a more descriptive name and add a command to explain what it does.
laurent22-joplin
js
@@ -77,7 +77,8 @@ public class UserPreferences { // Network private static final String PREF_ENQUEUE_DOWNLOADED = "prefEnqueueDownloaded"; public static final String PREF_UPDATE_INTERVAL = "prefAutoUpdateIntervall"; - private static final String PREF_MOBILE_UPDATE = "prefMobileUpdate"; + public sta...
1
package de.danoeh.antennapod.core.preferences; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.annotation.IntRange; import android.support.annotation.NonNull; import android.support.v4.app.NotificationCompat; import android.t...
1
14,657
we can never get rid of this...
AntennaPod-AntennaPod
java
@@ -28,8 +28,9 @@ var ( []string{"controller", "method", "resource", "remote", "status"}, ) metricKubeClientRequestSeconds = prometheus.NewHistogramVec(prometheus.HistogramOpts{ - Name: "hive_kube_client_request_seconds", - Help: "Length of time for kubernetes client requests.", + Name: "hive_kube_client_r...
1
package utils import ( "fmt" "net/http" "strings" "time" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/rest" "k8s.io/client-go/util/flowcontrol" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/con...
1
15,237
what is the effect of changing these buckets in existing data that is available in the monitoring system? if there are any existing dashboards that use previous histogram buckets they are probably going to be wrong ot invalid? also any reason why we chose these specific values?
openshift-hive
go
@@ -109,4 +109,13 @@ // // var h handler // yarpc.InjectClients(dispatcher, &h) +// +// Automatically Sanitizing TChannel Contexts +// +// Contexts created with `tchannel.ContextWithHeaders` are incompatible with yarpc clients generated from thrift. +// Using such a context will cause a yarpc client to error on an...
1
// Copyright (c) 2017 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
1
15,137
This won't work. For the flag to be passed to the plugin, it should be passed as part of the --plugin argument. --plugin "yarpc --sanitize-tchannel"
yarpc-yarpc-go
go
@@ -2308,6 +2308,13 @@ int LGBM_BoosterSetLeafValue(BoosterHandle handle, API_END(); } +int LGBM_BoosterGetNumFeatures(BoosterHandle handle, int *out_val) { + API_BEGIN(); + Booster* ref_booster = reinterpret_cast<Booster*>(handle); + *out_val = ref_booster->GetBoosting()->MaxFeatureIdx() + 1; + API_END(); +}...
1
/*! * Copyright (c) 2016 Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE file in the project root for license information. */ #include <LightGBM/c_api.h> #include <LightGBM/boosting.h> #include <LightGBM/config.h> #include <LightGBM/dataset.h> #include <LightGBM/dataset_loa...
1
31,625
@shiyu1994 @StrikerRUS what do you think about this addition to `c_api.cpp`? I think it's a really useful addition to be able to get this type of information from the `Booster`, but I want more opinions since `c_api` is the main public API for the library.
microsoft-LightGBM
cpp
@@ -213,6 +213,16 @@ type deferedCommit struct { lookback basics.Round } +// RoundOffsetError is an error for when requested round is behind earliest stored db entry +type RoundOffsetError struct { + Round basics.Round + DbRound basics.Round +} + +func (e *RoundOffsetError) Error() string { + return fmt.Sprintf(...
1
// Copyright (C) 2019-2020 Algorand, Inc. // This file is part of go-algorand // // go-algorand is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) ...
1
40,185
rename Round -> requestedRound and DbRound -> dbRound. we don't need to export the fields here, only the error struct.
algorand-go-algorand
go
@@ -1052,6 +1052,18 @@ func TestClusterDeploymentReconcile(t *testing.T) { } }, }, + { + name: "Add cluster region label", + existing: []runtime.Object{ + testClusterDeploymentWithoutRegionLabel(), + }, + validate: func(c client.Client, t *testing.T) { + cd := getCD(c) + if assert.NotNil(t...
1
package clusterdeployment import ( "context" "fmt" "os" "testing" "time" "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/p...
1
10,974
This expected value should probably be what you literally expect, otherwise there's a chance getClusterRegion is doing something wrong and the test wouldn't catch it because it's being run for both expected and actual.
openshift-hive
go
@@ -27,6 +27,7 @@ package encryption import ( "crypto/tls" "crypto/x509" + "encoding/base64" "errors" "fmt" "io/ioutil"
1
// The MIT License // // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. // // Copyright (c) 2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Soft...
1
10,488
TODO: update unit tests to exercise base64-inline path
temporalio-temporal
go
@@ -551,6 +551,16 @@ public class UserPreferences { restartUpdateAlarm(false); } + public static boolean shouldShowOnboarding(String location) { + String key = "onboarding_" + location; + if (prefs.getBoolean(key, true)) { + prefs.edit().putBoolean(key, false).apply(); + ...
1
package de.danoeh.antennapod.core.preferences; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.SystemClock; import android.preference.PreferenceManager; import android.support.a...
1
13,828
this method knows too much - it is kind of a strange side effect I'd prefer if we had separate method for acknowledging that the onboarding was done and should not be shown again
AntennaPod-AntennaPod
java
@@ -125,6 +125,7 @@ public class StorageCallbacksImpl implements StorageCallbacks { PodDBAdapter.KEY_CHAPTER_TYPE)); } if(oldVersion <= 14) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + " ADD COLUMN " + PodDBAdapter.KEY_AUTO...
1
package de.danoeh.antennapod.config; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import de.danoeh.antennapod.core.StorageCallbacks; import de.danoeh.antennapod.core.storage.PodDBAdapter; public class StorageCallbacksIm...
1
12,138
Do we need to increase the DB version? Also, should probably be a constant, no?
AntennaPod-AntennaPod
java
@@ -50,6 +50,11 @@ func NewWindow(every, period, offset values.Duration) (Window, error) { return w, nil } +// IsZero checks if the window's every duration is zero +func (w Window) IsZero() bool { + return w.every.IsZero() +} + func (w Window) isValid() error { if w.every.IsZero() { return errors.New(codes.I...
1
package interval import ( "github.com/influxdata/flux/codes" "github.com/influxdata/flux/internal/errors" "github.com/influxdata/flux/values" ) const epoch = values.Time(0) var epochYear, epochMonth int64 func init() { ts := epoch.Time() y, m, _ := ts.Date() epochYear = int64(y) epochMonth = int64(m - 1) } ...
1
15,567
We could utilize the new isZero method in this if-statement, right?
influxdata-flux
go
@@ -107,6 +107,14 @@ func (config testBlockOpsConfig) blockCache() BlockCache { return config.cache } +func (config testBlockOpsConfig) MakeLogger(module string) logger.Logger { + return logger.NewNull() +} + +func (config testBlockOpsConfig) DataVersion() DataVer { + return FilesWithHolesDataVer +} + func makeTe...
1
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "fmt" "sync" "testing" "github.com/golang/mock/gomock" "github.com/keybase/client/go/logger" "github.com/keybase/client/go/protocol/keyb...
1
15,002
should probably have config have a `t` or a `logger.NewTestLogger(t)`, and return the latter
keybase-kbfs
go
@@ -51,8 +51,10 @@ func (p *heuristicPlanner) Plan(inputPlan *PlanSpec) (*PlanSpec, error) { visited := make(map[PlanNode]struct{}) - nodeStack := make([]PlanNode, len(inputPlan.Results())) - copy(nodeStack, inputPlan.Results()) + nodeStack := make([]PlanNode, 0, len(inputPlan.Roots)) + for root := range inp...
1
package planner // heuristicPlanner applies a set of rules to the nodes in a PlanSpec // until a fixed point is reached and no more rules can be applied. type heuristicPlanner struct { rules map[ProcedureKind][]Rule } func newHeuristicPlanner() *heuristicPlanner { return &heuristicPlanner{ rules: make(map[Procedu...
1
8,617
Does this not do the same thing as `copy`? I thought that `copy` just did an elementwise assignment, but maybe I was wrong.
influxdata-flux
go
@@ -124,9 +124,9 @@ public abstract class FlatteningConfig { // flattening. Map<String, FlatteningConfig> flatteningConfigs = new LinkedHashMap<>(); - flatteningConfigs.putAll(flatteningConfigsFromGapicConfig); - // Let flattenings from proto annotations override flattenings from GAPIC config. + //...
1
/* Copyright 2016 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
1
27,655
Here we are merging the configs from proto annotations and gapic config. But in other places in this PR we are using the new enum to pick one or the other, right? Or is that not the correct way to think about this?
googleapis-gapic-generator
java
@@ -16,7 +16,7 @@ var opts = struct { Usage string Verbosity cli.Verbosity `short:"v" long:"verbosity" default:"warning" description:"Verbosity of output (higher number = more output)"` CacheDir string `short:"d" long:"dir" default:"" description:"The directory to store cached artifacts in."` - Port ...
1
package main import ( "fmt" "github.com/thought-machine/please/src/cli" "github.com/thought-machine/please/tools/http_cache/cache" "gopkg.in/op/go-logging.v1" "net/http" "os" "path/filepath" ) var log = logging.MustGetLogger("httpcache") var opts = struct { Usage string Verbosity cli.Verbosity `short:"v...
1
9,812
not related to this change?
thought-machine-please
go
@@ -51,9 +51,9 @@ if (options.arch) { const buildType = options.buildType; -const ndkPath = process.env["ANDROID_NDK"]; +const ndkPath = process.env["ANDROID_NDK"] || process.env["ANDROID_NDK_HOME"]; if (!ndkPath) { - throw Error("ANDROID_NDK environment variable not set"); + throw Error("ANDROID_NDK / ANDROID_...
1
//////////////////////////////////////////////////////////////////////////// // // Copyright 2021 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/li...
1
21,152
Why is this needed?
realm-realm-js
js
@@ -1353,7 +1353,7 @@ int64_t Creature::getStepDuration() const int32_t stepSpeed = getStepSpeed(); if (stepSpeed > -Creature::speedB) { calculatedStepSpeed = floor((Creature::speedA * log((stepSpeed / 2) + Creature::speedB) + Creature::speedC) + 0.5); - if (calculatedStepSpeed <= 0) { + if (calculatedStepSpee...
1
/** * The Forgotten Server - a free and open-source MMORPG server emulator * Copyright (C) 2017 Mark Samman <mark.samman@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; eithe...
1
15,104
This one could be replaced with a `std::max`, no?
otland-forgottenserver
cpp
@@ -87,7 +87,10 @@ module Selenium return unless File.exist?(manifest_path) manifest = JSON.parse(File.read(manifest_path)) - [manifest['name'].delete(' '), manifest['version']].join('@') + id = if manifest.key?('application') && manifest['application'].key?('gecko') + ...
1
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
1
15,944
Couldn't you just write this as an if/else or a guard clause like on line 87? Just seems a bit weird doing this conditional assignment for essentially an if/else.
SeleniumHQ-selenium
java
@@ -566,7 +566,11 @@ class Filter extends WidgetBase /* * Set scope value */ - $scope->value = $this->getScopeValue($scope); + if($scopeType=='checkbox' || $scopeType=='switch'){ + $scope->value = isset($config['value']) ? $config['value'] : $this->getScopeValue($sc...
1
<?php namespace Backend\Widgets; use Db; use Str; use Lang; use Backend; use DbDongle; use Carbon\Carbon; use Backend\Classes\WidgetBase; use Backend\Classes\FilterScope; use ApplicationException; /** * Filter Widget * Renders a container used for filtering things. * * @package october\backend * @author Alexey B...
1
12,658
Please use strict type comparisons (`===`), not loose type comparisons.
octobercms-october
php
@@ -73,6 +73,14 @@ public class FilterParameter { return blockhash; } + public boolean isValid() { + if (!getFromBlock().isLatest() && !getToBlock().isLatest() && getBlockhash() != null) { + return false; + } + + return true; + } + @Override public String toString() { return MoreObj...
1
/* * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing...
1
22,134
The filter parameters are a bit confusing. I understand that one of them has to be set, but what takes precedence if a from/to is set and the hash as well? Should that fail?
hyperledger-besu
java
@@ -6,6 +6,9 @@ #include "graph/context/Iterator.h" +#include <cstdio> +#include <tuple> + #include "common/datatypes/Edge.h" #include "common/datatypes/Vertex.h" #include "graph/util/SchemaUtil.h"
1
/* Copyright (c) 2020 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License, * attached with Common Clause Condition 1.0, found in the LICENSES directory. */ #include "graph/context/Iterator.h" #include "common/datatypes/Edge.h" #include "common/datatypes/Vertex.h" #include "g...
1
30,998
Is that necessary?
vesoft-inc-nebula
cpp
@@ -72,7 +72,7 @@ describe Ncr::WorkOrder do describe "#ba_6x_tier1_team?" do it "is true for whitelist of organizations" do - org_letters = %w( 7 J 4 T 1 A C Z ) + org_letters = %w( 1 2 4 7 A C J T Z ) org_letters.each do |org_letter| org_code = "P11#{org_letter}XXXX" ncr_o...
1
describe Ncr::WorkOrder do include ProposalSpecHelper it_behaves_like "client data" describe "Associations" do it { should belong_to(:ncr_organization) } it { should belong_to(:approving_official) } end describe "Validations" do it "does not allow approving official to be changed if the first s...
1
17,115
yess so much easier to read in order like this!
18F-C2
rb
@@ -613,6 +613,7 @@ public abstract class LuceneTestCase extends Assert { RuleChain r = RuleChain.outerRule(new TestRuleIgnoreTestSuites()) .around(ignoreAfterMaxFailures) .around(suiteFailureMarker = new TestRuleMarkFailure()) + .around(new VerifyTestClassNamingConvention()) .around(new ...
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
1
36,323
question: would this convention automatically and always apply to all classes derived from `LuceneTestCase` including any non-`org.apache` name spaces or would it be possible to opt-out (without an exclusion list) somehow for custom code that might perhaps have chosen a different convention?
apache-lucene-solr
java
@@ -57,7 +57,7 @@ public class PasscodeManager { private static final String EPREFIX = "eprefix"; // Default min passcode length - protected static final int MIN_PASSCODE_LENGTH = 6; + protected static final int MIN_PASSCODE_LENGTH = 4; // Key in preference for the passcode private static f...
1
/* * Copyright (c) 2011, salesforce.com, inc. * All rights reserved. * Redistribution and use of this software in source and binary forms, with or * without modification, are permitted provided that the following conditions * are met: * - Redistributions of source code must retain the above copyright notice, this...
1
13,766
Also found this bug, where we were setting the min passcode length to 6, but the min length for a connected app is 4. This can cause problems when the app is force closed or the shared pref is removed.
forcedotcom-SalesforceMobileSDK-Android
java
@@ -175,7 +175,7 @@ class FastTemporalMemory(TemporalMemory): """ self._validateCell(cell) - return int(cell.idx / self.cellsPerColumn) + return int(cell / self.cellsPerColumn) def cellsForColumn(self, column):
1
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
1
20,522
Why was this change necessary?
numenta-nupic
py
@@ -55,7 +55,7 @@ import java.util.logging.Logger; class Host { - private static final Logger LOG = Logger.getLogger("Selenium Distributor"); + private static final Logger LOG = Logger.getLogger("Selenium Host"); private final Node node; private final UUID nodeId; private final URI uri;
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
16,860
I kind of did this deliberately, so everything from the distributor appears in the same set of logs.
SeleniumHQ-selenium
java
@@ -300,6 +300,7 @@ class TCPSession(IPSession): return pkt metadata["pay_class"] = pay_class metadata["tcp_reassemble"] = tcp_reassemble + metadata["seq"] = pkt[TCP].seq else: tcp_reassemble = metadata["tcp_reassemble"] # Get a relati...
1
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license """ Sessions: decode flow of packets when sniffing """ from collections import defaultdict from scapy.compat import raw from ...
1
19,533
We already have a `seq = pkt[TCP].seq` so you can just re-use it.
secdev-scapy
py
@@ -22,11 +22,8 @@ package org.apache.iceberg.data.parquet; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import java.time.Instant; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; -import...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
15,607
We avoid wildcard imports because it isn't clear where symbols are coming from and there is potential for collision. Could you roll back this change? (As well as the additional newline, we don't use breaks in imports either.)
apache-iceberg
java
@@ -533,11 +533,11 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_client_verifies) (std::chrono::steady_clock::now() + std::chrono::microseconds(100))); while (!sent) { - Locators input_begin(locator_list....
1
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless re...
1
23,092
Why are these variables renamed? Is there a conflict with some Windows specific variable?
eProsima-Fast-DDS
cpp
@@ -18,6 +18,8 @@ require_once("../inc/util.inc"); require_once("../inc/xml.inc"); +if(file_exists('../../release.inc')) + include '../../release.inc'; BoincDb::get(true); xml_header();
1
<?php // This file is part of BOINC. // http://boinc.berkeley.edu // Copyright (C) 2008 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation, // either version 3 of the ...
1
11,724
Do you test for file existence simply to reduce the warning message that may occur using the include? Also - I think the practice used in BOINC is to go ahead and use include_once even though it isn't strictly necessary in this case.
BOINC-boinc
php
@@ -20,6 +20,8 @@ import ( ) // +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="action",type=string,JSONPath=`.spec.action` +// +kubebuilder:printcolumn:name="duration",type=string,JSONPath=`.spec.duration` // +chaos-mesh:experiment // TimeChaos is the Schema for the timechaos API
1
// Copyright 2021 Chaos Mesh Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to...
1
25,452
`TimeChaos` does not contains a field .spec.action
chaos-mesh-chaos-mesh
go
@@ -1,9 +1,10 @@ package net.runelite.rs.api; +import net.runelite.api.AbstractArchive; import net.runelite.api.IndexDataBase; import net.runelite.mapping.Import; -public interface RSAbstractArchive extends IndexDataBase +public interface RSAbstractArchive extends IndexDataBase, AbstractArchive { @Import("tak...
1
package net.runelite.rs.api; import net.runelite.api.IndexDataBase; import net.runelite.mapping.Import; public interface RSAbstractArchive extends IndexDataBase { @Import("takeFile") byte[] getConfigData(int archiveId, int fileId); @Import("getGroupFileIds") @Override int[] getFileIds(int group); }
1
16,544
You need to override where possible in rs-api
open-osrs-runelite
java
@@ -25,5 +25,12 @@ namespace Reporting public string BuildName { get; set; } public DateTime TimeStamp { get; set; } + + public Dictionary<string, string> AdditionalData { get; set; } = new Dictionary<string, string>(); + + public void AddData(string key, string payload) + { + ...
1
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Runtime.Serialization; using Sy...
1
11,737
Should this have an add/update/etc pattern? What happens if I need to change some set of data? May be better to just let the callsite manipulate the dictionary.
dotnet-performance
.cs
@@ -177,6 +177,18 @@ class PyRegion(object): name: the name of the output """ + @not_implemented + def getAlgorithmInstance(self): + """ + Returns the instance of the underlying algorithm that is performing + the computation. + + This method should be overridden by the region subclass. + + ...
1
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
1
20,132
I don't think this should be added to PyRegion. Adding it here requires that every region have an "algorithm" which may not always make sense and the return value type will be different in every case. But fine to use the same name in the regions where we choose to implement it as a convention if that makes the API more...
numenta-nupic
py
@@ -421,6 +421,12 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyht return nil } + // detect connection timeout to the upstream and respond with 504 + switch e, ok := proxyErr.(net.Error); ok { + case e.Timeout(): + return caddyhttp.Error(http.StatusGatewayTimeout, proxyE...
1
// Copyright 2015 Matthew Holt and The Caddy Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicab...
1
15,855
Returning here bypasses all the health check and load balancing features.
caddyserver-caddy
go
@@ -1,4 +1,4 @@ -// Copyright (c) 2020 Tigera, Inc. All rights reserved. +// Copyright (c) 2020-2021 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.
1
// Copyright (c) 2020 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
1
19,323
Should revert this copyright change, when the file isn't changing in any other way.
projectcalico-felix
go
@@ -90,8 +90,10 @@ func WriteFile(fromFile io.Reader, to string, mode os.FileMode) error { return err } dir, file := path.Split(to) - if err := os.MkdirAll(dir, DirPermissions); err != nil { - return err + if dir != "" { + if err := os.MkdirAll(dir, DirPermissions); err != nil { + return err + } } tempF...
1
// Package fs provides various filesystem helpers. package fs import ( "fmt" "io" "io/ioutil" "os" "path" "syscall" "gopkg.in/op/go-logging.v1" ) var log = logging.MustGetLogger("fs") // DirPermissions are the default permission bits we apply to directories. const DirPermissions = os.ModeDir | 0775 // Ensur...
1
9,394
Interesting that filepath.Dir("thing") returns "." whereas this returns ""
thought-machine-please
go
@@ -364,11 +364,11 @@ class Series(_Frame): ... 's2': [.3, .6, .0, .1]}) >>> s1 = df.s1 >>> s2 = df.s2 - >>> s1.corr(s2, method='pearson') - -0.8510644963469898 + >>> s1.corr(s2, method='pearson') # doctest: +ELLIPSIS + -0.851064... - >...
1
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
1
8,568
Nice, I did not know about that
databricks-koalas
py
@@ -2521,4 +2521,19 @@ namespace hip_impl { std::terminate(); #endif } + + std::mutex executables_cache_mutex; + + void executables_cache( + std::string elf, hsa_isa_t isa, hsa_agent_t agent, + std::vector<hsa_executable_t>& exes, bool write) { + static std:...
1
/* Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to us...
1
7,549
Since the lock is have moved outside of this function, I think it would be simpler and efficient to just return a ref to the std::vector<hsa_executable_t>? That way, we don't need to make a new copy on read and we won't actually need a write operation.
ROCm-Developer-Tools-HIP
cpp
@@ -448,12 +448,15 @@ func (api *Server) ReadState(ctx context.Context, in *iotexapi.ReadStateRequest) if !ok { return nil, status.Errorf(codes.Internal, "protocol %s isn't registered", string(in.ProtocolID)) } - data, err := api.readState(ctx, p, in.GetHeight(), in.MethodName, in.Arguments...) + data, readState...
1
// Copyright (c) 2019 IoTeX Foundation // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use...
1
22,089
also fetch block hash of this height and return hash
iotexproject-iotex-core
go
@@ -75,6 +75,9 @@ namespace Samples.HttpMessageHandler private static async Task SendHttpClientRequestAsync(bool tracingDisabled) { + // Insert a call to the Tracer.Instance to include an AssemblyRef to Datadog.Trace assembly in the final executable + var ins = Tracer.Instance;...
1
using System; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; using Datadog.Trace; namespace Samples.HttpMessageHandler { public static class Program { private const string RequestContent = "PING"; ...
1
15,636
Why do we need this in this sample app and not the others?
DataDog-dd-trace-dotnet
.cs
@@ -25,6 +25,9 @@ public interface Span extends AutoCloseable, TraceContext { Span setAttribute(String key, Number value); Span setAttribute(String key, String value); + Span addEvent(String name); + Span addEvent(String name, long timestamp); + Span setStatus(Status status); @Override
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
17,759
We don't need this additional method.
SeleniumHQ-selenium
py
@@ -97,6 +97,6 @@ class CreateUserCommand extends Command $output->writeln(sprintf('<error>Can\'t find role %s</error>', $role)); } - return 1; + return 0; } }
1
<?php /** * Copyright © Bold Brand Commerce Sp. z o.o. All rights reserved. * See LICENSE.txt for license details. */ declare(strict_types = 1); namespace Ergonode\Account\Application\Command; use Ergonode\Account\Domain\Query\RoleQueryInterface; use Ergonode\Account\Domain\ValueObject\Password; use Ergonode\Cor...
1
8,969
Shouldn't this return code conditionally? The above line seems like an error occurred.
ergonode-backend
php
@@ -24,6 +24,12 @@ import ( "k8s.io/apimachinery/pkg/types" ) +// SupportedDiskType is a map containing the valid disk type +var SupportedDiskType = map[string]bool{ + string(apis.TypeSparseCPV): true, + string(apis.TypeDiskCPV): true, +} + // SPC encapsulates StoragePoolClaim api object. type SPC struct { /...
1
/* Copyright 2019 The OpenEBS Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
1
16,202
What is the need to use string as key? Can we use the apis type as the key?
openebs-maya
go
@@ -867,6 +867,7 @@ class Uppy { info (message, type, duration) { const isComplexMessage = typeof message === 'object' + duration = typeof duration === 'undefined' ? 3000 : duration this.setState({ info: {
1
const Utils = require('../core/Utils') const Translator = require('../core/Translator') const UppySocket = require('./UppySocket') const ee = require('namespace-emitter') const cuid = require('cuid') const throttle = require('lodash.throttle') const prettyBytes = require('prettier-bytes') const match = require('mime-ma...
1
10,091
how about a default parameter instead?
transloadit-uppy
js
@@ -624,11 +624,11 @@ func (r *ReconcileClusterDeployment) reconcile(request reconcile.Request, cd *hi } func (r *ReconcileClusterDeployment) reconcileInstallingClusterProvision(cd *hivev1.ClusterDeployment, releaseImage string, logger log.FieldLogger) (reconcile.Result, error) { - // Return early and stop processi...
1
package clusterdeployment import ( "context" "fmt" "os" "reflect" "sort" "strconv" "strings" "time" "github.com/pkg/errors" log "github.com/sirupsen/logrus" routev1 "github.com/openshift/api/route/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/error...
1
17,646
i don't think we need to add duplicate check for clusterinstallref here, the function already assumes that it was invoked for clusterprovision
openshift-hive
go
@@ -159,7 +159,10 @@ class HybridTaskCascadeRoIHead(CascadeRoIHead): bbox_head = self.bbox_head[stage] bbox_feats = bbox_roi_extractor( x[:len(bbox_roi_extractor.featmap_strides)], rois) - if self.with_semantic and 'bbox' in self.semantic_fusion: + + # bbox_feats.shape[0] > ...
1
import numpy as np import torch import torch.nn.functional as F from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, merge_aug_bboxes, merge_aug_masks, multiclass_nms) from ..builder import HEADS, build_head, build_roi_extractor from .cascade_roi_head import CascadeRoIHead @HEADS.regi...
1
25,548
\`bbox_feats.shape[0] > 0\` requires the number of proposal is not 0.
open-mmlab-mmdetection
py
@@ -202,9 +202,8 @@ public class RewriteManifestsAction .createDataset(Lists.transform(manifests, ManifestFile::path), Encoders.STRING()) .toDF("manifest"); - String entriesMetadataTable = metadataTableName(MetadataTableType.ENTRIES); - Dataset<Row> manifestEntryDF = spark.read().format("icebe...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
27,335
Same here. Any way to fit on one line?
apache-iceberg
java
@@ -170,6 +170,9 @@ bool TestShard::commitLogs(std::unique_ptr<LogIterator> iter) { data_.emplace_back(currLogId_, log.toString()); VLOG(1) << idStr_ << "Write: " << log << ", LogId: " << currLogId_ << " state machine log size: " << data_.size(); + ...
1
/* Copyright (c) 2018 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License, * attached with Common Clause Condition 1.0, found in the LICENSES directory. */ #include "base/Base.h" #include "kvstore/raftex/test/TestShard.h" #include "kvstore/raftex/RaftexService.h" #include "kv...
1
28,849
using folly::to is better ?
vesoft-inc-nebula
cpp
@@ -376,7 +376,6 @@ def _init_profiles(): private_profile.setter = ProfileSetter( # type: ignore[attr-defined] private_profile) assert private_profile.isOffTheRecord() - private_profile.setter.init_profile() def _init_site_specific_quirks():
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
1
24,797
I'm guessing this is unintended?
qutebrowser-qutebrowser
py
@@ -284,11 +284,13 @@ class ChangeStreamCursor extends Cursor { if (this.options[optionName]) result[optionName] = this.options[optionName]; } + const resumeKey = this.options.startAfter && !this.hasReceived ? 'startAfter' : 'resumeAfter'; + if (this.resumeToken || this.startAtOperationTime) { ...
1
'use strict'; const EventEmitter = require('events'); const isResumableError = require('./error').isResumableError; const MongoError = require('./core').MongoError; const Cursor = require('./cursor'); const relayEvents = require('./core/utils').relayEvents; const maxWireVersion = require('./core/utils').maxWireVersion...
1
17,141
This looks a little suspicious to me, can you explain what's going on here?
mongodb-node-mongodb-native
js
@@ -48,7 +48,15 @@ class ApplicationController < ActionController::Base private def current_user - @current_user ||= User.find_or_create_by(email_address: session[:user]['email']) if session[:user] && session[:user]['email'] + @current_user ||= find_current_user + end + + def find_current_user + if E...
1
class ApplicationController < ActionController::Base include Pundit # For authorization checks include ReturnToHelper include MarkdownHelper helper ValueHelper add_template_helper ClientHelper protect_from_forgery with: :exception helper_method :current_user, :signed_in?, :return_to before_action ...
1
14,047
Can you talk about this? I'm not sure I follow why this is necessary.
18F-C2
rb
@@ -136,6 +136,8 @@ class AbstractBase extends AbstractActionController ->fromPost('layout', $this->params()->fromQuery('layout', false)); if ('lightbox' === $layout) { $this->layout()->setTemplate('layout/lightbox'); + }elseif(isset($params['layout']) && $params['layout']=='si...
1
<?php /** * VuFind controller base class (defines some methods that can be shared by other * controllers). * * PHP version 7 * * Copyright (C) Villanova University 2010. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, *...
1
26,505
Is there really a need for this 'simple' layout? Is there a reason you can't use 'lightbox'? The only difference seems to be that the lightbox layout includes Piwik/Google Analytics tracking and simple does not. If tracking needs to be disabled for some reason, perhaps there is a way to do that without creating a whole...
vufind-org-vufind
php
@@ -526,6 +526,19 @@ public abstract class MergePolicy { public abstract MergeSpecification findForcedDeletesMerges( SegmentInfos segmentInfos, MergeContext mergeContext) throws IOException; + /** + * Identifies merges that we want to execute (synchronously) on commit. By default, do not synchronously me...
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
1
32,008
Can you say what exception will be thrown in that case (or add an `@throws`, below)?
apache-lucene-solr
java