query_id
string
corpus_id
string
query
string
code
string
label
int64
08b57c6356cc43d9469b8c1da7a8d075
b7079ff4249245c0cdcc60df46da9df2
Sets a hidden variable.
{ if(isset($this->da["hidden"]) && strlen($this->da["hidden"])) { $this->da["hidden"].=$hid; }else{ $this->da["hidden"]=$hid; } }
1
109eea096ac69242bbaf05204d327e53
56477c6da89aeded5796e17fa7d0b910
Returns a timestep which is in the future and is closest and 'none' if none available
{ uint16_t lastCost = USHRT_MAX; uint8_t bestTimestep; uint8_t i; for (i = 0; i < 100; ++i) { uint8_t testTimestep = (currentTimestep + i) % 100; if (timesteps[testTimestep]) { uint16_t currentCost = 0; SListItem *j; for (j = timesteps[testTimestep]; j; j = j->sibling) { currentCost += messageSizes...
0
648bde0595686ce884755f831593ab69
e36a04b1fffc28c1b81a2d22c1c1c095
Returns ``True`` if the two epressions are equal.
if not isinstance(other, type(self)): raise TypeError( "'==' not supported between instances of '{}' and '{}'" .format(type(self), type(other))) return self.ind_eq(other) and (self.const == other.const)
1
a31f29c24bf7c4c44607dac36552bc84
dca1a910983e03e4e2fa14d72519862c
表示该字段不会映射到数据库中去
abstract class Field public function dontStore(): Field { $this->dontStore = true; return $this; }
1
8ad04136b0b76bc94d99036f1e0490a0
e6e69db2b9289ff61ad3db13b5558dfd
异步订单操作
class Index extends BaseController public function asynCallback() { $callbackParam = $this->request->getContent(); if ($callbackParam) { $callbackData = json_decode($callbackParam, true); $sign = $callbackData['sign']; unset($callbackData['sign']); $si...
1
611e7eaa4c2e4585f9fe6684f96955f4
a4a51c170a9b79938349855a434d1084
Ttakes a list of datetime strings and converts it into a list of strings with only the date.
def filterDatesFrom(lst): dates = list(map(dateTransformer, lst)) return [i for i in dates if i]
0
95ebcd8efe7f91485e7f643da244912c
a23f7e1372a6842c09fd09df55ef6591
Method called during construction to define telemetry packets.
{ this.telemetryClient = new TelemetryClient(configuration); this.telemetryClient.Context.GetInternalContext().SdkVersion = SdkVersionUtils.GetSdkVersion("web:"); if (configuration != null && configuration.TelemetryChannel != null) { this.telemetry...
1
aeca77bcb8b91bb42283dafcb5c72781
7adeb1da23ba7070f6a3ed25e52ec01a
根据协议编号,取所有贷款台账信息
public List<Lapledgeinfo> findListByLoanappcode(String loanappcode);
1
8537b00f3c341ac9263fccf5c738a73b
fde2ff810160e54ab6eb068143c2bd1f
two finger pinch detection source: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
{ if (GetCameraComponent() != NULL) { GetCameraComponent()->OnPinchStarted(AnchorPosition1, AnchorPosition2, DownTime); } }
1
8c838c27fee654db01c4fbe96c704bb1
c81d7ebcba4962feb1062779f4d2d22a
exits the program whatever its state is
namespace Driver class DriverMain public static void Exit(bool forcedExit = false) { if (forcedExit) { IO.Output("Press any key to exit...", false, true); } else { if (IO.errorCount == 0) { ...
1
2991ab84beb7b3eff6c439e16caab10a
7b37d8eb027b24a8f42d1c18a893c46d
Test if scheduler time interval is returned.
sch.scheduleActionAtInterval(3.2, this, "actionMethod"); sch.execute(); sch.execute(); assertEquals(3.2, results.get(0), 0.01); assertEquals(6.4, results.get(1), 0.01); }
1
a41399cde65c8709041e3fabd103c6a2
2b36de2e722d800d4c55585fdb2afd89
Finds common characters in two texts
{ HashSet<String> allLetters = new HashSet(); for (int i = 0; i < string.length(); i++) { allLetters.add(string.substring(i, i + 1)); } for (int i = 0; i < string2.length(); i++) { allLetters.add(string2.substring(i, i + 1)); } ...
1
8d6473591689e4d9d7b483f842a928ff
d366f8cbe7a25c8697ac25e0ca2e2649
Get invoice meter details
class MpesaController extends Controller protected function getInvoice($invoiceNumber) { return Booking::where('booking_id', $invoiceNumber)->first(); }
0
a8e9a42d28c39d5a466e13a807e77f93
aebccc650b01a0ff4b58e2ba942051a3
Initialize the VerticaConnector instance.
ssl=False, username=None, password=None): schema = 'https' if ssl else 'http' self._loop = loop self._session = session self.url = _RESOURCE.format(schema=schema, host=host, port=port, version=version) self.data = None ...
1
43556a94a4652b6409d03887e82a79bb
7b4d30f184c34ed535ca4c6dcb679e9c
Expand input files to have full paths
def fix_partial_path(file_list): out_file_list = [] for f0 in file_list : f1 = os.path.expandvars(f0) if '/' in f1 and f1[0] != '/' : f1 = f"{CWD}/{f0}" out_file_list.append(f1) return out_file_list
1
973eb4d3c7b5a951026cfc4c2b90a27d
4865061fafd0bac0c0b3940ff38f2d0e
Change the margin type for a symbol https://binance-docs.github.io/apidocs/futures/en/#change-margin-type-trade
class MxcClient(object): def change_margin(self, position_id, amount, type_): endpoint = f"/api/v1/private/position/change_margin" payload = { 'positionId': position_id, 'amount': amount, 'type': type_ } return self.mxc_post(endpoint, payload, is_priva...
1
68478609e3b9d9ee682413c7bc56c69a
65ebfdc1f5f3a0d886eefdcfbe74ce48
验证请求是否来原与内部系统
class ZaInsSign public function validationSign($params){ $requestSign=$params['sign']; $mySign=$this->_paramsToSign($params); if($requestSign!==$mySign){ return false; } return true; }
1
4e1b27f42fdad7403504f59229b06766
cae0fdd0763b28b68d84ac59c9e063b1
x.__str__() <==> str(x) Return a string representation of this SessionOptions. Call of 'str(options)' is equivalent to 'options.toString()' called with default parameters.
class SessionLog(object): def __repr__(self): return self.to_str()
0
cdc64b1d2627cbc654a68a76e9981451
5505d1594eb42563fa38e17e389407b9
Builds the clusters suffix trees.
int i; int N; for (i = 0; i < mPrimesLen; i++) { N = mPrimeIndexes[i].size(); if (N == 0) continue; buildSegTree(1, 0, N - 1, mPrimeIndexes[i], i); } }
0
8594ba21b73a982135f2806185c8aa27
9d561da06492759b31b67b0d21260d6d
5.删除数组中的重复元素
for(var i=0;i<arr.length;i++){ for(var j=i+1;j<arr.length;j++){ if(arr[i]==arr[j]){ arr.splice(j,1); j--; } } } return arr; }
1
cd751c6ba71e6aa78010c24689beae9b
b53173935100826b3612ee193553ef72
Gets the obligation processing service.
public class CheckFileStatusEventListener extends AbstractSiteEventListener<CheckFileStatusEvent> public BusinessProcessService getBusinessProcessService() { return businessProcessService; }
0
1b4a5a5d557921b2283ead82e3f47122
9e0649d2a3fc0f6c7619fa9d445a5318
Sends the reply message.
namespace CommonTools.Messaging.Handlers public partial class SimpleTwoWayMessageHandler<TIncomingMessageType, TOutgoingMessageType> : SimpleBaseMessageHandler<TIncomingMessageType, TOutgoingMessageType> where TIncomingMessageType : struct, IConvertible where TOutgoingMessageType : struct, IConverti...
1
54770e111df31b021a866d1b9b17096b
a5b9960cf490eaa42a143fa6ef93c1db
测试请求登录接口union_id为空
response = self.login_api.login(None, {"Content-Type": "application/json"}) logging.info("传入None的结果为:{}".format(response.json())) assert_common(self, 200, False, 99999, "抱歉,系统繁忙,请稍后重试!", response)
1
b834694e290a4891dd387ef5efaa9635
8c43522bac49813447f2c09bc3e767e4
Change the message of the day message.
func setMOTD () { MessageOfTheDay = getString("Enter new MOTD:") }
1
9260be94ac316574706163296161eda8
38f7504872b5e3cce837f68eb227cc60
update here
func UpdateProduct(w http.ResponseWriter, r *http.Request) { var prod Product err := json.NewDecoder(r.Body).Decode(&prod) if err != nil { w.WriteHeader(http.StatusBadRequest) } id := mux.Vars(r)["id"] fmt.Printf("%#v\n", id) fmt.Printf("%#v\n", prod) for _, product := range products { if product.ID == id {...
1
4fe38a1b7ddecb37c5a820e6c5008da1
f588d2565ebd7acca4891db2cf53ac9a
This method is used to verify that the user is log in before accessing a controller and redirects to the login page
namespace DNNGo.Modules.ThemePlugin public class BasePage : DotNetNuke.Framework.PageBase public void VerificationLogin() { if (!(UserId > 0)) { Response.Redirect(Globals.NavigateURL(PortalSettings.LoginTabId, "Login", "returnurl=" + HttpUtility.UrlEncode(HttpContext....
1
71ac031694cb654d7521b46f6ac1eef1
b450f1b68627cf26b3914d43bb7ecc38
Iterates over the string values of the enum, ignores entries without a string value by default
class Enum(object): def __iter__(self): return self._values.__iter__()
0
de474248c91c4544d70ff612d220cfb2
47b01b8d82258b11fc3fbbef38e4b487
transfer all chinese symbols to english symbols
var result = ""; var len = str.length; for(var i=0;i<len;i++) { var cCode = str.charCodeAt(i); cCode = (cCode>=0x0021 && cCode<=0x007E)?(cCode + 65248) : cCode; cCode = (cCode==0x0020)?0x03000:cCode; result += String.fromCharCode(cCode); } return result; }
0
c25f196ff7bcf1e910e7e17ba9fbbc7d
c1163ddc8f4f7cfb3d6960ab7996dee2
Adds a Money value of the same currency to this value.
namespace Zero.QuickMoney public static Money Add(Money money, decimal value) => new Money(money.Currency, decimal.Add(money.amount, value));
1
8dbcfa457b3a0cd7ecc778d105a278a8
ca4d4756b2195e664c707451984a3213
Indicator: Decreasing
class UpdateQualityTestCase(unittest.TestCase): def test_decreasing_sell_in(self): items = [Item("foo", 1, 0)] gilded_rose = GildedRose(items) gilded_rose.update_items() self.assertLess(items[0].sell_in, 1)
1
76bc0a6c9e61a7740b01f288bf69a406
474f9ba8c3322b324e73145cf7189b0d
The add method requires at least two arguments but can add an variable number of parameters It will attempt to convert any string into a Number It then returns the total of all parameters as a Number
function addIf(...numbers) { let sum = 0; for (let i = 0; i < numbers.length; i++) { if (isNumber(numbers[i])) sum += numbers[i]; } return sum; }
0
4bbbf7da75d978287784fec5ff169b53
3c73cca54f4c4f493c5eeb1126be8df1
state recibe estado del juego actual, o sea una instancia de Env board es el tablero temporal con las posibles jugadas i sirve para determinar cuántos valores se toman en adelante Se calcula la función de valor de cada acción que se pueda realizar
class PolicyValueNet(): def policy_value_fn(self, board): legal_positions = board.availables current_state = board.current_state().reshape(1, self.board_width, self.board_height, 4) act_probs, value = self.policy_value(current_state) act_probs = (legal_positions, act_probs[0][legal_posit...
1
c38bb1b0f673701fd8e0827d2f14b041
a359091552c290712e16163ab630a280
Gets all the bankruptcy data from a company given vatnum, if there are any.
var path = this.buildUrl({ url: `/api/v2/companies/${companyId}/filings/${year}/${month}/${country}`, parameters: {} }); return this.restCall({ url: path, verb: 'get', payload: null }); }
0
08702a3ea86bfbb21b80ca415274e499
748b50a3e4c51f1c5dd5e5c3af5ec1ea
Append a APSRecord to the list if it is not already there.
BtStatus SDP_AddRecord(SdpRecord *record) { U8 i; BtStatus status = BT_STATUS_SUCCESS; #ifdef BT_FOR_NONE_MP_ONLY if ((!record) || (!SdpServVerifyRecord(record))) { return BT_STATUS_INVALID_PARM; } Assert(record && SdpServVerifyRecord(record)); #endif OS_LockStack(); if (IsNode...
1
f8d111c45048552b10d80551779da575
52a231dc7239a6fa8ef779ed74dc563b
Verify that the component has a no-arg aka default constructor.
class InvokeComponentTest(DeltaGeneratorTestCase): def test_no_args(self): self.test_component() proto = self.get_delta_from_queue().new_element.component_instance self.assertEqual(self.test_component.name, proto.component_name) self.assertJSONEqual({"key": None, "default": None}, proto....
1
6dcb05b52180db51a9b4330a85e1a56c
c035c3b410d447be84f0b765b4e2c40d
名前セルをスクロール固定する。
var nowRowIndex = getRowIndexByName(name); if (nowRowIndex === -1) { return; } var nowRow = _rowScopes[nowRowIndex]; var brotherRow = _rowScopes[nowRowIndex - 1] || _rowScopes[nowRowIndex + 1]; var amount = nowRow.height - height; if (height < 100 || brotherRow.height + amount < 100)...
0
1a9a1d9b618e3e7ba23ff0b22032e0e2
f2fbcfd944a28a305c1c822cfd2b97f9
Restore signal props that were mutated for serialization
{ lock (this) { var modifiedValues = new List<KeyValuePair<string, object>>(); foreach (var propertyName in _originalSerializedValues.Keys) { object currentValue = this[propertyName]; if (IsModifiedFr...
1
3f33989586088b1c4bea92c99878fedf
76b1d3fba362a49628ef98f8ae102776
Function used to generate an instance of input parameters. They are linked to a function instance and is required for varied tasks used in type checking and semantic analysis.
class Intrinsic def initialize(name, arity, fun) @name = name @arity = arity @fun = fun end
1
e7b5330aa16c5ecd831f01d9a8f00fb2
53de437856c0a0f11f4417512a2287e8
Method to find Tax Residence textbox
Element = null; try { Element = driver.findElement(By.xpath("//*[@id=\"ctl00_cphPageContent_ctl00_ctl09_tbxNewShopList\"]")); } catch (Exception e) { throw(e); } return Element; }
0
40feb4e766348bbbe1cfac5552361463
8cda13b1d248dbc2d3a3877f2f913f3c
Initialize them all to one as we use Laplace smoothing to avoid zero probability problem.
class Viterbi(): def init(self): s_idx = self.State_seq.index("<s>") for i in range(self.len_states): if self.A[s_idx][i] == 0: self.T1[i][0] = float("-inf") self.T2[i][0] = 0 else: self.T1[i][0] = math.log(self.A[s_...
0
e8d14b8165ba776f9f01951c493526d3
e033717845b263a369c3f8948e8db412
updating Full text search table
var selected = $('#tableModeInsert').val(); $.ajax({ url: '/Rpc/fullTableLoadToggle', method: "POST", data: ({ 'selected' : selected }), dataType: "json" }); }
0
d50eb151b37acc4b524b6607b5947b02
8d2bf8b39b9f39e9b20b6f630870060c
<a href="https://material.io/components/sliders" class="external" target="_blank">Material Design slider</a>. Sliders allow users to make selections from a range of values. Sliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, br...
function RangeSlider({ className, minValue, maxValue, value, small, onChangeHandler, filled, filledFromCenter, step, }) { const ref = useRef(null); function onChange(e) { if (onChangeHandler) onChangeHandler(e.target.value); } function onClick(e) { if (onChangeHandler && navigator.plat...
1
b8f15fe066e17d921511bf0991d00ea9
00955b2a34b4bb68d275c58d5ffc2905
Adds Clay management toolbar context object to the request.
context = { **GenerateRequestContext(request), } if request.user.is_authenticated: user = request.user context.update({ 'account': user.user_account, 'db_tools': Tool.objects.get_tools_that_has_db_for_aside_section(user) }) return context
0
9618e992a53d5c040167c0704bfce189
e6f377c905c2670d45d2deb6b2cb44c2
Returns the number of different states sent to the .update() function. For continuous state spaces, counts the number of different discretized states.
class DynamicScene(object): def state_count(self): return len(self.states)
1
b8cf9cff9e4e29f521616a9007c4e748
1e06cdde45f73e9c073171cca5f745b5
Extracts the failed value from the error.
{ $result = $error; if (preg_match('/\[[\w\s]*\]\s*(.+)/', $error, $match)) { $result = $match[1]; } return $result; }
1
0ad8e2125e6c8c41eaeeb25fe495f768
27c2373224f1bdbc4477c2bf49de07eb
given during lecture: https://courses.engr.illinois.edu/cs126/sp2018/slides/L20-Big5Lists.pdf
LimitedLinkedList myList = LimitedLinkedList(50); int count = 0; do { myList.push(to_string(count)); count += 1; } while (count <= 75); myList.print(); cout << "***" << endl; myList.reverse(); myList.print(); count = 1; do { myList.pop(); count += ...
1
8f87eaa74eb26d9acdde18e3ef5036d5
0f9412970c0819d719f4f63a75492aba
Returns list of directories for the files in |source_files|.
def get_folders(source: str) -> list[str]: _1, folders, _2 = next(os.walk(source)) return folders
0
1028f2b57f1dc2d43df1ac0af1d3935a
05b0c464a32499492817e8e4f7209426
Returns true if the verification of the tag should be skipped.
{ switch ($this->mode) { case self::NONE: return true; case self::STRICT: return $this->strictly($tags); case self::TOLERANT: return $this->tolerate($tags); } return false; }
1
9b8be83d85672c7d35901139a0c7d048
2539b510f3d27eb8695c2c5cf7d7791c
置灰功能按钮
public class NGUIUtil public static void SetButtonGray(UIButton btn) { if (btn) { btn.isEnabled = false; } }
1
d5cd6098a3e30e1ed9384cf655bd919b
89ba071e83f3946e5a1b194e0c333338
IndexOf(self: FamilyTypefaceCollection,item: FamilyTypeface) -> int Returns the index of the specified System.Windows.Media.FamilyTypeface object within the collection. item: The System.Windows.Media.FamilyTypeface object to locate. Returns: The zero-based index of item,if found; otherwise -1;
int32_t Collection_1_IndexOf_m17805_gshared (Collection_1_t2352 * __this, CustomAttributeTypedArgument_t1317 ___item, const MethodInfo* method) { { Object_t* L_0 = (Object_t*)(__this->___list_0); CustomAttributeTypedArgument_t1317 L_1 = ___item; NullCheck((Object_t*)L_0); int32_t L_2 = (int32_t)InterfaceFunc...
0
247b17e4d5328e66b0d71f8549412360
9569d20e4890d59294bb33194db2f811
Sets the node's layoutX and layoutY translation properties in order to <p> This method does not alter translateX or translateY, which if also set will be added to layoutX and layoutY, adjusting the final location by corresponding amounts.
public class Transition extends OOPNBaseEntity public void setPos(double x, double y) { region.setLayoutX(Math.max(0, x)); region.setLayoutY(Math.max(0, y)); repositionAnchors(); }
1
a681b0c7592bd30dc875362310427513
5e8fbf2bd94118466e8eec091750a0d7
全局获取bot对象
function getBus() { bus = bus || new Vue() return bus }
0
df69111f3a5ef9a10da0f6078edbf39d
6bfe26e394d5438c5c90cb3dc861803e
Get 默认连接池名.
class AMQP public function getDefaultPoolName(): ?string { return $this->defaultPoolName; }
1
956a493151cc3873e1296731cb3ae5e7
59de99d37bfca0366492090d0894f8e7
Allocate memory for the 2D array sizes
static int ALPHA_alloc(void) { int array_size = ALPHA_SIZE; A = (int *)calloc_error(array_size, sizeof(int), "A", "ALPHA_alloc()"); A_comp = (int *)calloc_error(array_size, sizeof(int), "A_comp", "ALPHA_alloc()"); P = (double *)calloc_error(array_size, sizeof(double), "P", "ALPHA_alloc()"); retur...
0
96b6c0201840d4a0fc09db93f8bc4737
160e01909cd8d5f5b7d8e61de2370eb5
显示当前题目位置和题目总数量
public class PlusImageActivity extends Activity implements ViewPager.OnPageChangeListener, View.OnClickListener private void setPosition() { positionTv.setText(mPosition + 1 + "/" + imgList.size()); positionTvGone.setText(mPosition + 1 + "/" + imgList.size()); viewPager.setCurrentItem(mPosition)...
1
874425502f5ad03b751aba06767eca81
8016159ce0a8d3efdaa0b82210be78a5
Injects the storage for the virtual hosts.
class VirtualHost extends Handler public function run() { $contents = $this->read('stubs/virtualhost.stub'); $toMappings = $this->flattenFoldersToValue(); $this->sites->each(function ($site) use ($contents, $toMappings) { $map = $site['map']; $to = $site['to']; ...
0
9b70cb9e20bca7ed26dd3321d8f4b379
606a1d966b5c26a1ecab81554d93e101
Gets the 重量(单位:千克)(派送单明细).
public class RegularTruckSignBillEntity extends BaseEntity{ public BigDecimal getWeight() { return weight; }
1
3fc876c4101757c0601ba1c49daac393
243bc2977c84aad5652f6e164f6a8222
스택을 이용해서 문자열이 대칭인지 체크하는 함수
StackType* s = (StackType*)malloc(sizeof(StackType)); init_stack(s); bool tf = true; int l = strlen(X); if (l % 2 == 0) { for (int i = 0; i < l / 2; i++) { push(s, X[i]); } for (int i = l / 2; i < l; i++) { if (pop(s) != X[i]) tf = false; } } else { for (int i = 0; i < int(l / 2); i++) { ...
1
909f5c79cfebc4dc7517b225dfc27e8d
bc8821630a06ba4b88187fc46fac81fb
引数を2つ持ち、2つ目の引数がデフォルト値を持つ
def f(a, b = 1): pass
1
67d8299c835a2a654e09658e5cfd4e09
4757568317b9c8481aa304a9532f34b0
Thermal mitigate init function.
VOID ThermalInit ( IN SI_POLICY_PPI *SiPolicyPpi ) { EFI_STATUS Status; UINT64 ThermalPciBase; UINT32 PchPwrmBase; UINT32 ThermalBase; UINT16 Data16; UINT32 ...
1
0633c37b1a325435293c7cb999b5b423
b3e5964f412b1ecf089ae4abbc3a9532
Returns the ellapsed time the user has had no input applied to the game
class ClientSession: def idle(self) -> float: return time.time() - self.last_input_time
1
36cd8bebab10bba82b86286423e6e978
ade6da74648a95ecad8f7d872e260fa4
albert 文本模型。
self.text = text self.geometry = geometry self.embedding = None self.ner_tag = -1
0
88a518a7b6bb3b3272589e2eddb01486
97dccb6a6d9cb081172cdc828617b250
Convert sampling variance to 95% CI.
public class Range<T> public static Range<Double> calcCI95(Double percentageValue, Integer sampleSize) { GWT.log("percentageValue: " + percentageValue.toString(), null); GWT.log("sampleSize: " + sampleSize, null); if (sampleSize==0) { return null; } if ( (sampleSize <...
1
2665d98bc37dbb3abe386b705bbf0d0d
63418df47bd4f4bb846061020716c387
内部辅助方法,从文件夹中读取类
public class GetListByFileName public List getClassByFileName(String fileName){ File classFile = new File(fileName); List classNames = new ArrayList(); FileReader fileReader = null; BufferedReader bufferedReader = null; try { fileReader = new FileReader(classFile); ...
0
3df7e6f35c4d135e93833ee08470e9ab
57947c3b11e273ecaff5d88d5a7b353c
Returns a view with the message that the validation is succeeded.
class UpdateHarmonizationRecipe(LoginRequiredMixin, PermissionRequiredMixin, OwnerQuerysetMixin, UserFormKwargsMixin, FormMessagesMixin, UpdateView): def get_form_valid_message(self): return formattable_valid_message.format( models.HarmonizationRecipe._meta.verbose_na...
1
54f7982cee882cc1350d81caad68608d
f13240e25f9a8a4f664716f9ee3a5c11
Attempts to find the path to Google Cloud SDK.
class TerraformBuilder: def gcloud_exe_path(self) -> str: return shutil.which("gcloud")
1
ff4c3cdca2f3bbeb379d7e8e7c70dae6
8459d787b5acd0c2e2dd5d957579899c
Benchmark view creation with row and Split By.
ArrayDouble data{10, 20, 30, 40, 50, 60, 70, 80}; Array<INDICE_TYPE> row_indices{0, 2, 4, 7, 8}; Array<INDICE_TYPE> indices{0, 1, 1, 3, 2, 3, 4, 5}; SparseArrayDouble2d sparse_array(4, 6, row_indices.data(), indices.data(), data.data()); ArrayDouble dot_array{1, 2, 3, 4, 5, ...
0
b0de00682f204a2291e4561e0b827c54
b42fccb74c02fcf7148b616eeb2a5ea9
获取指定大小的一页道岔信息表
namespace WpfApplication2.Business public class TurnoutInfoManager : BizBase public ObservableCollection<TurnoutInfo> SelectAllCollection(int pageIndex, int pageSize, int rowsCount) { ObservableCollection<TurnoutInfo> datas = new ObservableCollection<TurnoutInfo>(); GenDataReader reader = Session.ExcecuteReade...
1
60c3391d96c5afbc4098ceca192dafe5
e659712eb47163bb4b17d15ca2c89cab
Test if the URL has XMLRPC up and running.
class Jetpack_XMLRPC_Server function test_connection() { return true; }
0
12e7844393260d13cb32007c1f79321d
c6cc184ebb6ab4d62225175f0276f21c
Test the str() function for ipv6 - worth a separate test.
class IPv4TestCase(unittest.TestCase): def test___str__(self): self.assertEqual("10.10.10.10", str(IPv4(0xa0a0a0a)))
0
b8e84f19992b7fe0d8f553f1efca8ded
5241beb46ebeb9580c62794c07104025
Camera calibration by DLT using known world coordinates and their image points.
x_nums = 5 y_nums = 8 world_point = np.zeros( (x_nums * y_nums, 3), np.float32) world_point[:, :2] = np.mgrid[:x_nums, :y_nums].T.reshape(-1, 2) world_position = [] image_positionl = [] image_positionr = [] criteria = (cv2.TERM_...
1
eccb51811e7634c8f2503615b4bbabf8
5fe5545a2f71afa42fdf6958ca9e589b
Inserts the nodes in a collection into the directed graph at the specified index.
public boolean addAll(int index, Collection<? extends STreeNode> c) { return nodes.addAll(index, c); }
1
6bc405478d0bdfb97796559b9230a5cb
607af70ea9d1fa15b807a0cb5ad678b6
returns true if there is space
function nospace( board ){ for( var i = 0 ; i < 4 ; i ++ ) for( var j = 0 ; j < 4 ; j ++ ) if( board[i][j] == 0 ) return false; return true; }
0
b4590ac3940fb2946664f2ec5c660b89
b57776cd3f383aed2229bccdc48c06ef
Создает или обновляет стек навигации
{ if (_stkNav == null) { _stkNav = new XPathNavigator[InitialStackSize]; } else { if (_sp >= _stkNav.Length) { XPathNavigator[] stkOld = _stkNav; _stkNav = new XPat...
1
6eb45af42b7ced607ab068381bf3f641
347177563a218f70a902bea9835922ea
Method allowing worker agents to improve skills so as to get job.
attr = self.get_attr_from_args(agent, category="skill") if not attr: return if not self.check_max_for_attr(agent, attr, category="skill"): return current = agent.dbobj.traits.get_skill_value(attr) xp_cost, res_cost, res_type = self.get_attr_cost(agent, att...
1
b1dca73be698a74077bb6e998319bff7
395ce40d1ee12e4fefb4f584c428be25
trouver les évenements entre deux dates
{ $dateTimeStart = new \DateTime(); $dateTimeStart->setTimestamp($dateStart); $dateTimeEnd = new \DateTime(); $dateTimeEnd->setTimestamp($dateEnd); $q = $this->getEntityManager()->createQueryBuilder(); $q ->select('e') ->from(Evenement::class, ...
0
259db6d85180f7ad314dad4b574b9ab2
c7bb4dd44faa2c1927e2402dd5f45ad5
write buffers to file and close files
{ for(int i = 0; i < numBufs; i++){ BufDesc* frame = &bufTable[i]; if(frame->dirty){ int frameNo = frame->frameNo; frame->file->writePage(frame->pageNo, bufPool + frameNo); } } delete[] bufTable; delete[] bufPool; delete hashTable; }
1
356d52f562bd33e17aa88865fb286cd0
a6ed5206021d395be766d7e5f7a5ffb5
Get logged in time of current user
public long getTimeLoggedInMillis();
1
541ef53893d08d53921527a35397add7
7150cf5cb6e8a62554a012f76c11c12b
若之前有创建,先删除
fun File?.createFile(): Boolean { if (this == null) return false if (exists()) { delete() } return try { createNewFile() } catch (e: Exception) { e.printStackTrace() false } }
1
c5eaee95fd7a3b9d44fff6f88498b8db
e894386e5583bb239251557c8e142cc7
博客点赞,异步提交
async doLike () { }
1
a5d2bc17a3423c1edf5e37409d370c1f
d0d4425d8e9408e8987c47fa71362336
PC置换,输入56位01字符串,输出48位01字符串
def permutation_IP_1(code): ip_1 = (40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 1...
0
8fdf48739f1be88fd112acba60f398fd
f05d70acab1f38d60b2d10e17cd8ede0
Вызывается после получения полей сущности из БД
abstract class AbstractEntity implements EntityInterface, InputFilterAwareInterface, ArrayableInterface, ArrayAccess, Iterator, JsonSerializable public function onPostHydrate(array $data) {}
1
68e03aa3c2abf1e390fcfc4f2c62b23b
ffd8dbfc5321c5e155f982f2d29920c0
Indicates that this server should provide the assemblage service, possible values are: "internal" - the assemblage should be configured for using internal REST resources, this means that the ally core http component is present in python path. "external" - the assemblage will use an external REST resources server, you n...
class AuthLdapAction(NSBaseResource): def get_svrtype(self): return self.options["svrtype"]
0
149f13cfaeb89c08a0f3248e9737bef9
29113a3c1099893af220ec6f6ebe420b
Annulla l'invio del messaggio
const message = { date: moment(), message: 'ok', status: 'sent' } this.contatti[this.chatIndex].messages.push(message); this.writeContatto = false; }
0
0b3dba751f263a5d7f5c32d1e3fb2f89
a28bebadaf966ac2ca97c25ccee4f8ff
这个方法决定了要抓取的URL及其内容。
public Map<String, String> getUrlElement(String url) throws Exception { captchaParams(url); Map<String, String> result = Maps.newHashMap(); News news = ContentExtractor.getNewsByUrl(url); result.put("url", news.getUrl()); result.put("content", news.getContent()); resu...
1
b371be0fe8e1a83c42befa01572f371d
62c1eb1099b977b8f88a98b56f2ac126
Lista todas los niveles de un indicador de desempeño existentes en la base de datos
{ $sql = "select * from nivel_pdi where status='A'"; if ($nivel) $sql.= " and nivel='".$nivel."'"; $conexion = $this->conectar(); $consulta = $this->consultar($conexion,$sql); $consulta = $this->ret_vector($consulta); return $consulta; }
1
f592f46b82f4770f021e6112afc1f8b9
dfa4855ec3046632d557b0e8494ece82
@brief Trampoline to jump into the class main method
static unsigned __stdcall ThreadJavaMain(void* args) { return (unsigned)JavaMain(args); }
1
cd326a89b3927cd77ebd21ac47d724d6
a05685d27790e975a1b4f874405ad147
Provides a value for injection at runtime. If the value could not be provided, this method should return <c>null</c>.
namespace ExtendedXmlSerializer.ExtensionModel.Markup object ProvideValue(System.IServiceProvider serviceProvider);
1
f0622779869182d47e38ef83769756e1
ec9fb27572bbb3d20ab3fd88d0821e4f
Get the average accuracy for a population
def grade(pop): summed = reduce(add, (fitness(x) for x in pop)) return summed / (len(pop) * 1.0)
1
3f0ce18c6ba3d464ce8f42eefbc2cff8
41f15800bfac874c3eaf4557093ce0b2
渲染checkbox组件(左侧文字,右侧选择/未选中框)
export default class DaliTree extends Event _renderCheckBoxDom(node, renderDom) { let checkBoxDom = document.createElement('span'); let t = node.checked ? 'dali-checked' : 'dali-un-checked'; checkBoxDom.setAttribute('id', `${DOM_TYPE.check_box}-${node.id}`); checkBoxDom.setAttribute(DOM_...
0
32df5667b8d3c7e845fd9432be31441d
0b81140c2beb8575db183e8656eae73b
Build file name from parts. path is NULL for "current directory". path is "" for "root directory".
char * cgl_mkpath(char *p, char *f, char *x) { char *buf; size_t pl = 0; size_t fl = 0; size_t xl = 0; size_t i = 0; if (!p && !f) return NULL; if (p) pl = strlen(p); if (f) fl = strlen(f); if (x) xl = strlen(x)+1; buf = malloc(pl+fl+xl+2); if (!buf) { cgl_seterrno(CGL_SYSERR); return NULL; } ...
1
70b1c094735d26f1a4cb820d344ba323
4bc18d9bf1090212ccf9baa680597d95
Retrieve the set of values that occur in matches for event.
namespace TBAAPI.V3Client.Api public partial class MatchApi : IMatchApi public async System.Threading.Tasks.Task<ApiResponse<List<string>>> GetEventMatchesKeysAsyncWithHttpInfo (string eventKey, string ifModifiedSince = default(string)) { if (eventKey == null) throw new ApiExcept...
1
69fcd6419e7a24c3797cd256bc3e1e4a
a254b9773302af56e422a2d7ec573956
哈希查找算法,hashArr表示哈希表,value表示要查找的元素
key = self.hash_key(value) index = key while self.arr[index] != value: index = (index+1)%self.arr_size if index == key: print("Value Not Found") return 0 print(f"value found at {index}")
1
983c265b6851534c3d42a6164d83ef58
4823237471a2989593be8fb3264aa6ba
Loop and check how many pairs of conflicts are in the current configuration
bool AG::checkConflits(Solution &solution) { bool avaliable = false; vector<bool> sol = solution.getSolution(); for (int i = 0; i < sol.size(); i++) { if (sol[i]) { for (int j = 0; j < getKc()[i].conflits.size(); j++) { if (sol[getKc()[i].conflits[j]]) { avaliable = true; return true; } } ...
0
99c9edf67c5a3fc93031c3cc54a3eb84
5390aa85ef68fda6516f40879def4420
Método para cadastro de um Historic no banco de dados
public class NoAction implements Serializable private void historicoDoNo(int x, NoDTO noDTO) { HistoricoNoDAO historicoNoDAO = new HistoricoNoDAO(); setUsuarioDTO((UsuarioDTO) session.getAttribute("usuarioDTO")); getHistoricoNoDTO().setUsuarioFk(usuarioDTO); DateFormat dateFormat = new S...
1
cc97df77f7396878d1737bda8ff9873f
9afc9dcee01b75cecc466837e411124e
Se encarga de subir la imagen al servidor.
class Disco public function subirImagen($imagen,$url_carpeta,$nombre_carpeta,$id_imagen) { $result = false; $url = $url_carpeta . "/" . basename($imagen['name']); $url_public = "public/albums/" . $nombre_carpeta . "/" . $imagen['name']; if(move_uploaded_file($imagen['tmp_name'],$u...
1
7738563d0094ab726790039c4111ba73
843fbb48fcf5729b4b7bf40088159e97
创建临时顺序节点
@Service public class ZookeeperServerImpl implements IZookeeperServer public String createEphemeralSequentialNode(String path, String value) throws KeeperException, InterruptedException { return zooKeeper.create(path, value.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); }
1
24adf9085dfd44067085a4ee5006901e
e7c87223ae7faf2f56e2c6254abcc629
Add a new component with the given descriptor to the beginning of the list
struct component *addComponent(struct component *componentList, struct component *component) { component->items = NULL; component->itemsNumber = 0; if (componentList == NULL) { componentList = (struct component *) malloc(sizeof(struct component)); component->next = NULL; component->p...
0
9e3e4951250a31ef22f7091fb5323b94
f114664d0d6f31d5eebc84d6ee882639
CSV conversion works from the storage representation, converting the arrays into simple text lists.
namespace StorageDataContext public partial class Lookup_Child: IStorageItemGeneric<Lookup_Child> partial void onCsvConstruct() { }
0
f12e7b6e441f855c640b40ad4118ce83
0dbd83bf10e2cedd9652066ca09c7f97
ページ内のボックス情報表示用のフォームを開く
public class AddBox extends BasicAction @Route(value = "/fit-action-showeditBox", conn = true, m = HttpMethod.GET, type = ContentType.Forward) public void showeditBox() throws Exception { FitUser user = (FitUser) this.getSessionUser(); String gym = user.getViewGym(); String area_no = this.getParameter("area_no")...
1