query_id
string
corpus_id
string
query
string
code
string
label
int64
bf2325184f144bfdf722d17ebe3e47cf
c4d441161b693c13d6d8e2f51149d763
Constructs a Datastore key for a guestbook
{ return '1006' . $this->randomkeys(6) . time() . $this->randomkeys(8); }
1
bd29f8c7b51d55bc4eb546ea1703f951
55fc2df24020d400f9977fb568b9848f
Seçilen indexdeki resmi istenilern çöznürlüğe çevirip PictureBox'a gönderir.
{ surface = new Bitmap(sender.ToString()); g = Graphics.FromImage(surface); cizimAlani.BackgroundImage = surface; cizimAlani.BackgroundImageLayout = ImageLayout.None; }
0
bf25da2835fb0c59bb7ae03073462661
51643a5da4548ef07a51cc5c4f2a991e
Check if the given slide index equals the active slide
function isActive(id) { return id === _currIdx; }
1
efbe1259906db598c6b1631ea98e77bf
3f346dddc2ba0188622934c4fa44b895
create Newick-formatted representation of JSON data or Python dict
class Newick(object): def __init__(self, data): self.nodes = [] self.node_index = 0 self.edges = [] self.construct_tree(data) self.name_index = {node.name: node.number for node in self.nodes}
0
d5d425fd1518118fe8be6ab1eab6eac9
6b5bfba5b2107f4667f9c5c78b314e38
Clear all document priorities for a job that is going to sleep
class Job(object): def bury(self, priority=None): if self.reserved: self.conn.bury(self.jid, priority or self._priority()) self.reserved = False
0
be780273e9bd30f7e9d435dcb76674f3
f1d03bfeef685b101420b8a1158c45e2
Retrieves function arguments from a GET request and casts them to their expected data types for a given module.
class Client(object): def get_module_fields(self, module_name, *, fields=[]): data = [self.session_id, module_name, fields] return self._post('get_module_fields', data)
0
e3a7a8db36607b8aae4cbcbf6007aef4
1a376450c9cfe20794dd033c39612338
Adjust the properties of the axes to be adequate for colorbar display.
cb.ax.set_ylim(vmin, vmax) cb.outline.set_transform(cb.ax.transAxes) cb.outline.set_xy( np.array([ [0, 0], [0, 1], [1, 1], [1, 0], ]), )
1
fe85fbb7c576dc87cf57f4b55ff74688
78a9909e745f869d2a1217e555581ec1
an accessor method for getting the boolean which indicates whether or not there was at least 1 valid line in the file
public class UrlLookUpLine implements Runnable{ public int result(){ return hasUpdate; }
0
9d2fffe361814b5abada289de92421a2
f101028a083b1775b004953816177ba4
Retrieve the city data from the web service In a worker thread since it's a network operation.
new Thread(new Runnable() { public void run() { try { retrieveAndAddCities(); } catch (IOException e) { Log.e(LOG_TAG, "Cannot retrive cities", e); return; } } }).start(); ...
1
a88818c03cf28728ca9aaee8b007efba
0db976e23cbb359250d9ed5c24a09f66
method to create box in storage
ContentValues initialValues = new ContentValues(); initialValues.put(KEY_BOX1, col1); initialValues.put(KEY_BOX23, 1); return mDb.insert(DATABASE_TABLE, null, initialValues); }
1
2eb4cb0dfb5a488fc5826377ed52a41b
8e6b98c8dc61c2d8bafe6e033f9e61d9
check if the rectangle is square
class Rectangle function isSquare() { if ($this->width == $this->height) { return true; } else { return false; } }
1
13f8e0b671847ea1a80365cfd70835f1
4caec84042cbb84de81efa68da6b0322
function that returns the distance between two words using levenshtein algorithm
if word1 == "": return len(word2) if word2 == "": return len(word1) if word1[0] == word2[0]: return levenstein_distance(word1[1:], word2[1:]) else: return 1 + min( levenstein_distance(word1[1:], word2), levenstein_distance(word1, word2[1:]), ...
1
676e407942aa3a64170aec5b43d5756d
6df2ff8e85ca77079fd0370b21f5f66c
Returns the value of the '<em><b>Specular Color</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Specular Color</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc --> extendedMetaData="kind='attribute' name='specular-color' namespace='##ta...
void setSpecularColor(float r, float g, float b, float a);
0
c4b8927bf29f7c6194ff16c3015c7ecc
4223518d08552276e78f3e09aacf6808
自分を除く生きているプレイヤーのみ取得(GM,観戦者などは除く)
return (from go in spawnPrefabs where go.GetComponent<Player>() != null select go.GetComponent<Player>()).ToList(); }
0
ba97259d188f45e9ce7bbe5419fd8eba
f0c09f0fe41e6820c14b9ef58ea7dfd3
Activates the node if not sensor - call Activation function. Also updates the activation value in connected nodes.
if (this->netIN > 2.0) { this->active = true; } printf("[Activation] Neuron is active\n"); }
0
46f6b30a26bb7df324677a867ff3a833
c02e2a28a34ecdadeab797914b0e6c67
Get list of objects which consists of opened PR names and its ref
public function getOpenPrs();
1
3f6558a9cf6bf3b0f30b20705a9261a0
ee7c0ae2d8eb3df7b1929170799854af
Load the faction.xml file in memory
$.get('xml/' + file + '.xml', function(data) { xml = data; loadLeaderboard(); }); }
1
08ca400192b1201532a1b71496354ee5
9a9217be79861dc8d0b69ce02110c489
根据用户ID获取基本信息或者根据用户名称,二级账号只能查询到属于自己增加的账号
@RestController @RequestMapping("testtask") public class TestTaskController extends BaseController @PostMapping(value = "getUserByNameOrACC") public Map<String, Object> getUserByNameOrACC(String userName,HttpServletRequest request) { Map<String, Object> result = new HashMap<>(); try { Long uid = CommonUtil.getC...
1
7f816fd5d54205459ad998449440b45f
bbba095c842dfd8c0c6b36501e74f52a
Apply rank 1 NMF to find spatial and temporal initialization for each superpixel in Yt.
np.random.seed(seed) if self.rp_mode == 'Gaussian': sk = self._gaussian_projection(Xy,self.rp_dim) elif self.rp_mode == 'SJLT': sk = self._sparse_projection(Xy,self.rp_dim) else: raise NotImplementedError self.SX, self.Sy = sk[:,:-1], sk[:,-1]
0
72a81f6fea829c87ba14a7f61039f287
93968e94db7eac6c6216116c3463cc07
Update site config
class PmLocalProject extends ArrayAccessebleOptions function a_updateConfig() { $this->updateConstant('more', 'SITE_DOMAIN', $this->config['domain']); $this->updateConstant('core', 'IS_DEBUG', $this->config['sType'] == 'prod' ? false : true); $this->updateConstant('site', 'ALLOW_SEND', $this->config['sType'...
1
6dc31415f6526fe569054be1432214aa
087775e92effaa8b5464511f831a8e9d
Commit id this reference now points to.
class Scm(AbstractClass): def commit_id(self):
1
73923f78e0a42c8cf21131a85af42f4b
5d4ffe3da6a79d85a14d95912cd6f2c1
Explicitly set whether or not to use the GetBulk method for OID retrieval in a SNMPv2 / SNMPv3 context. If the SNMP version is set to v1 then it will only use GetNext regardless. By default GetBulk is used if the SNMP version supports it.
public class SimpleUsmAgent implements UsmAgent public void setSnmpContext(SnmpContextv3Basis c) { }
0
92776e8a55d961149388773f59fc8611
f52e5961c9688706c0c388ceb8b41587
注销系统广播
if (mAudioBroadcastReceiver != null && isRegisterSuccess) { mContext.unregisterReceiver(mAudioBroadcastReceiver); } }
1
3654abe42dfa8b9e043723895cfa0d09
f9151b9cefbac44366fa46b635453b11
Configiure DDS control pins for digital output
{ pinMode(DDS_SPI_SCLK_PIN, OUTPUT); pinMode(DDS_SPI_SDIO_PIN, OUTPUT); pinMode(DDS_SPI_SDO_PIN, INPUT); pinMode(DDS_SPI_CS_PIN, OUTPUT); pinMode(DDS_IO_UPDATE_PIN, OUTPUT); pinMode(DDS_IO_RESET_PIN, OUTPUT); pinMode(DDS_MASTER_RESET_PIN, OUTPUT); pinMode(DDS_PROFILE_0_PIN, OUTPUT); pinMode(D...
1
3e77cf4ef3cd4d0d1ee4d9d4595c20ef
8748c77974ff593af330f24cbc0aa929
подготовка параметров для команды статистики
{ try { string[] values = (from c in te.status select c.name).ToArray(); StatParamsChooseForm param = new StatParamsChooseForm(values); param.RegisterOpenDataFunc(showStats); param.ShowDial...
1
fcd0abc94b643b387d4bc1d5eafaecff
b2274fcade27b1d9a5a9adfa092863c7
Compute build coefficients for adjoint DMD modes.
class TLSqrDMDHandles(DMDHandles): def _compute_build_coeffs_proj(self): return self.sum_correlation_array_eigvecs.dot( self.sum_correlation_array_eigvecs.conj().T.dot( self.proj_correlation_array_eigvecs.dot( np.diag(self.proj_correlation_array_eigvals ** -0.5).d...
1
0871320e6cfccf54d875971314c04886
ce1920d5278a06a40d70bcf466241051
请求h5的url添加productCode参数.
{ var url = MaiURL + "?response_type=code&client_id=" + ClientId + "&redirect_uri=" + callbackUrl + "&view=h5"; if (!string.IsNullOrEmpty(state)) { url += "&state=" + state; } return url; }
0
d00ea848ff94b7965769442966455f53
c9e55a10006ca4d6ac50912f9a29c954
funkcija za promjenu podataka korisnika
return this.http.put<any>(baseUrl + 'med-sestra/azurirajOsobnePodatke.php', { id: id, email: email, ime: ime, prezime: prezime, adresa: adresa, specijalizacija: specijalizacija }) .pipe(catchError(handleError)); ...
1
8ce8af84b847f38b0a5103578907dbb1
60646e16c751e01a51c6257d37790d36
gets the current region name and index
uint8_t buttonHandler_getRegionNumber() { return regionNumber; }
0
17ac44391ebcf53cddc12027458011cd
ec6a8dd7e519a4cde70b63d57a752ccf
图片加载成功后将进度条隐藏,并显示加载好的图片
public class WebActivity extends AppCompatActivity private class MyWebViewClient extends WebViewClient @Override public void onPageFinished(WebView view, String url) { if (progress.getWindowVisibility()==progress.VISIBLE) { progress.setVisib...
0
55d0f55b325ad87ad4c1543663ddd76b
20fb769ffb0d5e4012e655437d66f5d7
Test case for create_grunt_command
class CreateRequestUserCommandTest extends TestCase public function testExample() { }
0
bfa4d4e8867e047b80e0cf520c1cbb21
3782cac3129e0e095efe1c6f2ee4e8e7
Wait until video is detected and the get video properties
class DeckLinkDevice HRESULT waitForSignalLock() { std::unique_lock<std::mutex> guard(m_mutex); HRESULT result = S_OK; m_signalCondition.wait(guard, [this, &result]() { INT64_SIGNED displayMode; result = m_deckLinkStatus->GetInt(bmdDeckLinkStatusDetectedVideoInputMode, &displayMode); if (result != S_O...
1
9b2ec2853f47a94885bfb2ad884fe105
c7c1eecfbceb64a15415dbc1cd1bedfc
根据角色id,更新角色对象中所有属性,包括为null值的属性
int updateByPrimaryKeySelective(Role role);
0
b6999830e386eb110a780dbda19b2a79
b332c94e0693fed17e5f74bc4c3c0999
Returns the value of the '<em><b>Translated</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Translated</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
public function getTranslated(): bool;
1
bbd193931cf0643a05fcf6c45aa0f73d
2df2048634ea311fcaaf9a1cf3c8e5de
This function is called when the GT RX reference input clock has changed.
M2R_t * pDev, m2r_lif_tx_clk_mode_t tx_clk_mode) { cs_uint8 div ; XGXS_MP_XAUI0_t xauiCtrl ; LIF_SFI42CNTL_t sfi4_2_ctl; m2r_lif_ref_clk_t refClk ; m2r_port_cb_t *ppcb = M2R_PORT_ID_TO_PCB_PTR(port_id) ; refClk = ppcb->tx_ckref; if ( M2R_IS_SONET...
0
97deaf470f1b9e5765e3708696ac468c
df7916d8b6f0510630e53e2691a02eb0
StringBuilder操作
class StringBuilder { constructor(value) { this._value = value; } get value() { return this._value; } append(value) { this._value = this._value + value; } prepend(value) { this._value = value + this._value; } pad(value) { this._value = value + this._va...
1
675e954946c874551f93f9f66a6fe231
9cfd402ce6967dc41e667dacee8d0804
月間の所定労働日数を計算します。所定日数はカレンダー基準で計算するのに対し、 本メソッドは勤務実績を考慮して計算します。
int calcWorkDaysForPaidHoliday(boolean isCompleted);
0
456dcee41ac7a18d7d6b44175df19169
2a31da828c29759fd8cffd1ec1d726c1
Returns the number of problems for the topic
$db = (new Database())->getDB(); $stmt = $db->prepare("SELECT count(*) as count FROM QUESTIONS WHERE TOPIC_ID=:ID"); try { $stmt->execute([ "ID" => $id_topic ]); return $stmt->fetch(); } catch(PDOException $e) { echo $e; } }
1
5b99ffaaa808f38bf017fdfb49c89369
668e45fac7cdc0c0998a729e0e14f63a
6.检索没被利用的可使用的id号
if type(self.bqueue) == 'table' then local ids = {} for k,v in pairs(self.bqueue) do ids[v.slotid] = 1 end for i=1,100 do if not ids[i] then return i end end end return 1 end
1
00a9915a234443e5d8373badb4201594
dd6b390370ea9f8814f898461dbde067
汽车的创建方法
function Car() { this.name = "汽车"; }
1
c05f99789fe0cf1eb7ed169eba92c3f9
30928c64899619d1cf9f2d2bea387ea7
渲染最高价标记
val dataList = this.dataProvider.dataList val dataSize = dataList.size if (!this.candle.displayLastPriceMark || dataSize == 0) { return } this.linePath.reset() this.paint.apply { strokeWidth = candle.lastPriceMarkLineSize color = candle...
0
c8d45176c6b703ef01de1a9eec565977
579345e31bc44b225b014a2b32a435a0
Creates an input stream reading from the string.
{ return () -> new Iterator<Integer>() { int fNextIndex = 0; public boolean hasNext() { return fNextIndex < string.length(); } public Integer next() { int result = string.codePointAt( fNextIndex ); fNextIndex += Character.charCount( result ); return result; } public void rem...
0
63e5ecbfaf4b904c70b046f0e5c05793
2be908478564b1e9f7c4095bb55f2bde
endpoint to get all status of livecode
request = RequestFactory().get('') response = self.as_view()(request, channel=object.channel_id, live_only=live_only) return response.content
0
cd46c841a688f2ba9f2d4c0a7ebd5202
765b98cbabb8cedfee2034ba695bc24b
查询版块列表,根据版块名称可进行模糊查询
class TopicServiceT extends BaseService{ public static function getBoardList($name='',$pid='',$bid=false,$pageIndex=1,$pageSize=10,$hashValue=false,$displayType=2){ $params = array(); if($name) $params['name'] = $name; if($pid) $params['pid'] = $pid; if($bid) $params['bid'] = $bid; ...
1
64bc54fbb0c50de3c68d573f662a7757
537d4a73539bc796f5c2ae5d61fa2037
匹配正则命令,以便重定向到DO或LET命令
{ if(this.GrammarStr== "1011>1013") { this.GetNode(0).Assignment(vt, mlList); return; } if(this.GrammarStr== "1011>1014") { this.GetNode(0).Command(vt, mlList); ...
0
ac0273209cd55f1aa70156e41906590a
ad49b8881f5b1d7ee71b3624c53fadd6
Permet de savoir si la journée se passe en extérieur
{ if (premierJour < dateTestee && dateTestee < deuxiemeJour) { return true; } else { return false; } }
0
5c80f9b6040316456c0591db089e8339
109bc7a49a9780635d4a876eb52fc41b
True if we are probably in a unit test.
def _is_testing() -> bool: return os.environ.get("_called_from_test") == "True"
1
35c778fe410af90f6169b4f3fa106754
3d68e2a862368bb10e75dc4fdcd4e710
Muestra en la escena una simulación de las variables en un año especifico.
global snapshots, im, fig if variables[1][propiedades[0]]==4: prof=propiedades[2] if tipo==0: dimz=dataset.variables[variables[0][propiedades[0]]].shape[-3]-1 prof=dimz-prof snapshots=[np.transpose(dataset.variables[variables[0][propiedades[0]]][i,prof,:,:]) for i...
1
05465533d306559d33c5f3ac1243edc8
842e583d28fe96e7e924ecc4a1063233
Retrieve a stored RequestToken entry.
DelegationTokenInformation getToken(DelegationTokenIdentifier tokenIdentifier) throws TokenStoreException;
0
ca28d2253b5b79d3bdad060f87e8a735
05c33977be0c870dfcf4ca4aeeb9f5c5
Construtor da matriz de rotação
{ AtribuirIdentidade(); matriz[0] = Math.Cos(radianos); matriz[4] = -Math.Sin(radianos); matriz[1] = Math.Sin(radianos); matriz[5] = Math.Cos(radianos); }
1
d08508e6481df675979286cfe6bd4b31
487ee5451280a9c2eea7545acb70f12a
Gets the Map coordinates of a reference point.
{ if (referencePoint == ReferencePoint.TopLeft) { return (0, 0); } else if (referencePoint == ReferencePoint.TopCenter) { return (width / 2, 0); } else if (referencePoint == ReferencePoint.TopRigh...
1
5407f533bcc4d70308ccb09795654098
f4526b58cf5bbd0ce8d2812ddd0ff70b
获取人员工作量统计数据
@Controller // @RequestMapping("/service/workanalysis") @RequestMapping("/workanalysis") public class WorkAnalysisController @RequestMapping("/getPersonalWorkCapacityInProject") @ResponseBody public CyberResultInfo getPersonalWorkCapacityInProject(String start_date, String end_date, String names) { if (start_date =...
1
5a7940af35f0ea4572bf1a3e83f27ed6
de838db864287e76adcdac94b7ae5b13
Return a hash value of the MatchError instance.
def parse_error_hash(self): return hash((self.position, self.formatReason()))
1
0f351d1f6b1ac18af9ef3f9bd717dd14
9b8fd783c4e91002547ccc69c0d6b0f4
Checks the close flag of the specified window.
var count: number = this.activeWindows.length; if (count > 0) { for (var i: number = count - 1; i >= 0; i--) { var windowId = this.activeWindows[i]; var windowData: WindowData = this.windowMap[windowId]; var levelChecked...
0
740eb234de7713d8b13739e73c6da6d5
dcc7630947464e32603621f54fcc21b6
获得每个月天数,按平年和闰年
{ if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) return leapMonthDays[month - 1]; return normalMonthDays[month - 1]; }
1
c9d9cdb48cc1cb9fa235ca666c6de467
03668d502784de03633cc8c4063099ce
教师分页获取任务列表
PageGrids getToDoTaskPages(Integer pageNum, Integer pageSize, String id_, String assignee);
1
73966205f10657352d45ff5b86f1cc23
f7fa79d3e77eb919e538187cdb0e0aa3
レベルミックス時に何レベルをやってるか判断する関数
{ int level = -1; if(lpObj->Class == CLASS_MG || lpObj->Class == CLASS_DL || lpObj->Class == CLASS_RF) { if(lpObj->ChangeUp < 2) { if(lpObj->Level >= 10 && lpObj->Level <= 110) { level = 0; } else if(lpObj->Level >= 111 && lpObj->Level <= 160) { level = 1; } else if(lpObj->Level >= 1...
1
7c12a9f2d88abd443d612ddcae4cf159
db9bb81c5b5aac2046200a60c9780dce
Get 需要授权的用户UserId集合。跟上面的SealId参数配合使用。选填,跟上面的Users同时起作用
public class InvokeBcosTransRequest extends AbstractModel{ public void setSignUserId(String SignUserId) { this.SignUserId = SignUserId; }
0
e44ae2c4d0b95e74f60182102a4218af
8040472491b2568d6214219dcd88713d
Defines all the states specific for the pick and place environment.
super(ExploreHouse, self).__init__(outcomes=['succeeded', 'aborted', 'preempted']) explore_1_room_sm = DoOnExitContainer(outcomes=['succeeded', 'aborted', 'preempted'], input_keys=['map_image', 'map_resolution', 'map_origin', 'robot_radius', ...
0
0d0e36e122cbf229b3fb55c97274350c
896fcc3f337b25ba4a2e8f89a79f6b9b
avgör faktor för hur många rum som ska slumpas
class Difficulty (object) :#håller reda på svårighetsgrad och chanser def set_room_multiplier (self) : if self.difficulty=='easy' : self.room_multiplier=0.5 elif self.difficulty=='hard' : self.room_multiplier=1.5 else : self.room_multiplier=1
1
81aa12ff911a159ea06ff841f441de30
4d728ad92c0d730b3b53e58590d53669
Метод возвращает индекс элемента массива, сумма элементов до которого и сумма элементов после которого равны.
{ if (initArray == null || initArray.Length == 0) return null; var arrayLength = (long) initArray.Length; var n = arrayLength + 1; var fullSumOfItems = (n * (n + 1)) / 2; var fullSumOfSquareItems = (n * (n + 1) * (2 * n + 1)) / 6; long act...
0
611fd6e8207e97c762a0ca40d6db4a24
1d74166bb8cfbc6116ef9ddad56ea26d
Tests the get all book publishers of a book wrong parameter.
namespace LibraryAdministrationTest.ServiceTests [TestClass] public class BookPublisherServiceTest [TestMethod] public void TestGetAllVersionsOfBookFailsWrongParam() { var wrongParam = -1; var context = new Mock<LibraryContext>(); var service = new BookPublish...
1
ab1f3f108f4bd6c59d9d906579dc96f6
221c7b41531542a66c472c80f810fe18
getConstStr(). Builds the constant String based on the variables set in the constructor above.
{ $sConsts = ''; foreach($this->aFields as $sName => $aOptions) { if(isset($aOptions['const'])) { $sConsts .= $this->aTemplates['constDoc']; foreach($aOptions['const'] as $sName => $sValue) { $sConsts .= $this->fillFields('const', ['name' => $sName, 'value' => $sValue]); } } } r...
1
b7d87ca3838dae0eca723e9d1214171c
29c2ce6c242277ee6268d58d022ecc0d
Создает екземпляр объекта <see cref="object"/>, в зависимости от <paramref name="house"/>.
abstract class ModelFactory extends Object public abstract function createTypeHouse();
0
4dbb90f9c19514c0a039de6f28ab3ab4
92774f93f29ba545122e990bfc71c8fb
Sets the modified properties.
modifiedMaterialCompositionLabels = materialCompositionLabels; modifiedMaterialCompositionData = materialCompositionData; modifiedMaterialDataInPercent = materialDataInPercent; modifiedAssessmentValues = assessmentValues; modifiedChartDataInPercent = chartDataInPercent; }
1
44944dfbbb7dfb44652582ce8b2b887e
956781b340a980c4eb49b43269a75b25
returns the p-values for the tests against 0
class TestRQtiler(unittest.TestCase): def testZeroP(self): self.assertEqual(qtiler.quantile_R(self.testdata,0), min(self.testdata))
0
f9d224012362522c8a5173c41cb93eb2
c36564e218dd4aa5993be1586ee98bbd
Writes the specified character and color to the specified location.
namespace SchedulingUI void PutCharacter(int x, int y, char c);
0
7ff975ed3ccbfa9ef1418f67b33dd32d
996b555b9fda55ffca5348e894f5d81f
Sets whether to use syntax coloring.
public class EditorPart extends Composite implements HasChangeHandlers, HasLoadHandlers, HasFocusHandlers, HasClickHandlers public boolean getColorSyntax() { return this.colorSyntax; }
0
40831eb6e2a8280d160749358911be3e
64197fef0e6d36e9a38acdccf490604c
return LocalDate: beginning of the week of date in argument
def determine_begin_date_of_the_week(date): begin_date_of_the_week = date - datetime.timedelta(days=date.isoweekday() % 7) return begin_date_of_the_week
1
9f1e32f330a2f3cac8b554aeb325a7e8
41148d7b5a420e3a0c1e31fc6f06cbd5
Convert letters into numbers from string
class NumberLetterFullPipeline(Pipeline): def process_text(self, text): result = '' for c in text: inside_code = ord(c) if 48 <= inside_code <= 57 or 97 <= inside_code <= 122 or 65 <= inside_code <= 90: inside_code = inside_code + 65248 c = chr(ins...
0
e0f627035a71f65db49e6a03f67fc2ab
1a5e6be198e13ee4435c67563245cc4c
Update call for machines. Use instead of updateEntity -- it's called every tick on the server side.
class Mob(Entity.Entity): def update(self): self.Machine.update()
1
b12a716829e1df893a058cc75a8a84c7
b967047e4f9d8e90317799642b883717
Returns the row identifier for the latest entry of a particular property
{ $arr_s = SQLSelectOne("SELECT * FROM pvalues WHERE PROPERTY_NAME='".$prop_name."'"); if (is_array ($arr_s)) { $value_id = $arr_s['ID']; return $value_id; } else { return 'error'; } }
0
6478ab3186683eb2d1a47c5930dc94f4
8eff6cc2b3ae932f59ff7acc1db7fdee
+--------------------------------------------------------------------+ | PROJECT : GSM-PS (6147) MODULE : CMH_CCS | | STATE : code ROUTINE : chld_RetrieveHoldCallSpec| +--------------------------------------------------------------------+ PURPOSE : retrieve specific held cal...
{ l4ccsm_cc_call_disc_cnf_struct *msg_ptr = NULL; kal_uint8 src_id, id; kal_bool csd_flag = KAL_TRUE; kal_uint16 action; #if defined(__TCPIP_OVER_CSD__) l4c_result_struct result; l4c_call_entry_struct call_info; kal_uint8 next_call_id; l4c_number_struct addr; l4c_sub_addr_struct suba...
0
df89ecaa8520aed66085a483d98f0e6c
d28bf959cdb6b1cb7eac46f6a2eac4ff
层级遍历反序列化
class Codec: # 看的手机python的方法。思路还是比较清晰的。 # 在序列化时,前序遍历存入list。 # 在反序列化时,从头取数据(用deque比list高效),递归建树。 def deserialize(self, data): node_list = deque(data.split(',')) def rebuild(): if not node_list: return None node = node_list.popleft() if node ...
0
be39bdbe1a2649bb5c7eff81f9514cac
deae4c4228223dcabd63fdd848efc73c
Shifts out a byte, MSB first
void shiftItOut(int myDataPin, int myClockPin, byte myDataOut) { int i=0; int pinState; pinMode(myClockPin, OUTPUT); pinMode(myDataPin, OUTPUT); digitalWrite(myDataPin, 0); digitalWrite(myClockPin, 0); for (i=7; i>=0; i--) { digitalWrite(myClockPin, 0); if ( myDataOut & (1<<i) ) { pinState=...
1
45cecbad361ee51d00b61f6b2c178bf5
526249dcf60bd6644636c81466ae1507
Handle dynamic static method calls into the class.
public static function __callStatic($method, $params) { if (is_null(static::$instance)) { static::$instance = new static(); } $call = mb_substr($method, 1); if (0 === mb_strpos($method, '_') && is_callable([static::$instance, $call])) { return call_user_func_a...
1
7463f91e51a19a4fd89fdcc5cb09acb9
75196448691174ee9b208f39edf3dc11
样式二解析器。
{ HtmlStyleValueExpression result = new HtmlStyleValueExpression(); result.Expression = styleValue; if (styleValue.IsNotEmpty()) { using (HtmlStyleValueParserContext context = new HtmlStyleValueParserContext()) { ...
1
9673b8b9e8df842c7eac6404a60a7221
fba4f742947ae14f4ad83255525116ee
Pop a directory from the enumeration stack.
void dirstack_pop (void) { dirstack *tmp; if (dirstack_top) { tmp = dirstack_top; free(tmp->fullpath); free(tmp->filename); dirstack_top = tmp->prev; free(tmp); } else abort(); }
1
10fa77e5563c2b1fc4ae90f3e9bcc523
9e5c2bcf767ef00b32424dca4ebb5b33
Site Delete Confirmation
{ $del = Site::find($id); if($del) { if($del->delete()) { return array('status'=>'Deleted!'); } return array('status'=>'Not Deleted!'); } return array('status'=>'Not Found!'); }
1
eb9b3a5affafa103d2f117c6db553ce2
3763d4361cb6efc55c320168e570d07d
设置当前控件为修改操作员信息的状态。
{ if (_userState == Parameter.UserState.管理员) { setControlTrue(); } else if (_userState == Parameter.UserState.审核员) { if (_formState == Parameter.FormState.审核通过 || _formState == Parameter.FormState.审核未通过 || _formState == ...
0
e62a36f22fa5877f075a34b2b77e656e
b759cc15bebbea798518e8cda736bfc5
Return the cosine of z.
class CoordFunctionSymb(CoordFunction): def cos(self): return type(self)(self.parent(), self._simplify(self._express.cos()))
1
a72207379e1c4f6f5816f9980772f4e1
8590a02301c5349d05496061fe5bfb83
Makes an exact copy of the list, deep copying, not shallow copying
class LinkedList: def Copy(self): return copy.deepcopy(self)
1
233f7fc4dc704efd187773e9636838d8
356485fea2d2b64412124e2a04db3ada
Copy Constructor (auto generated)
NonCopyable() = default;
0
d1958878a3aaa659c408e1ca7123885a
a4bda853e3571b3a369e153511f98c7c
Convert core languages Latin string to digit token string
if text_input and self.supports_language: return alpha2digit(text_input, self.language_code_short, relaxed=True, ordinal_threshold=0) elif text_input: return text_input else: return ""
1
c6680bea4ac34303c1a0e73f710d4390
8bc8bae4f505261aeba40fb0b5caf6b0
The function thats called when the `deletion thread` *wakes up*. Here all the objects received from memfree() for deletion are deleted.
fn after_deallocate_all(&self) {}
0
b597babfa5d1be7d78e9af4cfe0aaf91
b2dd0715bc9f45a608189027954a296a
Output group directory permalink.
class QPPage extends RMObject public function permalink() { global $cuSettings; $mc = RMSettings::module_settings('qpages'); if ($mc->permalinks) { if ('' != $this->getVar('custom_url')) { $rtn = XOOPS_URL . '/' . $this->getVar('custom_url') . '/'; } e...
0
f93fd39d21c3d276078172b561862fff
b1fb42ea80c2c9d0adf67aeb8c8d829a
ウィンドウ上からマウスが出るのを待機する。
namespace AutoIt internal static class AutoItX public static int WinWait(IntPtr winHandle, int timeout = 0) { if (AutoItX.Is64Bit()) return AutoItX_DLLImport.AU3_WinWaitByHandle64(winHandle, timeout); else return AutoItX_DLLImport.AU3_WinWaitByHandle32(winHandle, timeout); }
0
fb80f95ba5b695f8173a633f6ac711ad
2ef3a10a633fdb9fa023487e4c58f9e3
导出售后申请列表
$paramData = request()->post(); $paramData = array_filter($paramData); if(isset($paramData['customer_id'])){ $where['oa.customer_id'] = $paramData['customer_id']; } if(isset($paramData['order_number'])){ $where['oa.order_number'] = $paramData['order_number...
0
bc7c1bfc2eaee1b01db01b0f47c3bdbe
913ae659cb38cc7f2d74cacf3008f159
Get the admin menu for the module
{ if ($this->module->id != 'admin') { return [ ['permissions' => \humhub\modules\admin\permissions\ManageModules::className()] ]; } return []; }
0
f439e931a43a376d51b66a0298d74194
48d762e9e2b338e9492d6ae82277f2ed
The quote instrument of the pair being traded.
class QuoteRequestCustomDefinition(QuoteRequestDefaultBase): def OriginalTrade(self): return super(QuoteRequestCustomDefinition, self).OriginalTrade()
0
60af59b36a6248d866d839d8401176ac
657670655def724584c3c85ad09a924b
Retrieves the Parser Ban ID
String parserId();
0
6b91b16563fd80e5dde1d02d67e9547e
44ed33177b2b5ce209482081df1d849a
Dead simple python wrapper to call xrandr to reorient itself with only real displays.
class XDevice(): def rotate(self, mode): Helper.sendSystemCall("xrandr", "-o", self.rotModes[mode])
1
18fbdc8266e9e3c92818f23389e8f726
ffd490666e5d10623857a8aa04188521
This function finds the nth permutation of a given set.
fac = [1] for i in range(1, n + 1): fac.append(fac[-1] * i) elegible = range(1, n + 1) per = [] for i in range(n): digit = (k - 1) / fac[n - i - 1] per.append(elegible[digit]) elegible.remove(elegible[digit]) k = (k - 1)...
1
8511aec56e7ca7469530ae331df0531c
4e6f553cf7bbdfee39ecbce866044fb7
Filter the `core.response` event to decorate the action
beforeSend(event) { const { breadcrumbs = [] } = event; return { ...event, breadcrumbs: breadcrumbs.filter( breadCrumb => breadCrumb.category !== 'console', ), }; }
0
a558639d4ad6d12717b32185faf44368
5239ba6abde20b3703b78cf84f18958f
返回一个迭代器对象,因为当前对象就是迭代器,所以返回自身
class MyIterator(): def __iter__(self): return self
1
570a5d7d29c7a4db99b372d806368383
7ff11591af7505618d7889660f0b5874
see https://developers.google.com/apps-script/reference/forms/page-break-item
const parserutils_vector *vector, int *ctx, css_style **result) { int orig_ctx = *ctx; css_error error; const css_token *ident; uint8_t flags = 0; uint16_t value = 0; uint32_t opv; bool match; ident = parserutils_vector_iterate(vector, ctx); if (ident == NULL || ident->type != CSS_TOKEN_IDENT) { *ctx = ...
0
3d0fa437f57f4687dd7acb76d28f2e72
12fde7e43eb291aadce401da7a072066
按照指定路径path 插入字符串 s
BufferedWriter writer = null; try { File file = new File(path); mkdirIfNotExist(file.getParent()); writer = new BufferedWriter(new FileWriter(file)); writer.write(s); writer.flush(); } catch (Exception e) { e.printStackTrace...
1
db3005a6912f416d0823b76d6cf8ace9
99f8c4149d2aaa7a47c96e3ed9e177fc
Parse the repsonsive attributes. containing values for each breakpoint, each of which could be null.
export class ViewConfig parseAttributes(values: string[]): void { this.attributes = values.map((value) => new AttributeConfig(value)); }
0
52863e9f4d1f23c568813f660476c8e7
f7a4a284dbbd2d0d5e6ce177d6488cb2
Applications usually only need a handful of samplers. So just define them all up front and keep them available as part of the root signature.
{ const CD3DX12_STATIC_SAMPLER_DESC pointWrap( 0, D3D12_FILTER_MIN_MAG_MIP_POINT, D3D12_TEXTURE_ADDRESS_MODE_WRAP, D3D12_TEXTURE_ADDRESS_MODE_WRAP, D3D12_TEXTURE_ADDRESS_MODE_WRAP); const CD3DX12_STATIC_SAMPLER_DESC pointClamp( 1, D3D12_FILTER_MIN_MAG_MIP_POINT, D3D12_TEXTURE_ADDRESS_MODE_CLA...
1
eba424282da0b70c5117b1aa1f84051f
cf91d5fb753398e6b7c74b83d2a0e73f
获取卖家待完成订单
func FindSellerOrderComple(sellerId uint)int{ var total=0 Db.Model(&table.Order{}).Where("seller_id=? AND state=?",sellerId,3).Count(&total) return total }
0