query_id
string
corpus_id
string
query
string
code
string
label
int64
cebb6f701c0f7c45e7cb3e5329ca7bbb
35e62f7cc90ae371dd0e1a771e5cdf93
Dummy mailing instance for unittests. Keeps all sent messages in *oubox* list.
class MailMockFailPass(Mail): def __init__(self): super().__init__('test@mail.com', 'password', ['receiver@mail.com']) self.send_call_count = 0
0
92f5c2bbf105c625f99c32a6eb15400e
e9e39333537d6287f7295d665a9f6362
@brief 测试窗口菜单键F2回调函数
static void set_gr_par_f4_2_cb(KEY_MESSAGE *key_msg) { }
0
db3e2051381a95e78a1fa0a8b59b2d19
f18712deea48fa2829df08fec8d4c68b
Updates a test run.
const method = 'update_run/'; const url = this.host + method + runID; const body = { name: name, description: description }; const options = { method: 'POST', headers: this.headers, body: JSON.stringify(body) }; const data = await this.myFetch(url, options, 'Provided data is not valid'); ...
1
a0c49173358e5b0706b8bdefd91f62f6
e7e84dd4faf5d15e12ee61bf6622920b
Returns the eider sequence.
byte[] getE();
0
ea193eea3afdfc75e5271749d3ae18a5
51aa71f4bd98565a44b012722dd3b1bb
使用下载管理器进行下载
public class ClassActivity extends BaseActivity implements View.OnClickListener,View.OnFocusChangeListener{ public void downloadMgr() { Intent intent = new Intent(); intent.setClass(ClassActivity.this, DownloadRecordActivity.class); startActivity(intent); }
0
3c4af908b760f95a3d617ee653287db4
3631fe1c3b48fe38c1f068ce46273054
翻译一个表
self.status.showMessage(u'开始导表...') excel_dir = self.config.getConfOne('excel_path') json_dir = self.config.getConfOne('json_path') cpp_dir = self.config.getConfOne('excel_cpp_path') csharp_dir = self.config.getConfOne('excel_csharp_path') try: if os.path.exis...
1
befa3ac3aee068a5902b54d82d759f7c
f3080b08caff691fbf03eaf8cf41fd62
Displays the list of present students.
void showStudentList(SeasonConfig & seasonConfig, int index) { system("cls"); cout << "Student list: " << endl << endl; for (int i = 0; i < seasonConfig.students.count(); i++){ for (int j = 0; j < seasonConfig.students.get(i).registeredCoursesList.count(); j++) { if (seasonConfig.students.get(i).registeredCours...
1
f4f9ba763d41dad4c2ec0bdc3bb03521
7e3b062cce2433f7e4cd5c3e4cbce4f2
Check whether or not an upgrade is available with a given name.
class UpdateService(Service): def check_available(self, attrs): try: applied = self.middleware.call_sync('cache.get', 'update.applied') except Exception: applied = False if applied is True: return {'status': 'REBOOT_REQUIRED'} if self.middleware.call_s...
1
c49c9be2ab7dec9da0211ad350259015
8bbb3a97714da769646c3c92fe6cd352
遍历所有边,使具有边的两个点在union-find算法中进行连通。
{ for(auto it = p.begin(); it != p.end(); ++it) { auto it2 = it; it2++; if(it2 == p.end()) break; for(auto& e:graph[*it]) if(e.to == *it2) { e.sub_person(); } } }
0
aef49d13037bf6b9786029a9f30ef832
2ff4ef6641eef0bd68596d7982523d14
GET: _clientFavoriteList
{ try { string id = User.Identity.GetUserId(); if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } var user = await UserManager.FindByIdAsync(id); ...
1
0cfe017743945d4aff3a7f63852710d2
a32241c8d2e7e9ef7163680f69f4d796
This function takes a pointer to a vehicle structure as a parameter and prints out all of the information from the specific vehicle on a single line in a human readable manner.
void print_customer(CustomerType *c) { printf("%s %s, %d vehicle(s)\n", (*c).first_name,(*c).last_name, (*c).vehicles_regist); for (int i=0; i<(*c).vehicles_regist; i++){ print_vehicle(&(*c).owned[i]); } }
0
898c4d2a76fed8d69fae6fc8a9bea720
314bd6e5978c31b8d3f42d3d534204b4
Génère une carte aléatoirement, dans des proportions données
public Carte[] genereCartes(int n){ nCartesMots = new Carte [n]; CarteCouleur tempMot = null; Graphics g = null; for ( int i = 0; i < nCartesMots.length; i++ ){ nCartesMots[i] = genereUneCarte(); } return nCartesMots; }
0
9dd1afbbcd852395f1e91ee787080a5c
62600d1d31a8c39e3e3a041a00fe9354
Função para retornar os favoritos desta arte
return ( <View style = {{flexDirection:'column', justifyContent:'space-between', position:'relative', top:'15%'}}> <Text style = {styles.Text}>Favoritos</Text> <TouchableOpacity style={styles.button}> <View style = {{flexDirection:'row', justifyContent:'space-around', alignItems:'cen...
0
3c5cbc6089b5e7b70d86e4397d041744
24798a40a1e8f47583b0e3c2bd089c23
确认按钮不可用颜色
function disableBtn(btn){ btn.css("background-color", "#BFBFBF"); btn.css("border", "1px solid #4D4D4D"); }
1
3ca369e2b06a3cfea032adae64c747eb
6ec3a245acd2ef32f68098a3615cb75d
行间距处理
namespace DianDianClient.Utils public class PrintImpact public int SetLineSpacing(IntPtr hPort, int nPortType, int nDistance) { try { string dllPath = Environment.CurrentDirectory + "\\ImpactDLL.dll"; Console.Write("===" + dllPath); g_h...
1
061090095dcd597605315129947f85ea
85fbcc4ef673b37ffde5a2c118fa4134
Configures Camera with Camera permission
public class MainActivity extends AppCompatActivity void configure_permissions() { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { ...
1
d66b43aec758a272a9d6349976fb4eb3
206c4c6024dcc8c1c7f544e212504ba7
Get Remittance Mail Text. Email text used for sending payment remittances
class SEPADirectDebitTransaction public function getRemittanceInformation() { return $this->remittanceInformation; }
0
1697150bcc3459a7b2c4d03a54322238
7489c461b1239e6f566d14f3f17a5114
Выданные аттестаты.
final class Entry extends BaseModel implements PhotoInterface, AnalyzableInterface public function getCertificates(): \ArrayObject { return $this->certs; }
1
08317d70a83b74478fc2d87e4706110d
b9d7a6e6396147eecc1b0af108203702
Opcode #0x1D. DEC E
func instr__DEC_E(z80 *Z80) { z80.decE() }
1
2dd80a67c874ff48f5fe34bd510ecf42
7afc39dae1524f8d1f275c2071e1fb74
Whether this is a formula column. Note that a non-formula column may have an associated method, which is used to fill in defaults when a record is added.
boolean isFormField();
0
c81af0545afd9e9ccbb45adf92d5a3f0
82c21d22b3bb4c596e682c890580a951
释放一个队列,释放所有的节点,最后释放队列
{ QNode *p = Q->front->next; QNode *q = NULL; while (p) { q = p; p = p->next; free(q); } Q->rear = NULL; free(Q->front); free(Q); }
1
594440f6da6ed7d7171afd536a69decd
0526451125ed2900b3b806ddb21de969
Computes a similarity score between user and item embeddings.
class LCFN(torch.nn.Module): def predict(self, users, items): users_t = torch.tensor(users, dtype=torch.int64, device=self.device) items_t = torch.tensor(items, dtype=torch.int64, device=self.device) with torch.no_grad(): u_embeddings = self.user_all_embeddings[users_t] i...
1
799f6859c1616e015c532b37c1eb76c3
9e664dad0011879ff544415965184840
批量删除代发价格档案
namespace Aim.Examining.Web public partial class FrmPriceApply : ExamListPage [ActiveRecordTransaction] private void DoBatchDelete() { IList<object> idList = RequestData.GetList<object>("IdList"); if (idList != null && idList.Count > 0) { PriceAppl...
1
3fffd6fa7ce725563775c1a239d48282
32cac459e05b5ad8962ee422160ec054
[=[ Gets the plural version of the asset type for instance naming ]=]
function FormationSlot:GetLuaTypeName() return "FormationSlot" end
0
765d58ea3e5e3770ebb0a1eb13ff1b5d
deff13d05ce58ddb7085127df9bc701e
Manages word2vec word embeddings
self.embeddings = embeddings try: nltk.data.find('corpora/stopwords') except LookupError: nltk.download('stopwords') if embeddings == 'glove': self.word_vectors = api.load("glove-wiki-gigaword-100") elif embeddings == 'random': self...
0
7f413e4db1ebc6dd511592b2cce4c468
b2e76fb7360d026774f0c1f7df73ec90
Takes as a parameter the ID of a storyboard card. Replaces variables in the storyboard card with their respective values stored in the pluginDataHash. Returns the a hash of information for that storyboard card.
function renderCard(x) { return api.grok_UI_RenderCard(x); }
0
644771ddc16aed9fb70483817af9c096
bbc3e39dbfa99182c2906771d070fbad
Helper method for determing if we are viewing the snippet add/edit screen or not.
function Scholarships($scope, Global, $http, $modal, $timeout, $location, $routeParams, Scholarship) function isEditMode() { return !!$routeParams.StudentId; }
1
887106e08223cbb57fb61125e3ff1971
c96059bec3cfccce127183c4c5ff5fd5
Construct LeNet for MNIST (Binary Weight Network version).
C_k_p_s_1=[5, 0, 1], M_k_s_1=[2, 2], C_k_p_s_2=[5, 0, 1], M_k_s_2=[2, 2], p=[0.0, 0.0, 0.0, 0.0, 0.0]): super(LeNet5OneD, self).__init__() self.name = 'LetNet5OneD' self.conv1d_1 = nn.Conv1d(n_channels, mid_layer_channels, kerne...
0
d1399c7816bfefb82967dff423ab32fd
b37df72bf8d0a33ec61d7da704e59c0e
Returns a full path to a dependency file.
path_parts = dep_path.split(os.sep) env_var = path_parts[0] assert env_var.startswith(PC_DEPS_PREFIX) path_parts[0] = os.environ[env_var[len(PC_DEPS_PREFIX):]] result = os.sep.join(path_parts) assert path_exists(result) return result
1
6e8a7f729d598b843d4ce657243f3b0c
004268495956c33494ed6951edd8054f
GET/v1/account/balance查询指定账户余额
if !authentication(r) { w.WriteHeader(http.StatusUnauthorized) return } data, err := ioutil.ReadAll(r.Body) if err != nil { w.WriteHeader(http.StatusBadRequest) w.Write(makeErrorRespone(err.Error())) return } defer r.Body.Close() var request GetBalanceRequest if err = json.Unmarshal(data, &request); e...
1
1b96dc6c7a895ac99764244be6191d1f
d33c65784b3d2fca02a0e60d3c8b3dae
Called when a graphics device has been created
void CApp::onCreateDevice(D3DPRESENT_PARAMETERS * pParam) { }
1
70228895c5443fb355bd920f75a0cf22
e4aac3cc837d0d52cf7678c39774f2f4
获取当前审批人的领导人员信息,如果不存在上级领导或者领导的level大于请假规则的最大等级则返回null,否则返回leader信息
public ApacityEntity getleaderinfo(String sessionUserCode) { return (ApacityEntity)getSqlSession().selectOne(NAMESPACE + "getleaderinfo", sessionUserCode); }
0
a2bdb0b5565375853abad933da053443
435a48c0ac91236dce0c37cf9a436829
print current time and authors
def print_time(): print('task completed') print(datetime.now()) print()
0
49a31e55ae00d94da0b5bdd210e4241c
57186f0ad184da2ad3b7b24d17d085c0
Returns the current state of the wireless radio (eg if it's on or off)
otRadioState otPlatRadioGetState(otInstance *aInstance) { otPlatLog(OT_LOG_LEVEL_DEBG, 0, "otPlatRadioGetState %d", sState); return sState; }
1
74789531409a0fa5d146d2fbb91b9290
34c2b4e4eda841752fbd92eccaf03bef
The result should be total bought - total sold
def stockdifference(totalvalue, totalpaid): return totalvalue-totalpaid
0
2735d08a43236b729730a4151676b71a
edd7894cd6c7c1aaebf8da43b08ca518
Finds production credit is from
class SolrMarc extends \knav\RecordDriver\SolrDefault public function getProductionCredits() { return $this->getFieldArray('508'); }
1
8e68777a4036c4aff94cc22fbf1dfa3e
a818f82324c678807c3e2ee692ec32d4
Synchronously, have the conductor update the LVM configuration.
update_op = self._adapter.UpdateVolume(volume_ref, volume_config, update_mask) if async_: return update_op operation_ref = resources.REGISTRY.ParseRelativeName( update_op.name, collection=constants.OPERATIONS_COLLECTION) return self.WaitForOperati...
1
0eb83c59b562dc153da9017b387f5b51
ce27445739f78b87509b4c30d48a76d9
Png matches a Portable Network Graphics file.
buff, err := br.Peek(33) if err != nil { return err } if herr := png.CheckHeader(buff); herr != nil { return herr } return nil }
1
6d527c5f507a879b952cb17bedebd206
adf4f8f2850cdf82033e11e451557701
把JSONArray转成Model集合
{ JSONArray jsonArray = JSONArray.fromObject(data); List list = new ArrayList(jsonArray.size()); for (Iterator iter = jsonArray.iterator(); iter.hasNext(); ) { JSONObject jsonObject = (JSONObject)iter.next(); list.add(JSONObject.toBean(jsonObject, beanClass)); } return list; ...
1
1855242ad9f01fd018d84959b5a9e0d5
8684ef9840aea786e6c695e535e6e1a6
Implementation for calling interactor method for adding the product to cart on the basis of product variant option code.
namespace ShoppingCart.ViewModels.Detail [Preserve(AllMembers = true)] public class DetailPageViewModel : BaseViewModel private void VariantClicked(object obj) { }
0
e59d359e6780d27d862786b9a116eafa
01dad63d0a957e8465675412951b786d
识别十三段形态
if (seatData.holds.length == 13) { var standArr = [0, 8, 9, 17, 18, 26, 27, 28, 29, 30, 31, 32, 33]; var flag = false; for (var k in standArr) { flag = checkHuThirty(seatData, standArr[k]); if (flag) { seatData.tingMap[standArr[k]] = { ...
1
81f3c06aa7b496ddfbe59a61ef63e6b7
cd4f47ea394124471bc5b73256a835f6
Count the number of vertices of the surface.
public class EllipsoidGlyph public int countVertices() { return _nv; }
1
a75f19b686cebd18d4a95f53771a53dd
503f27e57dedb693b3ba4da2910f8422
Convert a C string into a Java String.
def j_string(loader: JvmClassLoader, python_str): interned_str = interned_strings.get(python_str) if interned_str: return interned_str chars = string_to_utf16(python_str) j_chars = Object(loader.load_class("[C"), chars) j_str = loader.load_class("java/lang/String").new_object() j_str.set...
0
89f7a45b197d9958ce33cc739fcb08d8
bbd3b1c29dc18530164e71a3f64998df
マウスカーソル下の文字をステータスバーに表示
status_bar = self.get_status_bar() if status_bar: position = self.textCursor().position() status_bar.set_line_number(self.get_current_row_number(), self.get_current_col_number(), self.textCursor().colum...
0
205daba2948e3cffa81bb9b40b98d84d
cf4b914c4b91ddad992e85c13ed83c32
returns True if the User Agent sent by the client matches one of the User Agent strings known for any of the platforms android, ipad or iphone
{ if (uagent.search(deviceIphone) > -1 || uagent.search(deviceIpod) > -1) return true; else return false; }
0
6f0a17c32519bc91277a951a7e0d4253
2894f4e07607130d8d5982a25a5f5bd9
设置类型(0抽水井,1回灌井,2复合井)
this.quartzType = quartzType; switch (quartzType) { case NORMAL: this.data = 0; break; case CHISELED: this.data = 1; break; case PILLAR_V: this.data = 2; break; ...
0
9f5c012283fb717ab78dae4493202e1e
dce9b193ae0038fc3637eaed140a0746
Run NumPy einsum job.
matrix_dim_two, precision): return jnp.einsum( "ij,jk,ni->nk", x, matrix_dim_two, matrix_dim_one, optimize=True, precision=precision)
0
40f0dc83c775321d5b0ddcf4ed7e4911
633d631fdc5a27b2071bcc3ebf75fc9f
Create array object from JSON string
{ return json_new(json_arr_v, (union json_u){ .arr = arr }); }
0
136917c37a46dee67a044ad91a161e6a
b5c17957e8cf03e7ad205a4fabe4ff2b
以文件输出流的方式向文件写入2进制数据字节
public class FileUtil public static void writeBinFile(final String filePath, byte[] data) { DataOutputStream dos = null; try { File file = new File(filePath); if (!file.exists()) { file.createNewFile(); } dos = new DataOutputStream(new Buff...
1
e0f51bc798260aa8ef77b1c8d539bca7
ba2cb2f6b493a39a00eac797cd841491
采用严格的判断方式,只有当能查到状态且状态为正常的时候才返回设备状态正常, 否则认为设备状态异常
public int check() throws Exception { int checkResult = EnbCheckConstants.NORMAL; if (EnbCheckConstants.NORMAL != connectionStatus) { return EnbCheckConstants.NOT_NORMAL; } if (null != boradsStatus) { for (BoardStatusModel boardStatusModel : boradsStatus) { if (EnbCheckConstants.NORMAL != boardStatus...
1
ab4ed2da2cea63c3ce4a058f74100d25
27ba9d4874a81f8a07e048731572b82e
线程池实现,优先级队列模拟百度网盘下载任务
while True: url = queue.get() logging.info('get queue url %s', url) if url is None: queue.task_done() break download_pics(url) queue.task_done() cqueue.get()
0
95e515880dc4d8a86f956fd51244c239
5a7f6931268092c2edd447692034fb8c
지도표시 옵션 처리.
public class MainActivity extends NMapActivity implements AppCompatCallback, NavigationView.OnNavigationItemSelectedListener @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); mAR.setVisibility(ImageView.INVISIBLE); mTextviewHtmlDocument.setVisibility(...
1
2000f6485aaf642631e9467e3ad5bb64
03aa0e87a39c54cb07d4da1251d4571a
Preso un albero-dizionario ne ritorna la radice
nodo *DizionarioSearch(nodo *a, char *k){ nodo *p = a; while( p != NULL ){ if ( strcmp(p->valore.k, k) == 0 ) return p; p = p->succ; } return NULL; }
0
8659e39af8654990781b522807d436a3
f80c9ddcc0955ead1cac5697a70d2b95
Проверка максимума из двух чисел, когда эти числа равны.
public class MaxTest @Test public void whenCompareThreeAndThreeThenThree() { int firstCompareNumber = 3; int secondCompareNumber = 3; Max maxim = new Max(); int result = maxim.max(firstCompareNumber, secondCompareNumber); int expected = firstCompareNumber; assertThat(result, is(expected)); }
1
368107c137c539f2bafc157f3de0e398
a7089c1f6276d8ff1cc15683ab1dc0a5
Subscribe route not matched event.
public function routeToNotFound(ParsedUrl $parsedUrl): void;
0
7b137e0171dcfccbb34f38f341acd3db
b380755b685a72856f918c153da4d052
Imprime a Informação da Pattern corrente
{ Console.WriteLine(Lang.Tools.XorImageRes.Info); Console.WriteLine(Lang.Tools.XorImageRes.Info_Pattern, binPattern != null ? BitConverter.ToString(ptnAry).Replace("-", "") : pattern); Console.WriteLine(Lang.Tools.XorImageRes.Info_Hex, ishex.ToString()); Console.WriteLine(Lang.Tools.Xo...
1
7e4e56d460cdf837ba3aea5f02da9360
8cb14a60e164bc59ef34addb7fe77b34
Search Bank accounts by first name of holder.This function searches for holder's accounts. It returns list of matching accounts (empty list in case none are found).
public BankBook[] searchAccountByName(String ownerName);
1
e535aea7842d2e4e54b34979f459a571
dad3b92d58c4d98f88c474c4aa8623b8
店舗基本情報更新確認DAOを設定します。
public class AspUpdateCommitInServiceBean public void setShopKanriUpdDt(String shopKanriUpdDt) { this.shopKanriUpdDt = shopKanriUpdDt; }
0
9bd8fae7fa90dfe91f39188196dfcae9
0cb788dc6bcdd00e4ce024a21c426a0e
Informs the Map about the nodes that are blocked for pathfinding.
for x in range(self.map_state.cells_square): for y in range(self.map_state.cells_square): if ((x == 0) or (x == (self.map_state.cells_square - 1)) or (y == 0) or (y == (self.map_state.cells_square - 1))): self.nodes[x][y].occupied = True ...
1
7f5406abe3e421eef3cae6a29a55ec3e
c07af0c99df67295758a195c97430c67
Finish recording DBClass log
if (self::$mbWriteLog){ $aBuf = array(); foreach ($this->moDBL->getSqlLog() as $aNode) $aBuf[] = implode('', array(date('H:i:s'), "\t", $aNode['time'], "\t", $aNode['sql'])); if (count($aBuf) > 0) $this->setSaveLogData($aBuf); unset($aBuf); } if (!is_null($this->moDBL)) unset($this->moDBL...
1
8054fafe537a16d1eb41e953ad530580
a0f3f33c0cd3120180eef86a7cc4df42
更新抽奖用户对象
class Activity_Service_Lotteryuser extends Common_Service_Base public static function updateUser($data, $id) { if (!is_array($data)) return false; $data = self::_cookData($data); return self::_getDao()->update($data, intval($id)); }
1
751077d45f6238d8f7eb29d406f487bd
a722cac5ba0123aabc72a799b9e97380
将连续的id切分,避免单次分配过多的任务(id)
class ZhiXingSpider(object): def idQueue(start_id, goal, step=2500): end_id = start_id + goal while start_id < end_id: if start_id+step < end_id: yield range(start_id, start_id+step) else: yield range(start_id, end_id+1) start_id += ste...
1
f19367e9877074f34dd37df102173bd9
717fc92b4e021cfb3edcae52de71e6cf
判断s是否为目录
int checkDirectory(String s) { DIR *dir = opendir(s); if (dir) { closedir(dir); return 1; } else if (ENOENT == errno) { return 0; } else { return -1; } }
1
6fb259a241882dcc50da8ee51f13dccd
e5b59c656c51aae10fa79ca0f0115ff2
Fetch any media URLs from the incoming message. Optionally filter based on mime type.
function findMediaUris (data: any, uris: Set<string>): void { if (Array.isArray(data)) { for (let i = 0; i < data.length; i++) { findMediaUris(data[i], uris) } } else if (typeof data === 'object') { for (const prop in data) { findMediaUris(data[prop], uris) } } else if (typeof data ===...
0
351c049b2f9e56b527e46d27f772d760
3d51c6b07e1166e411c5c00323492cb9
Méthode lancée suite au clic du bouton "parcourir". Lance l'explorateur de fichiers Java.
public class About_ActionListener implements ActionListener{ public void actionPerformed(ActionEvent e){ if (Desktop.isDesktopSupported()) { try { Desktop.getDesktop().browse(uri); } catch (IOException ex) { } } else { } }
0
3af9b1fd1497d54c8146a22317a5618b
a99983b050d52850bebbba04fa258610
! \brief Initialize the timer when card detection starts.
{ csi_error_t ret; ret = csi_timer_init(&timer_hd, timer_idx); if (ret != CSI_OK) { return -1; } ret = csi_timer_attach_callback(&timer_hd, ttimer_callback, (void *)&cell_count); if (ret != CSI_OK) { return -1; } cell_count = 0; ret = csi_timer_start(&timer_hd, time_c...
1
19e5457151ed69c05d71b4b0046a8619
9db678a666b40b5f75dfaceace50d189
Gets the list of polygons formed by the polygonization.
class Scene public java.util.List<Polygon> getPolygons() { return Collections.unmodifiableList(polygons); }
1
9167c778561365984625bec2703cca33
aa92f4bdd6c317cdb07de6781a1b3ac9
Gets the range of IP's to scan on the default network interface.
class IPRange public function getIpRange() { return $this->ipRange; }
0
670eaa7eda423a2f2fd6d0138d108aa8
2348a841791adb9e853d378c4d2b89c6
Loads a .mtl file to a material array
public class ObjMesh extends Mesh private void loadMtl(String path, HashMap<String, Material> materials) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(MainApplication.getInstance().getAssets().open(path))); String line; Material curMaterial = null; ...
1
ad64591dfb74bd8913dd5079d1a725d9
47c831891b29423d3066e44ef96a0d2f
<para>Create a new HttpClient with reasonable defaults (which you can update).</para> <para></para>
{ Contract.CheckValue(clientFactory, nameof(clientFactory)); Contract.CheckValue(loggerFactory, nameof(loggerFactory)); return CreateCore( clientFactory, new HttpCommunicationClientOptions(), new DelegatingHandler[] ...
1
eb07ed980cb293bb8d00787e5e9551c2
4f31c2fd60120658f8ed5953934f3eaf
Create an instance of {@link GetSumOfOrderAmountResponse }
@XmlRegistry public class ObjectFactory public GetSettCrmOrdersResponse createGetSettCrmOrdersResponse() { return new GetSettCrmOrdersResponse(); }
0
588b49d682241c1be2d1f30fcf9307a4
6e39e01f95046e862afd258341f71006
用标注出来的关系丰富stop_words,这些词在识别三元组实体的时候过滤掉
class IRTermCount(object): def __remove_stop_words(cls, bags): import nltk res = {} for word in bags.keys(): if word.__len__() < 3 or \ word in cls.__get_stopword_set(): continue else: res[word] = bags[word] return ...
0
064ec766694ee91c38d444c7e328623d
1e8ecc55948da3b5ff8d479234eb2791
Fix IE Issues
function fixIESelectBug() { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { $('div.login-container div.login-box div.login-content div.login-form-row select.form-control').css('background-image', 'none'); }; return fal...
1
4eb24baca213b2d96b58b6fe52ab51ba
fa7bb05ab975be8aded63db60e312593
Reaction on chart data changes, hides current chart data and then shows new chart data
function optionChanged(newYear) { buildCharts(newYear); }
0
134d17a7e8d9b96573c6a773315bb203
470e6b739886217c367c87d29cb48d24
打孔
{ GameObject b = (GameObject) Instantiate( bulletHole, point + normal * 0.005f, Quaternion.identity ); b.transform.forward = normal; b.transform.Rotate(0, 0, Random.Range(0, 360)); b.transform.SetParent(hitObj); Destroy(b, 10); }
1
2f306a55d94ae6a644c1635f852e7bf1
0103eb61775645e78cea021349803ee1
https://gist.github.com/pypt/94d747fe5180851196eb
def print_progress(cur, tot, fill="=", close=["[", "]"], length=20, opt=None, sep=" - ", add_newline=False, notebook=False): ratio = cur / tot perc = int(length * ratio) char_size = len(str(tot)) if opt is not None: opt = sep + sep.join(opt) else: opt = "" end = '\r' if notebook ...
1
404a75238f884e97f50fbeb52c010f57
8ea826a0a4af1d5595aea45c00f832d5
updates the rows from the current store and data_filter state
export class VariablesBodyGrid extends Panel protected onUpdateRequest(msg: Message): void { if (this._grid) { const { dataModel } = this._grid; dataModel.filter = this._filter; dataModel.scope = this._scope; dataModel.setData(this.model.scopes ?? []); } super.onUpdateRequest(msg); ...
1
589f4433391004c1b1bce1aeb7a111b6
ba83043df68f6acd41a63679be4d4ca5
查询每月的用户量
public List<UserVo> selectMonth();
1
442eb351362e7f42828e1ed1f6e6a893
8f8cd307ed8707350ad22e250ba1a997
Test method for ensure output results in Json format.
class StructureTest extends AbstractBaseTestCase public function testJsonSerialize() { $this->assertJsonStringEqualsJsonString(json_encode($this->getTestData()), (string) $this->instance); }
1
9950534d0825369bb272e7a0950d5eca
0a633fb5ada435a245d06793da24c3fa
用户新增产品时,添加分省发送
String isSaleNationwide,List<Long> provCodes,Long operId){ prodTargetAreaAtomSV.discardForProduct(tenantId,prodId,operId); if (ProductConstants.Product.IsSaleNationwide.YES.equals(isSaleNationwide)){ return; } for (Long provCode:provCodes){ ...
1
c3d809dcf4a09f325f17c4b6c0d92938
75981d8b7f19bd206a80359335257c58
dbApplyForTeam() - allow user with the given UID to apply for the team with the given TID. Note that this function does NOT deal with the associated notification!
namespace NIM.Team public class TeamAPI public static void AgreeJoinTeamApplication(string tid, string uid, TeamChangedNotificationDelegate action) { var ptr = NimUtility.DelegateConverter.ConvertToIntPtr(action); TeamNativeMethods.nim_team_pass_join_apply_async(tid, uid, null, _team...
0
3ac8317e80e57755f2ae8dfd088818af
acaaee137e7018a711a14d087c1d8a00
@brief RTCC Interrupt handler, triggered on RTC channel 0 compare match. Toggles the EXTCOMIN pin 60 times per second, and transfers a frame 2 times per second.
void EXTIT0_IRQHandler(void) { }
0
9660048a4762e51a43f5e62838a9ad38
4048467f8f2abce4962772cc739917c4
Gets the value of the inputBranchAdvanceExpense property. possible object is {@link String }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Assignment", propOrder = { "actionCode", "assignmentId", "effectiveStartDate", "effectiveEndDate", "effectiveSequence", "effectiveLatestChange", "assignmentType", "objectVersionNumber", "assignmentName", "assignmentNumber", ...
0
0560232f811ac8cea2dae511d40b7125
20182e0d77e2882f38b82c7e279d580b
# normalized FFT-spectrum
normSpectrum <- function(A) { s <- (as.numeric(eigen(A, only.values=TRUE, symmetric=TRUE)$values)/ sqrt(nrow(A))) s <- s[-1] return(s) }
0
8d8f2e30251ebc7e0efcf01e94be2513
66dcae4104d70eb591aef264550f0703
从缓存取得(已启用)皮肤信息列表
namespace Applications.Services.Impl.Security public class SystemService : ISystemService{ public List<Item> GetSkins() { return SiteManager.GetSkins(); }
0
db5ccd7c3aa6d580d27c702a8f700414
be853680e83edd4553f8481eda42cc70
AJAX required decorator. Source: http://djangosnippets.org/snippets/771/
def ajax_required(f): def wrap(request, *args, **kwargs): if not request.is_ajax(): from django.http import HttpResponseBadRequest return HttpResponseBadRequest() return f(request, *args, **kwargs) wrap.__doc__ = f.__doc__ wrap.__name__ = f.__name__ return wrap
1
11e438713b10bde3893389d259984226
9b52c344c7a2a01c5f83dcc029ddddec
Output: *int
var s string t.Log("*" + s + "*") t.Log(len(s)) }
0
cf7050407315d86a88968840479bc5e2
a97b9c1af1a732f1c8d63ff91c66fe63
chỉ cho nhập số vào ô giá
namespace UI_QLTV public partial class SachWindow : Window private void TxtGiaTien_PreviewTextInput(object sender, TextCompositionEventArgs e) { Regex regex = new Regex("[^0-9]+"); e.Handled = regex.IsMatch(e.Text); }
1
70a1ffb438fc08ea518899ce0a159c7e
3ebb28f34de0b424193a56eab7ad7bf7
Splits job into multiple jobs if it contains multiple images or env var sets
class AIMiddleware(): def _get_inference_job_signature(self, imageIDs, maxNumWorkers=-1): if maxNumWorkers != 1: num_available = self._get_num_available_workers() if maxNumWorkers == -1: maxNumWorkers = num_available else: maxNumWorkers = mi...
1
0c441e7af61aa08950efcf084e4048dd
456442f433af7a314fc08146023a23fd
URL that links to the New Lesson iFrame
def challenge_url(): return 'https://class.coursera.org/nlp/assignment/challenge'
0
fb6c41a3a7ac49600d258cd4f15bd19b
5f2b2c3efe305633b909e2a1f95a24a2
пересчет вероятности выпадения в зависимости от веса события ( математическая пропорция)
sumProba = 0 for particle in self.particles: sumProba += particle.p if sumProba != 0: for particle in self.particles: particle.p /= sumProba
1
cd55f33fb9ddde5582eb50fab32cbe68
45643d2bc8665c9b233370cd2b846693
현재 스크린 번역기가 실행될 가치가 있는지 확인합니다.
namespace FantomLib public static class AndroidPlugin public static bool IsSupportedSpeechRecognizer() { using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) { using (AndroidJavaObject context = unityPlayer.GetStatic<AndroidJav...
0
3a65b97a22ff9915133ea9754a2bb83c
6d96fdd84942cc02199752af6540e2c7
Возвращает список категорий новостей, пытаясь получить их от сервера, либо восстановить из локального файла.
namespace ContosoElectronics.DataSource class CategoryDataSource private async Task ReadXmlDataFromLocalStorageAsync() { try { if (_categoryDataSource.AllCategories != null) return; var dataFolder = await Package.Current.InstalledLo...
0
7f53f91aca53dde684eb8abfd99d30a3
6f5d3c73f9ee510daabcfd7f85f1381f
Funcao responsavel por matar os filhos que estao a executar, uma vez recebido a instrucao para paragem forçada
int flag=1; while(flag) { int size=jobs.size(); for(int i=0; i<size;i++) { int status; if((waitpid(jobs[i].getPID(),&status,WNOHANG)>0)&&(flag!=2)) { flag=2; jobs.erase(jobs.begin()+i); } } if(flag==2) {flag=1;} else if(flag==1)...
0
a5a1a9c62995a30215c150c30a3dcd09
19e9ae79398efec10df97780ce6be9f9
Removes a vertex to the graph. If the vertex is not in graph, does nothing.
public class Graph implements GraphADT public void removeVertex(String vertex) { if (vertex == null) { return; } if (isVertexInGraph(vertex) == false) { return; } Graphnode<String> vertexNodeToRemove = findVertexNode(vertex); List<Graphnode<String>> inEdgesListOfNodeToRemove = ...
1
6d48296e264e1fa28bb8109ba8dd3c1f
83b6569eb9b3da88e829cf0a0a9e8447
Carrega a grid que mostra os Professores.
namespace ProjectTeam09 public partial class AdminAddUser : Form private void InitializeProfessorGridView() { if (context.Professors != null) { context.Professors.Load(); dataGridViewProfessors.DataSource = context.Professors.Local.ToBindingList(); ...
1
9391788e3bcd2ad14d7fc3088dec6197
61ad5ed8d85baf3f516b555c2ba2ca4d
Midpoint circle algorithm, a.k.a. Bresenham's circle algorithm. Implementation adapted from code in Wikipedia, http://en.wikipedia.org/wiki/Midpoint_circle_algorithm on 2008-06-16.
{ ThrowIfCoordNotValid(x_center + x_radius, y_center); ThrowIfCoordNotValid(x_center - x_radius, y_center); ThrowIfCoordNotValid(x_center, y_center + y_radius); ThrowIfCoordNotValid(x_center, y_center - y_radius); int a = 2 * x_radius; int ...
1
cd2aa00cbc8a2e24d67f75b6515a7135
ff775df23e41f757d1a3cece167201ae
通过经纪人broker_id获取所在城市信息
class Broker_info_base_model extends MY_Model public function get_by_agency_id($agency_id) { if ($this->_select_fields) { $this->dbback_city->select($this->_select_fields); } if (is_array($agency_id)) { $this->dbback_city->where_in('agency_id', $agency_id); } else if (intval($agency_id) > ...
0
b704650a87c0a329de3a6ecd443e986c
d41b9af6d4d952a6b5d848077c05dcdc
POST: /TimeTableEntry/Create
namespace MVCApp.Controllers public class TemplateController : Controller [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> Create([Bind("Id,Name,Grade")] TemplateEntity entity) { if (ModelState.IsValid) { _context.Add(entity); ...
0
db108331c0e7e491dbc7e64c8db57048
44d38f7cf4ffc65e8d020903420acd12
Método que grava a instância actual do jogo
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); Date date = new Date(); String filename = "Sokoban" + dateFormat.format(date) + ".ser"; try { FileOutputStream fs = new FileOutputStream(filename); ObjectOutputStream os = new ObjectOutputStream(...
1