query_id
string
corpus_id
string
query
string
code
string
label
int64
f5f26876549329532d575d424e98539a
1e20098d85aedb6fe28bc7b47eec72a8
从美元金额转换为本地货币金额
public double convertFromDollar(CurrencyEnum to, double amount) throws Exception;
1
ac3844f9aee2ac91fda1afd7394f7d98
21af29f95148640aa7f9f5966405d496
Tests when the video ID is found.
class TestChannelVideoController(TestCase): def test_retrieve_video_by_id(self, mock_get_video): video_id = 1234 mock_get_video.return_value = Mock() retrieve_single_video(video_id) mock_get_video.assert_called_once_with(id=video_id)
1
8736ed7a83ecddeb2a6108a1320d1f56
b8ad831c3c9ac85f1d78eae625b79ead
根据特殊疾病id获取指导意见信息
namespace NewAsiaOASystem.IDao IList<IQC_JYDjyconinfoView> GetJYDjyconinfobyjydId(string jydId);
1
3a8ceefe8025252b148fd5cde74b399e
51cd475c7ef65a243aa283fe79025ee2
Получение файлов из архива
$arResult = []; if(!empty($arIDS)){ $strIDS = implode(', ', $arIDS); $res = CFile::GetList(['ID'=>'ASC'],['@ID' => $strIDS]); while($arRes = $res->fetch()){ $arResult[$arRes['ID']] = $arRes; } } return $arResult; }
0
8c8654fa9ab1137bb116284d52e2eaa4
02b57bfd76e37c63ba809b44c3ce0028
Save the draft of the comment to be the new comment message. This will take the comment out of "edit mode" with the new content.
export class SingleOfferComponent implements OnInit draftComment(id) { this.commentForm.reset(); this.newComment = []; this.newComment.push(id); }
0
761481a508ecf89e85a3c46f57c9d2dd
7f61448ad6da3ef0f9cb03f40c5be655
=================== Getter and Setters ===================
cases like (1)
0
94c7cb1b8b85b16b90ebdbf58b73a292
d38cbb484d95a893c6ba60c032e404c0
新增保存供应链
public class BHSupplyServlet extends HttpServlet{ private void saveSup(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String id = req.getParameter("id"); HttpSession session = req.getSession(); PrintWriter out = resp.getWriter(); Object obj = session.getAttribute("c...
1
db634e7e5a066b21fa1905a41fd95901
668f622fe99d56e1728d270439116165
getter for the control DO terms
class StudentT: def getDOF(self): return self.dof
0
101342c45055fe00b1f8ad608c5d2023
b710f79ae2de9a753f32335b9a05ecf2
Switch the currently playing song
var audio; if (!newMusic || newMusic === currentMusic) { return; } if (currentMusic && currentMusic !== hackOptions.silenceId) { audio = getAudio(currentMusic); audio.pause(); if (!hackOptions.resume) { audio.currentTime = 0.0; } } currentMusic = newMusic; if (newMusic === hackOptions.silenceId) { ...
1
80e227eee06b7a3b0d6db67fe0914efb
8f6d5c827ecafb83b218f906693985bd
СПИСОК АДМИНОВ КОТОРЫЕ НЕ ЯВЛЯЮТСЯ ОТВЕТСТВЕННЫМ ЗА ОТКРЫТИЕ ВЫБРАННОГО МАГАЗИНА
namespace Bars.Gkh.DomainService IDataResult ListExceptDirectManag(BaseParams baseParams);
1
7197150ecde54ab6fcc9839d71d4bf99
0082dc28fb39b8981d7c60a6897e2320
Verifies that the contents of one file is equal to the contents of another file (canonicalizing).
class VerifyString extends Verify public function notEqualsFileCanonicalizing(string $expectedFile, string $message = ''): self { Assert::assertStringNotEqualsFileCanonicalizing($expectedFile, $this->actual, $message); return $this; }
0
6e6b8238f43595d90c3858da8a051380
61bef55ca2e481ea51604fe1c68960ff
knowledgeの更新をslackに通知
if Transaction.sum(:tyc) != TYC_DISTRIBUTION_AMOUNT message = <<"MESSAGE" 研究室の皆様 TYC管理秘書のF.R.I.D.A.Yです。 TYCの流通量に変動があったことをお知らせ致します。 以上です。 MESSAGE slack_notifier = Slack::Notifier.new(ENV['SLACK_WEBHOOK_URL']) slack_notifier.ping(message) end end
0
dfee8e294dfbd314d8130f45c97a5847
2a0f16f77e6b979ad5f323fe03d2080d
Initialize variables or game states before the game starts (only called once)
namespace BeamMeUp public class Game1 : Microsoft.Xna.Framework.Game protected override void Initialize() { oldKB = Keyboard.GetState(); starTrekRect = new Rectangle(450, 50, 330, 400); delay = 180; delayTrue = false; base.Initialize(); }
1
7d54081332a6160cc5129ab7a20e7cc4
28fe426ae42af0450f06b31cbba91efb
Returns {@code this} if this is a left, otherwise returns the result of calling the given function with the right value. <p> This is otherwise known as monadic bind, >>=, andThen etc.
@NotNull default Function1<T2, R> bind1(T1 argument1) { return argument2 -> apply(argument1, argument2); }
0
e5ca5d0abe8e516c55f004d83a54a150
9d9ff490a2eb590c519ff5e85a2248c1
绑定当前用户、当前角色分类下用户还没有的角色
{ $appId = $this->getAppId(); $roleList = null; if ( ! empty($this->_uid)) { $roleList = RoleModel::find([ 'conditions' => 'assignPolicy=:ap: and appId=:aid:', 'bind'=>['ap'=>Acc::ASSIGN_LOGINED,'aid'=>$appId] ])->toArray(); ...
1
a4292d487f8ce0edb2cf60133e92769c
09f426bfd8ada8b628b85775b9553652
Accept a parameter to decide visibility based on the global DEBUG flag
int checkDebug (int argc, char * argv[]) { if (argc == 1) return 0; else if (strcmp(argv[1],"-d") == 0) return 1; return 0; }
0
a2407d1555a68724bc382fd05491c904
251900b7575431fbbe3942f6b8bb3413
Get locale specific time based on whether we are in test mode
const testTimeString = testTime.toLocaleTimeString(locale); const amOrPmRegExp = /[^\d\u0660-\u0669]/; const matches = testTimeString.match(new RegExp(`${amOrPmRegExp.source}+$`, 'g')) || testTimeString.match(new RegExp(`^${amOrPmRegExp.source}+`, 'g')); return matches && matches[0].trim(); }
0
33b85c3a5789b50e82ab73db040e1b76
782f940d1716ee28df74f614de5a0e05
Gets the k combs without repetition.
for (int d = 0; d < MAX_D; d++) { double denominator = IntStream.range(0, d - 1).mapToDouble(i -> combinations(n - 1, i)).sum(); if (Math.pow(2, n - k) <= denominator) { return d - 1; } } return -1; }
0
05f2e4f9bbc1286d253d9410e321226d
5e84152ed619e62857557d8a6d6f1d0e
Konstruktor wstawiajacy wektory z argumentow do wierszy macierzy
Matrix3D :: Matrix3D(double nums2DArray[SIZE_OF_VECTOR][SIZE_OF_VECTOR]) : Matrix3D(Vector3D(nums2DArray[FIRST_ROW]), Vector3D(nums2DArray[SECOND_ROW]), Vector3D(nums2DArray[THIRD_ROW])) { }
1
63adc5f685b7bd6e819653d992d5a029
f5a2dd58fef8e7e580cc7880ba47ef64
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % ...
EIF_REFERENCE F1299_15130 (EIF_REFERENCE Current, EIF_INTEGER_32 arg1, EIF_INTEGER_32 arg2) { GTCX EIF_POINTER tp1; EIF_REFERENCE Result = ((EIF_REFERENCE) 0); RTLD; RTLI(2); RTLR(0,Current); RTLR(1,Result); RTLIU(2); RTGC; Result = RTLNS(eif_new_type(1323, 0x01).id, 1323, _OBJSIZ_0_2_0_3_0_1_0_0_); tp1 = *(...
1
21cf2616658ba1b09661d883a75e06c1
df3199d770f3a906bb756793d07e2f3f
הבאת כל התגבורים שהתלמיד שהגיש בקשה משתתף בהם, באותו תאריך של התגבור המבוקש
public ActionResult Attending() { var userId = User.Identity.GetUserId(); var courses = _dbContext.Attendances .Where(a => a.AttendeeId == userId) .Select(a => a.Course) .Include(l => l.Lecturer) .Include(l => l.Cate...
0
86858082815023c92333b99b444a18b2
abc5dda69e2ef2fafa3b9fa0d96f4f3b
Metodo que une elementos de una lista en un solo string separados por guion bajo.
if lista_1 or lista_2: return '/'.join(sorted(list(set(lista_1 + lista_2)))) else: return '-'
0
cfa25d980314c3d03f9c592e4927c3d1
39b58e4bad3fc2719f707858f4b6db31
when you click on the block the news opens
namespace vp_lab_8 public partial class Main : Form private void listBox_DoubleClick(object sender, EventArgs e) { (new NewsDescription(news[((ListBox)sender).SelectedIndex])).Show(); }
1
d4c9ce9b291136eafa94ab1184b89587
7a89593f5dfd7fdc2c55ccde1ba9f2c0
Gets this message composer's associated context mapper.
if (m_mapper == null) { initialize(); } return m_mapper; }
1
f186e190c8d2f8f477e9f18a8306cdaa
e57f7fe0e6be3d185eb76aa2ffc9a0bd
Sets the columns and objects in the ObjectListView
public void setItems(List<Column> columnList, ObservableList<ObservableList> list) { if (!loaded) { loaded = true; } else { return; } if (list.size() <= 0) { setPlaceHolderNoResults(); return; } TableColumn<ObservableLis...
1
39fc83a35b994cf086f823b4b0a64ef5
21f33125018712f93c6f6180d704966f
读取器件ID (M7-M0) 生产厂商 MSB (ID15-ID8) 存储器类型 | (ID7-ID0) 容量 LSB
u8_t FPH_ReadID(NAND_DEVICE_t *pstNandDev) { u8_t ch; u8_t ce; u16_t rbuf[6]; if (( !pstNandDev ) || ( !pstNandDev->rbuf )) { return FALSE; } ch = pstNandDev->ch; ce = pstNandDev->ce; REG32(FPH_CH0_REMAP) = ch; REG32(PIO_SETUP) = 0xA; REG32(PIO_CE) = 1 << ce; REG32(PIO_CMD) = 0x90; REG32(PIO_ADDR) ...
1
8ac307b889bc692ce7717807352b6352
e42f409c1b60c7c29faba8a21d114233
Interrupt service routine called when button is pressed
void button_ISR() { ledState = !ledState; digitalWrite(LED_PIN, ledState); }
1
449e90f5a465f14b5db5977da8def307
8656c1d5d84f72bf8bd40bcddd654ff3
remove anything between < and >
def ExtractContent(string): return re.sub(r'<.+?>','',string)
1
d5afcf9b67eaa1558960b3c29b955692
153534061ad5593c8bf567d45f846f61
Number of times you expect to deduct this item from a payroll.
{ if (!is_null($deducts_quota) && !(is_int($deducts_quota) || ctype_digit($deducts_quota))) { throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($deducts_quota, true), gettype($deducts_quota)), __LINE__); } $this-...
1
a6dd2446aa343aae53c85aeb7879eff4
da2f6fb4ecaff9601193c78eed930666
Gets the total of this FBMemoryUsageGPU.
ft_uint32_t Ft_Esd_GpuAlloc_GetTotal(Ft_Esd_GpuAlloc *ga) { return RAM_G_SIZE; }
1
bfd67a8a03fc0e17ff29d5cc5e951df5
b7fcbf9f20fad320d1dc674eadd7de43
attach the link to the remote router, which is identified by the given simulated ip; to establish the connection via socket, you need to identify the process IP and process Port; additionally, weight is the cost to transmitting data through the link <p/>
public class WebGraphMemory private Double addLink(String fromLink, String toLink, Double weight) { Integer fromId = addLink(fromLink); Integer toId = addLink(toLink); return addLink(fromId, toId, weight); }
0
1d7cc3731a9037a3b2545c06fdfe1db5
4339806a291f15799a663a24edecdbd7
Executes the specified stored procedure with the provided arguments and returns the resulting raw rows.
{ var db = GetDatabase(); using (var reader = db.ExecuteReader(storedProcedureName, parameterValues)) { return reader.Read(mapper).ToArray(); } }
1
80ca2f4bd6530db1b0a756c67c84f10c
e2cc821c9ced9565a6d87a114c04cca4
同步运行(添加了超时机制)
public class Dispatcher public static void startTaskSync(Runnable runnable) { boolean isRunning = false; while (!isRunning) { if (get() < currentThreadCnt) { fixedThreadPool.execute(runnable); increase(); isRunning = true; } else { ...
0
f38f8d0c5d54a47912b66f1847971e4f
01ed047cfb4e6cbfdf06789e2cd7af37
Translates a given remote linq expression into a lambda expression.
{ var s = _predicate.Parameters[0]; var t = Expression.Parameter(typeof(TTranslatedSource), s.Name); var binder = new ReplaceExpressionVisitor(s, t); return Expression.Lambda<Func<TTranslatedSource, bool>>( binder.Visit(_pre...
1
86658ebcbe7208d10fd8b3c0aa02d0e4
7a1abd38844afe7ab39317fefcf727a3
Set the number of retries when requesting the SNMP Agent
public final class GetSNMP public final GetSNMP setSnmpRetries(final String snmpRetries) { properties.put(SNMP_RETRIES_PROPERTY, snmpRetries); return this; }
1
117cf9205471ddcea05863bbff8f0896
10f9e32873d05a6513e420fc8f97c538
人気のある投稿リスト取得
@RequiredArgsConstructor @Controller public class PostController @GetMapping("/post/popular") public String popular() { return "post/popular"; }
0
2ddcaf93db77f070f92d86a900ca06b5
32eac9d909b03a3b1566986ba68d1fc6
让返回顶部固定在页面中间
function htmlScroll() { var top = document.body.scrollTop || document.documentElement.scrollTop; if (5 < top) { elFix.style.position = 'fixed'; elFix.style.top = 70; elFix.style.left = elFix.data_left; } else { elFix.style.position = 's...
0
df9f71e36c12e517cb0faa136d76212b
0034aba0d811f488d27d28608808a8b6
首先判断是否有存储
if(this->_storage != NULL && this->_storage->isConnected()){ return true; } if(this->_storage != NULL){ delete this->_storage; this->_storage = NULL; } this->_storage = new GroupStorage(); ServerConfig* serverConfig = Singleton<ServerConfig>::instance(); this->_storage->host = serverConfig->getStrValue("st...
1
b19eed4bd5628ac78e8b6ac493de8bfc
42a3e329a89973dd07fd0ee1a531c038
Execute an SQL statement and return the boolean result.
{ var cmd = connection.CreateCommand(); cmd.CommandText = query; return GetBoolean(cmd); }
1
a193372389b515231a9eb03a6734638f
d41537878ee364b2e2becf7e86b38658
获取最近验证过的n个券号.
public class UserWeiboJDBC implements DataBaseConstant public String[] getAccessToken(int nums) throws SQLException { String[] result = new String[nums]; String[] tokens = this.getAccessTokenone(nums); long time = System.currentTimeMillis() / 1000; int flag = 0; long expiresin = 0; for (int i = 0; i < token...
0
353617f5cf17257e842d85305b6846ac
1cdf085a097b00aa1e3bd3b9ccb07c75
Execute an FIO benchmark; sane defaults provided in lieu of configuration
def radostest(fs, obj_size=16 * MILLION, nobj=2500, clients=1, depth=1, copies=1, crtdlt=False): if crtdlt: tc = fs.create(depth=depth) td = fs.delete(depth=depth) print("\t\t create\t delete") print("\t\t%6d IOPS\t %6d IOPS" % (iops(tc), iops(td))) print...
1
818476537073ef7ebe802ea5bfe4dce9
f27ce1759a04a0b22e48c18dafd64d96
搜尋節點位置--搜尋NUM,存在則回傳NUM在節點中的位置,不存在則回傳0
{ for (int i = 0; i < Array.Length; i++) { if (Array[i] == queryNumber) { return i; } } return 0; }
1
e9062577dedc40918d8949514c0c8b1e
ebc7d0f200bdb4fa0ff3e8b8d422c259
以session ID为键,存储
def dump_session(sessionId, session): sessionData = json.dumps(session, ensure_ascii=False) RedisCache(app_config).set_data(sessionId, sessionData) RedisCache(app_config).get_connection().expire(sessionId, 60 * 24)
1
717b3378767d5013c85624b61bea63d5
1f762bc611c6701c011932be87f63e0d
Sets the ngay tra ket qua of this ho so chung thuc.
public class HoSoTTHCCongWrapper implements HoSoTTHCCong, ModelWrapper<HoSoTTHCCong> public java.util.Date getNgayHenTraKetQua() { return _hoSoTTHCCong.getNgayHenTraKetQua(); }
0
b788c7d4c1aa34977d900e9da3427f59
9365f8c05f4ff69ba10c4cf8a09ffd9e
Converts a datetime to a string in an unambiguious datetime format for SqlServer.
namespace Vega public static class Helper public static string ToSQLDateTime(this DateTime pDate) { return pDate.ToString("yyyy-MM-dd HH:mm:ss"); }
1
d2569215650bba270b54e6605ba18a2b
51eb3529d6f0682dc7b196ad1024e260
Checks we can add a recipe to the meal.
meal_data = json.dumps({"meal_id":1, "meal_name": "Rice", "price":200, "category":"dinner", "day":"none"}) response = self.tester.post('/api/v1/meals/', data=meal_data, headers=self.headers) self.assertEqual(response.status_code, 200) setup = self.tester.post('/api/v1/menu/', data=meal_d...
0
12a4fdba3d3a032d2e68768379a7a4d3
0187c2c6bd47a9841acdd4f43569ff09
執行批次可帶有參數或預存程序的SQL
@Singleton public class SqlFragment implements FragmentProcess public List<Object> batchRunFragment(Hints hint, List<Map<String, Object>> params, String fragmentString) throws Throwable { if (params == null || params.size() == 0) { return Collections.singletonList(this.runFragment(hint, Collections....
1
4dff633352703dd23866493baf11a8d4
73976e5e6d4f92feb1dcebb7db04cca4
Set the value for the Date input for this CreateAuthenticatedPost Choreo.
class MWSFinancesService_Model_ShipmentEvent extends MWSFinancesService_Model public function setPostedDate($value) { $this->_fields['PostedDate']['FieldValue'] = $value; return $this; }
0
7bb8fa5cbf97c5b83a094dec9cf960a7
779b3a512785ea977fdb5c3f3312ee64
creates a list of urls given a template and the subsitutions
local out = ' '..template..' ' for k, v in pairs(subs) do out = out:gsub('([<,> *&])'..k..'([<,> *&])', '%1'..v..'%2') end return out:sub(2, -2) end
0
ded469a1f4ea291f1ad626b09e4a413a
983913e355963aa7454a930465cc964e
Mark a user as positive.
export class VoteHandler async vote2positive(id: string) { return await this.positive_vote_list.add(id) }
1
7ce260f745d002c06b0fabc7804782c1
00494dc65797d99ee0dc5d710e451893
Возвращает логин пользователя по id блога
def get_login(id_user): try: sql = "SELECT Login FROM Auth WHERE User = '{}'".format(id_user) result = gs.SqlQuery(sql) except: logging.error(names.ERROR_EXECUTE_DATABASE) return None try: if len(result) == 0: return None except: return None ...
0
a8c329d4e91485dd8aa163ec51b72ba1
63adb69396ec36e4be1e9f686486b46a
Deletes keys from the S3 bucket that were used in the tests
def delete_s3_key(key): s3 = s3_resource() current_app.logger.warning("Deleting S3 key=%s" % key) bucket = current_app.config['UPLOAD_BUCKET'] s3.Object(bucket, key).delete()
1
aafc4eb8fb5ae180786ca948061b05a4
db07c5bbb3f1d7240b7c337ea5ca199c
UTF-8 to Unicode | UTF-8 转换为 Unicode
{ if ($unicode_str) { $unicode_str = explode('\u', $unicode_str); if (is_array($unicode_str) && count($unicode_str)) { $utf8_str = ''; foreach ($unicode_str as $key => $value) { if ($value) { $temp = ''; $code = intval(h...
0
c3839dba64184ef2fecdb5de16d71e7b
9d2b135322b89d02d85a8d4a31c75ead
read the rating file,each rating is converted into a tuple with keys are (userid, movieid), value is the rating
def read_ratings(): ratings = pd.read_csv("../data/ratings.csv") ratings_dict = {} for i in range(ratings.shape[0]): line = ratings.loc[i] if line.movieId in ratings_dict: ratings_dict[line.movieId][line.userId] = line.rating else: ratings_dict[line.movieId] =...
0
ca024386bd9a43fc84d85e422aaafd33
f8ca5b75d0b49fbc94e7a15801b11115
Use-case : Also Ranked Test case : Open any grid list that has system nodes that are also ranked on other lists http://www.ranker-stage.com/list/entourage-movie-alternative-titles/jacob-shelton
def test_ranked_walk(): dag = Dag().add_edge(1,3).add_edge(2,3).add_edge(4,2) for _ in simpledag.ranked_walk(dag): pass
0
67a84c9f4225eb0e100ee12d99c25355
6302a50c0313022547a5a846342a0f18
выбор таблицы по значению QComboBox
namespace DiplomProject public partial class Form2 : Form private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { Form1 form1 = new Form1(); Form1.con.Open(); da = new SqlDataAdapter("SELECT * FROM " + "[" + comboBox1.Text + "]", con); SqlCo...
1
da0e9f619554e2f9712a5b98bc6cda95
13a7696b126516e2e48ba97bb3c5c6be
Encodes a line via quoted-printable encoding.
QuotedPrintableOutputStream qpOut = new QuotedPrintableOutputStream(out, true); ContentUtil.copy(in, qpOut); qpOut.close(); }
1
e9bafd5d58b9afbe674e0feec8dfbff3
f4701f94e36bbd58a9fc5d795958cba6
通用处理DML语句,附带错误检测回滚操作
try: cursor.execute(sql) except Exception as e: self.err_signal.emit('DateBase Error:' + str(e)) db.rollback()
1
d4ef6449779c369218fa393820fc8c33
b9979e89f7fc1e3244fcf2efe94e48f5
Extract embeddings from the embedding file corresponding to the passed train vocabulary 'train_vocab' and some more. If |train_vocab| > |select_size| then pick |train_vocab| - |select_size| most frequent elements (in the corpus on which embeddings were trained) as well.
assert args.emb_file and args.min_freq fields = cnn_utils.get_fields() train_utils.build_vocab(args, fields, TTDataset(words, fields), []) vocab = fields['text'].vocab model, pre_fields = train_utils.load_cnn_model(args, cnn_file, fields) return model, pre_fields['text'].vocab.stoi
0
37ba655f024a3c0a5bb63752666bd0df
38cb1bbcaf71f63fe923a34c2b87cd7b
编辑文章页获取用户的标签和分类数据
public Object findArticleByIdForEdit(@RequestParam("id") Integer id) { Article article = articleMapper.selectById(id); String[] split = article.getArticleLabel().split(","); List<ArticleLabel> labelList = new ArrayList<>(); for (String s : split) { int i = Integer.parseIn...
1
08b5bb6ab5ec80af1831b411393194ff
644039b85ce400c9edfc3608121b20f8
Converts a legacy callable policy into a TabularPolicy. Recommendation - instead of using this to convert your policy for evaluation purposes, work directly with a `TabularPolicy` if possible. Second choice - work with a `Policy` class and call `to_tabular` as needed.
tf_env, tf_policy = get_env_and_policy( load_dir, env_name, alpha, tabular_obs=tabular_obs) return tf_policy
0
5413bc9e0741bfde1b92d2b2931c215e
7d34567da32035eee8db17dd0837b4d2
Allocate node and prepend it to the hash bucket.
hash_item *item_alloc(struct pagecache_engine *engine, const void *key, size_t nkey, int flags, rel_time_t exptime, int nbytes, const void *cookie) { hash_item *it; pthread_mutex_lock(&engine->cache_lock); it = do_item_alloc(engine, key, nkey, flags, exptime, nbyt...
0
64cca9b4bcca02d6c094c8cd7cd1627b
0ef26fc64609ed9bb8edaa42a307038b
The transpiler for the <see cref="StardewValley.Object.cutWeed(Farmer, GameLocation)"/> method.
{ if (who.itemToEat is CustomObject obj) { PackData.TextureAnimationFrame animationFrame = obj.Data.pack.GetTextureFrame(obj.Data.Texture); TexturedRect tex = obj.Data.pack.GetTexture(obj.Data.Texture, 16, 16); string textureName = obj.Data...
0
6bb7d2558aa45ae87b14ff0c8ab2b950
d7626a75a7455caf1338138a4683f5f9
Creates a new contract wallet asset
class Utils public static function newWallet($url, $label, $addresses) { return [ "url" => $url, "label" => $label, "addresses" => $addresses ]; }
0
e73472ab300350af3a8d16ba703449ea
d86cc77b61f6d00f9cab32c95795ecd3
@brief Return a pointer to context with the given transaction sequence number.
( glink_core_xport_ctx_type *xport_ctx, uint32 rcid ) { glink_channel_ctx_type *open_ch_ctx; for (open_ch_ctx = smem_list_first(&xport_ctx->open_list); open_ch_ctx; open_ch_ctx = smem_list_next(open_ch_ctx)) { if (open_ch_ctx->rcid == rcid) { return open_ch_ctx;...
0
032651c212221326b861c07146488ef4
a5d0085577eea2870d01280811b42eb5
以step步长, cacheKey的自增, 过期时间为expireTimeSeconds秒
{ if (false !== ($value = S($guid))) { if (NOW_TIME > S($guid . '_time') + $lazyTime) { S($guid, null); S($guid . '_time', null); return $value + $step; } else { S($guid, $value + $step, 0); return false;...
0
515dfc550a6c055cc334d5260e814024
696b5d56e5b2ea6faea21bf7286dc31f
PREDEFINE KEYWORD MACROS
#define op(id,str) keywords[str]=DataStruct::AST_TYPE::id; #define keyword(id,str,_) keywords[str]=DataStruct::AST_TYPE::id; #include "../include/keyword.inc" #undef op #undef keyword keywords["["]=DataStruct::AST_TYPE::LSQUARE_BRACKET; keywords["]"]=DataStruct::AST_TYPE::RSQUARE_BRACKET; keywords["("]=Data...
1
5851097c07b397f1801ffb5c817fe755
6f908844dfd27bb35d68716f97363c05
检测是不是我创建的课程,如果不是教师用户,就不用检测了
class CannotSeeOtherStudentsMixin(BaseUserPassesTestMixin): def test_func(self): course_id = self.kwargs.get('course') course = get_object_or_404(Course, pk=course_id) school = School.objects.filter(id=self.request.user.id, teached_courses__id__exact=cour...
0
b51096e9c5ffd83daea6e28e1c4f96ce
be6030f3a0d4e2ff3fb8cf426256437d
constructs data structure with all problem statements and their ids
def get_all_problems(): ps = [*COLL.find({}, {'_id': False})] return ps
0
c6e759eb89b52e583241e22eb47ced93
cebd37073d345bcf405065ff72a67dac
compute the gradient and temporal derivative of the input image pair
assert type(I1) in (np.ma.core.MaskedArray, np.ndarray), \ ("please provide an array") assert type(I2) in (np.ma.core.MaskedArray, np.ndarray), \ ("please provide an array") are_two_arrays_equal(I1, I2) kernel_t = np.array( [[1., 1., 1.], [1., 2., 1.], [1., 1., ...
1
65f98c52b1d3b6ef2a7ca119aa89442f
09b7179c2c916338d082f21dea05bc01
Divide a register with a constant.
fprintf(Outfile, "\tmovq\t%s,%%rax\n", reglist[r1]); fprintf(Outfile, "\tcqo\n"); fprintf(Outfile, "\tidivq\t%s\n", reglist[r2]); if (op == A_DIVIDE) fprintf(Outfile, "\tmovq\t%%rax,%s\n", reglist[r1]); else fprintf(Outfile, "\tmovq\t%%rdx,%s\n", reglist[r1]); cgfreereg(r2); return (r1); }
0
5668f5320873e314e001143e068daf25
e2c24324b8b7b65703c800d7517feccb
Draw Compressor ON/OFF
if action == 'on': action = 15 elif action == 'off': action = 18 else: raise RuntimeError('Invalid action for function compressedChar. Options are on and off') self.send(chr(action))
1
c71820e75c6fe6c421b2ea0a3f609212
201c0556e0df3bdf47d68295d5d541c2
Test that a read is not returned as overlapping a protein unless it meets the minimum number of required overlapping offsets.
instream = kevlar.open(data_file('var1.reads.augfastq'), 'r') graph = kevlar.ReadGraph() graph.load(kevlar.parse_augmented_fastx(instream)) graph.populate_edges(strict=True) assert len(graph.nodes()) == 10 r23name = 'read23f start=67,mutations=0' assert len(graph[r23name]) == 6 r35name =...
0
6dc3368a9bea5802b1e01e70ca4acbd9
02452382a4d4f2a7748727d14a3d25f6
输入一个块的索引,返回起始地址+索引*单位块大小,即该块的地址
int getBlockAddress(int wordAdd, int blockSize) { return wordAdd/blockSize; }
0
4342dc0614e5ef8dfaf21a2bb3bf8006
22cd1a31f86080a766f9d4461dedc7a5
Checks the filepath to ensure correct format.
if currentFilePath == '' or currentFilePath == None: msg = "Load or create a new file before compiling code" self.display_error(msg) return False return True
0
caa1fe3e2bb9964886307088187b84be
818236c409cc2c27c753495af9aa68c3
Get TestSecuritySubObjItem (FullDTO) by name
namespace SampleSystem.WebApiCore.Controllers.Main [Microsoft.AspNetCore.Mvc.ApiControllerAttribute()] [Microsoft.AspNetCore.Mvc.ApiVersionAttribute("1.0")] [Microsoft.AspNetCore.Mvc.RouteAttribute("api/v{version:apiVersion}/[controller]")] public partial class TestRootSecurityObjController : Framework...
0
4a644a24594d9c4a80d6151ac1fd7c20
b0f11776e727bdf8da341ac292aeb817
Get the total cost of a bus fare
distance_price = distance*2.70 duration_price = duration*0.50 final_price = distance_price + duration_price + drop_charge return float(final_price)
1
546a2eca1fdd570eaa568dcb176d308d
843a54f4b418b41537db66a7639a5538
Write current material variables to a JSON file
namespace tp_math_utils nlohmann::json MaterialSwapParameters::saveState() const { nlohmann::json j; j["albedoUse"] = tp_math_utils::vec3ToJSON (albedoUse ); j["albedoScale"] = tp_math_utils::vec3ToJSON (albedoScale); j["albedoBias"] = tp_math_utils::vec3ToJSON (albedoBias ); j["sssUse"] = tp_math_util...
1
23ca62ea94033ef15ee9b9ab2498a1ab
d852b4b7375a0e936e6a390debd87527
Searches for orders in the database if the search box is not empty, or shows all orders when it is
{ string order = ""; if (OrderSearchText.Text != "") { switch (OrderSearchType.SelectedIndex) { case 0: order = "SELECT id,username,date FROM orderform WHERE username LIKE CONCAT('%',@content,'%');"; break; ...
1
6180c1a9f4fc3c983e374569fb06b4ea
7b4fa637ef19b26a034b3db990e9774e
Recount result value after menu changes.
{ resultnum++; if (resultnum > lastresult.Count - 2) resultnum = lastresult.Count - 2; ChangeResult(resultnum); }
0
49526453388163a43f3f7acc51be6d1f
5be18a1df27d189b4e599a6e5995e914
Signal that this connection is no longer in use.
public class LinkPool public void closeConnection(MySQLConnection connection) throws SQLException{ connection.setUseNow(false); }
1
9f133adb3dc7b310531c38466d72d4ec
cf9882389da3965a63454ad017c20aed
Append a new paragraph to the end of the document.
class _Body(object): def add_paragraph(self): p = self._body.add_p() return Paragraph(p)
1
5e7913cde2dcc3d85af4917c1e7c05df
f2f3b72f9ba9f55038ea03f75d34f611
Get multiple agendas from the database.
@RestController @RequestMapping("api/agendas") public class AgendaRestController @GetMapping public List<Agenda> getAgendas() { return agendaService.findAll(); }
1
cb51fdb51f338788d79657840a0c9e81
cc5f8f62ab4615122b873fda48a273bb
Only letters, numbers and spaces
function Only_characterswithspace(f,evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 64 && charCode < 91 || charCode > 96 && charCode < 123 || charCode == 32 || charCode == 46) return true; return false; }
0
49df800e4474163cf522b53ff1b43363
b20df0f20147b7e168703c14531ca413
I.S Matriks merupakan matriks persegi.<br> F.S Menghasilkan matriks adjoin pada matriks ini.
{ mMatrix2D<T> matrix = new mMatrix2D<T>(capacity); for (int i = 0; i < capacity; i++) matrix[i, i] = this[i, i]; for (int i = 0; i < capacity; i++) for (int j = 0; j < i; j++) { matrix[i, j] = this[j, i]; ...
0
f56955b6f32f0bc75777316607feca5b
ad3a69354bb274a2c1d59270e9f57af8
Lista los archivos tipo "otros documentos" de un expediente
class ArchivoController extends Controller public function selectArchivo(Request $request) { $archivos = Archivo::select('id','viejo_num_expediente','nuevo_num_expediente','estado') ->orderBy('nuevo_num_expediente','desc')->get(); return['archivos'=>$archivos]; }
0
f11174dc1aeb53c9f4fe8830012d08e5
f4e2c4d84e4dcf4eae87850952aafe3f
! @brief thread to handle the incoming packets with packet acknowledgement
void * handle_ack(void * unused) { char fromAddr[100]; char recvBuf[1024]; struct sockaddr_in theirAddr; socklen_t theirAddrLen; int bytesRecvd, i, j; while(1) { theirAddrLen = sizeof(theirAddr); if((bytesRecvd = recvfrom(udp_socket, recvBuf, 1000, 0,(struct sockaddr*)&theirAddr,...
1
c02ecdfe4a1341538da2b906758824da
816fbaed694c87bcf157dfa0efe10046
Get Passenger credit card details
class ModelExtensionPaymentMundipagg extends Model public function getCreditCardInformation() { $sql = "SELECT * from `". DB_PREFIX ."mundipagg_payments` order by id DESC"; $query = $this->db->query($sql); $brands = $query->rows; $brandImages = $this->getCreditCardBrands(); f...
0
1172b254780eb7198708ed4584fd2388
4b7a85d438cad621ea63a1119e756972
https://github.com/vesoft-inc/nebula/issues/1888
public class FlinkConnectorSourceExample public static void nebulaEdgeBatchSource() throws Exception { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(2); NebulaInputRowFormat inputFormat = new NebulaInputRowFormat(storageConnectionProvider, ...
0
6724627b404b9bac7351c85db0a768ed
9893d3e22907cfb507aed64cc17ddf1d
Transform json data format into Amenity object
HotelMessageBean bean = new HotelMessageBean(); try { JSONObject jsonObj = new JSONObject(json); if(!jsonObj.has("street_address")) return null; if(!jsonObj.has("name")) return null; if(!jsonObj.has("nightly_rate")) return null; bean.setAddress(jsonObj.getString("street_address")); bean.setName(js...
0
59fd2d07a24c2d2e98136e0c9c8f679e
a08e664309ff05c913930ba5e89fed83
-------------------------------------------------------------------------------- Description: Removes all OPCItems from the current OPCGroup --------------------------------------------------------------------------------
void CKGroup::RemoveAllItems (bool bDelete ) { CKItem *pItem = NULL; HRESULT hr = E_FAIL; if (m_cdwItems == 0) return; ASSERT (m_pItemHead); if (m_pIItemMgt != NULL) { CObArray cItemList; DWORD cdwValidItems = 0; try { cItemList.SetSize (m_cdwItems); pItem = m_pItemHead; while (pItem) { ...
1
401fdcc4b63d5962778887ce8c4608ca
8a80c11d46ee9f3ea0f6c33693b193b4
{@link com.internousdev.shiki.dto.SeasonDTO#setImgAddress005()} のためのテスト・メソッド。
public class ItemDTO public void setImgAddress005(String imgAddress005) { this.imgAddress005 = imgAddress005; }
0
cb64b463b82add31a6e915f8ce3736b3
dc5dd9d6db0ab42771ce1ab66cb7527d
Initialise the fft plugin. This creates the underlying object and prepares the filter for operation. This will be called before any data is ingested
fftNode[0].g_HzPerBin = (float) adcNode[0].g_uiSamplingFreq / (float) NUM_SAMPLES; arm_rfft_fast_init_f32(&FastfftStructure, NUM_SAMPLES); }
1
bfe17feb380e40c05b897a2631cfb3f5
1c5031a9f9c04749c3799076735f57ab
Creates method for dispatching messages.
public class BluetoothConnectionManager extends Thread private void dispatchMsg(String msg){ Message m = new Message(); m.obj = msg; if(Objects.equals(msg, Settings.WELCOME)) MainActivity.getHandler().sendMessage(m); else if(Objects.equals(msg.substring(0,1), "T") || Objects.equals(msg, ...
1
79786b79fcafe313b8dea5e5d3635bd6
881e2a2b63538af138ef04b41b329db9
Function : GetClipboardData Purpose : Retrieves data from the clipboard in a specified format. The clipboard must have been opened previously. Params : uFormat : Specifies a clipboard format. For a description of the clipboard formats, see the SetClipboardData function. Return : If the function succeeds, return TR...
namespace MC2DUtil.WinAPI public class User32 [DllImport("user32.dll")] public static extern IntPtr GetClipboardData(uint uFormat);
1
bc7f19f6329acf02d920de49b924bbed
9571bc16d06e0c2e02a7ecb36c7dd29e
Check if this marker has a label
class PointCloud: def has_label(self): return self.label is not None
1
794b5a8e0b7a8bbe0e01f11f9571f05f
5c50e5723e1c5304956cf7bf42d9ea4c
将两个uint16的数字合并为一个uint32
class GMH3000(ConnectionSerial): def _to_uint32(a: int, b: int) -> int: return (a << 16) | b
1
2ecb1f2ed988ff09b25f94ffd4efdafa
4157db5e6580e16a6276b4950c910f19
* A new table containing the same data as the input table
Ne_Text_Buffer* destBuffer) { RangesetTable* newTable = NULL; int i; if (srcTable == NULL) return NULL; newTable = RangesetTableAlloc(destBuffer); newTable->n_set = srcTable->n_set; memcpy(newTable->order, srcTable->order, sizeof(unsigned char) *N_RANG...
1
1d0910d7b62e526c41cd587f012d1e51
dbab6731b604fe6b430777a283cfdece
Should return the format when the format is not null
class DataRetentionAssignedToTest extends MockeryTestCase public function testFormatUnassigned() { $this->assertEquals('', $this->sut->format([])); }
0
96cff12416978b10302c23ee0938aa1b
920a6cc6e0b9752e3eb622fbea94ee9a
获取指定类型的 <see cref="ServiceLifetime"/> 生命周期类型
TService GetRequiredService<ILifetime>(string serviceName) where ILifetime : IPrivateDependency;
0