query_id
string
corpus_id
string
query
string
code
string
label
int64
67c8da6174a9beec442e8ed82f6ff19d
9398385b52e5aea8ba9f117bb405e5b3
Get the amount of listings on this page
class GetDataExchangeResult: def listing_count(self) -> int: return pulumi.get(self, "listing_count")
1
67eaaeb5a27fae99871fd0f0f4360f30
ae13b925e60c2138493be22205cfd5d8
Unsets the value of the '{@link com.nokia.carbide.cpp.internal.codescanner.gen.Kbdata.CodeblockType#getScale <em>Scale</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
boolean isSetScale();
0
7bf71c420a7520a1a91dccb3b8fd5e27
e245634a6aa44df5aefa0a1ad78f2f76
Load headers from csv file and return a set of headers
def get_header(path: str) -> List[str]: with open(path) as f: header = next(csv.reader(f)) return header
0
3b132c9acc7d4ea36c457d6806f974b8
a0951b15282c5d23628962e299be15bb
检查当前帧是否是关键帧,判断策略是检查相对参考帧(上一个关键帧)的运动是否足够大, 只有运动足够大才算关键帧
int frameNumber = (int) (stateTime / frameDuration); return keyFrames.length - 1 < frameNumber; }
0
9473059c338b313ba5029072ab980ebb
4683be48f8824c71b7b28fded6b664be
Magically pass methods to the default bot.
abstract class Driver public function __call($method, $args) { return call_user_func_array([$this->client, $method], $args); }
1
e151625bfeb82a70bad8f4ac9bfbcbaa
76bc73b2734fb1092ee21cc578d0614f
Retorna um array correspondendo a cada linha do arquivo.
public List<String> getLinhas() throws Exception;
1
0e59fdeb7fe6c9b15d6a11c26d667dab
b24f011e395fc86aa0338ad089a7d1bc
Function to update the positon of a set of particles in an electromagnetic field over the time dt
void update_particles(int idx, double m[], vector f[], vector recv_p[], vector recv_v[], int N, int chunk, double delta_t) { int curr = rank * chunk + idx; double factor = delta_t / m[curr]; recv_p[idx][0] += delta_t * recv_v[idx][0]; recv_p[idx][1] += delta_t * recv_v[idx][1]; recv_v[idx][0] += fac...
1
d61c86cddf2b26bfe855b70a6a1c6935
97a63fc926b19963687560d43346d980
将实体对象传入到需要执行的任务线程中
public class CommonTaskManager public void createTaskThread(Object task){ }
1
173c58370c3ef0b59464bed780c190a6
d624b4de0a0bcda0c34092138612a9c8
Функция проверяет, что если при создании поста указать группу test_slug, то этот пост появляется на: - главной странице сайта, - странице выбранной группы.
class PostURLTest(TestCase): def test_post_group_slug_url_exists_at_desired_location(self): response = self.guest_client.get('/group/test_slug') self.assertEqual(response.status_code, 200)
0
f0d578324ff12f079f58e9c60fc2ebef
1622e609a12d4c46416dfb80cb215911
Sends the alliance info.
function okayButton.DoClick(okayButton) Clockwork.datastream:Start("CreateAlliance", textEntry:GetValue()); end
1
ba82b5b9a3946193828cb80f4895892d
41fc17b95aa73e95f5e56992441fb5ad
从 第一PPT 网站上把 no1ppt对象对应的包含PPT文件的压缩包下载到本地
namespace ZK.Common public class CommonFunction private static string GetPPTImage(string filepath) { string imagepath = System.IO.Path.GetFileNameWithoutExtension(filepath) + ".jpg"; try { Microsoft.Office.Interop.PowerPoint.Application pptapplication = nu...
0
32a1a622b915a2b3290af7c34e41e4e9
2fe45be564c7fdd1752f2abfd2d14972
添加用户(医生)
async function addDoctor(data) { return request.post(`${BaseUrl}/manage/health/BaUserController/add/doctor`, { data, }); }
1
ef6d7c3d22fc9233a2dacf7cde688629
7aae353e99ee53bfa0dbb23d67af1c16
获取北京单场最新开奖期号
$type = intval($type); include_once($_SERVER['DOCUMENT_ROOT'] . "/include/http.class.php"); $curl = new Curl_HTTP_Client(); $curl->set_referrer("http://old.1680180.com/lottery/10015.html"); $curl->set_user_agent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4....
1
37448d778aa2137205256755ab4b4962
df22a17e8324bd610a26390f59f693c1
Dynamic finder that find thread Id which has unread messages.
@Slf4j public class ProfileMessagingLogicImpl implements ProfileMessagingLogic @Override public int getThreadsWithUnreadMessagesCount(final String userId) { return dao.getThreadsWithUnreadMessagesCount(userId); }
0
a25f46b84e2f23c7242db99291c47457
bb9b59f4596c5d34cf3dcf2a7a75155f
Sets trip deals.
class OptionTrips extends OssnDatabase public function setTrip($values) { $user = ossn_loggedin_user()->guid; if(empty($user)) { return false; } $this->title = $values['title']; $this->place = $values['place']; $this->continent = $values['continent']...
1
5c760220a1e13da536912f64b16dd6bf
a9edc493ac8026b06c7e0d1fc3677d36
将带有CRC检验码的字符串进行CRC检验,判断生成的校验码是否等于字符串自带的验证码
ok = False if crc16_check == self.__crc16: ok = True return ok
1
635afea4f8730b3d4f604613104ffbcc
53890e60f1972e5ab363d8036f001531
List-1 > make_ends Given an array of ints, return a new array length 2 containing the first and last elements from the original array. The original array will be length 1 or more.
def make_ends(nums): return [nums[0], nums[-1]]
1
4e4e5f35861911046c17388b0f2c4c90
d64e11de7d5ddac7773a09de4ff06803
Подписывает сообщение-ответ в СМЭВ
PrivateKey privateKey, X509Certificate certificate, ZonedDateTime expireDateTime) throws SOAPException, GeneralSecurityException, TransformerException, InvalidCanonicalizerException, CanonicalizationException, IOException { final SignAlgorithmType signAlgorithmT...
1
ed102be969ded346e3a36700eae16596
166210fb7e2bde677a376b2a63738723
retorna a casa na posicao (linha, coluna)
casaTabuleiroTetralath* vizinhoEncontrado = this; if(distancia_param == 0){ vizinhoEncontrado = this; } else{ if(distancia_param < 0){ switch(linha_param){ case LINHA_HORIZONTAL: vizinhoEncontrado = getVizinhoC(); break; case LINHA_DIAGONAL_CRESCENTE: vizinhoEncontrado = getVizinhoE(); bre...
0
94b7e3ce21b57f375ac326725d08ee38
23e847d4d64e7ca15ea94beadf42b8d4
发送某礼物成功调用,更新本地钻石数量
function HomeLandCanvas_New:UpdateGiftNum(giftcnt,boxcnt) MyCompany.Aries.Inventory.HomeProfilePage.UpdateGiftNum(giftcnt,boxcnt) end
0
790ece0edba232999415c39bd216fa95
67170d2c9a46c0b3470a689723e518ed
Runs a command. If not successful (i.e. error code different than zero), print the stderr output as a warning.
class SampleRunner: def _run_command(self, desc: Text, args: Sequence[Text]): if logging.get_verbosity() > 0: args = list(args) + ['-v={}'.format(logging.get_verbosity())] cmd_line = subprocess.list2cmdline(args) logging.vlog(1, '%s: %s', desc, cmd_line) start = time.time() basename = os.path...
0
a90993b315ad2cc014b67d59b3baa1e4
4ff23708c696ff4ae56bf62b3292bae9
根据省份ID查询所在其省份的学校
namespace com.xiaolianxiao.DBInterface List<School> GetSchoolList(int proId);
1
29b8f80cfe22a1f7ace423dc4fcb38a7
5dfdfa45bcd710178c348004e28ee0ba
Loads M-Tree instance from a pickle file
def grab_tree(filename): import pickle fr = open(filename, 'rb') return pickle.load(fr)
1
a56bdc6414c3b5217622ac64403788a2
22cfa2959fc2c4a6f695946ca5f96af8
Posts the diagnostic logs.
{ try { var data = new LogEvents(events.Select(x => new Data.LogEvent(x, x.RenderMessage()))); var text = JsonConvert.SerializeObject(data); var bytes = Encoding.UTF8.GetBytes(text); var request = (HttpWebRequest) WebRequest...
1
009e2a380cca5eeecaa8587cae78b999
3d511a5eece227367a4603f0da3c8422
We always make sure that the transaction is rolled back after each test execution, so the database will remain in its initial state.
class ActiveSync_Backend_SyncStateTests extends PHPUnit_Framework_TestCase protected function tearDown() { Tinebase_TransactionManager::getInstance()->rollBack(); }
1
4b48c94f67d8e835c480bd2a0624d6fa
278cfb1368f491447d0ec1b580be966d
Replace the instances in the group using updated launch configuration
class InstanceGroupTest(test.HeatIntegrationTest): def test_update_group_replace(self): files = {'provider.yaml': self.instance_template} env = {'resource_registry': {'AWS::EC2::Instance': 'provider.yaml'}, 'parameters': {'size': 1, 'image': se...
1
6219fb35b39ec5c97c0948f5cf75dd23
457808ba3cd2f2f96d8d9bd1f7d5a67e
根据备注查询订单
try { Orders orders = OrdersServer.findOrderByOrdNo(getOrdNo()); getResponseMsgMap().clear(); getResponseMsgMap().put("orders", orders); } catch (SqlException e) { e.printStackTrace(); getResponseMsgMap().clear(); getResponseMsgMap(...
0
66c68b842ba879daf3fa85eb81e392f2
0c4cf7a84cc8b7d940dc84fcbf712eff
createTheFleet method will ask for co-ordinates from the player to place the ship and will check whether the inputs are valid or not. It will then call the function to place the ship at the given location.
{ int CxPoS; int CyPos; CoordinateGenerator randomCoordinate = new CoordinateGenerator(); for (int i = 1; i <= Integer.parseInt(info[3]); i++) { do { CxPoS = randomCoordinate.generateCoordinate(0, Integer.parseInt(info[0])-1); ...
0
eab7feebea2bb9b898d636c034e847a3
cdbbae85a29053d2fa5ff27ee0d553ec
When this callback is called the table parameter is unreferenced and the sound source can be garbage collected
namespace ASCIIPlayer FMOD_RESULT F_CALLBACK OnDSPRelease(FMOD_DSP_STATE *dsp_state) { if (dsp_state->plugindata) { mydsp_data_t *data = (mydsp_data_t *)dsp_state->plugindata; if (data->buffer) { free(data->buffer); } free(data); } return FMOD_OK; }
0
bda1bd2a760cf18fb5959ea507499084
327831061e74f18ba06d78e3b99ba87a
获得当前页面客户端的IP地址,使用ServerVariables获取。
public class BaseJsonPage //: System.Web.UI.Page public String GetClientIp() { String clientIP = ""; if (System.Web.HttpContext.Current != null) { clientIP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(clien...
1
012798a9a28983ce5a986b703eaf47b2
1cfac3f77916d6c2910cfafeeb9dee44
设置主商品进项税额
@Table(name = "biz_tx") public class BizTx implements Serializable public void setTtJe(Double ttJe) { this.ttJe = ttJe; }
0
ecb425d8c10bccc7648a847d2df3edb2
e689d5bed6f2d6f449e713eb3d5efce9
检查交叉引用 (检查 参考节点 是否在树模型中存在重复引用)
String sql="SELECT 1 FROM RD_CROSS_NODE CN WHERE CN.U_RECORD != 2 AND CN.NODE_PID = "+nodePid; DatabaseOperator operator=new DatabaseOperator(); List<Object> result=operator.exeSelect(getConn(), sql); if(result!=null && result.size()>0){return true;} return false; }
1
bbbf155ab99355af21a5dbed7aff74a4
955021f5e9d161724c92224748cb3f6e
Determines whether this hand has no value (no pairs, three of a kind, etc. etc.
{ if (($this->countPairs() === 1) && (count($this->handInfo['values']) === 2)) { return true; } return false; }
0
14e4dbb52c95d2a90b7ccf1c54e762fc
c33689832e4a67b22ea8ba97e155f640
Проверяет, есть ли зарегистрированные пользовательские модули
class UserList extends CBitrixComponent protected function checkModules() { if (!Main\Loader::includeModule('main')) throw new Main\LoaderException(Loc::getMessage('STANDARD_ELEMENTS_LIST_CLASS_IBLOCK_MODULE_NOT_INSTALLED')); }
0
1858d899c9348ff9ae1b3f21e5fffc1d
5a94acbafc6de8af2cc131ef5954073a
Asserts that a mutex is locked by the calling thread.
{ OS_ERR os_err; D_ASSERT(rtos_mutex_p->mtx_signature == MUTEX_SIGNATURE); D_ASSERT(CPU_MODE_IS_THREAD() && CPU_INTERRUPTS_ARE_ENABLED()); OSMutexPend(&rtos_mutex_p->mtx_os_mutex, 0, OS_OPT_PEND_BLOCKING, NULL, &os_err); if (os_err !=...
0
2473dc638eac3216707d89a1f91cc22e
988304951cfedb5b58db3355f162b39d
This function creates a single parameter and returns it
ASTNode * node = new ASTNode(AST_PARAMETER); node->children.push_back(type()); node->children.push_back(identifier()); return node; }
1
806605ef480f18907d2e4783da1ec2b7
07f5a4593f0534f1b4937d932a46efa7
自定义listview显示数据库条目
{ List<Map<String, Object>> userlist = new ArrayList<Map<String, Object>>(); Map<String, Object> map; SQLiteDatabase sqliteDatabase = dbHelper.getReadableDatabase(); Cursor cursor = sqliteDatabase.query("menu", new String[] { "menu_id", "menu_name" }, null, null, null, nu...
1
e4cb470ae6d3d2766b1072d7ee6d05d6
7b7bac0137066c51071dbb3d2e58d172
Test the api can create a company.
url = reverse('api-v3:company:collection') response = self.api_client.post( url, data={ 'name': 'Acme', 'trading_name': 'Trading name', 'business_type': {'id': BusinessTypeConstant.uk_establishment.value.id}, 'compan...
1
3636f27e2d5482c4803c7106ce147810
083357f9c1e5c43673a0009675bd7204
订阅报价表回调
void CustomMdSpi::OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { if (!pRspInfo->ErrorID) { LOG(INFO) << "取消询价订阅成功"; LOG(INFO) << "合约代码:"; } else { LOG(INFO) << "取消询价订阅失败"; } }
0
f41573c5db2b349cbb5117feb2e62a86
ec3dcf2a1bf2098b787b2fe82c46d8e9
将Map组装成Post请求参数
System.out.println(map); if(map != null){ int cnt = 0; StringBuilder sb = new StringBuilder(); for(Entry<String, Object> entry :map.entrySet()){ if(cnt!=0){ sb.append("&"); } sb.append(entry.getKey()).append("=").append(entry.getValue()); cnt++; } postParams = sb.toString(); } ...
1
97dd24a7c6c871832f46dfa37072758b
5522c8a501ad9144f2c3f3eb7b09d8a3
เพิ่มคอร์สเรียน
{ $this->load->library('form_validation'); $this->form_validation->set_rules("batch","batch",'required'); $this->form_validation->set_rules("name","name",'required'); $this->form_validation->set_rules("subjects","subjects",'required'); $this->form_validation->set_rules("hour"...
1
2d7d8a8d9091bcc076ea22680ea2d33b
a4365b0a55066e9a77fb8b0b6c853aa9
Attempts to download the free version of the song
{ File.Delete("Cookiesound(kari).old"); File.Move("Cookiesound(kari).exe", "Cookiesound(kari).old"); downloadClient = null; u = new Uri("https://cookiesound-4de19.firebaseapp.com/" + str + "_Cookiesound(kari).exe"); if (downloadClient == null) ...
0
97d1769f94496e7b4829436f1055ef22
f7ec7c6814446afb3b62c8a4ec66fa13
A felhasználói felület kilépés gombjának eseménykezelő metódusa.
public class MainAppViewController extends ViewController public void onCloseButtonAction() { mainAppViewModel.userLoggedOut(); System.exit(0); }
1
8b877481329cfd5305c8aa693b4d4df7
b34f2a7b144ac40b1c7f676ccf7fca03
获取折扣开关
@Table(name="yoehi.ra_store") public class RaStore public Integer getStore_decoration_switch(){ return store_decoration_switch; }
0
b4626f51edb54ab1669b065e104aaa8e
3518dc8a0af934ea78bdc9a89526ee53
Add element of type Int32.
public void WriteInt32(int value) { const int size = 4; var index = Length; GrowBy(size); WriteUnaligned(ref GetReference(_buffer.Slice(index, size)), value); }
1
0e477248a99b218c21a6c027d1586352
7fd1c0149f07fd6d37238e24c238770b
Method to add an action to the selected Incident.
operation_id = "PerformIncidentAction" target_url = f"{self.base_url}{[ep[2] for ep in Endpoints if operation_id in ep[0]][0]}" header_payload = self.headers body_payload = body returned = service_request(caller=self, method="POST", ...
1
f5f42df38103061da900c1aa38c34ee8
b102d18befa52654a16112d7386d9104
Enter a `with` block. Collect coverage and outcome; classify as FAIL if the block raises an exception, and PASS if it does not.
import sys import traceback echo.echo_info(message, nl=False) try: yield except exception_types as exception: echo.echo_highlight(' [FAILED]', color='error', bold=True) message = str(exception) if include_traceback: message += f"\n{''.join(traceback.form...
1
284ac5d89a544078143377bdb5d4339f
1232f0440e8b4b46aab9384238cc6da7
Get a color from hue, saturation, brightness and alpha values
float hue60 = pHue/60f; int i = (int)Math.Floor(hue60)%6; float f = hue60 - (int)Math.Floor(hue60); float v = pVal; float p = pVal * (1-pSat); float q = pVal * (1-f*pSat); float t = pVal * (1-(1-f)*pSat); switch ( i ) { case 0: return new Color(v, t, p); case 1: return new Colo...
0
34e11ddcc2dd3987009bbc76146e95d2
587c8351cece834b555e2bbaa0993453
添加标签并绑定到游戏
{ if (!TagIndex.ContainsKey(tag)) { TagIndex[tag] = new List<GameObject>(); } TagIndex[tag].Add(obj); }
1
f17bb4586964f2964a9f1e43aef3eabd
a69a2fd11e561d426aa37dca86977301
再生中に呼ばれるイベントを登録する
{ if (onPause != null) { m_onPauseEvent += onPause; } }
0
f8c9f6ceff44892c7253285d93ec36ac
b4bfeff7a1eeee265058c5b48943936f
Installs a jar using maven coordinates
def main(pomPath, config): dependencies = fetchDependencies(pomPath) jarDeps = JarDependencies() jarDeps.setFilesystem(filesystem.Real()) if "m2path" in config: sourceJarFilepaths = jarDeps.deriveSourcePaths( dependencies, config["m2path"]) else: sourceJarFile...
0
f69e98e3b403c67fa3d60baf04fbb3d0
eee675445f7ff98bb7f53f7110039887
Returns true if the entity has a muti-field key.
public function hasKeyField();
0
24379b35216bb8e20c2ebb21d13c4a13
43320d9ce33253b255a348736799e1db
与中序遍历的迭代版1等价
class Solution_v2 vector<int> inorderTraversal_Iter(TreeNode* root) { if (!root) return rslt; stack<TreeNode*> stk; TreeNode* node = root; while (node || !stk.empty()) { while (node) { stk.push(node); node = node->left; } node = stk.top(); stk.pop(); rslt.push_back(node->val); node = ...
1
4a7bb17383b823e92a6c3c9d5b489118
75c3da41155d0844dcd8a8c1ccdfa0b2
弹出一个YesNoCancle的消息框(0否,1是,2取消或者直接关闭消息框)
namespace Zao.CrsPlat.DevExpressHelper.ZaoUtil public static class ZaoMsg public static DialogResult ShowYesNoAndWarning(string message) { return XtraMessageBox.Show(message, "警告信息", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); }
0
73d2cca68effbe6b300f959bc153fc8d
3b18700cdcf8220f587aedb736de78bf
opens the mobile navigation
function openMobileNav(button) { document.getElementById("mobile-nav-container").style.transition = "all 0.3s"; button.classList.toggle("menu-open"); document.getElementById("mobile-nav-container").classList.toggle("expand-menu"); }
1
b33bb2289e8669cd75e7b53d74863a9d
4e8428ab3236b24af6874cc12847ad9b
Returns the tel richiedente of this richieste.
public Date getData_richiesta();
0
24ec66bf7e97f2b32d7ab2472bc6a524
bc2ddff2782fa9a0933ad1ff2800e39a
This method is responsible for logging the agent into the CTI system and handling issues with login
public void attemptLogIn();
1
db069e6a8131d7e7c26f0dca797dc5a0
86f69666de2da14150eb8e2ec468839d
This routine does a simple optimization on the Biot number of the Pressure Solution i.e. adjusting of the element wise paramaters accelerates convergence by reducing the system stiffness. If the cell-wise divergence goes up, it increases the stringency of BC's at that point otherwise it lets it loosen slightly. The de...
{ REAL delp = inletstate[EInletPressure]-cellstate[TPBrCellConservation::EPressureWater]; REAL corrdelp = inletcorrection[EInletPressure]-cellcorrection[TPBrCellConservation::EPressureWater]; if(delp < 0.) { DebugStop(); } if(delp+scale*corrdelp < 0.) { scale = -delp/corrdelp...
0
06233ffb0a4b15fa8f8e5ce2e872a596
7dcf1e826d82a78d0aa418528d2a05f6
An iterator that will stream data by only reading 'chunk_size' bytes and yielding them, when we can't buffer the whole datastream
while True: chunk = stream.read(block_size) if not chunk: break yield chunk
1
088169c56bb0cba7221fe4c52578491e
ed98b3a4d18d62845dd17e0e82a6fcd6
Prints the response to the specified output stream.
public final class HttpErrorHandler public void sendResponse() throws IOException { if( (v_response == null) || (v_response.toString() == null) ) { throw new IllegalStateException("v_response cannot be empty."); } String resp = v_response.toString(); v_writer.writ...
1
e3994f7a603367fb8f58277a265cd1e1
311f0fc42fd0f67a84ccca2baad2224a
Tries to invoke a null ctor. This should cause an exception.
public class UnknownConnectionExceptionTest extends TestCase public void testCtor2WithNullCause() { new UnknownConnectionException("tc", " ", cause); }
0
96d7bfc920b0b0153da22d25af7daae1
c9d9e3d7f7256275bad82b9f18c9cacf
返回当前时间的md5值
namespace Solution.Logic.Managers public partial class OnlineUsersBll : LogicBase public string GetMd5() { var md5 = HttpContext.Current.Session[OnlineUsersTable.Md5]; if (md5 == null) { IsTimeOut(); } return HttpContext.Current.Ses...
0
651a025f1be1d16b3cbd46349591fa0f
eb367a090f1d4f883a4931b5371d82a6
Get Search Type by it's localised name
namespace Amazon.WorkDocs public class SearchResourceType : ConstantClass public static SearchResourceType FindValue(string value) { return FindValue<SearchResourceType>(value); }
0
28138d0966479c39229e3fbd769b2a12
003bd25d6bf1e63315df99212ff5d31b
영화별 선호도를 조사
def getMovieFec(): loaded_graph = tf.Graph() movie_matrics = [] with tf.Session(graph=loaded_graph) as sess: loader = tf.train.import_meta_graph(load_dir + '.meta') loader.restore(sess, load_dir) user_gender, user_age, user_job, movie_categories, movie_titles, targets, lr, dropou...
1
f3d7d97e268c2142275f5aa213a617eb
aae57dc69583155811419b6b63e24a27
FUNCTION PURPOSE: Allocate a VirtualLink in the virtual link table.
{ lsdn_err_t err = lsdn_link_vlan_create( p->net->ctx->nlsock, &p->tunnel_if, p->phys->attr_iface, lsdn_mk_ifname(p->net->ctx), p->net->vnet_id); if(err != LSDNE_OK) abort(); lsdn_lbridge_init(p->net->ctx, &p->lbridge); lsdn_lbridge_add(&p->lbridge, &p->lbridge_if, &p->tunnel_if); }
0
df39d4b982f2dfbc0b64cbf1f5266609
e6245026683097255b8c6107e1496183
Starts and stops the pump. If the pump is running, it will stop it. If the pump is not running, it will be started.
if not self.is_idle(): self.logger.warning("Pump is already running, please, stop first before starting.") else: self.send(self.cmd.START)
0
2b878b0bd3db36f6bec086c705bc42e4
a9ad161f2932cc040d665d91491db910
根据传入的fragment返回和他相对应的tab值
public class SectionsPagerAdapterEditProfile extends FragmentStatePagerAdapter public int getFragmentNumber(String fragmentname) { if(fragmentName.containsKey(fragmentname)) return fragmentNumber.get(fragmentname); else return -1; }
1
98e70fb9114994fc2158a5d6a28ed9aa
2171d162e435e01cb90308a27c094727
功能描述:按用户格式字符串距离当前时间分钟数
{ if (Validator.StrIsNullOrEmpty(time)) return 1; DateTime dateTime = TypeConverter.StrToDateTime(time, DateTime.Parse("1900-01-01")); if (dateTime.ToString("yyyy-MM-dd") == "1900-01-01") return 1; TimeSpan ts = DateTime.Now - dateT...
1
88b446ab714a0c527da9f78032b8c1da
533524781a03d9ab07d22f45058b0f42
Toggle notifications
public final class UserUtils public boolean toggleNotification() { sharedPreferences.edit().putBoolean(AppConstants.IS_NOTIFICATIONS_ON, !sharedPreferences.getBoolean(AppConstants.IS_NOTIFICATIONS_ON, true)).apply(); return sharedPreferences.getBoolean(AppConstants.IS_NOTIFICATIONS_ON, true); }
1
49b99a90c91bcf162552777f3c130336
43bd503bd9100a2268c649506792814a
@brief checks whenever an array contains only digits and spaces
bool flag = true; for (unsigned int i = 0; i<s.length(); i++){ if (!isdigit(s[i])){ flag = false; break; } } return flag; }
0
c4642cba7c1bf83ea459599db6dc8ac7
3547c57f363a97dd50baa3f6b8dde163
Flush cache for Beaver builder.
Dispatcher::component( 'CacheFlush' )->flush_all( array( 'cloudflare' => 'skip' ) ); Util_Admin::redirect( array( 'w3tc_note' => 'flush_all' ), true ); }
0
7ea0e000cf12075d754d37fe599d73d3
896a958505bae237982944dbe6d52d3e
https://proofwiki.org/wiki/Sum_of_Sequence_of_Squares
assert p%4 == 1, "p must be 1 modulo 4" r = sqrtmod(-1, p) v = contfrac_rat(-r, p) n = int(sqrt(p)) for a, b in convergents(v): c = r*b + p*a i...
0
c946460c996cacb2f262efc3ebd4b2aa
8b4472d5b62e7f5bf3e087c0d8a7764b
Sets the number of attendances.
public class TutoriaBO implements Serializable{ public void setNum_asistencia_asistio(int num_asistencia_asistio) { this.num_asistencia_asistio = num_asistencia_asistio; }
1
0c4aa25c76272e52dde8e548e3b28569
d28ed94ada43bb1d3a0088b239b795ec
Clip bounding box coordinates between 0 and 1.
def clip_bbox(bbox, im_size): bbox = np.array(bbox) im_size = np.array(im_size) bbox[..., 0] = np.maximum(np.minimum(bbox[..., 0], im_size[..., 0] - 1), 0) bbox[..., 1] = np.maximum(np.minimum(bbox[..., 1], im_size[..., 1] - 1), 0) bbox[..., 2] = np.maximum(np.minimum(bbox[..., 2], im_size[..., 0] -...
0
08cd035de965e971666844e0fd333521
6c6bbbd882067d237c4a33f7c4b23a3c
获取有空的技师
public class PickAssistUserPresenter implements Presenter<PickAssistUserMvpView> public void getLeisureTechnician(Call<ResultBase<List<User>>> call){ if (mvpView == null) return; mvpView.showLoadingView("获取技师..."); this.call = call; this.call.enqueue(new ResponseCallback<ResultBase<List<...
1
65231b64b03a6fbdc051c3f6c4422466
a770257fe14083490a6933a989f219ef
取得所發票資料 BY 日期區間
public long GetInvoiceInfoByDate(string p_strStartDate, string p_strEndDate, string p_strBalanceDeptID, out DataTable p_dtResult) { long lngRes = 0; p_dtResult = new DataTable(); string strSQL = @"select a.invoiceno_vchr, a.recorddat...
1
49060b01d60fb79bf64de5016b0c5184
c3d1326f32dbb31020be434720b04708
Returns a random active customer.
if (!empty($_SESSION['user'])) { $except_me = "AND id != {$_SESSION['user']->id} "; } else { $except_me = ''; } $sql = "SELECT COUNT(*) FROM users WHERE password != '' AND active = 1 " . $except_me; $count = $this->user->count($sql); $index = rand(0, $count-1); $sql...
1
36eca5438e0773977d542d0e5c67ded9
8cc6c3398fa918f3ad53e1df85f3db87
创建公会建筑
const { app } = this; const { company_id } = requstData; let build = requstData.build; build.pub_company_id = company_id; build.available = 1; build = app.addDefaultTime(build); const res = await app.mysql.insert(build_table, build); return { code: res.affectedRows === 1 ? 200 : 40...
1
3acd7ce02c66e3538c0cfe3b8c6a612f
b2585fddaf51ba3b8174255e56dd1567
Create object corresponding to the default user locale.
public class LocaleUtil public static ULocale getDefaultLocale() { return defaultLocale; }
1
a5087a66169dbda6fc8fa2fb37cf8ad6
858030a4facb1ff91e85f30c40c3dc88
Returns copy of registration_requests with merged conditional datas.
if ($data = parent::get_data()) { if (empty($data->emailalert) || empty($data->emailalertnewemail)) { $data->emailalertemail = null; } unset($data->emailalertnewemail); if (empty($data->commnews) || empty($data->commnewsnewemail)) { ...
0
48f3bbab9ec10a15c808828c0eea70c0
5744aebb34b8b626a77c674e0ffb5ba0
对用户输入的值进行预处理,如文本转数字等
class BaseModel(object): def preprocess(self,inputs): pass
1
117c8203bc698a39779689477e9e73b0
df942c9ab5209a05cf671ead6beac6be
获取数表格状态
export class TableComponent<T = any> implements AfterViewInit, OnDestroy, OnChanges getTableState(): TableState { return this._tableService.getTableState(); }
1
9aca548461c449164bfdab0bd98ad0d0
493b25d03d4aff04e9727e42942da3a2
just prints out what was inputted!
def printmeKey( stri ): print(stri) return;
1
ee328746d7c3627f5596a0c3050d9da5
91c7b33fda33009d524ae3ae0dd267fc
<p> Starts a new run of the specified blueprint. </p> Documentation</a>
export class GetBlueprintRunsCommand extends $Command< GetBlueprintRunsCommandInput, GetBlueprintRunsCommandOutput, GlueClientResolvedConfig > constructor(readonly input: GetBlueprintRunsCommandInput) { super(); }
0
0f02cbb7bd7755bcfaff0d84b767d77d
360945b471a203ad04a0dc62bd50c6d2
检查两边的括号是否对称,即产生的括号组合是否有效
stack = [] for i in p: if not stack: stack.append(i) elif i == ')': if stack[-1] == '(': stack.pop() elif i == '(': stack.append(i) if not stack: return True else: return False
1
8f9ed0e662611ce88e03194e9d67c72f
c76e7f251d41bcc9a2d644f4cbc4bf71
Reverts the data for this soundscape to the data in the db
public class PLGenEntryController private void restoreBackup() throws SQLException { Dystrack.db.execRaw("DELETE FROM " +RCTables.playlistTable.getName()+ ";"); ResultSet restore = memDB.execRaw("SELECT * FROM " +RCTables.playlistTable.getName()+ ";"); PreparedStatement ins = Dystrack.db.getDb().prepareStatement...
1
f2d3c03dd510c2cd54c87a2b8f5c7867
3a53a1fa85f962ae8e192523d3b7aa67
print a nice-looking description of cookie
function showCookies($hash) { $html = ''; foreach($hash as $key => $val) { if ($html != '') $html .= ', '; $html .= $key . '=' . $val; } return $html; }
0
1b8a39db3fc14e32ce4fdb70d8bbb542
62dc7f7bd7af4cb2bc6c324c335be1b4
! Get CAD detect flag status
int HDMI_DDC_MAN_CTRL_ddc_sda_stGet(HI_VOID) { HI_U32 *pu32RegAddr = NULL; U_DDC_MAN_CTRL o_ddc_man_ctrl; pu32RegAddr = (HI_U32*)&(goptx_aon_regAllReg->DDC_MAN_CTRL.u32); o_ddc_man_ctrl.u32 = HDMITXRegRead(pu32RegAddr); return o_ddc_man_ctrl.bits.ddc_sda_st; }
0
dda48cb3fd08428f9da8d1202788036e
874e16e15d57d40d9d14c72210854ada
GET: ResidentPortal
{ $user = Auth::user(); $residents = $user->resident()->orderBy('created_at','desc')->get(); $count = $user->resident()->where('id','!=','')->count(); return view('residents.index', compact('residents', 'count')); }
1
25c3c0318ba8128be8978c646b75eb96
7e2baa95c798c121af3f82fa90018bb1
Keeps a copy of end-of-iteration tables for use in next iteration.
class PerceptronRanker(FeaturesPerceptronRanker): def store_iter_weights(self): self.w_after_iter.append(np.copy(self.w))
1
9ed1888f4459a81b766757b35436e9ba
8c5ae5b1f7ea3c2280d9910b4e0c5479
calculate the binomial coefficient http://rosettacode.org/wiki/Evaluate_binomial_coefficients#JavaScript
public class problem_15 private static long binomialCoef (int n, int k) { return LongStream.rangeClosed(1,k) .reduce(1, (x,y) -> x * (n + 1 - y)/y); }
1
9d96091cc3bac9385125c895ce24d8a0
b8d539823cced36dacbb25c11031b3da
CheckKubernetesVersion return an error if the Kubernetes version in a cluster is lower than the specified minK8sVersion.
var allAvailableVersions []*semver.Version allK3sVersions, err := ListK3SAllVersions(client) if err != nil { return } for _, v := range allK3sVersions { rkeVersion, err := semver.NewVersion(strings.TrimPrefix(v, "v")) if err != nil { logrus.Errorf("couldn't turn %v to a semantic version", rkeVersion) c...
0
a9266df7e39692ffb7756e31605ede64
fd40b1be18f4043f145a487498556b1e
Get the number of cells along z for each local zone
namespace udm UdmSize_t UdmZone::getNumCells() const { if (this->getSections() == NULL) return 0; return this->getSections()->getNumEntityCells(); }
0
644b5e11c7cd8b5990cf38e68526a698
5c13a5d659939562f1d0cf2da9186de0
Strip the HTTP headers from the request string
static size_t Http_ProcessHeader(char* buffer, size_t size, size_t nitems, void* userdata) { struct HttpRequest* req = (struct HttpRequest*)userdata; size_t len = nitems; cc_string line; if (len && buffer[len - 1] == '\n') len--; if (len && buffer[len - 1] == '\r') len--; line = String_Init(buffer, len, len); Ht...
0
22af57c38988c7ac38e5c1e1389eb251
f5575a6428d8f31d5facebdc4dd34cc5
Modify the contextual menu output on embeddables
$element = array(); foreach ($items as $delta => $item) { if ($url = $item->getUrl()->toString()) { try { $info = \Drupal::service('url_embed')->getUrlInfo($url); if ($info) { $element[$delta] = array( '#type' => 'inline_template', '#temp...
0
c2bbf3bff9aedb0edb3e0134d9d8093a
873cf39b56221c4c498704701d5eaa15
Returns the last data type in the ordered set where groupId = &#63; and status = &#63;.
public DataType findByGroupId_Last( long groupId, com.liferay.portal.kernel.util.OrderByComparator<DataType> orderByComparator) throws NoSuchDataTypeException;
0
8b38039aed1c28dc8a55b7f65eb5c8da
7c2e8f94c3c98bd71045f35eff23ded3
點擊類別的DataGridView,刪除或修改該項類別
namespace Com.Nidec.Mes.GlobalMasterMaintenance public partial class GlobalItemForm protected virtual void ItemData_dgv_CellClick(object sender, DataGridViewCellEventArgs e) { if (GlobalItemData_dgv.SelectedRows.Count > 0) { Update_btn.Enabled = Delete_btn.Enabled = t...
1
456a2470af77064563fa7715e9fb5410
e9aec96ee1f0ac54b24ee5749aed7fd6
Returns the theme handler service.
function thb_theme() { return THB_Theme::getInstance(); }
1
3ae3d743539ac313804d772e4e0b8afc
098d3eb81ee4f6a7d93862ace815a802
Get the idle background
public class Panel public String getIdleImage(){ return idleTexture; }
1
09f41bd90e8f0d134af559e2ddd29a11
cd93131b29fe414dc4b87488a4e814a9
取得这周的最后一天的23:59:59【从周日--周一-...-周六】
public class DateUtil public static Date getEndDateOnCurrWeek() { Calendar cal = Calendar.getInstance(); cal.setFirstDayOfWeek(Calendar.MONDAY); cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); cal.set(Calendar.HOUR_OF_DAY, 23); cal.set(Calendar.MINUTE, 59); cal.set(Calendar.SECOND, 59); return cal.getTime...
1