query_id
string
corpus_id
string
query
string
code
string
label
int64
3a9fcee8671ab5ff39f6f3fc9fbffd9a
8b32bf94c387f87b5f6dd044c6bd7fbf
Signals that changing the dream experiment was successful.
def success(): return "Data successfully changed!"
1
510198338831ec9e731a7714165e9a0f
8214d1df47623c47c96e2ad01acb82a8
Evaluiraj podstablo i vrati skup stranica koje sadrže reč.
path = os.path.join(directory_write, frontpage_filename) with open(path, "r", encoding='utf-8') as f: return [ujemanje.group(0) for ujemanje in regex_book_block.finditer(f.read())]
0
86693be6c09da4f44dc428ca9a5b28cb
47bf3992a895fef3575895b27fe950d1
Moves the given email from a given user's account to the trash
class PbeImap extends AbstractModel protected function _delete_email($email_uid) { if ($this->_is_gmail) { $trash_bin = $this->_get_trash_folder(); imap_mail_move($this->_inbox, $email_uid, $trash_bin, CP_UID); } imap_delete($this->_inbox, $email_uid, FT_UID); imap_expunge($this->_inbox); }
1
099cc504125f153e3242d3b55e4b0620
7bd53c66bf8670f925f854eee5eb742f
Get a single WRONG testing value for the specific type
class ilLOSettings public function isRandomTestType($a_type) { $tst = $this->getTestByType($a_type); include_once './Modules/Test/classes/class.ilObjTest.php'; return ilObjTest::_lookupRandomTest(ilObject::_lookupObjId($tst)); }
0
d26bc7441430fb8ab576272eae6827c4
ac683cb90ceae3988235e11803f96757
InputStreamとして取得したレスポンス情報を文字列用バッファに格納します。
{ int byesRead = _responseStream.ReadFromStream(_buffer.WriteBuffer, 0, _buffer.WRITE_BUFFER_SIZE); if (byesRead > 0) return _buffer.WriteBuffer.Take(byesRead).ToArray(); else return null; }
0
fac90246701c86316a2e5769a9fab5aa
4080561088bdb3dbccee15c6e81ec888
Provides an {@code Iterable} collection of the entries in this {@code Map}.
public class UnsortedTableMap<K, V> extends AbstractMap<K, V> public Iterable<Entry<K, V>> entrySet() { return new EntryIterable(); }
1
46787d51e7838d563934f7e4aa9f203b
240b16bfb4ab3c3d388cec15a51fe70a
Capitalizes the first letter of each word and removes any spaces between words to form a single, Pascal cased word.
string[] wordArray = phrase.Split(' '); for (int i = 0; i < wordArray.Length; i++) { wordArray[i] = CapitalizeWord(wordArray[i]); } return string.Join(" ", wordArray); }
0
c070053411cc67938f155b26a2373f13
1ed2f4a7fcbf79999f64a1f5d4cf9310
Handle a double tap on the side of the device
public void onSingleTap(long timeStamp) { boolean talkBackActive = TalkBackService.isServiceActive(); boolean tapIsntFromScreenTouch = (Math.abs(timeStamp - mLastTouchTime) > MIN_TIME_BETWEEN_TOUCH_AND_TAP_NANOS); boolean tapIsntFromHaptic = (Math.abs(timeStam...
0
e20d94e37053ae686bf6adc27532eb43
25b1f1747ebf46b60657d54ea04cd3f5
makes the setup for the Yamaha YMZ294 component
{ UINT8 l_bReturn = FALSE; s_YmInit_t* l_psYmInit; UINT32 l_u32YMFileSize; DWORD l_u32ByteRead; UINT16 l_u16TempData; UINT32 l_u32TempData; UINT16 l_u16Digidrums; TCHAR szYmPlayerInit[MAX_PATH]; UINT32 l_u32Offset; UINT8 l_u8Reg; UINT32 l_u32Frame; UINT32 u32YmDataSize; UINT8 u8NbOfReg; if (...
1
3aa56edfd4ecc8f047f2e9adc47e03af
85d1b03b2ddd82d86d6aa5d83fb0d362
Executa a rotação RL na árvore.
void RotacaoRL(ArvAVL *raiz){ RotacaoLL(&(*raiz)->dir); RotacaoRR(raiz); }
1
c8a310e2e2dab31125b10c84fd2949fd
81a5d226efeeeb53132e12551b6d1203
@brief Donne la date (UNIX timestamp) de la création du compte.
class User public function getCreationDate() { return $this->creationDate; }
1
e4c59d3be424e7b8e9b7b1599c7609a9
5545db8fd4a8ef0fb2bd068af6350161
Shows the attach panel and selects whether or not to animate.
namespace Tizen.Applications.AttachPanel public partial class AttachPanel public void Hide(bool animation) { if (animation) { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel); CheckException(err); } els...
0
43a05dddee8492fe11da15135bf6eff7
3ecea68f004e2039dcfca38edeb59d83
Рисует машины
function draw_cars() local x, y, a, c local x1, y1, x2, y2, x3, y3 love.graphics.translate(-camera_pos, 0) for i=1,num_cars_per_generation do c = car_list[i] if c ~= nil then x = c.car_body:getX() y = c.car_body:getY() a = c.car_body:getAngle() love.graphics.push() love.gra...
1
67911821a58318c59a27b6da3bde7803
910350cd6ff551d09aa1af21adae7dae
按控制器组封装控制器
function C($name,$method){ require_once "libs/Controller/{$name}Controller.class.php"; $controller=$name.'Controller'; $obj=new $controller; $obj->$method(); }
0
45afe627baede93c0a49fcd2c4d27ab9
572f1b15e862774f9938302e8d54b50f
this setter adds logic to handle conversion of several format types as well as enforces access rules on certain fields
{ switch ( $name ) { default: parent::__set ( $name, $value ); break; case 'type': $this -> $name = is_null ( $value ) ? NULL : (int) $value; break; case 'buttontext': $this -> $name = is_null ( $value ) ? NULL : substr ( $value, 0, 100 ); break; case 'lang': ca...
1
100346ef368b86b5eb222d496347a5be
3db940314f850ba3960806877361cad7
Test method for {@link com.sessionnotes.model.domain.Address#validate()}
public void testValidate() throws MessageValidationException { AuthenticationMsg instance = new AuthenticationMsg(); instance.setPassword("password"); instance.setLogin("login"); instance.validate(); }
0
10afcc64b0648bdb50cb5edf7ec28fb6
a109d2afc53eb5165a176e4520bda123
加载类路径下的属性文件
Properties prop = new Properties(); try { InputStream in = Configuration.class.getResourceAsStream(path.getPath()); prop.load(in); } catch (Exception e) { log.error("Classpath Properties init Failed. path:" + path, e); } this.putAll(prop); ...
1
4037a1824680fd65852e928383955d66
ec7a87528efb4bf1658b63d09afd171c
get_hist | | Takes an image, a channel specifier, a position in the | image, and a neighborhood size. Calculates the histogram for the | neighborhood centered around the given image position, for the | given channel. Returns the calculated histogram. | | Authors: Scott Carda
int* CImage::Histogram( int& m_pHistSize, void *pMem, int dRows, int dCols, int dBpp ) { return Histogram( m_pHistSize, pMem, 0, dRows, 0, dCols, dRows, dCols, dBpp ); }
0
637990324c1a9e5b50fa14cf9773c779
cfbb5adee955ed5a9f3e1962eab025e8
Returns whether Onboard has been rendered or not
boolean isRendered();
1
fd4c91b984616b589de19202a6e5e193
1711f163a501e9873cccbd4440a390e1
结束的判断,当矩阵恢复到顺序排列时结束
public class EightNumUI public static boolean finish(int[] currentStatus){ for(int i = 0; i < 8; i++) if(currentStatus[i] != i + 1) return false; return true; }
1
9822dbe4a2179f80ffb23df7b0f51581
a390664e7d97495a494123163bcea8f8
Gets site lookup information based on service(s) provided as paramater
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status422UnprocessableEntity)] public async Task<IActionResult> GetAsync(String domainOrIp, [FromQuery] String[] services = null) { (bool isValid, bool isDomain, bool isIp) = isValidDomainOrIp(domainOrI...
1
a5c59d2a4bd2dc968efc9833c12aab56
5638dffa77a5913e2ad25246f32bdaef
Handles the left mouse button coming up when the tool is in the 'panning' state. Stops panning if the left mouse button is the drag button.
public void onMousePressed( MapMouseEvent ev ) { panePos = ev.getPoint(); panning = true; }
0
a138a237aa0fada620a649df5a34d0c6
e8b8d0d9739f17e6c6c16370be019e1f
Faz a marcacao e a desmarcacao do registro conforme a sua selecao.
const product_id = $(this).val(); const content = $(this).parent().parent(); if ($(this).prop('checked')) item_selecionado_element(product_id, $(this).parent().text(), content.find('[data-price]').text()); else $(`#list-group-item-${product_id}`).remove(); attTotais(); }
1
ee38ba46b35e74783c7a02da50e9a618
fd8696d45f6f57eb6731053b524239b7
Test covered deals conforming to contract with chunk files and memory optimization feature enabled.
func TestOfflineChunks(t *testing.T) { hdb := &offlineHostDB{ "foo": false, "bar": false, "baz": true, } rsc, _ := NewRSCode(1, 1) f := &file{ erasureCode: rsc, contracts: map[types.FileContractID]fileContract{ {0}: {IP: "foo", Pieces: []pieceData{{0, 0, 0}, {1, 0, 0}}}, {1}: {IP: "bar", Pieces: []p...
0
e640314cc74697a073e5e79d6de6923d
43b45d10b4d9715fff33c4e065d619b1
ajax 获取当前等待处理的在线订单的列表
$ret = array('ret'=>'-100','count'=>'0', 'data'=>array()); $ebayOrderModel = new \Order\Model\EbayOrderModel(); $orderList = $ebayOrderModel->getWaitPrintOrderList(); if (count($orderList) > 1) { $ret['ret']= '100'; $ret['count'] = count($orderList); $...
1
2340d5a284ade5ee1a6fc2b3e540db53
8378c39f9794eb951af44b03830a9ceb
add days for recurring weeks.
class RAFDate extends RAFObject function addWeeks ($weeks) { $this->addDays (intval ($weeks) * 7); }
1
976006bdc8d1e6041fa8beaecafb0ef2
ec557622c44045c95dac5c50a4d91c58
字符串的左旋转操作是把字符串前面的若干个字符转移到字符串的尾部。 思路:以n为界,两部分内部翻转,再全局翻转可达到左旋效果
class Solution: def LeftRotateString(self, s, n): if not s or len(s)==1: return s length = len(s) k = n%length return s[k:]+s[:k]
0
181ef708b8e4c484891a7572b3012008
bba7e8521ee74f1f782ded567b2ef2f8
We want all blinking element to blink in sync
Scheduler_Init(); int blink_count[] = {1,3}; void* count_ptr = &blink_count; Scheduler_AddSporadicTask(100, 50, blink_for_count,count_ptr); Scheduler_Start(); }
0
2991b84027280011719d840d3bfaec62
4ef6756fa4bf325fc5c07ca98d8ef220
GET: CTVMonAn
{ if (DevExpressHelper.IsCallback) Thread.Sleep(500); var de = new DacapEntities(); var username = "Root"; if (Request["username"] != null && Request["username"] != "") username = Request["username"]; var root = de.AT_Th...
0
4598e9a1c6c82b904d90aade62d18c89
65290edd28b8271ae7bbde0cb436b0db
Remove duplicate nodes that have same x,y coordinates and different z coordinate
{ List<Point> pointList = new List<Point>(); foreach(Point point in mPointList) { point.Z = 0; if(!pointList.Contains(point)) { pointList.Add(point); } } mPointList = p...
1
457f3cb1117eafa80915cbd5e799afec
805d95def1cc5d6bec51204b69e3db85
Проверка ОГРН
function checkINN($inn = ""){ if(empty($inn)) return false; if (strlen($inn) >= 10) { $inn = substr($inn, -10); if (substr($inn, 0, 2) == '00') { $inn = ''; } } else { $inn = ''; } $inn_charset = !preg_match('/^\d{10}$/', $inn) ? "ERROR" : "OK"; $inn_v...
0
c49124d2c6fb3bd8f134a58be47d5ac2
092d073ffcbfdec7649f510e83f58926
Use the RGB LED as an indicator of WiFi status
void updateConnectionStatusLed(void) { RGB_Status networkStatus; bool bIsNetworkReady = false; if (Networking_IsNetworkingReady(&bIsNetworkReady) < 0) { networkStatus = RGB_No_Connections; } else { networkStatus = !bIsNetworkReady ? RGB_No_Network ...
1
f1416a89c5ff16b39b959d8821dd8a8e
423d42bda5933802c4094b93da59348f
Method to be called whenever there is an update about the sync progress
void progressThreadUpdate();
1
62ef8d856b61515d887f2b820527fec5
7a052f858c427e5c02593910de9b27ed
Updates subset of records with specified values.
abstract class GDbCursor extends GModel implements \Iterator, DbCursorInterface abstract public function update($criteria = [], array $properties = []): DbCursorInterface;
1
16f7cb225b770677f62fa463581e7c89
40fed33d8523bf8b0a1824c90bda1a36
服务器接收到客户端发送来要一对一传送的消息,判断要转发的另一个客户端是否存在, 如果存在则将原消息转发,如果不存在则传回消息给发送消息的客户端,告知目标客户端 不存在。
public class Server private void sendInfoToOtherClients(String msg, SocketChannel self) throws IOException { System.out.println("服务器转发消息中..."); for (SelectionKey key : selector.keys()) { Channel targetChannel = key.channel(); if (targetChannel instanceof SocketChannel && targetCh...
0
bc21333c16937de5786b1de97f90931c
7c871e44b4f1fa9bbef7ebcec650a712
Функция освобождает память занятую структурой HyScanDBInfoMonitor.
RTDbgSymbolFree(PRTDBGSYMBOL pSymInfo) { RTMemFree(pSymInfo); }
0
116ab75fd6898374142acde051f10678
9185927b0cdc62393de9b8f8cdeea0b1
Setter of <see cref="DependencyProperty"/> Culture. Only supported at DesignTime.
namespace WPFLocalizeExtension.Engine public sealed class LocalizeDictionary : DependencyObject [DesignOnly(true)] public static void SetDesignCulture(DependencyObject obj, string value) { if (Instance.GetIsInDesignMode()) { obj.SetValue(DesignCultureProperty,...
1
26a377731a6034ae0af00e2b749c0d51
a8d0893673ba052f88ee85761bc89005
Opens the settings window, with an optional specific tab
namespace SpectrumLook public class Manager public void OpenOptionsMenu(string startingTab) { m_options.SelectTab(startingTab); m_options.Show(); m_options.BringToFront(); }
1
acb0756e5c09ec8b5d15b9d0168571c2
c805f4b3e44ec9e2c1d6d0f3b5530f79
Initialization of consumptions
{ $req = $this->getBdd()->prepare("SELECT * FROM consumption ORDER BY idconsumption DESC"); $req->execute(); $myConsumptions = $req->fetchAll(PDO::FETCH_ASSOC); $req->closeCursor(); foreach ($myConsumptions as $consumption) { $conso = new Consumption($consumption[...
1
f66efda09f9717a9482a7fc37119d6d9
73f7dfacc6d42cdeb24d5c84a03c9d6a
エクセルを閉じたときに呼ばれる
class cExcel static public function close() { self::$book->disconnectWorksheets(); }
1
2337d9149af4f28e6ed0fecd2849ffef
61e80e36be5dd4fbe46587a74f2b2389
View of individual payroll company
{ $emp_row = Employee ::find($id); $menu =''; $empsal_row =Salary::join('employee_salary_pay_rates', 'salaries.salper', '=', 'employee_salary_pay_rates.id') ->join('employee_salary_types', 'salaries.saltype', '=', 'employee_salary_types.id') ...
0
a15850e98bb267c07720734556e959d1
5891b20b922f806d440b9dcaaed84afb
constroe a barra de tarefas
class MyViewPage(BasePage): def ir_para_ver_tarefas(self): if self.elemento_visivel(self.VER_TAREFAS): self.clicar(self.VER_TAREFAS) return ViewAllPage(self.driver)
0
f8e16002a6ab8c40fca5a9544b46d158
38b970f4f397ed533a172bf63729d99d
Test deleting an attribute value.
predicate = "metadata:tspredicate" data_store.DB.Set(self.test_row, predicate, "hello100", timestamp=100, replace=False, token=self.token) data_store.DB.Set(self.test_row, predicate, "hello200", timestamp=200, replace=False, token=self.token) data_store.DB.Set...
1
2685134a1433fa7c5b613852a97b7538
68e2ef71556c9fb7f145aed4ec5ee16b
Action for configuration of user login methods
class User extends \Website\Component{ public function init() { $this->add_function('loginForm', [$this, 'login_form']); }
0
1a9a19d8a1e785981ab25e9db3ebcfae
3720db75d470be1369d38cc663a6396f
Test get medication entry.
class ProUserFlaskTests(unittest.TestCase): def test_client_meds_json(self): result = self.client.get('/client_prescriptions.json', query_string={'client_id': 2}) client_meds = json.loads(result.data) assert ({'username': 'user2', 'prescriptions'...
1
343b1fae9e5023a6d5d079c1372a3c54
736a02a650a129465e13f225e59ff1c4
Set inter-compartmental flows (whether time-variant or constant).
original_time = self.time_flow self.timeRev() self.perm_shocks = perm_shocks self.temp_shocks = temp_shocks if not 'perm_shocks' in self.time_vary: self.time_vary.append('perm_shocks') if not 'temp_shocks' in self.time_vary: self.time_vary.append('...
0
d6804759979a059eb367a48864ee2700
7b209564ff028d65f7bca4621aafca9d
Recursively get all linked children of an element
{ var children = obj.GetChildInfos().Select(o => app.GetObject<GenericObject>(o.Id)).ToArray(); return children.Concat(children.SelectMany(child => GetAllChildren(app, child))); }
1
e639ac7482e11ce3ccc1766d00b9df91
cc5b833465e8774f6471568614374d82
loads initial page. Without filters and at zero page.
export class TableFilterStateService goToPageOne() { this.skip = 0; this.take = this.rows; }
1
38f0afaa911ca85d4e4e7674c470309b
1b51800800cbed0c7d4e9a2e59b31ba1
增加到工作流的尾部,moveTask用于控制当已经存在key的时候,是否将它移动到尾部
public class WFTaskPool extends TimerTask public synchronized static void addWFTask(String key, Map tasks) { CURRENT_POOL.put(key, tasks); }
0
ffc9cec24bc46460599d819c7b4ad5fd
3a0d3336d691f549aed1a41526140786
Overwrite a timestamp with the adjusted value.
void adjustTSVar(uint32_t * timestampVar, uint32_t timeSecs){ static uint64_t adjTime = 0ul; adjTime = timeSecs - (getNowTimestampSec() - (*timestampVar)); *timestampVar = adjTime >= 0 ? (uint32_t)adjTime : 0ul; }
1
62e553278262f8c52bcb53d701da6c99
514e4af4dc4afd40e4219186cd9b91ea
функция отправки сообщения пользователю аргементы чат айди и текст со значением по умолчанию
def send_message_to_user(message, id): vk.messages.send(user_id = id, random_id = get_random_id(), message = message)
0
a2245ed218e8497a04ae71b55eb68d0f
d958f51c97d0c8a70499bc65bff8af95
Returns the destination port transformation step for the specified server.
public Destination[] getDestinations(int serverId) throws ConnectException, AdminException;
0
d843992ea5a7284dedfce5239bb74f1c
bc9de30817a04b2157664cdc2ea7d332
Returns an Adadelta (Zeiler 2012) trainer using self._rho and self._eps params.
rho=0.9): self.learning_rate = learning_rate self.current_learning_rate = learning_rate self.decay = decay self.iterations = 0 self.epsilon = epsilon self.rho = rho
0
0c86d17a495a9a7995a2a3de8d7526e8
fd8f6bfadac3becccd6e700b7e345053
Metode som returnerer antall rader
public class SiteModel extends AbstractTableModel{ public int getRowCount() { return listSites.size(); }
1
46dfb6b63809b87ca046311a8828b46e
a4751b462d126fb32d3555f668039a2e
按最新的时间排序回答,返回合集Collection
final Query query = new Query().setFilter(new PropertyFilter("QID", FilterOperator.EQUAL, id)); query.addSort("Best", SortDirection.DESCENDING).addSort("AddTime", SortDirection.DESCENDING); JSONObject answers = answerRepository.get(query); final JSONArray answersArray = answers.getJSONAr...
1
916a2c837cfe7caec41181f39e47905f
7e072e114121e09497c7de99bbb8ef2d
Move Console function
const int FONT_SIZE = 15; HWND console = GetConsoleWindow(); RECT r; GetWindowRect(console, &r); MoveWindow(console, r.left, r.top, (width + 12) * FONT_SIZE, (height + 5) * FONT_SIZE, TRUE); }
1
3d22221a64c9eb69a022b376d94cd512
baece942d7a509e55892f05985ed4e53
图片向右动画
function right(count, speed) { if (count > 0) { count--; $.when( $(first_img).animate({ width: 'hide' }, { duration: speed, easing: 'swing', }) ).done(function () { ...
1
a974405ae876d781c617feef36bde7bc
17bc972b5e98abbb776e6524306042f6
https://matrix.org/jira/ => matrix.org/jira
func ParseGitProject(url string) string { var r *regexp.Regexp if strings.Contains(url, "@") { r = regexp.MustCompile(`.+:(?P<project>.+)\.git`) } else { r = regexp.MustCompile(`https://[\w.]+/(?P<project>.+)\.git`) } return r.FindStringSubmatch(url)[1] }
0
35f8c33cb99a5dd43dec75d487afb9c3
d86dcb85900ac7979a533c88889cc533
アニメーションランダム再生
public class Airship_Mover : MonoBehaviour public void RestartAnimation() { enabled = true; anim.Play("Airship_Move_Z", -1, Random.value); }
1
b20c96f14072d1e22880b33db115ab5a
f3c06d84aa781a55f1f1b77ca0d2e98d
回归树构建的核心函数,找到数据的最佳二元切分方法
feature,value=choosebestspilt(dataset,leaftype,errtype) if feature==None: return value regtree={} regtree["spInd"]=feature regtree["spvalue"]=value le,ri=spiltdataset(dataset,feature,value) regtree["left"]=creattree(le,leaftype,errtype) regtree["right"]...
1
e738c17ec70db6a8e20f8bcb999fc208
bb20f28d8ad13cc8c3c714c32f7a46f7
删除广义表L的第一元素,并用e返回其值
if (l == NULL){ return NULL; } Node* f = L_firstNode(l); void* value = N_data(f); L_firstNode(l) = N_next(f); L_size(l)--; free(f); return value; }
1
73a3d3ae3459def81e707a82d5a06aec
68e81283a76512d2d7bbdec53cd7f428
Retrieves the map of term weights for each document.
class Document public HashMap<String, Integer> getHashMap() { return this.hashMap; }
1
2cb782356552e166b8a44a02c87473e7
a1cf8ccd66fd22eb4b79d93d60d93fa0
chooses the first attacker at random
public class Board extends JPanel public void chooseFirstPlayer() { if (Math.random() > 0.5f) setActivePlayer(1); else { setActivePlayer(2); enemyDice = new Dice(); setDice(enemyDice); timerMode="InitiateAI"; animationTimer.start(); } }
1
d796e6745ae99d30407f91d7b66fa27e
b00092b8a3e59800debf834dd732c29d
Swaps the order of the two specified layers.
class YDisplay(YFunction): def swapLayerContent(self, layerIdA, layerIdB): self.flushLayers() return self.sendCommand("E" + str(int(layerIdA)) + "," + str(int(layerIdB)))
1
c17f7f3350e83a69585153f35ab0c301
b8add705b5678b41e27d0b5f4daf154b
将Java对象序列化成为JSON格式
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ObjectOutputStream out; String serStr = ""; try { out = new ObjectOutputStream(outputStream); out.writeObject(obj); serStr = outputStream.toString("ISO-8859-1"); serStr = jav...
0
ea4ccc9e2328422bd4886524ea4d5646
7d1945cbe6aab0464e71ad50030b56dc
calcolo messaggi effettivamente inviati, mex_non inviati e pacchetti persi
if(msg->data.hdr.len>maxmsgsize){ SendHdr_mutex(fd, &(msg->hdr), OP_MSG_TOOLONG); IncrError(); return 1; } char **lista=CreaLista(); int cont=AddtoAll_H(msg,lista); for(int i=0;i<cont;++i){ long fd=GetFd(lista[i]); if(SendMsg_mutex(fd,msg,TXT_MESSAGE)){ pthread_mutex_lock(&mutex_stat...
1
aee2d4e689388236ba9dc1cd7de6bad2
4ec580f79f2f89027b45635e1430482a
刷新顶部的UI
function RankListLayer1:refreshTop() local topBgPath = { "res/image/plugin/ranklist/duanTop.png", "res/image/plugin/ranklist/powerTop.png", "res/image/plugin/ranklist/levelTop.png", "res/image/plugin/ranklist/starTop.png", } self._topBg:setTexture( topBgPath[self._tabIndex] ) if self._myData.rank <= 50 then...
1
836ac3ab20e9b8d8d283a757825a4f0b
ed207470634a67e5b69e88dcd3e69353
returns the normalised cross product of two vectors
public class GameDirector : MonoBehaviour Vector2 CrossProduct(Vector3 vl, Vector3 vr) { Vector3 ret; ret.x = vl.y * vr.z - vl.z * vr.y; ret.y = vl.z * vr.x - vl.x * vr.z; ret.z = vl.x * vr.y - vl.y * vr.x; return ret; }
0
d389781d5aaee0c71683911331b4a7ce
1bbfbb5a23dbd7783c391b03df9dbff0
Toma los registros NO SINCRONIZADOS en SQLite y los guarda en WebService
public class SubirDatos extends AppCompatActivity public void updateLocalCapturas(JSONObject joCapturas) { try { JSONArray jaCapturasIserted = joCapturas.getJSONArray("ids"); if (jaCapturasIserted.length()>0) { for (int i = 0; i < jaCapturasIserted.length(); i++) { ...
0
2d7eac6560d032f7efadc2e4eb6659ba
64c521cd75586a66bbfd006737d2dc4f
Loads the PHONEMES table with file-data.
self._preTokenize() with open(filename, "r", encoding="utf8") as f: letter = f.read(1) while letter: self._processChar(letter) letter = f.read(1) self.emit()
0
35cf7516bbf0a552529b252bd4206576
4df8903b58cba5a1bb2f58efd53ff8b4
Tests successful sync
osbCtx := *broker.NewOSBContext("id", "2.3") underlying := &automock.CatalogGetter{} underlying.On("GetCatalog", mock.Anything, osbCtx).Return(fixCatalogResponse(), nil).Once() defer underlying.AssertExpectations(t) syncer := &automock.Syncer{} syncer.On("Execute").Return(nil).Once() defer syncer.AssertExpectati...
1
f6fb46250562647432c7bb6561095423
e4b1c3e211db5b53c4db3ec60c0f31c9
Function Synopsis [Dereference an ADD node.] Description [Dereference an ADD node.] SideEffects [The reference count of the node is decremented by one.] SeeAlso [add_ref add_free]
SUPR0DECL(int) SUPR0ObjAddRef(void *pvObj, PSUPDRVSESSION pSession) { return SUPR0ObjAddRefEx(pvObj, pSession, false ); }
0
b4f4ddf1b8280197afd1208dc6efc4dc
de1aa63ed668dee43bd5267aa427f4ee
Callback function for new ball detected
int j, i; static int last_frame_counter = -999; static int sendflag = FALSE; raw_blobs[BLOB1].status = TRUE; raw_blobs[BLOB1].x[_X_] = 0.25*sin(2.*PI*0.25*ball_speed*(task_servo_time-start_time)); raw_blobs[BLOB1].x[_Y_] = -0.75; raw_blobs[BLOB1].x[_Z_] = -0.8; if (sendflag) { send_raw_blobs(); sendflag = F...
0
ff19b5d81d6eb50eda4bf407caaf9ed3
80965da311028771130f2f78a4aa666e
修改弹性伸缩策略(V2版本) 修改指定弹性伸缩策略。修改弹性伸缩策略V2版本与V1版本的区别在于,V2版本支持修改伸缩资源类型。 Please refer to HUAWEI cloud API Explorer for details.
public class AsClient public CreateScalingV2PolicyResponse createScalingV2Policy(CreateScalingV2PolicyRequest request) { return hcClient.syncInvokeHttp(request, AsMeta.createScalingV2Policy); }
0
3bb396d613301f3e0fa3ec67ba5ecf93
03af1aa7f68c38d44e1d74433a6da750
e.g. hsa:5236
def get_chromosome(gene_id, bio_seq_obj) bsopa = bio_seq_obj.primary_accession return false unless bsopa chromosome_array = bsopa.split(":") $gff_chr.puts "#{chromosome_array[2]}\t.\tgene\t#{chromosome_array[3]}\t#{chromosome_array[4]}\t.\t+\t.\tID=#{gene_id}" return chromosome_array[2], chromosome_array[3],...
1
ca6b76fb6b3a0eee1835281a8276e571
eb9ddfa9a9cdc292c60ca88f82b6a7e8
コンポーネントの有効状態の設定
public class BehaviourEnableAndInitialized : MonoBehaviour, IInitialized, IEnabled public void SetEnabled(bool flg) { this.gameObject.SetActive(flg); }
1
d20ea645ef43416b5d0f8bc7951812e4
a9ba384e973b1808b3c191cca6883c69
Activate or deactivate BFD feature toggle effect.
void nsm_mpls_ftn_bfd_update (struct nsm_master *nm, struct ftn_entry *ftn) { struct nsm_mpls_bfd_fec_conf *bfd_conf = NULL; u_int16_t lsp_type; struct prefix_ipv4 fec; if (! nm || ! NSM_MPLS) return; if (! ftn || ! NSM_MPLS->bfd_fec_conf_list) return; lsp_type = nsm_mpls_bfd_ftn_owner2lsp_type (ft...
1
ec44f14d2b425597de9d080f7761b3e1
949b0865f9d61ac1682cf390c62fc065
存储当前用户是否曾开启阅后即焚的标识
local firstEnter = SystemUtils.loadAccountLocalData("STARCHARTS_IS_FIRSEENTER") if firstEnter == nil then SystemUtils.saveAccountLocalData("STARCHARTS_IS_FIRSEENTER", "1") end end
0
c4f9ea4c560030b005f220f2e1506458
b2d43016d0e7a578326e48a6fdd3812d
Update button state for mode changes (e.g. scenario edit vs game mode)
{ if (mode == DisplayModes.Generating) { generateButton.Text = "..."; } else if (mode == DisplayModes.Generated) { this.Height = 427; generateButton.Text = "Regenerate"; } }
1
70c0ff357a51efa21dcec80fc65d4ccc
a59d4dec5422f10c2b73585c3a1835f6
Find all instances of @xxxx text and send slack notifications to those users. If the user doesn't exist slack will just ignore.
sc = SlackClient(token) userlist = sc.api_call("users.list") for member in userlist['members']: if member['name'] == bot_name: bot_user = member['id'] print(bot_user) if sc.rtm_connect(): while True: messages = sc.rtm_read() if messages: ...
0
56f9f805ce0664c4d8aa20b6f9250441
cc36f3b92029b15a82d312a4f1b4fb37
se pueden escribir más datos
void escribir(string entrada){ fi.open(arch,ios::app); salid.open(arch); salid.seekg(0,ios::end); long fileSize=salid.tellg(); fi.seekp(fileSize); fi << entrada; fi.close(); salid.close(); }
1
8edeb95da017d8484a6c22ad764a12ee
bf5b280e02cba220ea97c2f381b42fe3
Check if there is given letter.
{ foreach (KeyValuePair<char, double> item in occurs) { if (item.Key == letter) { return true; } } return false; }
1
9345573d6591fab3efd59528d1559f7f
3f0c25f1bfcf7774c609e5af11c50fc2
Obtain a new (free) thread ID. Returns a free thread ID, or SYSERR if all thread IDs are already in use. This assumes IRQs have been disabled so that the contents of the threads table are stable.
{ uint32 i; static pid32 nextpid = 1; for (i = 0; i < NPROC; i++) { nextpid %= NPROC; if (proctab[nextpid].prstate == PR_FREE) { return nextpid++; } else { nextpid++; } } return (pid32) SYSERR; }
1
22d11a476c3802a11ede9cecd087e00d
55adbf6999a61bc1decc7daa924d037a
The ``(y, x)`` coordinate, relative to the cutout data, of the maximum pixel value of the ``data`` within the source segment. If there are multiple occurrences of the maximum value, only the first occurrence is returned.
class MaxMetric(BaseMetric): def run(self, dataSlice, slicePoint=None): return np.max(dataSlice[self.colname])
0
503372e3eb6f027ebf357913bd30c451
28495d9a82dd934574177bf98c3a9092
This is the list of coverages, wxTypes, intensities, attributes, for which special weather attribute wording is desired. Wildcards (*) can be used to match any value. If a weather subkey is not found in this list, default wording will be used from the Weather Definition in the server. The format of each tuple is: (cov...
class WTSS: def _list_coverages(self): result = WTSS._get(self._url, op='list_coverages') return result['coverages']
1
547b6c408353ea2bd527b8e2ec1c19ca
7985e029492fe01faaa1c65c3930a93e
● オートマッピングが更新されたときに呼ばれます。
class Sprite_AutoMapping def marker_updated draw_markers end
1
70326c5fc97d66176aa5c18866b2046e
3e74e9316b6db92939c8391c48f959b3
Get the physx Controller Manager of this world
FController* FComponent::GetController() const { return mlpController; }
0
0b6d094038f06aa5a7748690bfa75da1
bb60f03b05b89ae0dbae7635176515b4
Same as increment_mins, but decrements instead of increments
void CDateTime::Decrement(int secs){ long nSecsSinceMidnight = second + 60 * minute + 3600 * hour; if(secs <= nSecsSinceMidnight){ nSecsSinceMidnight -= secs; this->hour = nSecsSinceMidnight / 3600; this->minute = (nSecsSinceMidnight - 3600 * hour) / 60; this->second = (nSecsSinceMidnight % 60); return; ...
1
2d02a6480b4f7668e4ab59c73b405850
7725e17eea359929f8499dfe95cdfff4
Select the nearest pickupable object to pickup
public class Mover : MonoBehaviour bool SelectNewObject() { if (controller.placedObjects.Count > 0) { float shortestDistance = float.MaxValue; for (int i = 0; i < controller.placedObjects.Count; i++) { if (!controller.IsReserved(controller.placedOb...
1
a6df78c6f0fda02890551786a6b3a8cf
4ea58dd8752a1ed71678f663b863f05a
GET /kitchens_sliders GET /kitchens_sliders.json
class KitchensController extends BaseController public function index() { $kitchens = $this->kitchen->all(); return View::make('kitchens.index', compact('kitchens')); }
0
a91385485a5ad2b51428eef8492a61b7
ccfb3be1cd2e1fa75283c22f162aa8b8
If we're not dealing with an absolute path, then we need to get the *calling* code's directory, since the sql file is being referenced relative to that location
depth = RUBY_VERSION >= "1.9.2" ? 4 : 3 self.pathname ||= Pathname.new(caller(depth).first.match("(.*)#{File::SEPARATOR}lib")[1]) end
1
f8c14c29ea1f415e0e630edfa69ebfd7
5818e970df15bd28ed8526945c72d107
frequency to midi pitch
impl NoteSym pub fn to_freq(self) -> Pitch { 2.0f32.powf( (self as i32 - 69) as Pitch / 12.0 ) * 440.0 }
0
d755140763ee22ffb748cebb808ae0cc
d5c605c7161af69289438abf4b70583d
对方使用的第三方监测类型
abstract class dbs_templates_thirdParty_userInfo extends super public function get_thirdpartytype() { return $this->getdata ( self::DBKey_thirdpartytype ); }
1
2a7c9c7bd2f8084f0191d67c775563ad
0719772d8b58aefc43225243fb4c486f
Con este metodo podemos decir si el estudiante aprueba o reprueba.
class Asignacion(models.Model): def get_aprobado(self): return self.get_nota_final() >= self.grupo.curso.nota_aprobacion
1
1b610027244c6ca59b0fee9fb4896b2e
95276df2903ecb828971bb6add2d0e6d
Находит объем параллелепипеда.
namespace Moreniell.Inheritance.Entities.Body public class Parallelepiped : Body public override double CalcArea() { return 2*(size.Cx + size.Cy + size.Cz); }
0
11f67e850cd9c21c6a019affebfc0fd9
d7553e402721ed1a85e33d407d2d3936
Leave current subcommand. Returns parent command instance.
export class Command< // deno-lint-ignore no-explicit-any CO extends Record<string, any> | void = any, // deno-lint-ignore no-explicit-any CA extends Array<unknown> = CO extends number ? any : [], // deno-lint-ignore no-explicit-any CG extends Record<string, any> | void = CO extends number ? any : void, /...
1
66aedcd2938bd20c2d6727c6ab6734dc
e9b86f2b748e4736f61b21b4d4b61eff
Obtains the Tick Resolution.
public class YCarbonDioxide extends YFunction public double getResolution() throws YAPI_Exception { return get_resolution(); }
1
43d2995f753fe79632bfd695ed4be3cd
545dd4fa198d5e85d3e48e1acc4d8fd1
Se agregan los juegos disponibles para el casino
try { $result = array(); $stm = $this->db->prepare("select Id, Nombre from tJuegos;"); $stm->execute(); $data = $stm->get_result(); if(!$data){ echo 'no hay resultados'; ...
1
4f3ac0fe556f2f90c298ed47806178ad
6b549cd2716937485876f634b7d4e0fd
会员登录获取token
loginGetToken(params) { return requset(urlType.type.POST, urlType.url.LOGIN, params); }
1
bb90275675be86e005950eb56f662a57
e40325d8e7815b586fb12fa5697d4200
Test when the access token is expired
class TestAuth(EndpointShared): def test_access_expired_auth_token(self): self.__login_user_with_custom_duration(duration = datetime.timedelta(microseconds=1)) self.client.cookie_jar.clear(domain="localhost.local", path="/", name="session") time.sleep(1) response = self.client.get('/api/...
1