query_id
string
corpus_id
string
query
string
code
string
label
int64
eebb9e2a087d8b4eaa798359e84ab528
92368ad142f754bed32ce9786c6e62c5
Нормализация хранения почтовых адерсов
function normalizeEmail($email) { if (isEmail($email)) { $parts = explode('@', strtolower($email)); switch ($parts['1']) { case 'gmail.com': { $parts[0] = str_replace('.', '', $parts[0]); } break; ...
1
4ab61ae31b90a085184c9173b75d4667
0b37af67be1cf64b429aa655ecf02e37
Получает варианты фонового изображения для опросов.
return [ 1 => '#6ec1e4', 2 => '#54595f', 3 => '#7a7a7a', 4 => '#61ce70', 5 => '#4054b2', 6 => '#23a455', 7 => '#000', 8 => '#fff', ]; }
0
1f8e1df2bcddc1b3c7f43d138aad2854
c789853f0d1fb16dcd1636a95451e4fa
查询所有的行车日志文本
public class DBManager public synchronized List<CrashesLogBean> selectAllLogs() { List<CrashesLogBean> list = new ArrayList<CrashesLogBean>(); SQLiteDatabase db = helper.getReadableDatabase(); Cursor cursor = db.query(DBHelper.CRASHESLOG, null, null, null, null, null, null); if (cursor.m...
0
797840242f48885d01e07aa5d31e84f6
d8d2a56c088566608bd68f8d59993230
test if the method returns an array of Transaction objects
class TransactionApiTest extends \PHPUnit_Framework_TestCase public function testListeTransaction() { }
0
10daf76970811ece08cecd15dcf16c03
07226249afe68cbe167f91a8532863c3
@brief Tests the default event predictor generation
def test_event_generation(): cascade_1 = CascadeParticle(energy=10., direction=0.2, x=5., y=5.) cascade_2 = CascadeParticle(energy=10000., direction=0.2, x=70., y=70.) cascade_3 = CascadeParticle(energy=10000., direction=0.2, x=-20., y=-20.) detector = Detector() detector_no_noise = Detector(noise_l...
1
8eb47fc7934347bf4434d78f06ff48b2
33fc2a38653d82b0bbf74915b0958944
删除符合条件的记录, 成功返回影响的行数, 否则返回FALSE
class model final public function delete($where) { if (is_array($where)) $where = $this->sqls($where); return $this->db->delete($this->table_name, $where); }
0
8ef786a636bebdd8f503154223a573dd
daf5e0f899cbac57d76742a53b21135a
重载小于号使其可以按照边权值从小到大排列
class Edge: def __lt__(self, other): return self.weight < other.weight
1
592b5de8acded1e57a19973ec6314141
6c1206d4e1647ba670fe2db21e22cc7b
Writes the configuration settings contained within this System.Configuration.Configuration object to the specified XML configuration file
{ if (configuration == null) throw new ArgumentNullException( "configuration" ); if (string.IsNullOrEmpty( path )) throw new ArgumentNullException( "path" ); using (var stream = new FileStream( path, mode, FileAccess.Write, FileShare.None )) ...
1
6b0f154a893dcd6eb2ae378ea9b32152
ec8cad978c786ad52b63702ab35ea692
フィールドを確認し,置ける位置を[x][r]の配列で返す
bool FieldBoard::circle_field(int x, int y) { if (!in_range(0, 3, x) || !in_range(0, 3, y)) return false; int it = 3 * y + x; if (!fieldArray[it].is_empty()) return false; fieldArray[it].circle(); return true; }
0
6da7d0bf523b71c08a046dfb7c879a31
1c3242801db2a5c2e96901b655540264
向数据表tb_Task_Keyword更新一条记录。
{ var sqlBuilder = new SQLBuilder(DBProvider); sqlBuilder.BeginUpdate(this.CurrentTableName); this.SetEntity(sqlBuilder, taskVarEntity); sqlBuilder.SetWhere(TaskVarTable.FieldTaskVarId, taskVarEntity.TaskVarId); return sqlBuilder.EndUpdate(); }
0
746415c4b6defa1a295c6bd0e5aa1959
404a8def847fce497e38a2d4a60f9344
returns the config slot for a key name
$name = (string)$name; $query = " SELECT `key_id` `id` FROM {{ t('LoclistsConfigKeys') }} k LEFT JOIN {{ t('LoclistsConfigs') }} c ON k.`conf_id` = c.`conf_id` WHERE c.`conf_name` = {{ s(name) }};"; $keys = self::getDb()->getColumn($qu...
0
cec5dcf7a709d0d91d6d2243526b3547
80aee2ec355b6a488f45ae73fd8457fd
Converts `value` to an object if it's not one.
def dicttoobj(value: dict = {}) -> object: if type(value) == dict: return (ObjectProxy(value)) else: return (value)
1
06c738790902dad27c911d083adcdde8
dc2c40213d7a3e3097e09e1431f2f558
Retorna o nome do destinatário
class EventoRastreio extends \Softr\Vipp\Core\Model\AbstractModel public function getNomeRecebedor() { return $this->nomeRecebedor; }
1
b9f17dadcadded6fd84a5131966d5fd6
40d11c5881418cc3b68a3b53d01335aa
Return the path of the wrapper's velocity template.
class Cache: def template_volume_path(self): return self.settings.versioned_cache_directory / f"template_{self.settings.system.resolution}.bin"
0
6dae12f96050570be089469688bd737b
ba1f986dc0266501d5b68182f8d00bf8
POST /clothes Test creating new clothes with manager JWT.
{ $this->post('/items', ['name' => 'Sally']) ->seeJson([ 'created' => true, ]); }
0
b418b5095e05931ec4a6f1892674608c
8468b8947aa53ff44b0fc622d04de416
check the database representation of a char field
self.assertEqual(unchurch(lc.CH_NEWLINE), ord('\n')) self.assertEqual(unchurch(lc.CH_SPACE), ord(' ')) self.assertEqual(unchurch(lc.CH_ZERO), ord('0')) self.assertEqual(unchurch(lc.CH_B), ord('B')) self.assertEqual(unchurch(lc.CH_F), ord('F')) self.assertEqual(unchurch(lc...
0
9af1b54dd77f4dc394630925b502d72c
b1bdeeec49408c3bf934a18a5ccb7474
NewFlightsList creates FlightsList by data from AirFareSearchResponse
class FlynikiSearch(SearchForQuotas): def extract_data_from_response(self, params): currency = params[0].xpath('.//th/@aria-label')[0].split()[0] raw_tax = params[1].xpath('.//tr[@class="additionals-tsc"]/' 'td[@class="price"]/text()')[0].split() tax = float(raw...
0
b6060858c23148124730c507d6af98a6
613e7a15addfda6433cf49244af0ebea
设置选中日期为一周
var dateInfo = formatDate(dateString); changeHasChosedDate(true); var date = new Date(formatIEDate(dateString)); var weekday = date.getDay(); switch (weekday) { case 1: var endDate = getWantDay('next', date, 6); if (endDate - dateEnd <=...
1
cf3306d760e72f8ebdb0949f71d330d7
1a177ff331b0d163daa22fbd82bafe07
The function here is the scene runner. Our first scene is specified here, then below we have the scene looping.
displayBackground(); youtubeIntro.display(); livingRoom.display(); livingRoom.switchScene(); livingRoom.moveAcidTab(); livingRoom.startTrip(); livingRoom.changeFurniture(); livingRoom.simulateCameraTilt(); zipper.zipperTeeth(); zipper.displayZip(); zipper.openZip(); flowerScene.setupPetals() ...
0
45ef55938c2cdeabee25dbe63952864c
ba93fce5f05c8352128ebd33d93a271a
截取字符前n位
{ if (s == null) return null; if (s.Length < n) return string.Empty; if (s.Length < n + m) return s.Substring(n); return s.Substring(n,m); }
0
a5fbe25969252e55454e0ed47c85fd93
72eac916fa41c6256ba7439a286b8c80
Converts milliseconds to h:m:s:ms format
def convert_ms(ms): seconds = (ms / 1000) % 60 seconds = int(seconds) if seconds < 10: seconds = "0" + str(seconds) else: seconds = str(seconds) minutes = (ms / (1000 * 60)) % 60 minutes = int(minutes) if minutes < 10: minutes = "0" + str(minutes) else: mi...
0
30d97960dd79fc9cc3a3a282b2869596
87720f1d90a13b61948de77a6bf6caf0
Cada que presiono el Mouse se ejecuta esta función.
event.preventDefault(); mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1; raycaster.setFromCamera( mouse, camera ); const intersects = raycaster.intersectObjects( xilofonoG.children ); console.log("intersects"+intersects); if...
1
7462f23b6e1b46b1ae20b7bac55966ed
27f2fd0cb9d0ea1bea3d71404853171c
刪除tad_web_news某筆資料資料
namespace Game.Facade public class NativeWebFacade //: BaseFacadeProvider public void DeleteNews(string sqlQuery) { aideNativeWebData.DeleteNews(sqlQuery); }
1
0eb633baf6b9a8fcd0b1e7efc4fbcc50
be7282dfe66093564aaac50cbe36e2f6
判断首页是否关联,如果首页关联了商品,就不能在这里删除,要先把首页的配置信息删除
class IndexPageController extends CommonController public function prductModuleDelete(){ $pid = I('pid'); if(empty($pid)){ $this->ajaxReturn(array("result"=>2),'json'); } $result = M('product_module')->count(); if(empty($result)){ $this->ajaxReturn(array("result"=>0),'json'); }else if($result<6){ $...
0
33781e805b522e510aa91157e97cd120
fdf59590dc4bdc60d92fccc9ba335ff9
攻击
local isCrt = (math.random(0,99) < unitA.strike.crt) local isHit = (math.random(0,99) < unitA.strike.hit) local might,damage=0,0 if isHit then local factor=1 if isCrt then factor=3 end might = unitA.strike.dmg * factor damage = might if damage > unitB.hp then damage = unitB.hp end unitB.hp = unitB.hp - ...
1
7bd43f3c7bc2ec3e58cc33ccd019dd98
5d97fb0394c60aaa4993cc8cd0bb6853
Cuts out a smaller portion of a Wma file.
class MP3Cutter static cut(o = {}) { var buffer = new Buffer(fs.statSync(o.src).size); try { var fd = fs.openSync(o.src, 'r'); fs.readSync(fd, buffer, 0, buffer.length, 0); o.buffer = buffer; var outBuffer = MP3Cutter.cutBuffer(o); fs.writeFile...
0
d9e1d67ae48b1bd60fe3ea8527b2f8c2
c68b6c63347c5346b8b0b1fd927c26b6
Get the reference to the array of EE error labels
map<string, int>* ErrorChecker::getLabels(){ return & labels; }
1
b8d2d996127da2babecaec0122ed55ec
35709ce932ee42dbb94c85fb54187289
Get the number of remaining slots
class OZSMTD AvailableSpaces() { return this.MaxSlots() - this.FilledSlots(); }
1
4946749593a9ab70f5d371e5df49c54b
889956d5155517f0745dc4b77db6bbf6
获取当前会话人聊天记录,第一次api获取,保存至本地缓存,后续从缓存获取
function getRecordsByOpenId(openId, firstCreateTime) { return new Promise((res, rej) => { let cache = CacheUtil.get(MSG_CACHE_KEY + openId + firstCreateTime, 300); if (cache) { return res(cache); } HttpUtil.get(ApiPaths.chat.getRecordsByOpenId, { firstCreateTime: firstCreateTime, ...
1
e78fa960db08e8167fd91050934b8a4a
7e9e9add548ef1451cc74a206c061678
Return a buffer into the pool.
public final class Transport public ByteBuffer pollBuffer() { return this.bufferPool.get(); }
0
b2856829bcb336e98a18957e897f2eb8
9ee7fb04817f2d6dfb3eba53fb3f3bcc
テキストの配置時の gravity を返す <p>この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。</p><p>テキストによる注記を行う際に使用するテキスト配置の gravity を返します。</p>
public class CarouselLayoutManager extends RecyclerView.LayoutManager public int getGravity() { return mGravity; }
1
d87a21eae4855c0f73aaa2a0bc7d9140
444952e2456a51694e20fce97c952d46
Ignored because the MCP does not filter outgoing environments yet.
public class StaticWorld extends AbstractEnvironment @Override protected void updateNetwork() { }
0
4c611d38848d74048fb7969466973d27
e1c40f1c5ee060fc887dde7d42208e7a
Write a formula to a cell, defined by its name.
_write_formula_num_cell(lxw_worksheet *self, lxw_cell *cell) { char data[LXW_ATTR_32]; lxw_sprintf_dbl(data, cell->formula_result); lxw_xml_data_element(self->file, "f", cell->u.string, NULL); lxw_xml_data_element(self->file, "v", data, NULL); }
0
1b3e9a58712ee5dcdcb5b4638634a2f1
9ef84c43827cd90514a6b375d50717f9
returns the number of job postings
fhand = open(complete_file_path,'r') for line in fhand: line = line.rstrip() if "<h2" in line: num_jobs = re.findall('<strong>(.+)</s', line) fhand.close() return int(num_jobs[0]) fhand.close() print("*** Didn't find number of jobs in: "+complete_file_...
1
c65b611ec72d665c39e465eda76c6f0a
060cc4780793d83feb4e5cbe0c45ab28
match ips to locations and count hits
current_node = self.head dictn = {} list_d= [] while current_node.next != None: current_node = current_node.next print(current_node.hostname) print(current_node.flag) print(current_node.flag, current_node.ip, current_node.hostname, current_...
0
e18f91014a0eeae9d9bf3aa506d92625
2dc0ca3460b58e66f710e33f032aa0b4
数値が完全数かどうかを調べ、結果をbool値で返す
flg = true prime_list.each do |prime| break if Math::sqrt(num) < prime if num % prime == 0 flg = false break end end return flg end
0
84308645a7c2adc9294b47a4ffd9d9a6
fe878f815c0aa32f8610d6c866ac9898
UpdateItemModifierLists Updates the [CatalogModifierList](#type-catalogmodifierlist) objects that apply to the targeted [CatalogItem](#type-catalogitem) without having to perform an upsert on the entire item.
{ if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); string serializedJson = JsonWrapper.SerializeObject(request, PlayFabUtil.ApiSerializerStrategy); Action<CallRequestContainer> callbac...
0
2826c9577f8a20789f96bc33dc34a35d
372437aa5c5d98442b8cdc707e5cc213
点击右侧的创建作业按钮,将界面变为创建作业时的界面:也就是将一些数据清空
$('.task .add').onclick = ''; document.getElementsByClassName('taskText')[0].value = ''; document.getElementsByClassName('taskText')[1].value = ''; $('.myTextArea').value = ''; $('.task-title span').style.display = 'none'; $('.ta...
1
f746d1ad97a6100e6d62d55018409beb
320dc73149894b3b30474132409dd8b6
Get a life matrix based on the named pattern.
arr = [] self.pattern.each do |line| row = [] line.each_char do |char| char == LIVE ? row << true : row << false end arr << row end arr.transpose end
1
6a5e04980d6b7f2a527fa3d4fa6c5e2b
4bf57a0e48290e13d339bdc65704f4c9
根据文章名称查询文章ID
int queryIdByName(String name);
1
767ad68905e5f38756e666c35f58d2ae
ec1ce251dab1249a0958c04c426a06bf
# do a lattice plot to test many dims
df <- gather_array(datamat) p <- ggplot(df, mapping=aes(x=dim_1, y=dim_2, fill=var)) + geom_tile() + xlab("samples") + ylab("samples") + theme_minimal() + guides(fill=guide_legend(title="covariance")) ggsave(file.path(base_path,plot_dir,paste0(filename,".png")), plot=p, scale=1.5, width=4, hei...
0
ce717d912460710cb92a1cb322e2020f
02a6ba0af2f2c4eeabd302740593c106
アトム構文を膜に追加
showIMM(); int curTextLength = mContent.getText().length(); if(curTextLength < MAX_TEXT_LENGTH) { String atme = TEXT_ATME; int start, end; if((MAX_TEXT_LENGTH - curTextLength) >= atme.length()) { start = mContent.getSelectionStart() + 1; end = start + atme.length() - 1; } else { int num...
1
b25fc64ac6bd051c34a2a5b10a3dea4e
8852594c12a8533e2b933fd9c0b0ba24
编辑midi
void BlobTracker::midiNoteUpdate(int channel, int note, float velocity, float pitchbend,float modulation){ pitchbend = resizePitchBend(pitchbend); Serial.write(0xB0+channel); Serial.write(7); Serial.write((int)velocity); Serial.write(0xA0+channel); Serial.write(note); Serial.write((int)velocity); Serial...
1
0f96d482644d1c6d4f054164c258a021
84eca6c0cc85c5ada963499b3f4d271c
This method gets the current angle of the cannon in radians. Returns a double that is the cannon's angle.
public class Cannon public double getCurrentAngle() { return currentAngle; }
1
2289546fed3b097522254d2bc386dbfc
acfe8cdd938b1fea1224aba771085894
Returns a list of Calendar_SelectDateModel's if any are found
class module_strongcal extends module_template implements avalanche_interface_os{ function getAllCalendarsMatching($text){ $ret = array(); $text = addslashes($text); $like = "1 "; $texts = explode(" ", $text); foreach($texts as $text){ $like .= "AND ((name LIKE '%$text%') OR (description LIKE '%$text%'))";...
0
c97478ce9311a18457ffaa077128a1af
dad543cf1c066a40d0c2efa5cd591392
Spinning the object randomly
public class points : MonoBehaviour private void Update() { transform.Rotate(0, spinspeed * Time.deltaTime, 0); }
0
61429f3f522d81cceb027a54dbd6b9ce
0cf682e39d35cfdd6e29aeea62f3e57d
Returns a 2D ndarray where each row is newly selected model. Selects new models using the Gibbs Sampler method from the Voronoi cells of the best models found so far.
mask = np.ones(len(self.model_data), dtype=bool) for param, param_err, model in zip(self.param, self.param_err, self.model_columns.values()): mask *= np.abs(self.model_data[:, model] - param) \ <= (mf.max_param_err * param_err) ...
0
96384745d32753a3d2f1623d98cb1b41
6f8c8c0201a9e78c54dc5b1478df0847
Renvoie le choix de B.
class UserInput public String getB() { return B; }
1
6a841052cf5308eaddd0049062280454
bd531db0ef92732cc42f6c827f0f772f
Calculate the distance between two N-dimensional points
{ double dist = 0; while( --dims >= 0 ) dist += (a1[dims] - a2[dims])*(a1[dims] - a2[dims]); return sqrt(dist); }
1
ce31fd5fdf08c885965d41ec61bcde68
de1f3a2ef17fa5975c8d9058d091abc9
user login that returns user logged in information
{ $this->db->select('*'); $this->db->where('email', $post['email']); $query = $this->db->get('users'); if ($query->num_rows() > 0) $userInfo = $query->row(); else return false; if(md5($post['password']) != $userInfo->password OR $userInfo->...
1
c356b9ca352b696bd194da98b31b68cd
f0b39b8382521dfe1c1b7e9382ec56bc
This command is used to set the resolution of the display. The screen is cleared and the cursor is positioned at the upper left position.
namespace Microsoft.Tools.WindowsDevicePortal public partial class DevicePortal public async Task SetDisplayResolutionAsync(string displayResolution) { await this.PostAsync( DisplayResolutionApi, string.Format("newdisplayresolution={0}", Utilities.Hex64Encode(dis...
1
da253e5e73678f8d70ffdb911a8467fc
a4858e1ea03d8d812890f9d796252e48
concatenate one string to another (ANSI)
char *os; os = s; while((*s++ = *t++) != 0) ; return os; }
0
9e9b0445091d6130050a3b4c7b2e423d
9c93be050ae7079b4542754051239d6e
Sorteia a carta para o jogador sem repeti-las.
{ string[] Temp = new string[NBCARTES]; int position; for (int i = 0; i < 52; i++) { position = rnd.Next(0, NBCARTES); if (Temp[position] == null) { Temp[position] = Deck[i]; } ...
1
690c776cf281f52c59a0ab2666d43735
c3ece9719f5bc912aa4fcb403464b34e
Set Brain Mask for datasourceAnat
def create_mask(image,threshold): mask_img = nibabel.load("/usr/share/mouse-brain-atlases/dsurqec_200micron_mask.nii") atlas_mask = mask_img.get_fdata() img = nibabel.load(image) img_data = img.get_fdata() img_data[np.logical_and(img_data > threshold,atlas_mask == 1)] = 1 img_data[np.logical_or(img_data <= thresh...
1
e1724f9730af725caf4d92adfc7521fd
7373ac3a902ad280f13eca0691115723
Executes the POST-style request and deserializes the response content using the appropriate content handler
namespace argonaut_subscription_server_proxy.ResourceProcessors public abstract class SubscriptionProcessorR5 internal static async Task ProcessPostAndRespond(HttpContext context) { ProcessorUtils.ReturnPref preferredResponse = ProcessorUtils.ReturnPref.Representation; foreach (KeyVa...
1
36983a3f185d0136e0d7d09dc36a06c7
a9df5e5989fe465caed0c2eaacd97597
Get the value of this aggregator (do nothing).
class AtomicQueryAggregatorBase(base_aggregator.BaseAggregator): def done(self): return None
0
bf2b8a64c315ca0b38f26704ea7e8145
471668b147f204462ac567df9824c1a2
Returns an ordered range of all the creators where fullName = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. ...
String creator, OrderByComparator<MetaData> orderByComparator) throws com.osp.icecap.exception.NoSuchMetaDataException { return getPersistence().findByCreator_Last(creator, orderByComparator); }
0
fa2053985e1ee6c55aeef73e82151dba
a04e7a7947e000dd37d2dcaf5447f802
Test case where there are no suspects.
class test_us11(unittest.TestCase): def test_no_bigamy(self): ged = Gedcom('./GEDCOM_files/us11/test04.ged') self.assertEqual(ged.us11_no_bigamy(debug=True), [])
1
0d3633588b56491442ec8cb7f8313e35
2c7c405c97eb3de114d1dfbf3fb5bbbb
Displays to the user that a player has died
function playerDeath() { if (playerHealth <= 0) { document.getElementById("diescreen").style.display = "inline-block"; gameArea.stop(); } }
1
cd5ce12946cb50ae89ab224d660aaf5e
a6aa86b60d433bb29333e4b72704ab8a
May be called to ensure that _updateFromSet() is called immediately if a lazy update has been scheduled but not yet performed.
void pg_force_update( pg_obj_t *me) { set_dirty( me); }
1
860a12b2ad0305f127b5f59c22cd8e9f
3bfb855c9cb15d931a02c43ed312de99
Function: test_no_mongo_cfg Description: Test with no config for mongo passed.
class UnitTest(unittest.TestCase): def test_no_mongo_cfg(self, mock_print): mock_print.return_value = (False, None) self.assertFalse(mysql_perf.mysql_stat_run( self.server, perf_list=self.perf_list, db_tbl=self.db_tbl))
1
85ecedc54439b059d7228726f9d2be05
46cd9d191ca52fc6f9182bd31a5571e7
根据不同的状态去调用不同的行为函数和动机函数
class Basic extends Component triggerMotivation(info,oldValue,newValue){ let movt = {}; this.logic.motivation.forEach((motivation,name)=>{ if(info['movt'][name]==undefined){ let isTouch = false, isActive = true; motivation.status.forEach((value,state)=>{ ...
1
8c76d7ad58224e5e7d4121797346e81e
e65ae111428ee68010aab23c71d1f13d
Lists Clusters in the GKE On-Prem VMware API.
class CloudTableClient extends Client public function listClusters($request) { return $this->listClustersWithHttpInfo($request); }
0
95ee0ebb6b8b1593bc9a7a0feba27265
f74882139c7aa1cf7cb0441ae7b80494
Returns the sign of x (-1 or 1), and 0 if x == 0.
namespace mfemopt static inline double __mfemopt_sign(double x) { #if 0 static const char testpz[16] = {'\0'}; static const double testpn = +NAN; return x != x ? ( memcmp(&x,&testpn,sizeof(double)) ? -1.0 : +1.0) : ( x == -x ? ( memcmp(&x,testpz,sizeof(double)) ? -1.0 : 1.0) : (x < 0.0 ? -1.0 : +1.0) ); #else ...
0
a51a1b90404e7f2b6495a82f4884407c
ef16fff98b9d3a53d14a6a8276e3231d
给定已验证的数据,更新并返回现有的“User”实例。
class UserProfileSerializer(serializers.ModelSerializer): def update(self, instance, validated_data): instance.profile_photo = validated_data.get('profile_photo', instance.profile_photo) instance.save() account_data = validated_data.pop('account', {}) account = instance.account a...
1
2a4e05948e8d2c9dc4318cf0a7237ca9
affbd4788e588bef7b3938fcafc73838
Set VA select code display.
void DISPLAY_setCodeBMode() { featureData &= ~(1 << FEATURE_DECODE_SELECT); DISPLAY_writeByte(FEATURE_ADDRESS, featureData); }
0
c88cc146a93b21373caf078cf435e587
c2f017d0ed6d7025572e78196db50b2b
吸血
int v1; int v2; v2 = (128 * Rand(0, 1)); v1 = 0; while ((v1 < 32)) { asynccall CreateBlood(target, zOffset, v2); Delay(Rand(0, 1)); v1++; } return; }
0
14b77ed34553ded413495ae0a0383dfa
9d2014677b454fa379f9b66e351ec06d
add attributes per building
unitAttributes.put("TankDestroyer", new int[]{10, 800, 50, 500, 400, 10, 20}); unitAttributes.put(soldierString, new int[]{10, 400, 40, 350, 75, 8, 20}); unitAttributes.put("Tank", new int[]{10, 2500, 100, 1500, 150, 10, 20}); unitAttributes.put("Astronaut", new int[]{10, 250, 20, 200, 1...
0
3e9373b173f3b3b256d2ae5383963d43
69bd55b64d9dcf02ee7823fb1c7a58ee
Set scope level delimiter.
class ConfigFile public function overrideScopeDelimiter($sScopeDelimiter) { $this->sScopeDelimiter = $sScopeDelimiter; }
1
e2fced47f4e78cc1324ac6b0722d4c50
27c6255dc1645e423166755074257e37
显示商品列表数据
public class ShowGoodsActivity extends AppCompatActivity public void initData(){ mMyPsersenter = new MyPresenter(); Map<String,String> map = new HashMap<>(); map.put("pscid","1"); map.put("page",""+page); mMyPsersenter.Show(map, new PersneterInterface() { @Override ...
1
175c89eccbd0c525e93d253bef3fc62d
dff7d2667652b4aa3d4feddb7c675c0f
设置是否显示地图导航窗体
try { await MV.setShowNorthArrow(this._MGMapViewId, show); } catch (e) { console.error(e); } }
0
d51e957f9a9ae0ec695cb374206e2f48
e859a55f31b0c02bc00120d0256ff597
Remove a given member's vote from a given card
class CardTest extends TestCase{ public function testRemoveMember($title){ $card = Card::where('title','=',$title.'-update')->first(); $member = User::all()->last(); $data = array('user_id'=>$member->id); $this->client->request('POST','/card/removeMember/'.$card->id,$data); $this...
0
aaa79a5f91e45d09a11db11e7597eeb7
ce48923dca251cc628c033eff34b438c
增加代理商充值预审
{ $login_user = Auth::user(); $user_logic = new UserLogic(); $login_role = $user_logic->getRoleByUser($login_user); if (!in_array($login_role['name'], Constants::$admin_role)) { throw new BaheException(BaheException::AGENT_NOT_RECHARGE_FOR_AGENT_CODE); } ...
1
1d5e4a2d751e7ccdb02bdd32ae5f4eb1
e591edf95238b9616c74277cfb9a33e6
Dynamic dependency. This routine applies the suffis rules to try and find a source and a set of rules for a missing target. If found, np is made into a target with the implicit source name, and rules. Returns TRUE if np was made into a target.
void find_rule_at_dependency(Rules **found_rule, Rules *ruleset, char *targetstring, char *roottarget) { if (ruleset && ruleset->target) { if (ruleset->dependencies && is_in_list_2(roottarget, ...
0
0d1cce989309bce6483d85bdcd367869
7d889428e232611e8ffaf1294fbee508
Checks to see if an update is currently being downloaded.
public class UpdateManager public boolean isDownloadInProgress() { return mDownloadId >= 0; }
1
70c3e4d7045a7e3fa573bd0ff7834f2f
1d4d007b3a810cc2c647c25a3003cc62
Try to change the system associated to a profile.
if (theUser != null && theUser.systemCode !== systemCode) { const oldSystemCode = theUser.systemCode const { secondaryCode: oldSecondaryCode } = theUser.systemList.find(it => it.code == oldSystemCode)! const { secondaryCode } = theUser.systemList.find(it => it.code == systemCode)! accessToke...
1
cfb71c9d7f2132cb8d559eafd2105608
30b4574572a3907ccfea9b0f0a351d22
同時に検出するマーカの最大数を設定します。 関数は、少なくともi_max_number_of_marker以上のマーカを同時に検出できるようにインスタンスを設定します。 @throws NyARException
public void setMinMarkerCount(Integer minMarkerCount);
0
eefbf9f404d255106ade985d71bc7aaf
21959c2ad7810d23304d1ab8e695da2b
租车最低价
public class FareUtils public static void cpDomesticLowestPrice(FltItem fltItem, Map<String, String> subclassLevelMap) { if (fltItem == null || CollectionUtils.isEmpty(fltItem.getClasFare())) { return; } List<String> firCabins = getCabinListByDictCode(subclassLevelMap, "F"); List<String> ecoCabins = getCabin...
0
f379557eec580220a357cf9f3f579953
b4fea2a9e4775caf37fcb90d78593a1c
Frees an allocated block, and its corresponding TXs.
tx_release(struct net2_objwin_tx *tx, int decrement) { int do_free; net2_mutex_lock(tx->mtx); if (decrement) tx->refcnt--; do_free = (tx->refcnt == 0 && (tx->flags & TX_RELEASED)); net2_mutex_unlock(tx->mtx); if (do_free) { net2_buffer_free(tx->msg); net2_mutex_free(tx->mtx); free(tx); } }
1
88a4aca08752a8c7a1060cad4a45759c
2d7ebd7eb632cd443b304eff9b746277
metodo di appoggio che, dopo la morte di un tamagolem, risistema l'ordine delle pietre di quello sopravvissuto
{ if(morto==false) { int indice; do{ indice = (int)(random()*((double)aziende.size())); }while (aziende.get(indice).fallita==true); sommaTempo(-1); sommaFelicità(-2); sommaSoldi(3); aziende.get(indice...
0
44e2a7b6b0362216529a868db8b67797
5130bba16bc2e4adf3c680eb14441ead
Create our audit fields as shadow properties
{ $this->auditColumns = $theAuditColumns; $this->fullOption = $fullOption; $this->auditTableOptions = AuditDataLayer::getTableOptions($auditSchema, $tableName); $this->dataTableOptions = AuditDataLayer::getTableOptions($dataSchema, $tableName); }
0
b4631129b44e443ffed4828e9d4887e1
ba52d7c0f39ac64de0490e98ecc2832d
判断某个URL的下载的某个线程是否在数据库中存在
public class DlTasksManager public boolean isExistDownloadFile(String url){ return dbController.isExistDownloadFile(url); }
1
df71a7d44c1d8b83196479ed01794fed
419d10f12e1113f69a0fff65dd5d875d
use regular expression to check for a valid dollar amount
const rDollars = /^(?<!\$)(?<amount>\d+(?:\.\d+)?)$/u const match = rDollars.exec(input) if (match === null) { return null } return match.groups.amount }
1
3a25840b6b0f2733ce89d555f8615bbd
f40d7d47613c9a5f50652a2433367603
Find an access token by its refresh token.
class OhGooService public static function getAccessTokenFromRefreshToken($refreshToken) { return self::_getAccessToken($refreshToken, self::$ACCESS_TOKEN_FROM_REFRESH); }
1
c506c54a4756407225f8fbd07d97a78c
a3ccf9dc537efb31943a27ae1f7b660c
验证香港居民证件
String nationCode = aac002.substring(0, 3); String IDnumber = aac002.substring(4); String asizeCode = aac002.substring(3, 4); if (!nationCode.equals(aac161) || !asizeCode.matches("[0-9]") || !IDnumber.matches("[0-9]{8}")) { return false; } if ("HKG".equals(a...
1
a01b953c5f3d40f045f676d9ca0e9c48
2b0965b9da3255083cd6033e40e232b6
Decorador para servicios REST que comprueba si el usuario que ejecuta la petición está autenticado. Si no lo está devuelve un 403. Se implimenta ya que para los servicios REST no puede utilizarse el decorador login_required de django ya que hace una redirección a una URL determinada.
@wraps(view) def _wrapper(*args, **kwargs): request = args[0] user = request.user if not user.is_authenticated(): if not request.is_ajax(): return render(request, 'auth/login_required.html', status=http.UNAUTHORIZED) e...
1
39a9ebb0167f227db7a17947c7c1b45e
6cdeaad8194514be20f26c79124ad547
Using the names saved by #save, try to find them now. Since names can change we use Damerau-Levenshtein distance on lowercase versions of all strings.
def automatic_alignment(id_series, id_ep, refsT, hypsT): names_dict = {} save_dict = {} hyps = hypsT[:] refs = refsT.copy() savePath = Path(PC.__file__).parent / 'data' / f'{id_series}' \ / 'transcripts' / 'names_dict.json' if os.path.isfile(savePath): with open(savePath, ...
0
d4ef65b7dd81a2fa032090f74690b17e
d6156442b24c7356d26a477dde92df56
合同签约数排行榜
d=sorted(d.items(), key=lambda x: x[1],reverse=True) with open('txt_file/address_txCount.txt', 'w+') as f: for i in range(len(d)): f.write(d[i][0]+ ':' + str(d[i][1]) + '\n') for i in range(len(d)): spider_contracts(d[i][0], d[i][1])
1
89b8189001649e22faf139df9565eb79
e805cc872bbaaef04f67894647c98c00
Function decorator for every telegram command issued by user.
def decorator(func): @wraps(func) def wrapped(bot, update, *args, **kwargs): try: chat_id = update.message.chat_id username = update.message.chat.username except AttributeError: chat_id = update.callback_query.message.chat.id ...
1
9948c8f93a79a1f9d591e23de99c937b
0987d913d185d6539dc696914bc76bd7
Sets the telemetry context.
namespace MagicOnion.Server.OpenTelemetry public static class ServiceContextTelemetryExtensions internal static void SetTraceContext(this ServiceContext context, ActivityContext activityContext) { context.Items[MagicOnionTelemetry.ServiceContextItemKeyTrace] = activityContext; }
1
5fa5bd89683128ef0a3c21e50c4aad61
579b3491481dd7195aa3f80d0cc5b514
The account authentication type. The possible values are `internal` and `saml`.
class UserAuthenticationMode(dict): def type(self) -> str: return pulumi.get(self, "type")
1
d3b8e91337f43a297653da45a8d27741
f10e3544497068f49ca0ec4a34acf4c2
create navigation for slideshow
for(let i = 0; i < slides.length; i++) { const span = document.createElement('span'); if(i === 0) { span.classList.add('active'); } span.addEventListener('click', changeSlide); sliderNav.appendChild(span); } }
1
242ce1f43757f0a59c6e0768d852b14b
eeaf33e3b635d62188513a12c4c77a0e
获取私有成员的方法。
namespace System public static class EShuiNetExtention public static List<string> GetPrivateMethodList<T>(this T model) { List<string> FieldsList = new List<string>(); MethodInfo[] fields = model.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance); foreac...
1
a99a017e848cf61b0e58e97c52369f43
0c74c98a6a329478f3da38f14ca217fe
Converts data version 8 to version 9.
impl TypeMigration<MarketStateV8, MarketStateV9> for TypeMigrator fn migrate_type(from: MarketStateV8, _: &impl Blockstore) -> anyhow::Result<MarketStateV9> { let out_state = MarketStateV9 { proposals: from.proposals, pending_proposals: from.pending_proposals, escrow_table: f...
1
4563dbbf5b7eb34fea18e33165dece6e
95fc72a15a4827b59dffac1b97f0aec9
a以上の最小のbの倍数
if (a <= 0 && b <= 0) { return 0; } int re = 0; if (a > b) { int t = a; a = b; b = t; } for (int i = 1; i <= a; i++) { if ((b * i) % a == 0) { re = b * i; break; } ...
0
239df1141699a9b4dfcf0e69f0aebdaa
022a9c747c9f2c9e4b3f64ce57a0b65f
备份按钮单击事件---执行备份
var nodes = $('#tt').tree('getChecked'); var tablename = ''; var path; for (var i = 0; i < nodes.length; i++) { if (tablename != '') tablename += ','; tablename += nodes[i].text; } path = document.getElementById("txtFile").value; document.getElementById("path").value = path; ...
1
8afc738834d608d39262a922aa613648
f39805b4dc828b47e041d6832ae0055c
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4767965 http://nghiaho.com/?page_id=671
spdlog::debug(" → Computing Kendall Correlation..."); int len = x.n_elem; int m1 = 0, m2 = 0, s = 0, nPair , i,j ; float cor ; for(i = 0; i < len; i++) { for(j = i + 1; j < len; j++) { if(y[i] > y[j]) { if (x[i] > x[j]) { s++; } else if(x[i] < x[j]) { s--; ...
1
6636558c71ec564da4eba2d642e32893
05ccfd473106cfd81ed74e9d12e05d5a
Specifies the buffer list to use with this session. Needs a valid buffer list - aftwards imgSessionAcquire can be called.
class Plugin(plugin.Plugin): def evt_bufferlist(self, bufferlist): self.refresh(bufferlist) if not self.buffers.set_active(self.cbuf): self.do_edit('getcurrentbuffer')
0
e0b2c05d32a356682bd8cea833423fdb
3cf34eb533b7dd5abcf58f8386bbaecf
Aquest procediment s'encarrega de actualitzar l'hora del joc, obtenint la hora real de la informació pròpia de l'ordinador. l'ordinador.
public class PageLoader public void updateTime(){ Time t=new Time(); t.setToNow(); int hour = t.hour; int minute=t.minute; TextView textView=((Activity)mContext).findViewById(R.id.system_time); String s=String.format("%02d:%02d",hour,minute); textView.setText(s)...
1
e7ed0c53cbe1db84cef945bad95b3d31
3a97f56365df15f2a47c8b2a2c6566fc
Returns predicted class with probability. Format: (class, probability)
is_valid_prediction, log_softmaxes = model(x) _, most_likely_class = log_softmaxes.max(1) probability_valid = F.sigmoid(is_valid_prediction[most_likely_class] return most_likely_class, probability_valid)
1