query_id
string
corpus_id
string
query
string
code
string
label
int64
d734491d599cd578f7f2f975ce273d3f
3655720325ac4e7757bf2090f5bd4dd4
Einzelspieler Vokabelmodus: Antwortevaluation
class StartBildschirm function Check() { if ($_POST['deutsch'] != "" && $_POST['englisch'] != "") { if (strcmp($_POST['deutsch'], $_SESSION['vokabel']['deutsch']) == 0 && strcmp($_POST['englisch'], $_SESSION['vokabel']['englisch']) == 0) { echo"<p class=\"richtigeAntwort\">Klasse das...
1
34c39d960b17536ea0cc161524f65641
58719cd81beee19293fe438a0c3a8b99
Wrapping method allowing us to act or perform a piece of code as another user (impersonation). Expecting a callback (of type Task<bool>) as parameter to be started during impersonation.
namespace WmcSoft.IO.Sources public class FileCopyBatch : Batch<IDisposable> public void Impersonate(string domainName, string userName, string password) { _impersonator = () => new Impersonate(domainName, userName, password); }
0
2a1a36abee54c61f28730bba8abc4e8e
fc175029d51a3a4e350f826817625815
map coordinates to rank
int get_rank_proc(int x, int y) { return x * CNT_PROC_2 + y; }
1
59bbe563dc5f2025f5d61a857c17ba63
f2000b06c56244371568d5d52b210718
u""" создает словарь, заполняя его отфильтрованными DataFrame значениями
for i in self.files.csv_files: tmp = list(pd.read_csv(i)) tmp = [x for x in tmp if x in self.filtered_cols] name = [i for x in tmp] tmp_dict = dict(zip(name, tmp)) self.cols_dict.update(tmp_dict)
1
06638bf4582cd63a3762ad8dcafd6502
00a54f750c011b07192276b4197630d7
个人已完成订单
{ if (IS_POST) { $page = (int)I('p') ? (int)I('p') : 0; $list = 10; $memberId = parent::get("account")['id']; $orders = M('transaction') ->alias("t") ->join("member m","t.buyerId=m.id",'LEFT') ->field("t.id,t.buy...
1
bad86e0cbf2ea26c9879887c4209dc2c
2cdbeda533e81e0bd7567df839bc8c40
Simple buoyency simulation.
void SimState::Convect(float * v, float dt) { float g = dt * params.grav; for(int i = 1; i <= N; i++){ for(int j = 1; j <= N; j++){ float density; if(params.temperatureOn){ density = MixedDensity(ind(i,j), params, fields); }else{ densit...
1
8103b9a754c55d700f4283838eda3d49
1663afb9e02bc137e90a0c85fc98aae4
Save the scene in Maya Ascii based on the configuration.
def serialize_scene(): lm.serialize('lm.serialized')
0
a7368a995ea1e594a7558f53b0ecec54
f611c985fbebca25bc5c320ed90a3072
获取与pfClass对应的标注的FeatureClass
{ try { IFeatureWorkspaceAnno pAnnoWrksps = (IFeatureWorkspaceAnno)pTargetWrksps; if (pAnnoWrksps == null || pRefAnnoFtCls == null) { return null; } IAnnotationClassExtension pAnnoExten = ...
1
6926c3680cd429e1ed6eee91e0de9360
b59e2dc0d28bf6886bc8c5746fd65262
Function Takes in a .json file and flattens contents to a dictionary that still represents the nested structure through namings.
def flatten_json(unflat_json, flatten_lists=True): flat_json = {} if isinstance(unflat_json, dict): for key, val in unflat_json.items(): flat_val = flatten_json(val, flatten_lists=flatten_lists) if isinstance(flat_val, dict): for subkey, subval in flat_val.items()...
1
9a10c2e1d4a7a7315bce670556036992
8c268b46977a992cf078a98af7a4a473
Init to generate gdmix fixed effect workflow.
class FixedEffectWorkflowGenerator(WorkflowGenerator): def __init__(self, gdmix_config_obj, jar_path="", namespace="", secret_name="", image="", service_account="", job_suffix=""): super().__init__(gdmix_config_obj, jar_path, namespace, secret_name, image, service_account, job_suffix) s...
1
7ebeb2846046e3876cbf2bdff203e1aa
001bf04c54595a05221d3c45338dc63c
是否应该提醒满员
class Elevator checkOverload () { if (this.currInsidePeople >= this.maxCapacity) { return this.warningOverload() } return this }
1
68db6204732c20e7a106adf44a518e22
2b257e369d1b73efef7b6bd408fac1c2
Gets the select count reader management. - 리더 갯수 조회
public int selectLeaderSttusListCnt(LeaderSttusVO leaderSttusVO);
1
0d213bc7faf3ac8a3a014b06c3c434a9
c4baff7aa8b5b93ea6f69baad2e68f99
Returns the meta object for the attribute '{@link com.junit.model.ETypes#getEString <em>EString</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getEString();
1
32f265411c05b333b9036a116a6cc692
5d92a365840287407cbee7baa6345e98
ユニットモデルリストビューの項目編集前の処理
{ this.IsHimmeiCodeReadOnly = false; this.IsDantaiCodeReadOnly = false; this.IsCopyButtonVisible = false; this.IsUpdateButtonVisible = false; this.IsEntryButtonVisible = true; this.IsIconGroupVisible = false; this.IsHimmeiCodeFo...
1
19a533e09b1db382ecd7badc613aa409
41d1d277d56953313eaf18f215ed91c6
宾客总数一周
result = [] dataList = Utils.db_t_d(dBSession.execute( "SELECT count(*) as c, date_format(from_unixtime(created_at),'%Y-%m-%d') as d FROM ht_room WHERE YEARWEEK(date_format(from_unixtime(created_at),'%Y-%m-%d'),1) = YEARWEEK(now(),1) GROUP BY date_format(from_unixtime(created_at),'%Y-%m-%d'...
1
f14a28f614eec01e619f2259fdc0a3a2
f2a4ae5d0288ffd8acb2843e7b8f3ad8
按被访问者和访客的id 获取记录数
@Query("SELECT count(v) FROM Visitor v WHERE v.user.id=?1 and v.visitor.id=?2") public long getCountByUser_IdAndVisitor_Id(Integer userId, Integer visitorId);
1
03cd8599b15bbb1e76a1a3e2f6d1b1f3
096d215df644a03f493b4238ca5274de
以字符串显示栈中所有内容
class LinkedStack(object): def __str__(self): n = self._head s = "" for i in range(self._size): s += "{} ,".format(n) n = n._next s = s[:-2][::-1] return s
1
ea631c40ae327d37d77c95c623916aff
83f8a49f2b51745d20ac21757ce0bfd0
Metodo para agregar puentes a una lista de puentes
void Port :: addBridge(int bridge_id){ this->connected_bridges.push_back(bridge_id); }
1
f4c9182e5232b72ba7786776fc6bca01
c651ef39c23d9ef79abde12e0b678ea0
SkillBusinessService constructor.
class LegalSoldierService extends BaseService public function __construct() { }
0
ed276b484051008ab5b3e76d5b5dce23
a7a154262c6aacc0aecc57216bc7dcea
获得一个实体类型的一条记录.
namespace LX.EasyDb Object Get(Type type, Object id, Int32? commandTimeout = null);
1
2e3c6cf6544140cc8587bca3a91f0cb0
5ea83ee1f713b6d5dc6bf670f2265254
Test case for update_prefilter_default_action
class TestPolicyApi(unittest.TestCase): def test_update_prefilter_policy(self): pass
0
60ab1b4b143e1cde24e59eb4953e7c51
67b16521176a5fb0dfa0497eea4c15cb
日活跃
class CountActive extends Model public function activeCount() { $activeAction = config('COUNT_ACTIVE_ACTION'); if(!$activeAction){ $activeAction = 3; } $time = strtotime(time_format(time(),'Y-m-d')); $day_data = $this->_dayActiveCount($activeAction,$time); ...
1
3ca404b10b57d0c0e3af442f62c77c4f
6143d4d5a01cbe0e63c50dea3ab21b81
Returns deserialized and validated pythonic data structure, represented by this schema type.
class SerializedDictionaryField(HStoreField): def to_python(self, value): if isinstance(value, dict): return self._deserialize_dict(value) else: return value
1
0ad9c632b53986c786345097f008f003
d379c30d22926bc4b889e944b26d671e
fast_tp and slow_tp are dicts from {(bs, seqlen): throughput} with throughput in steps/s it's ok if values are missing in the dicts. See Seaborn heatmap docs. for plot in pre-print, slow_tp is LSTM throughput and fast is LS-LSTM
samp_ids=None, minibatch=None, count=None, markers=[], weights=True, plot_tc=True): if count == None: title = ", epoch {0:03d}".format(epoch) filename = "_ep{0:03d}".format(epoch) else: title = ", epoch {0:03d}/{1:03d}".format(epoch, ...
0
751cc0854847125d6c51d5a81a8c211c
e3313928ead8136cff1bf476b689d3b5
Записывает одного продавца в базу
public async Task<Seller> CreateSeller(Seller seller) { return await Task.Run(() => { var temp = MappingService.Map<Domain.Seller>(seller); var result = MappingService.Map<Seller>(SellerService.Create(temp)); return result; ...
1
e1dcaf759fc5999b2afb865cf1007893
198302a3a54fab8be6da1e201f485b56
Конструктор получает на вход дополнительный параметр - матрицу оценок (пользователь, книга) 0 - нет оценки, а также получает маппинг для индексов пользователей и книжек
{ $this->stuff = $stuff; $this->operations = $operations; $this->stuffAddiction = $stuffAddiction; }
0
de7d85d11abd5be793a95bf82edea9ed
dfbc47b0602dce50b0992fdc074c8c5d
Method to add a collider based on index from drop down list
{ switch (tile_CollisionIndex) { case 0: go.AddComponent<PolygonCollider2D> (); break; case 1: go.AddComponent<BoxCollider> (); break; case 2: go.AddComponent<CircleCollider2D> (); break; case 3: go.AddComponent<EdgeCollider2D> (); break; cas...
1
66d62464a85c9365f20b89b6d665ec48
1288df4d74f88fbfe77c5fa474a929fa
Set csv export file name
class Excel public function setFileName($name) { $this->exportName = $name; return $this; }
0
06a36a07b791b9ddb97bd56f54df89a7
a5be23033e4ab23d28ba11d2609727b3
Produces an initial restriction for the given element. This API is required to be implemented.
CeedElemRestriction *elem_restr_q, CeedElemRestriction *elem_restr_x, CeedElemRestriction *elem_restr_qd_i) { DM dm_coord; CeedInt dim, loc_num_elem; CeedInt Q_dim; CeedElemRestriction elem_restr_tmp; PetscFunctionBeginUser; Pet...
1
c0e69059c6ea1931806ceb41ec6e5f29
7f9918eb38807edb117b8c1c31594b12
显示信息(默认中间显示,默认显示时间:Toast.LENGTH_LONG)
public class ToastUtils public static void showMessage(Context context, CharSequence msg) { if (isShow) Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); }
0
fab203e4431e7305130139e91a5290cb
a38ac05aabf33c8d9a4ea770d92beaad
Returns the JUnit report as String
public class ReleaseTestResults implements Serializable public String jiraSummary() { String total = ""; for(TestSuiteSummary tss : testSuites) { total += "* " + tss.suite + ": " + tss.status + " [#" + tss.buildNum + "|" + tss.link + "]\n"; } return total; }
0
169f179d80c4a48c44af0cfc67a8bbe5
5017f146799774c02f00ac86032c940c
Returns the meta object for the containment reference '{@link mgl845.Client#getDossierclient <em>Dossierclient</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EAttribute getDossier_LieuCreationID();
0
6f76a5c0128687067548f73d89e1d7eb
c888ca66dfe77bfdbe836c27dbc01560
线段的起始点要保存对应节点的引用 所以在set的时候要根据id去查找node并用对应的引用进行替换
changeSequenceFlow (id, { cx, cy }) { Object.entries(this.allSequenceFlowInfo).forEach(([sid, item]) => { if (item.start.id === id) { item.start.x = cx item.start.y = cy this.setSequenceFlow(sid, item) } if (item.end.id === id) { item.end.x = cx ...
0
e57c7aee90cba2eecd262a23cae9f60d
9283c5969bf30c80276967671bce480c
Converte para pontução padrão BR, valor esperado e.g. 10456.98 gerando e.g. 10.456,98
class Convert public static function to_decimal($value = null) { if(empty($value)){ return '0.00'; } $trans = array('R$' => '', '.' => '', ',' => '.'); return (float)trim(strtr($value,$trans)); }
0
4d7daf99e99e6786c624a36ee904382f
c541727cf8b890640d01903a17b15002
Calculate number of digits for formatting.
int Board :: NumDigits(int x) { x = abs(x); return (x < 10 ? 1 : (x < 100 ? 2 : (x < 1000 ? 3 : -1))); }
1
c24e297d9bb7e1f15a1b7db5ec8010ea
a3a5e19e3b5ef1301bbb4d18f6200e84
{WEL_SIZE}.set_height
{ GTCX char *l_feature_name = "height"; RTEX; EIF_INTEGER_32 ti4_1; EIF_INTEGER_32 Result = ((EIF_INTEGER_32) 0); RTCDT; RTSN; RTDA; RTLD; RTLI(1); RTLR(0,Current); RTLIU(1); RTLU (SK_INT32, &Result); RTLU (SK_REF, &Current); RTEAA(l_feature_name, 1846, Current, 0, 0, 27666); RTSA(dtype); RTSC; RTME(d...
0
643e90350eb8f7b9fd50a9fec255d551
b5076611b8b5013cd83cf3c296c908b1
As `get` with the first coefficient always set to 1
class Superposition: def getWithBase(self,coefficients): return self.get(np.concatenate(([1],coefficients)))
1
125a80ee38463163b760a3c75b881296
c5d0bdc8b824cacdfb99e66c4b94bce8
为指定的Key设定Field/Value对,如果Key不存在,该命令将创建新Key以参数中的Field/Value对, 如果参数中的Field在该Key中已经存在,则用新值覆盖其原有值。
namespace CZGL.RedisClient public class StringClient : CommandClient<StringClient> public async Task<bool> Set(string key, string value) { await SendCommand<MessageStraceAnalysis<string>>($"{StringCommand.SET} {key} {value}", out MessageStraceAnalysis<string> strace); var result = aw...
1
4ba54598d6bfdab3b685b06607a186ef
97acb9ef395f6f91f739d625c6b78a94
Take a two-parameter function and lift it to become a [[Function2]], enabling you to call [[Function2.andThen]] and other such methods on it.
infix fun <P1, P2, R> Function1<P1, P2>.andThen(function: Function1<P2, R>) = fun(p1: P1) { function.invoke(this(p1)) }
0
07c2baffaa4e7fc6fbb80b92953c9728
00128ef4be1eea32fe3dc50427e9dabb
Esta clase representa la eliminacion de un procedimiento almacenado
{ int resultado = 0; Conexion conectar = new Conexion(); List<EstructuraTabla> miTabla = new List<EstructuraTabla>(); #region cadenas de procedimientos string comentario = "/*==============================================================*/ \n" + ...
1
89962348c0738cbad50d53b430bd8a40
f9f74d04ad14564d27267cec682a4914
Update the mod's config.json file from the current <see cref="Config"/>.
XmlDocument xmlDocument = JsonConvert.DeserializeXmlNode("{\"Mod\":" + JsonConvert.SerializeObject(modList) + "}", "Mods"); using (XmlTextWriter writer = new XmlTextWriter(file, Encoding.UTF8)) { writer.Formatting = System.Xml.Formatting.Indented; xmlDocument.Save...
0
114251f7eae1562354dc6ba037a4d872
eb7cd29e76c2b7ac0c365d21c2080af1
使系统公告生效
class Notice extends Base public function enable() { try { return $this->model->changeStatus($this->params, 1); } catch (Exception $ex) { return $this->returnException($ex); } }
1
e9345cb10ff0bc1337cd360e46d1074e
5d7220f1a1511ffd59f0b45ae8da4e6c
Esta funcion se encarga de llevar al usuario a la pagina para añadir contactos a su lista.
export class ListaPage goAddList(){ this.navCtrl.push(AddListPage); }
0
3b80c0198ad3e6fb255a031e7ad3e647
8d1ef00350ebe000d51148cfdde88eed
test processing single quotation marks on start of the value
class TypeRecognizerTest extends TestCase public function testShouldHandleQuotes() { $recognizer = new TypeRecognizer(); $this->assertTrue($recognizer->isQuoted('"true"')); }
0
12361983fa27257db2fb104634dc8393
64a8ea6223ce31f7a6f17bbedfaca7b8
gets the maximum fuel capacity of the ship
int getFuelCap();
1
b6e2f7e9040b072cf23675bf11f223c2
4fd93fdccfd633d8e9fe03477d05e5d8
Try to determine latest image taken for the timelapse.
class JSONProxy(Rts2JSON): def lastImage(self, device): return self.getResponse('/api/lastimage', {'ccd': device}).read()
1
0be1edf99b7efb73feb3917eb3a7ebef
d4617c3fe4233d7078daffebb7ddc64b
This function will mask some element in the tensor with fill_value, if condition=False.
if ones: masked = np.where(matrix > threshold, np.ones(matrix.shape), np.zeros(matrix.shape)) else: masked = np.where(matrix > threshold, matrix, np.zeros(matrix.shape)) return masked
0
4d29f900f38970f6c5c3f8fba8c4e7ac
2c48b08dd16c990e9ae4a8a9ce0ca7c5
Adds a link between two words that can later be referenced when constructing a sentence
class Crawler(object): def add_link_ref(self, url_from, url_to, link_text): words = self.separateWords(link_text) fromid = self.getentryid('urllist', 'url', url_from) toid = self.getentryid('urllist', 'url', url_to) if fromid == toid: return cur = self.con.execute("insert into li...
0
f6fbe46ecc420b8c8636612d619b929b
253d26077fe6e6b707c3e637c3b9d2ca
创建唯一值的数组,这个数组包含所有给定数组都包含的元素,使用 SameValueZero进行相等性比较。(可以理解为给定数组的交集)
union(...originParams) { let result = []; let { params, comparator } = Helper._getComparator(originParams, (item, arr) => { return arr.includes(item); }); for (let i = 0; i < params.length; i++) { let arr = params[i]; for (let j = 0; j < arr.length; j+...
0
0a731c891437f1dc31b942917e655d55
96d1603c3d49977d5cec398e0d02c4ff
Word-wrap mode setter:
RibbonToolTip::WrapMode RibbonToolTip::wordWrap() { return RibbonToolTipPrivate::m_wrapMode; }
0
46e3ad316b2f81e8c9f08d52a5d34b77
e4af2c096ed257de00c96d5db964990f
truncate classlist to given size without reordering any Student; will not expand the classlist
void Student :: ResetClasses() { delete [] classList; numClasses = 0; }
0
f331a3d75350886dd8706181ebaee22b
fa7df220900c1bb105440321d36beae4
Use bowtie to map `fastq`, saving the SAM file as `outfile`. Ensures that '--sam' is in the parameters.
def sam_to_sort_bam(sam_file, ref_file, fastq1, fastq2, sample_name, lane_name, config_file): lane = lane_name.split("_")[0] cl = ["picard_sam_to_bam.py", "--name=%s" % sample_name, "--rg=%s" % lane, "--pu=%s" % lane_name, config_file, sam_file, ref_file, fastq1] if fastq2: ...
0
b81270f56283f6b30879a3ff647508f9
72d4295dc2e6e87ec4366650aafb501b
Returns the total amount of memory in use.
DWORDLONG getMemorySize() { MEMORYSTATUSEX status; status.dwLength = sizeof(status); GlobalMemoryStatusEx(&status); return (status.ullTotalPhys * (1 - (float)status.dwMemoryLoad / 100u)); }
0
0d55aa4bbfa202e3d05faa183c66bb0c
e0922c60f9d3b7b5e2e625fa2ebbc9fd
Construct the custom post type for Reports
register_post_type( $this->custom_type, array( 'labels' => array( 'name' => __( 'Boards' ), 'singular_name' => __( 'Board' ) ), 'supports' => array( 'title'), 'public' => true, 'ha...
0
5a77eb1411e7a5d89920ec81f4853f7e
e731b274cc2bbd2030d20b5ac1b563f0
获取excel某行的j列内容
throws Exception { int rowSize = 0; if (!pwd().endsWith(".xlsx")) { System.out.println("文件不是excel类型"); } FileInputStream fis = null; Workbook wb = null; try { fis = new FileInputStream(pwd()); } catch (Exception e) { e.printStackTrace(); } try { wb = new XSSFWorkbook(fis); } catch (IO...
1
cc2ec6c533967d187a024f607bea1523
bbf3880c0f656a2bfb86c55952468e2c
删除用户全部文章
@RestController @RequestMapping("articleInfomation") @Api(value = "articleInfomation", description = "调用这个删除的接口时注意! 接口内会将剩下的部分全部执行完毕(仅仅针对博客部分的接下来的操作),示例1——删除一个用户1:</br>1、调用删除角色接口</br> 2、调用删除角色其他信息的接口<br> 3、 开始删除该用户的博客部分信息,调用'admin/deleteAllByUid/{uid}'接口, 接口内会删除文章信息表中这个用户的文章信息,然后自动删除用户创建的所有标签,最后自动删除用户写的所有用户属性的文章,也就是说删除...
1
7569f85b18811d1ddc21bd0f12ed1fc5
2659dc4613f076a1c1bdec294b61ff31
Build the site parameters and the list of telescope models, including reading the parameters from the DB.
class COSMOSCatalog(object): def _makeParametric(self, indices, chromatic, sersic_prec, gsparams): if chromatic: if self._bandpass is None: zp = 25.94 self._bandpass = galsim.Bandpass( os.path.join(galsim.meta_data.share_dir, 'wfc_F814W.dat.gz'), ...
0
d80b0f461da7e107dbfdea46702c1ded
f2ece6007d2aad7ae3aaa487a7fea629
Getter for <code>pg_catalog.pg_shdepend.refobjid</code>.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.8.4" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class PgDescriptionRecord extends TableRecordImpl<PgDescriptionRecord> implements Record4<Long, Long, Integer, Stri...
0
6a671bd70e10be09ccf0bc38d9b9ea6f
768a6679bfab3e744b09e9e48fea25ed
Get workspace folders in IDE.
public class LanguageServerContext public void workspaceFolders(List<WorkspaceFolder> workspaceFolders) { this.workspaceFolders = workspaceFolders; }
0
156d5d37ceda8279165b7773ff5cc9b5
6f2e30768bf40760d1958f5870ddf1a5
Returns the value of field 'ind2'.
{ BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Col_2); if (bd == null) return Env.ZERO; return bd; }
0
ecb4ad23a4dd0f3c8222a2f366df5ba9
c8edd46c913e690c53a40f78312f8984
Converts the record/s into a Unity GameObject structure with meshes, materials etc and imports into the scene.
{ return ImportTextureFile(texturesPath, archive.ToString() + "_" + record.ToString() + "-" + frame.ToString() + MapTags.MetallicGloss); }
0
719bdd44a75e9e024b6b9605f086e492
7906eff187484d7b43e5919b42949922
Modifier le contenu de formulaire : conversion en (int)
var value2 = eval($( "#boiteDeDialogueEnvoi" ).val()); var typed2 = typeDD(boiteDeDialogueEnvoi + ' = ' + value2); }
0
b6058aca48bda1cd4285ee55b0a10ea6
35f579213419cc25ae06bec3d21a8a44
Computes the partial derivative w.r.t. z1 of the hypergeometric function 1F1(a;b;z1,z2,z3) with a = 1/2, b = (dim+1)/2
{ if (z > -1 && z < 1) { return gsl_sf_hyperg_2F1(a, b, c, z); } else { return pow(1.-z, -a) * tgamma(c) * tgamma(b-a) / (tgamma(b)*tgamma(c-a)) * gsl_sf_hyperg_2F1(a, c-b, a-b+1., 1./(1.-z)) + pow(1.-z, -b) * tgamma(c) * tgamma(a-b) / (tga...
0
92699661d8668fe45212b61ed369314f
fb9e5139816f7b36afab939a7262b0a0
Computes A_n terms of the Fourier series.
void MultA(long n, double *u, double *out) { double pre_factor = (n + 1) * (n + 1); out[0] = pre_factor * (2.0 * u[0] - u[1]); for (long i = 1; i < n - 1; i++) { out[i] = pre_factor * (2.0 * u[i] - u[i + 1] - u[i - 1]); } out[n - 1] = pre_factor * (2.0 * u[n - 1] - u[n - 2] - 1.0); }
0
031a0124af9f51810dd2647a9e4c8810
a8423b6810602ec015792c157a2043ef
this may or may not currently be called by anything in this file. it is useful for debugging. it prints the scanned data, each field to a line
printf("Index %04d : \n", index); if( pat.ren ){ printf(" Read : addr=%#04X, expected_data=%#018lX;\n", pat.addr, gld.rd ); } if( pat.wen ){ printf(" Write : addr=%#04X, wd=%#018lX, wvpn=%#014lX, wasid=%#05X, mask=%#010X, G=%d;\n", pat.addr, pat.wd, pat.wvpn, pat.wasid, pat.mask, pat.G )...
1
50663e0b0ebbe40d364663ea0b480c60
7af3d3aa15784891745cfd548a4ba856
Executes a command in the shell. `code`: The command to run in the shell.
class shell(): def exec(command): return subprocess.run( command, stdout=subprocess.PIPE, ).stdout.decode().replace('\n', '')
1
eb762bee7af2e3214e14514cbc31df0c
92c71ec1d338777ab09326b047fa319e
Insert Tutor Data to DB
namespace CourseManagement.Client.DB.Model public partial class Tutor : Person public override void addToDB() { try { TutorQuery.insert(this); } catch (Exception e) { throw new Exception(e.Message); } ...
1
e49926bc20679b445b7fa0813f7341c0
af8d5c0c13702f1627c0a0eb99014f37
Reads a var int 64 from the internal byte buffer.
function readVarInt64(bytes: Uint8Array | Buffer, startIndex: number = 0): varIntResult { return (readVarInt(bytes, startIndex, 53)); }
1
ec65bed9302f7be31b25b74b387bb7cd
2c4be94927538b665ef3f7a476c76610
Find group that command is a member of.
granula = self._guild_commands.get(guild_id) if granula is not None: return granula.get(command_id)
0
e9461905fb1cd74824f59d3444e7d1b3
05fb0edbc68def1de294e649f4eab892
Sets the state of the enquiry with the given id to declined.
if (!info || !info._id) {return false} setIsProcessing(true); setProcessingStatus(1); console.log('declining with code...', declineCode); axios.delete(API_URL + (!isReported ? '/api/declineQuestion' : '/api/question'), { data: { questionID: info._id, ...
1
1cd46c9af39a9eaeabf1a7ddfda99007
a90690eeaedeefe813e1593f5cd44748
match topics vs RM
rf_sim = sim vec_queries = vec_queries.todense() vec_docs = vec_docs.todense() for itr in range(3): top_rel_docs = np.zeros((len(vec_queries), n, vec_docs.shape[1])) top_nonrel_docs = np.zeros((len(vec_queries), n, vec_docs.shape[1])) for query_ind in range(len(vec_queries)): ...
0
9d63886c4580c3d48053acdd11fa6868
39ae449d6bd58a8a385299ce7b243222
Отменяет задачу
class TaskController extends AbstractController public function cancel() { $user_task_id = (int)$this->request->input('id', 0); $this->container->get(TaskService::class)->cancel($user_task_id); $this->success(); }
1
ebd20c2296132066df1990f014945dc2
00771c42a8a10050fad07b19c5ad0a0b
:reset-coords
def main(): reset() setworldcoordinates(-1200,-1000,1200,1000) speed(8); hideturtle() width(2); coosys() width(4); plot() return "Done!"
1
37d80691575bd93bcd453d8ed5a6eaa3
a538deab7d72b1898b2347fb9812a5e3
敵のアクションカード破棄(fromテーブル)イベント
{ Game game = args[0] as Game; if (args[1] == null && args[2] == game.UsedActionDeck) { if (game.UsedActionDeck.Count > 0) _changeTarget = game.UsedActionDeck[game.UsedActionDeck.Count - 1]; } return Task.CompletedTa...
0
31fbd94aed5ff54db1a2435ca2a0c914
817dcea5d639e609e0bb9153e937f2ae
選択されたユーザ情報を取得します。
Optional<User> getSelectedUser();
1
63cc967635789350cb7a8c38d3df2c48
34b5ef8370592f7fb1b23053babdf26a
增加最大魔法值
namespace Control public class Ctrl_HeroProperty : BaseControl public void IncreaseMaxMagic(float _increaseMagic) { Model_PlayerKernalDataProxy.GetInstance().IncreaseMaxMagic(_increaseMagic); }
1
c40922f72cfc3dc2e1b77d781fc6b0e0
4968033fc8b28dfed05c6ef999cc116d
e.g. "MDCCCCX" -> "MCMX"
class RomanNumeral def to_sub new_numeral = self.dup.to_add.denumerate ROMAN_CHARS.each_char do |char| first_order = lower_chars(char)[-1,1] || "N" second_order = lower_chars(char)[-2,1] || "N" new_numeral.sub!(/[#{first_order}][#{second_order}]{4}/, second_order << char) end ROMAN_CHA...
1
781939b9bddb3b1baa5b1d9b3540bff4
71b9c848e9d076f9e343797cf311bafa
Sets dependsOn
public static final class Builder implements software.amazon.jsii.Builder<DirectoryServiceDirectoryConfig> @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @SuppressWarnings("unchecked") public Builder dependsOn(java.util.List<? extends com.hashicorp.cdktf.ITerraformDep...
1
cc7a78a7ce764911f6cd4e07531a6560
bccc061cc35089d515fbd87686a0b8dc
GetPaidUnionIDWithMCH 用户支付完成后,通过微信支付商户订单号和微信支付商户号(out_trade_no 及 mch_id)获取该用户的 UnionId,
class WxWeApp public function getPaidUnionId(string $accessToken, string $openId, array $orderInfo = []) { try { if (empty($accessToken)) { throw new \Exception("请传入access_token!", 1); } $param = array_merge([ 'access_token' => trim($accessToken), 'openid' => $openId ], $orderInfo); $resul...
0
f7d948735cf54fb0b1fea4cab5191fad
94a229372813bc9ecb0342062b7a7740
Checks if the claim is the HTTP Authorization Header claim.
{ if (_claims.ContainsKey(claimId)) return true; if (claimId.Type == CBORType.TextString && _JwtMapping.ContainsKey(claimId.AsString())) { return _claims.ContainsKey(_JwtMapping[claimId.AsString()]); } return false; }
0
7501865d7789d801c2bdc67eab90fcbb
0133bc39bfea25265d03381fafc65672
获取阶段下并联里程碑事项
StringBuffer _sql = new StringBuffer(); _sql.append("select psl.objid,psl.prestepid,psl.aftstepid,psl.sort,ps.name as aftstepname , ps.steptypeid as aftsteptype \n"); _sql.append("from WF_ProcessStepLink psl "); _sql.append("left join WF_ProcessStep ps on ps.objid=psl.aftstepid "); ...
1
5ccc62d8f8a39b6a72729fe67063c079
a69caa030d3d4b344518da5ea6bdc085
gets the distance between two points as tuples
def get_vect(x1, y1, x2, y2): return (x2 - x1), (y2 - y1)
0
82e62f8bd795f1639eba3c50ce6cedce
eb4841ecadf190c71a51ef51b3aadbb2
Action used to mark the start of the conference.
return async function(dispatch: Function, getState: Function) { const tracks = getState()['features/base/tracks']; const audioTrack = getLocalAudioTrack(tracks)?.jitsiTrack; if (audioTrack) { await dispatch(replaceLocalTrack(audioTrack, null)); } dispatch(joinConf...
1
92acf830801b7f6e42586704d208eac9
3be27277cad5f10b903965843bc203d6
同意解散
if is_auto: if not desk or not user or user.user_id in desk.dissolve_agreed_users \ or user.user_id in desk.dissolve_reject_users: return if 1 == agree: desk.dissolve_agreed_users.append(user.user_id) if len(desk.dissolve_agreed_users) > desk.max_player_num / ...
1
1094c7b6870f3b6be2df17b089f434a4
7293366335c6b461842a4e37fa34f180
Set clock to 32MHz internal RC oscillator.
{ CPU.CCP = CCP_IOREG_gc; OSC.CTRL |= OSC_RC32MEN_bm; while(!(OSC.STATUS & OSC_RC32MRDY_bm)) WDR(); CPU.CCP = CCP_IOREG_gc; CLK.CTRL = CLK_SCLKSEL_RC32M_gc; }
1
cfceba5e177616c514c25fb4eb40c4cb
9132c0a7fa71f972b1df3e51354d22cf
はみ出したindexを範囲内にする。
if (index < this.minIndex) return this.maxIndex; if (index > this.maxIndex) return this.minIndex; return index; }
1
a4deb21536cc5179486c44405c6bb11a
5a5523fc182af098e9657aed82ebebe5
start with all code points equally likely
const long int minc = numeric_limits<char>::min(); const long int maxc = numeric_limits<char>::max(); CodeType k{ 0 }; for (long int c = minc; c <= maxc; ++c) initials[static_cast<unsigned char> (c)] = k++; vn.reserve(globals::dms); reset(); }
0
936ce04c88c522fe57768cd4e25ee7fd
2bf6bb77928853b826e7fbd052dc4f28
ボスのワールド座標を設定する。
export class Boss extends Enemy set(x: number, y: number, life: number = 1) { this.position.set(x, y); this.life = life; this.frame = 0; }
1
b37f0c75343935b277858077e8be113f
21ce9b50e3c47df70e4145ba26ae9418
Detects all instances attached to a specific ELB.
func Instances(name string, config *aws.Config) []string { instanceIDs := []string{} svc := elb.New(session.New(), config) dii := &elb.DescribeInstanceHealthInput{ LoadBalancerName: aws.String(name), } dio, err := svc.DescribeInstanceHealth(dii) if err != nil { return instanceIDs } for _, instance := range ...
1
2e66de99534a4f24f0ffbd16f22977e7
120f3ed9684f9a27b909e112aa3bae30
Create a directory and any missing ancestor directories. If the directory already exists (or if 'name' is the empty string, which means the current directory, which of course exists), then do nothing. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rath...
class Pytester: def mkdir(self, name: Union[str, "os.PathLike[str]"]) -> Path: p = self.path / name p.mkdir() return p
0
7c21c6d8d6af7c8e12074b8d7d2939e4
7670f5710f2a80812afed6460a444039
Gets the font style (also known as slope) of the text at the specified position.
namespace SharpDX.DirectWrite public partial class TextLayout public float GetFontSize(int currentPosition) { TextRange temp; return GetFontSize(currentPosition, out temp); }
0
e54c9760ffcdcf23afa73828052db542
80003794f58ab59f05544513c9b03754
(3) 当Trigger错过被激发时执行,比如当前时间有很多触发器都需要执行,但是线程池中的有效线程都在工作, 那么有的触发器就有可能超时,错过这一轮的触发。 Called by the Scheduler when a Trigger has misfired.
public class DefaultTriggerLister implements TriggerListener{ @Override public void triggerMisfired(Trigger trigger) { logger.debug("Trigger:[" + trigger.getKey().getName() + "] is Misfired."); }
1
1034c17477645f1405cbf3d0c478b538
b12c138dfe9d58eea9e592c2c8758b0b
peak point calculation
def ComputePointVal( varInfo, i ) : return varInfo[0] + float( varInfo[1]-varInfo[0] ) / ( varInfo[2]-1 ) * i
0
f2fb8ff17a19171e46299fd802f23ed9
5bed26d2a7329ca8737daf50a8c6d879
Converts the initially read routing table from an array representation to a Trie one
{ int nbrs = topology_getNbrNum(); int *nbrArr = topology_getNbrArray(); routingtable_t *rt = (routingtable_t*)malloc(sizeof(routingtable_t)); memset(rt, 0, sizeof(routingtable_t)); for (int i = 0; i < nbrs; i++) { int nbr = nbrArr[i]; int idx = makehash(nbr); routingtable_entry_t *rouentry = (r...
0
f3519ad6d2bfbb96e8531022aff0d8a6
0ae85311ad100a02cc3f56c1734cfd13
根据用户ID查询获取红包用户信息
if( empty($uid) ){ return false; } $where = [ 'uid' => $uid ]; $result = $this->getDb('fx')->find('red_packet_cash', $where,['fields'=>'*','order'=>'create_time desc']); if( count($result) >=1 ){ foreach( $result as &$v){ ...
1
5635f72d43a4347b00af6c44c42e41a7
f3daa306568257a2577632f76ce647d4
Returns the error message for a certain field or NULL if the field is filled correctly.
public function getError($field);
1
93cf56c54635cbd4becc5c6474482219
57340a6dd2e9e5bd677957f262d7eb6c
Ensure that the tables this implementation depends on are there.
public class HBaseTenantManagement extends LifecycleComponent implements ITenantManagement protected void ensureTablesExist() throws SiteWhereException { SiteWhereTables.assureTable(client, ISiteWhereHBase.USERS_TABLE_NAME, BloomType.ROW); SiteWhereTables.assureTable(client, ISiteWhereHBase.UID_TABLE_NAME, BloomType....
1
5b271192c07d851659d19b175a0f459f
8177017b5f5544aa25039aae22017ec4
Многобайтовый аналог ф-ции ucfirst
function mb_ucfirst($str) { $fc = mb_strtoupper(mb_substr($str, 0, 1)); return $fc.mb_substr($str, 1); }
1
02d4ebbe22fa72a86d6ee54397498d01
901bee0a83bdf038914c104d315ec886
Generates an empty array of strings.
String[] result = new String[size]; for (int i = 0; i < size; i++) { result[i] = ""; } return result; }
1
0d9bc71824b59476aa9b42e36ca0e206
4f8aa207c0962947f212f29c567431e3
Only stop if we've actually played something (we don't want to kill music the user has playing).
public class CustomizerActivity extends Activity protected void onPause(){ super.onPause(); if(SoundManager.players[0].isPlaying()){ SoundManager.playMusic(0); SoundManager.isMuted[0] = false; } }
0