query_id
string
corpus_id
string
query
string
code
string
label
int64
32cb48fa21692fa2ab2818be54b8bff9
c00733329f4c1a8903f74929454d9f3f
Gets the source account id.
public class PerSourceTransaction public int getSrcId() { return _srcId; }
1
48532de4b8268fc3161ac4b9a0b99cde
82e581c4c361d4a130670aec8ba0ddf3
把所有html文件转换成pdf文件
{ string[] sourceFileArray = Directory.GetFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"../Data/input_dir")); foreach (var filePath in sourceFileArray) { var fileName = Path.GetFileName(filePath); Conversion.ConvertToPdfStream(fileName); } ...
1
4cd85f7c70ca12f21f47ae0ca63cbc83
20093228635106eb6af9e8726331acb2
获取某元素在静态链表内的位置
let current = this.head for (let i = 0; i < this.count && current != null; i++) { if (element === current.element) { return i } current = current.next } return -1 }
1
da3d3358fe002565be07bd0c5c60df2a
5deb6a50104ebd87b49edd7341eb8046
Sets the maxThreadIdleTime.
public class ThreadPool public void setMaxIdleSec(int maxIdleSec) { this.setMaxIdleMS((long)maxIdleSec * 1000L); }
1
630227baf823eb830f79466072c854bc
a5f76ffe726284ca002f9110daacce67
Handles the movement logic of the knife. Transitions along bezier curve to give boomerang motion
public class Blade : MonoBehaviour void UpdateCut() { Vector3 input = new Vector3 (Input.mousePosition.x, Input.mousePosition.y, mCam.nearClipPlane); Vector2 newPosition = mCam.ScreenToViewportPoint(input); rig.position = newPosition; float velocity = (newPosition - previousPosition).magnitude * Time.deltaTime...
0
e90982ddd75c0cdac1a91d041f2afeb6
90642ce2803c4f628a7a07f3567739e2
需求:输入一个字符串,统计该字符串中每个字符出现的次数。
public class LC_767 public static void Solution(String str) { char [] array = str.toCharArray(); int[] alphabetCount = new int[26]; for (int j = 0; j < str.length();j++) { alphabetCount[array[j] - 'a']++; } System.out.println("count"); for(int i = 0; i < alpha...
1
91bed190382b4bdff8133ea999cb0ed4
07e1e8e6ffc077a9eaec9e869b68c8f7
当前天是本周的第几天 , 从星期天开始算
int day = calendar.get(Calendar.DAY_OF_MONTH); if (day < 7) { int ifsunday = calendar.get(Calendar.DAY_OF_WEEK); if (ifsunday == 1) ifsunday = 7; if (ifsunday > day) return 1; } System.out.println(day); ...
0
ccda1000bf361e08784a9ec7a33f98b7
7efa4e5f8690883d6bc6019017ac7808
This API is used to modify the recording template configuration.
public class MonitorClient extends AbstractClient{ public UpdateRecordingRuleResponse UpdateRecordingRule(UpdateRecordingRuleRequest req) throws TencentCloudSDKException{ JsonResponseModel<UpdateRecordingRuleResponse> rsp = null; String rspStr = ""; req.setSkipSign(false); try { ...
1
5460abc0740679e447828b2b96ec7831
a11e06a9a516aa5d41aafa0ac58f3e1c
Decompress a range of rows into a dense block
const CompressedBlock& compressedBlock, size_t numRowsToRead) { DecompressedBlock decompressedBlock{compressedBlock.size()}; decompressedBlock.resize(numRowsToRead); for (size_t i = 0; i < compressedBlock.size(); ++i) { auto col = decompressedBlock.getColumn(i); decompressColumn(compressedBlock[i], nu...
1
e7d7f1dc9c04b7a41441e3d041b43f68
3a09e6746701d18b77cd05669f837e8f
Timer that controls delay before snackbar auto hides
function showSnackbar () { state.snackbar = true if (state.snackbarTimer) { clearTimeout(state.snackbarTimer) } state.snackbarTimer = setTimeout(() => { state.snackbar = false }, 2000) }
1
4f6786f2b08210ba220f147ec57aadfa
4ae386a92d9f5a606ffd6274c763f59a
轉換數值座標到圖片上的座標
{ Point cp = new Point(); cp.X = (int)((value.X - m_ruler.x.offset) / m_ruler.x.unit * (float)this.XTickLength); cp.Y = (int)((value.Y - m_ruler.y.offset) / m_ruler.y.unit * (float)this.YTickLength); return cp; }
1
318ff54ea08b4c58c84c2330df330d61
df95c5fad7415ee33bafff3b4a986164
此函数的作用是在训练集汉字的基础上,添加一些ext_emb_path文件里的汉字
filepath = os.path.join(self.path, self.doclist[seed_number]) file = open(filepath,'r', encoding = 'utf8') with open('seed_pku_4','w', newline = '') as fp: writer = csv.writer(fp, delimiter = ' ') for line in file: tl = [] for i in range(le...
0
16de4d203a9a5374e529f13ce76ef0c5
60ef6cdf28f34ee38dd1928c53761251
Checks if we should send emails using plain text.
class Brief extends \lithium\template\Helper public function isUsingPlainText($projectRecord) { return strtotime(($projectRecord->started) < strtotime('2013-07-25 16:30:00') && ($projectRecord->published == 1)); }
1
c4a14ed39d9f5ef562df28833e683478
af8b4a2af0f5d7243faa61433385cd56
加载域名操作详情
function showDetail(selp){ var url = $(selp).data('url'); var id = $(selp).data('id'); var field = $(selp).data('operate'); layer.load(1); $.post(url,{id:id,field:field},function(ret){ layer.closeAll('loading'); if(ret.code == 1){ layer.msg(ret.msg); }else{ var remark = {'txt':'简介:','m...
1
292421e947edf2f50de33b89aa1d3424
eec91d237d6b9a12148986dbfafee70d
Get extension string checked, returns GL_FALSE or GL_TRUE
static int is_glx_extension_supported(Display *dpy, const char *query) { const int scrnum = DefaultScreen(dpy); const char *glx_extensions = NULL; const size_t len = strlen(query); const char *ptr; if (glx_extensions == NULL) { glx_extensions = glXQueryExtensionsString(dpy, scrnum); } ptr = strstr(glx_extensio...
1
0b607845cde01b2182f7e8554396157f
e0ba678df0612cfac88cf1cffd3cd43b
* ``cam_width`` x ``cam_height`` -- This should be the size of the image coming from the camera. Default is 640x480. HSV color space Threshold values for a RED laser pointer are determined by: * ``hue_min``, ``hue_max`` -- Min/Max allowed Hue values * ``sat_min``, ``sat_max`` -- Min/Max allowed Saturation values * ``va...
class cam_pid(): def __init__(self): self.TARGET_SETPOINT = (640/2,480/2) self.DEPTHPWM_MAX = 150 self.YAWPWM_MAX = 75 self.prevXerror = 0 self.prevYerror = 0
0
76c388e1f3240f2ba79f073b2ed86217
742f078ce7906dba8a7df74510793352
Called from the MoSync activity in onDestroy. Do cleanup here (but it is not guaranteed that this will be called.)
public class LicenseChecker implements ServiceConnection public synchronized void onDestroy() { cleanupService(); mHandler.getLooper().quit(); }
1
5eaea8b8478dd8ead107df11446ef0e9
9577d61adca26eb752450a13fff5757d
void WF_GpioSetHibernate(uint8_t level); Puts the MRF24WG into and out of hibernate. Called by Universal Driver during initialization to take the MRF24WG out of reset. Sets the HIBERNATE line high or low. level -- WF_HIGH or WF_LOW None Should not be called directly from application code.
void WF_GpioSetReset(uint8_t level) { WF_RESET_SET(level); }
0
5c467fcee9ef0a52617a2570f0ca45ee
4e89fc6a4de1e7aa3532d2537c520430
修改客户经理信息
@RestController @RequestMapping("myManager") public class ManagerController @RequestMapping("/updateManager") public HashMap<String, Object> updateManager(Manager manager) { HashMap<String, Object> result = new HashMap<String, Object>(); managerService.updateManager(manager); return result; ...
1
a2d18ff7e92526325bf0103f12445704
bd9fd3128caaa9454d8825a5f9bd74d2
对象类型强制转换
{ if (obj == null || obj == DBNull.Value) return default; return (T)Convert.ChangeType(obj, typeof(T)); }
1
b51c9ccf272bd57ce6b991ba879c6968
09246851e52baf1a48ce9712ceef38d0
Initializes an empty set with the given capacity (which must be a power of two). Allocates memory for the entry array which must be freed.
{ assert((arraySize & (arraySize - 1)) == 0); m_arraySize = arraySize; m_entries = new Entry[arraySize]; Clear(); }
1
88f0cc41c9fded2afc8845cdf7ab8052
2cfde8c44984ca7b25cf540c5af1c86f
用学号定位输出学生信息
idlist = self.content['学号'].tolist() if idd in idlist: find = self.content[self.content['学号']==idd].index.tolist() print("姓名:%s 学号:%s 成绩:%d"%(self.content['姓名'][find[0]],idd,self.content['成绩'][find[0]])) else: print("No such id.")
1
1034874d09df8d30d679caf891caa043
93120bf1ed850b38a309f2eab57da4b8
Immediately move the message to the error queue when the exception caught matches this criteria
public class PolicyExpression : IFailureActions public IAdditionalActions MoveToErrorQueue() { return new FailureActions(_match, _parent).MoveToErrorQueue(); }
1
2543d7eb9785e8483a9af114f4c11fc0
3d84ce8fef5dee1f35e2867183f01e28
--------------------------------------------------------------- [役割] 商品に対応した在庫数を返す [引数] id: itemID [返り値] 在庫数 ---------------------------------------------------------------
{ this.FlushData(); this.LoadFromRawSql(HCMIS.Repository.Queries.Item.SelectGetNearlyExpiredQtyItemsById(itemId, storeId)); Int64 qunatity = 0; foreach (DataRowView dv in this.DataTable.DefaultView) { qunatity = qunatity + Convert.ToInt64(dv["QuantityLeft"]); } return qunatity; }
1
bfa1c5ccf1c8c676bcd9d8ae1455aa7b
ee2c23ddadf725f239eeb5bf488d333f
团长订单统计(按商品)
$model = Model('stat'); $where = []; $searchtime_arr = $model->getStarttimeAndEndtime($this->search_arr); $where['order_add_time'] = ['between', $searchtime_arr]; $where['goods_type'] = 2; $field = " goods_id,min(goods_name) as goods_name"; $field .= " ,SUM(goods_...
1
d24aa8a8aa374f0dea65d5cac4081883
52f7c47a273323245a91b6f1b2f2d9c3
通过用户名查询该用户订阅的栏目
@Controller public class ColumntypeController{ public List<Long> getColumnTypeByUser(User user){ List<Long> ids=null; if (user!=null) { Map<String, Object> params=new HashMap<String, Object>(); params.put("userId", user.getId()); List<Usersubscription> usersubscriptions= usersubscriptionService.getByP...
1
ba185d6ca61d8424c3799bb6bf23442f
3827fcb6c3723f46070225f1340c1400
functie om de omschrijving van een geslacht op te halen
class artikel public function getOmschrijving() { return $this->omschrijving; }
0
8b4cae085ea2d975708adc22a9dfb7df
7427013c401e56473fa4dc5bdd0b4269
加载app的rewrite配置文件
namespace JWShop.Common public sealed class ShopConfig public static void RefreshApp() { Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(".aspx", ".ashx"); dic.Add(".html", ".ashx"); URLRewriterModule.ReplaceFileTypeDic = dic; ...
1
794e457f4c75fdb2ca241167b70ec45e
ef3274f61f58f9a60661434bf38b3786
Generate a dictionary of price histories from csv data where symbols are keys and values are price histories
class HistoricCSVDataHandler(DataHandler): def __init__(self, events, csv_dir, symbol_list): self.events = events self.csv_dir = csv_dir self.symbol_list = symbol_list self.symbol_data = {} self.latest_symbol_data = {} self.latest_bars_data = {} self.current_bar =...
1
1c6d8b4c91611dccd6fed760c5d12041
c80ef19a909779e4bcedbfc060795a1a
Returns the result of interpreting the object as an instance of '<em>Class Diagram</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
public class NodesSwitch<T> extends Switch<T> public T caseClass(Deployments.Nodes.Class object) { return null; }
1
79e695a9190ed7c859af426bfaf6dce8
94d5a0bedad393051da1401769c9ca9c
Compute the chi-squared terms of each model's simulator-set's fit to an observed simulator-set, by summing the masked chi-squared map of the fit.
def N_covar_chi2(flux, fluxmod_wbias, icov_diag, two_icov_offdiag): n_models, n_filters = fluxmod_wbias.shape fluxdiff = flux[None, :] - fluxmod_wbias chisqr = np.einsum("ij,ij,ij->i", fluxdiff, fluxdiff, icov_diag) m_start = 0 for k in range(n_filters - 1): m_end = m_start + n_filters - k -...
1
1169d0de57a7955cf79d02b8fe778327
0b658669ffee754d6fa18cc84da55e66
获取保存好的决策树
def grab_tree(filename): import pickle fr = open(filename) return pickle.load(fr)
1
6a1bff7ac8cefefbd42c459f0e8070e0
4d398563fdd21e3325d04223cdc0a4ff
清理主题缓存
$this->themeModel->where(true)->update(['current'=>0]); $map = []; $map['current'] = ['eq', 1]; if ($this->themeModel->where($map)->count() == 0) { $this->success('取消主题成功!'); } else { $this->error('取消主题失败', $this->themeModel->getError()); } }
0
cd56856691b55b550baf8456fc27152f
f40dc6ba00df36b560b515063f89fde1
Navigate to profile page and wait for the body element to be present
await browser.waitUntil( async () => !(await $(this.rootElement) .$('div[data-id="table_body--loading"]') .isDisplayed()) && (await $(this.rootElement) .$('tr[data-id="table_body-row"]') ....
0
08597a9385348c040d65df65dfe1e754
aa9024f1c908723a43d66146af19d1de
@brief Enables or disables the specified interrupts. This parameter can be: ENABLE or DISABLE.
void UART_INTConfig( UART_TypeDef *UARTx, u32 UART_IT, u32 newState ) { if (newState == ENABLE) { UARTx->IER |= UART_IT; } else { UARTx->IER &= (u32)~UART_IT; } }
1
ff9dd40c6882f6377d887b127defb790
8bbb7fb8bc969536ee0e94f8718000e3
Find coolest core and migrate
void CPU_SelectCore() { if (gDynarecEnabled) Dynamo_SelectCore(); else Inter_SelectCore(); if( gCPUStopOnSimpleState && CPU_IsStateSimple() ) { gCPUState.AddJob( CPU_STOP_RUNNING ); } else { gCPUState.AddJob( CPU_CHANGE_CORE ); } }
0
54f084489f88540be3fac4d40b4ef178
14d4bb199274891d1f5b4440d80caa1b
Visit a parse tree produced by {@link FAZEDORESParser#parametro}.
public class GparametrosParserBaseListener implements GparametrosParserListener @Override public void enterParametro(GparametrosParser.ParametroContext ctx) { }
1
95dda1f2bfe4e3c9cc2fc3cf3e8caaad
3a175020b75faf4a5602efa31aec0d99
Navigates the user to another activity when an option from the option menu is clicked
public class Recommendations extends Activity implements AppDetailResponse @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); return super.onOptionsItemSelected(item); }
0
8bd32f422912b9620e710d269fd8a2e2
1591c2cfb092a6ad449ef954ec1c0523
Function to test the registration of reporter with invalid GPS
{ _ifptr->put_UserPassword(L"29"); _ifptr->put_Mode(TED::Fptr::ModeRegistration); _ifptr->SetMode(); _ifptr->CancelCheck(); _ifptr->put_UserPassword(L"29"); _ifptr->put_Mode(TED::Fptr::ModeReportNoClear); _ifptr->SetMode(); _ifptr->put_ReportType(TED::Fptr::ReportX); if(_ifptr->Repor...
0
edbd85985a2a19596d1093cb441f9fea
dd800c3a67522ad45f305a99f646e9f7
安装APK,解决了7.0兼容问题
public class VersionUpdateUtils protected static void installApk(File file, Activity activity) { Intent i = new Intent(Intent.ACTION_VIEW); if (Build.VERSION.SDK_INT >= 24) { i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); Uri apkFileUri = FileProvider.getUriForFile(activity....
1
fe040d413f8bf5e4b14698d737619662
451687446cd338636972b8eabc2f7403
Új Szint mentése.
{ $this->db->prepare("UPDATE ceg SET nev = '" . mysql_real_escape_string($name) . "', modosito_id = " . (int)$userId . ", modositas_timestamp = '" . date('Y-m-d H:i:s') . "', modositas_szama = modositas_szama + 1 WHERE ceg_id = " . (int)$companyId . " LIMIT 1 "...
0
1b02ad46d767a8a7916e9d3ffd3becbb
ecdfbd356ed547c2650edc9f8936703b
返回具体图片地址的二进制内容,用于下载
def get_one_pic_content(pic_url): r = requests.get(pic_url) return r.content
1
be42428c30586556849bac1d2f6e5156
105cbaccd618890060af6422dc0d6e4b
Changes the value of {@code confidence}.
if (CategoryDecision_Type.featOkTst && ((CategoryDecision_Type)jcasType).casFeat_confidence == null) jcasType.jcas.throwFeatMissing("confidence", "eu.excitement.type.tl.CategoryDecision"); return jcasType.ll_cas.ll_getDoubleValue(addr, ((CategoryDecision_Type)jcasType).casFeatCode_confidence);}
0
a238357d6d81175c0fbded17b8d4a4a5
e27ea9879c3db24bfb9db9d39ad59122
Выбор вида транспорта
$(".transport-button").addClass("selectedButton"); $(".routelist-block, .finded-routes-for-places, .route-info-halts, .overflow-city-menu, .favorites-body").getNiceScroll().remove(); $(".search-for-travel-block, #city-menu, .route-info, .favorites-block").hide(); if ($("#div-route-halts").hasClass("ui-a...
1
7b49bae858160da18b6cccc03fb59595
26695d1acd5ce16d2a216bba71829278
将一个带有起点的向量划分成小段,每段可以上独立的颜色,来达到渐变效果
{ Paint(point); if (last_point == Vector2.zero) { last_point = point; return; } float dis = Vector2.Distance(point, last_point); if (dis > _brushLerpSize) { Vector2 dir = (point - last_point).normalized; int num ...
0
ac96dc6ab2ecb019c1336dadf1ade620
a4a43377321392a227e095613f6fdc9e
Returns an array of Patients, ordered from the most urgent to least.
List<PatientData> patients = new List<PatientData>(); foreach (PatientData patient in this.GetAllPatients()) { if (patient.WaitListStartDate != null) { patients.Add(patient); } } patients.Sort(StaticUtilities.comparePati...
1
e107545f8828b59c2b0071c32a78ec04
4ec74fdca11c70b6e198e6e20d0a788c
Configure interrupt for P2.1
P2->SEL0 &= ~(BIT6 | BIT7); P2->SEL1 &= ~(BIT6 | BIT7); P2->DIR &= ~BIT7; P2->REN |= BIT7; P2->OUT &= ~BIT7; P2->IE |= BIT7; P2->IES &= ~BIT7; P2->IFG = 0; NVIC_EnableIRQ(PORT2_IRQn); }
0
99f461768a2c48e3b97bf37405e24020
61069e318e4c45c0ca8e708a6f57bbae
Возвращает массив всех свойств лобби.
{ return array(self :: PROPERTY_ID, self :: PROPERTY_LP_ID, self :: PROPERTY_ITEM_TYPE, self :: PROPERTY_REF, self :: PROPERTY_TITLE, self :: PROPERTY_DESCRIPTION, self :: PROPERTY_PATH, self :: PROPERTY_MIN_SCORE, self :: PROPERTY_MAX_SCORE, self :: PROPERTY_MASTERY_SCORE, s...
1
d43bea0cbccd75f04bb2390c0fe4d37e
5d5e7cae031beb9b77b8039a7664f046
Write the XML description for the given container of map elements.
{ for (int i = 0, iMax = aShape.getChildCount(); i < iMax; i++) { RMShape child = aShape.getChild(i); XMLElement childXML = aWriter.toXML(child); anXML.addElement(childXML); } }
1
501958b20ba352b1fac1e233d0a1cc89
34731f4569eaeda5320eef5d2bf3511a
新增集团财务数据接口
@Service public class SysFinanceServiceImpl implements ISysFinanceService @Override public int insertSysFinance(SysFinance sysFinance) { return sysFinanceMapper.insertSysFinance(sysFinance); }
1
4181deace40e5fa71b3cb88d899299c7
50fa5e2e189c3fb21faf549c21a3e583
获取指定分类包含关键字或关键词的样本数目
{ $sql = 'SELECT kw_seq, kw_rootdomain, kw_keyword FROM tb_keyword WHERE kw_status = 1 AND kw_cl_seq = ' . $setdata['kw_cl_seq'] . ' '; if ($gt_type == 0) { $sql .= 'AND kw_group = \'' . $setdata['kw_g...
1
d8d438e37464fa0fa6524045b499bcb5
933e3e0fa9c9482fbf2f0b6b5c1f7011
Returns the meta object for the attribute '{@link org.sculptor.sculptormetamodel.Consumer#getChannel <em>Channel</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EAttribute getCall_Channel();
0
82bf2139cc4a840d9143b86ec5f9baf9
974d46dd28a7d1196359a91665b54090
'读入footer部分的属性 '返回0代表成功 '返回-1代表失败
FILE* fp; if ((fp = fopen(name,"r"))==NULL){ return 0; } if (!fscanf(fp,"%d",res+1) || !fscanf(fp,"%d",res)){ fclose(fp); return 0; } fclose(fp); return 1; }
0
3e9c1de299d27a4c07c8a817826b2cd3
0f80c966f5a2940eddeeb805cfa618d9
print all available families
class AeroSolver(BaseSolver): def printFamilyList(self): from pprint import pprint pprint(self.families)
1
b45ca0126062929a9f7d7f86e98afb76
daef31fe0e7accaee172a2d74e0ce66a
The binary arithmetic operation ``+`` x.__add__(y) <==> x+y
class NumericExpression(Expression): def __add__(self, other): return self._bin_op_numeric("+", other)
1
4f4abad7ff05d6c9c61437f4779e522e
730e54f4bba6017aca82c3b68d3c08da
Create signature for builtin function This function creates a function signature for a builtin function. The number of arguments, function prototype, and pointer to the builtin function need to be given.
def build_signature(function_name, function_parameters): return "def {}({}):".format(function_name, function_parameters)
0
16d6a6d9c5a2e1645585d03fe11bc1f3
83fd3d9419843cdfa15f4134d6265c33
Sends mail with multiple attachment files
namespace EQT.Intranet.Business.Helpers public class MailHelper public static void Send(MailAddress mailFrom, MailAddressCollection sendTo, MailAddressCollection ccTo, string subject, string body, byte[] postedFileData, string fileName) { Send(mailFrom, sendTo, ccTo, subject, body, true, new Att...
0
db58d2a57144b74ed00b1ffefd30cbf6
7031ebf3122d4d8a501811a5b3662405
Asynchronously loads this ad.
namespace InMobiAds.Common void LoadAd();
0
00bc1d2c41a9cbaa392ec89bcc431325
196a7a94248197e9d75bf6723dadd288
管理操作日志记录
class BackendController extends Controller protected function recordOperateLog($admin_name,$admin_group,$action,$info,$data){ OperatorService::operationLog($admin_name, $admin_group, $action, $info, $data); }
1
1efc1618dff18db6b5738b2c33122cfa
c518663e4b4f0688173938a523241b70
Determine intersection over union between two boxes 'A' and 'B'
class TrackDataCache: def boxiou(self, a, b): a_min, a_max = self.rect_min_max(a) b_min, b_max = self.rect_min_max(b) i_min = np.maximum(a_min, b_min) i_max = np.minimum(a_max, b_max) i_size = np.maximum(i_max - i_min, 0) i_vol = np.prod(i_size, axis=-1) a_size = ...
1
d92b237d6a5f71f33b9facf0c0c2910b
7fe1eb8cf95625f640d2e353591a78e0
We _must_ gracefully stop if aoss is enabled, otherwise we will leak the spark workers
public class MiniOzoneOMChaosCluster extends MiniOzoneChaosCluster @Override protected void shutdownNode(int failedNodeIndex) throws ExecutionException, InterruptedException { shutdownOzoneManager(failedNodeIndex); Executors.newSingleThreadScheduledExecutor().schedule( this::getClusterReady, get...
0
b7e76fda0c04b8c883cb9f18aa809059
b36eaa27f29d7192403b7da5ba524e64
Returns true if and only if the "Edit Item" menu item should be enabled.
namespace Catel.Examples.WP8.ShoppingList.ViewModels public class ShoppingListViewModel : ViewModelBase private bool OnEditCanExecute(object parameter) { return SelectedShoppingListItem != null; }
1
472bdbfd2fbb0b9dea3f7551bca37252
3f85cac6651439335469c5a79b3a3aa4
Metodo que permite modificar el nombre configurado de la competencia
function changeNameTeam(indexMatch: number, indexTeam: number, value: string) { return { type: CHANGE_NAME_TEAM, payload: { indexMatch, indexTeam, value }, }; }
0
4637388845de0a5523a6419a1c60e4d1
33790c05a062d468b7d603c094529fe5
Metodi katsoo, onko ruutu tyhjä. Ruutu on tyhjä, jos siinä ei ole miinaa, eikä sen viereisistäkään ruuduista löydy miinoja.
public class Pelilauta public boolean onkoPiilossa(int x, int y) { boolean palautettava = ruudut[x][y].olenkoPiilossa(); return palautettava; }
0
14dc410f98a6035d44954df7fb246597
8c51ab1276cb48d4d9b58af0f1e420cb
Clears the given bit in the given register of the RTC.
byte statusRegister = (byte) device.read(RTC_STATUS); statusRegister = (byte) (statusRegister & 0b11111101); device.write(RTC_STATUS, statusRegister); }
1
fbc9279f938fd157bb8c729f529103f1
84cf2dd304ba98d17484dede081b09d4
this method is used to start the menu used when the player is waiting the other players playing the phase
namespace UNO public partial class Lobby : Screen public void LoadWaiting() { window.hostingPlayerList.Visibility = Visibility.Visible; var hostingLabel = Shared.LoadImage(Path.Combine(window.resourcesPath, "hostingLobby.png"), 548, 112); Canvas.SetTop(hostingLabel, -25);...
1
96b7fa9d19f4f4f7e297dece0baef427
1c454ba5b111cf38276bbd95643cdbd6
<p> Configure reporting for the <i>ScaledTolerance</i> attribute. <p> </p> <p> The attribute is of type {@link Integer}. </p> <p> The implementation of this attribute by a device is OPTIONAL </p>
public void setF9( Integer value );
0
0e471b997248dcaf110139a59780f785
fd13e8fe29f6b8694ef8227a589bc9a6
Gibt an welche Dateiendungen durch den implementierenden Importer importiert werden können
public abstract class ExportFileType implements Comparable public abstract String[] getMIMETypes();
0
05348a87f1ec12f6362a7a6cb7a5019e
f54e50ef9f2b2bdd979b474c3a421fa4
Given a list of [[storyobj, themeobj]] pairs, use the last theme to choose another story and theme that are somewhat similar. Add the new choice to the end of the list.
for index in sorted(choices.iterkeys()): choice = choices.pop(index) updated_choice = self.update_choice(choice, to_remove) shifted_index = self.shift_left(index, to_remove) if updated_choice and shifted_index: choices[shifted_index] = updated_choice
0
01c5a10fbccdf3c3c2b856ee5e221797
28a0f7f2c7822ad8ae789f8be20b46e9
Check if binnings are same taking into account floating point things
public final class TBaseHelper public static boolean equalsNobinary(float a, float b) { return a == b; }
0
f308bcf41736548a56f8ef37a86d3452
0f6f441b6fe3dfaf3fdcff60566e145e
通过attrValue跟attrName来确定并修改Text
{ if (_oldAttr[i] != _newAttr[i]) { if (_oldAttr[i] < _newAttr[i]) { _oldAttr[i] += _step[i]; if (_oldAttr[i] >= _newAttr[i]) _oldAttr[i] = _newAttr[i]; } else if (_oldAttr[i] > _newAttr[i]) { _oldAttr[i] -= _step[i]; if (_oldAttr[i] <= _newAttr[i]) _oldAttr[i] = _newAttr[i]; } ...
0
052554f69fe366bd7b7c958a6110acbb
bb26755f3ce668c6633d3136cde87026
Create the popup window used to adjust temperatures, fan speed, extrusion factor etc.
Widget parent; { Widget bb, popup, button; static XtPopdownIDRec pdrec; Arg wargs[4]; XtSetArg(wargs[0], XtNsaveUnder, TRUE); XtSetArg(wargs[1], XtNlabel, "Divided Line"); popup = XtCreatePopupShell("popup", shellWidgetClass, parent, wargs, 2); bb = XtCreateManagedWidget("board", xmBulletinBo...
0
34fb59436d755240c00063649d325d33
e9aeb113ea1967893e0ff1acfe21fc89
Writes an unisgned short to the buffer
namespace WCell.Core.Network public class PrimitiveWriter : BinaryWriter public virtual void WriteUShort(ushort val) { Write(val); }
1
942359b9850518743c110f2e2b9c3d70
4c89e944c79b3fd807e1a30db82640cd
获取剩余数量最多的普通收集元素id
function BornController:getMaxCountNormalId() local normalCountList = {} local gridDatas = self.mGridController:getGridDatas() for row, rowData in pairs(gridDatas) do for col, gridData in pairs(rowData) do local elementId = gridData[1] if Factory:isNormalId(elementId) then normalCountList[elementId] = (n...
1
f129752395f128887b4dbd5816b8c44f
d136760b26c8ddb4d8c507646478e5a1
Select the clock source for the Timer2 instance.
static inline void mux_timer_init(void) { T2CONbits.T2CKPS = 0b01; PR2 = 250; TMR2IE = 1; TMR2ON = 1; }
0
1d1005bd617df4270ef27df5dfa1b81d
44e6ddb0efc17ba4936bd84ffa65d30d
获取微信公众平台的消息,各类消息,以数组形式返回
class Wechat public function receive() { if ($this->request) { $request = $this->request; $out = array(); $out['ToUserName'] = $request['ToUserName']; $out['FromUserName'] = $request['FromUserName']; $out['CreateTime'] = $request['CreateTime']; ...
1
00625015385b18681d179d6e3aadb8db
7ae91af92614a3c8977294278ce9370f
为推荐位内容打造的分页显示方法
function rec_position($rec_id = null){ if (!is_numeric($rec_id)) return null; $string = ''; if (config('cache_open')) { $info = rkcache("rec_position/{$rec_id}", function($rec_id) { $rec_id = substr($rec_id, strlen('rec_position/')); return db('recposition')->find($rec_id); ...
0
ef19cce7d8b3cb294555c932df9fa35b
61dbbefaa86ea170463f7c0256c02e4f
Creates a login history model.
class Login(db.Model): def __init__(self, username, password): self.username = username self.password = password
0
1970a005aa4a2ce9ec4a8a4ae2ff4452
96f497bd9a5e0f13817ab96412734a23
Writes the jpeg file header.
static void jpeg_write_header_RGB(jpeg *jpg) { FILE *file = fopen(jpg->jpeg_filename, "wb"); const unsigned char SOI[2] = {0xff, 0xd8}; const unsigned char APP0[2] = {0xff, 0xe0}; const unsigned char DQT[2] = {0xff, 0xdb}; const unsigned char SOF0[2] = {0xff, 0xc0}; const unsigned char SOS[2] = ...
1
bdc503088556c98ab9ad0d398ed46ba7
48c4913d33743b594300d24f5ab9ebf3
Returns the logical multiply tests before and after the current logical multiply test in the ordered set where title = &#63;.
long userId, int status, int start, int end, OrderByComparator<LogicalMultiplyTest> orderByComparator) { return getPersistence() .findByC_U_S(companyId, userId, status, start, end, orderByComparator); }
0
20318b277c14363e8a62176bee05c72d
86aee335cb85b61ad99f55d0b77f718d
Сливает корзины из сессии и из БД `max` - в БД будут добавлены новые товары, а у совпадающих сохраниться наибольшее кол-во
class Cart2 extends \yii\base\Component public function syncSession() { $this->setCookiesItems($c1 = $this->getSessionItems()); $this->setDbItems($c1); }
0
c3b11d0a7423582332200defb6a99070
b74d9f938b052616035b2c5d8e1e7b92
Synopsis This function performs a complete pass through the training set.
class AllDS2020(): def do_train(self): self.Core.do_data() self.Core.do_network() self.Core.do_train() self.Core.do_evaluate()
1
1a2bc47cda7cd9c23ed84fab14c916b2
451cf7dc2a427f2279d43918524dc405
用于产品关键字中核查产品品牌.
$res = true; $brandStr = 'magideal'; $needCheckEbayAccount = ConfigService::getEbayAccountByCheckAdvtBrand(); if(in_array(strtolower($ebayAccount), $needCheckEbayAccount)){ $pattern = '/(^'.$brandStr.'\s+)|(\s+'.$brandStr.'\s+)|(\s+'.$brandStr.'$)|(^'.$brandStr.'$)/i'; if(!preg_match($p...
1
53ae9f8ce00fc4d7bd4ce345c5f01210
183291bd6063f4a2f56ec342886bbc91
Callback function for print button
class Ui(QtWidgets.QMainWindow): def printButtonPressed(self): print('printButtonPressed')
1
f8a5a44c4959c376d8028fd9bcba4fd9
074411afae336ba291eda191c46a9f04
# Add Blendle Button button to tinyMCE
function strl_add_custom_tinymce_buttons( $external_plugins ) { $external_plugins['mce_editor_js'] = get_stylesheet_directory_uri() . '/assets/tinymce-plugins.min.js'; return $external_plugins; }
0
11424b8a10df5f9640d4544adf6f4ea9
62c5f29d4e4dded2d09d0e8f8b640367
Called during initialization of the Group service.
class GroupService(object): def __init__(self, session, user_fetcher, publish): self.session = session self.user_fetcher = user_fetcher self.publish = publish
1
5c15b4af17e8502eaeaadc8246ba5489
b70e71a73f9bdfe83e9d55c28d0b125d
parse day from timestamp
def timestamp_to_day(timestamp): return int(datetime.fromtimestamp(timestamp / 1000.0).strftime("%d"))
1
8db9a9a4b4e3d23bd0002b660f74def5
673fba4f3428222da5d45eabbcacd08c
Multiplies input image by window function; input and output images may be the same
{ uint32_t smpl; assert(window != NULL && data != NULL); for (smpl = 0; smpl < num_samples; smpl++) { data[smpl] *= window[smpl]; } }
1
7585794e3c5727fa7d4939d23d4ebf3a
95c5925871400f2b46c3a30896b3beef
@brief Save blob scale parameters for later use.
void CImageEditorBubbleControl::StoreParameters() { LOG(KBubblePluginLogFile, "CImageEditorBubbleControl::StoreParameters()"); iParam.Copy (_L("x ")); iParam.AppendNum (iX); iParam.Append (_L(" y ")); iParam.AppendNum (iY); iParam.Append (_L(" angle ")); iParam.AppendNum (iAngle); if ( iScaleToHeight ) { ...
1
0a2ebd2c0798e10fd0faf85bc0456345
eb1d30078a2773c8cb4612a72dc2d565
Set Group. Request Group
if (empty($args)) { return $this->group; } $this->group = $args[0]; return $this; }
1
4abaa585f1ebff7e1d8897434e7fb5e9
d398ddc8f644a558b751b182f3c9516f
Add the extended advanced widget to the UI if one has been defined (via subclass)
class UniversalExport extends BsExtensionMW public function onBSWidgetBarGetDefaultWidgets( &$aViews, $oUser, $oTitle ) { $oWidget = $this->getWidget(); if( $oWidget !== null ) $aViews[] = $oWidget; return true; }
1
30600822327e6fc7d5c41f0cd81ec7c1
fa1730acee1972dd1984051bf559b82d
посчитать общее время просмотренных фильмов
void Database::returnTotalViewTime() { int sum = 0; for (MediaFile* &m : mediafiles_) { sum += m->getTotalLength(); } std::cout << "Total viewtime is: " << sum << "min!" << std::endl; }
1
db9a9701f95cf74d58ddce4bda3f6134
1b341ec243ffe13ae4e07120f6f0bed7
Returns to the previous viewing configuration.
{ Trace.Script("Reverting view", this); this.View.Copy(this.PreviousView); this.SetView(this.PreviousViewTarget, this.PreviousViewMode, this.View, new Transition(0.0f, Ease.Linear, false)); }
1
d726ceba691641d10225887f40d0f4ba
4783cc64c034251c772a20c64bdb61b0
清除全单打折状态 清除单个菜打折状态
function DishesStatus(type) { if (!OrderTableProjectsdata) { layer.msg('无可操作的菜品!'); return false; } if (type == '1') { var title = '即起'; } else { var title = '叫起'; } layer.closeAll('page'); layer.confirm('您是确认操作全单' + title + '吗?', { btn: ['确认', '取消']...
0
a873c63f7f70a6ee16eccc8ea1bd298b
8de47d34d8e067e7e4efd47ac75ce0fa
默认不带框
void LoginDialog::setStyle() { this->setWindowFlags(Qt::FramelessWindowHint); this->setMinimumSize(45,45); this->setStyleSheet("background:#D1EEEE"); }
1
a6ec21246eb96d9195fecd8842cc94d0
14b365ad0eb838214936b69736220cd5
Refer to: https://leetcode.com/discuss/17278/accepted-shortest-explaining-algorithm-comments-improvements
def longest_common_prefix2(strs): if not strs or not strs[0]: return '' def lcp(l): for i in range(l): for s in strs[1:]: if len(s) < i + 1 or s[i] != strs[0][i]: return False return True min_l = min([len(s) for s in strs]) l, r = 0...
1
f82f75b7b29888ce0aaa419fb66f9661
e6a879333ed7e0c9fa02752ffe1dddd1
Implementing click report export to pdf button functionality
namespace AutotaskCorporation.Autotask.Web.UI.PopulatedWebControls.Reporting public class ReportViewerBase : Page protected void ExportButton_Click(object sender, EventArgs e) { this.ReportLayout.Report.ExportToExcel = true; this.GenerateReportButton_Click(sender, e); }
0
1fc4769c77c96f03af03b7f4da319041
01064cab4542d2e594ba6c649b2536b6
Читает разделенный запятой список параметров. Признаком конца является закрывающая скобка, которая не удаляется из потока.
{ var types = new List<string>(); var paramStart = startIndex; var level = 0; for (var i = startIndex; i < startIndex + length; i++) { var c = value[i]; if (c == open) { level++; ...
1
8feb34041c7083fc71f3da7facff6d3c
96d04335eb602614549ad2d561948f42
Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation. <p>Sample code: <pre>{@code This snippet has been automatically generated and should be regarded as a code template only. It will require modifications to work: https://cloud.google.com/java/docs/setup#c...
@Generated("by gapic-generator-java") public class InterconnectAttachmentsClient implements BackgroundResource public final OperationCallable<SetLabelsInterconnectAttachmentRequest, Operation, Operation> setLabelsOperationCallable() { return stub.setLabelsOperationCallable(); }
1
329b890c187c386b6f6b0e811c7be410
7f61448ad6da3ef0f9cb03f40c5be655
Allow unpacking as a tuple
cases like (1)
0