query_id
string
corpus_id
string
query
string
code
string
label
int64
bbdbea324a021e90d4237868209e8a3f
09789ac60ec0bc1435ea3704c98a79ab
define a global function called echo which prints the first argument on stdout
def echo(arg): return arg
0
b05f40e5fef007ed6cb3d709dfba523f
55f3e137ba2713837f4be3d71f09f175
Gets the ProblemInfo object from the DSS for given problem_id.
Problem getProblem(int problemId);
1
4643cce5102214f36d65755f368d000e
06609e94d9c38d167ca756736cdd550a
查询memberId对应的会员所有的被举报的动态
List queryByMember(Integer memberId);
1
c6aa6bf5d3036597c50d7e0e58984b46
f6bcc728aadeddc33f6cb7ae77d85bbc
初始状态,如果合成的音频数据已经加载则开始朗读,否则调用相应tts获取音频数据后朗读
this.audioStop() this.setStatus("init") this.audioDataOffset = 0 this.audioData = [] this.ttsWS && this.ttsWS.close() clearTimeout(this.playTimeout) }
0
d99474a804e777b6658b1deb624c7b2e
c307f97431e93428d24e593dca132951
Sets the font for this component. This is overridden to update the cached font metrics and to recalculate which lines are visible.
public class TextAreaPainter extends JComponent implements TabExpander, PropertyChangeListener @Override public void setFont(Font font) { super.setFont(font); currentLineTokens = null; this.fm = getFontMetrics(getFont()); synchronized (stylesLockMonitor) { if (styles != null) { for (SyntaxStyle ...
1
e886c38b8b955dc23d24ceb31405100b
f4b3b9945fcf94dd279e07440e7671ca
инициализация кнопки закрытия формы (крестик)
export default class Modal _closeButton() { this._modal.querySelector('.modal__close').addEventListener('click', () => { this.close(); document.body.classList.remove('is-modal-open'); }, {once: true}); }
1
54877e6a18145fd40117868157926036
5f7a03f14fd964262661056662118424
Generate Random 6-digits
class CommonUtils public function generateSixDigitRandomNumber(){ $randomNumber = mt_rand(100000, 999999); return $randomNumber; }
1
bb0a555967cfe9b575b579472727c863
aaf8d62ac7feb32226f276a7e1a44b2b
串行矩阵乘
namespace YCXTTEST_01 public class OperaterBase public double[,] MatrixMultiply(int rows, int cols, int rc, double[,] rfv, double[,] rda) { double[,] product = new double[rows, cols]; for (int i = 0; i < rows; ++i) { for (int j = 0; j < cols; ++j) ...
1
0da4812ae1e1d538fe2cc2661e9ea99f
97f87e6212051b9bacb3c76e69b662c3
Wait for all background commits for an AU to finish
{ long done_ts = 0; do { int done = ve_urpc_recv_progress(up, ncmds); if (done == 0) { if (done_ts == 0) done_ts = get_time_us(); } else done_ts = 0; } while (done_ts == 0 || timediff_us(done_ts) < timeout_us); }
1
0862b7a09f043330becf18f685a3f7bf
06524581a10757ee1dbc35a792a1cf4c
Function input: Nothing Change the direction of the scheduler.
static void cambiarScheduler() { int cantLotery = getThreadNodeLoteryCount(threadsQueue); int cantRoundRobin = getThreadNodeRoundRobinCount(threadsQueue); if (loteryControl && cantLotery > 0 && cantRoundRobin == 0) { roundRobinControl = 0; loteryScheduler(); }else if (roundRobinControl && cantRoundRobin > 0 &&...
1
3cbdc7310bc954586b494fc6516858cf
aa816e021b0b5d873b3bdf8b43dbce9a
根据权限项序号获取权限项
class PurviewService extends PipiService{ public function getItem($id){ return PurviewItemModel::model()->getByPk($id); }
1
424f9055e2fc6d58aa092430324d77b5
d6c6a97014b11a4bdd639b16c346668d
Get number of callbacks of TLS
pe_base::tls_info::tls_callback_list& pe_base::tls_info::get_tls_callbacks() { return callbacks_; }
0
cd829a2fbdca0708cd56ec1ef6fd7610
ce25acadafab8ca047683d6dcf970a9f
Transforms direction vector v (v.w is presumed 0.0) by the inverse of this rigid transformation. Actually, only the rotation is used.
namespace Aardvark.Base public V2f InvTransformDir(V2f v) { return Rot2f.InvTransformDir(this, v); }
1
2b0317411b3ea4a7765f5f8bfdf76437
764d56bb1555e212504613ba69adfedc
Returns the first employee hiring in the ordered set where uuid = &#63; and companyId = &#63;.
@ProviderType public class UserRankUtil public static UserRank fetchByUuid_C_First( String uuid, long companyId, OrderByComparator<UserRank> orderByComparator) { return getPersistence().fetchByUuid_C_First( uuid, companyId, orderByComparator); }
1
c30a899aa7bd879cc28f3defd3f54830
47734a533bee97a657433aa33d689c25
Capture first of the supplied regex
def process_image_regex(result): image = re.findall(image_regex, result) if image: return image[0]
1
08c879cd99aee26e7f4ef1949d26c919
6896f5f84c570085803135afc5012cb6
call this to turn all debugging OFF, both error messages AND debug( ) method output
void set_debug_off (void) { debug_on = FALSE; }
1
7b77ce9477dc9ece8dbb02f73bcdbfcc
7e8c2dc68757a0eb57568374faeb0612
Validate the input fields of the tab Income history in view transaction for SND reference.
var isOk=true; if(!checkInType(frm1.etd_dt_tm.value, "DD")){ alert(getLabel('FMS_COM_ALT007') + "\n - " + getLabel('FMS_COD_ETD_')); isOk=false; moveTab('01'); frm1.etd_dt_tm.focus(); return isOk; } if(frm1.pol_cd.value == "") { alert(getLabel('FMS_COM_ALT001')); moveTab('01'); frm1.pol_cd.focus(...
0
7ce5d959d08f445553aa21c93f07165b
01db5dbd4bd173e2f444252fcdadd60d
读写锁测试,保证先写后读.
public class RedissonDistributedLocksAndSynchronizersTest public static void testReadWriteLock() throws InterruptedException { RedissonClient redisson = RedissonUtil.getRedissonClient(); RReadWriteLock rwlock = redisson.getReadWriteLock("anyRWLock"); RLock readLock = rwlock.readLock(); readLock.lock(); RLock ...
0
512e80c793b77b4a76fcbf452ca89810
135702b3c26d70cf9b050ccf536bb3b2
Test ordering the permission fields without any fields in the form. Expected result: No errors are raised.
app_api_client, staff_user, order, permission_manage_orders ): current_reason = "Granted refund reason." current_amount = Decimal("10.00") granted_refund = order.granted_refunds.create( amount_value=current_amount, currency=order.currency, reason=current_reason, user=staf...
0
0c05f8dbd43106167244571d9a8ee57d
ea3d75b1907adeaff578cbc1f8a5a6c1
プレイヤーをタップ位置によって左右上に動かす
if(player.body.touching.down){ player.body.drag.x = 150; } else { player.body.drag.x = 0; } switch(player.moveState){ case PlayerState.ANGLE: chooseAngle(); break; case PlayerState.POWER: choosePower(); break; case P...
0
e33b66744e4f412760cfe3f3f2fec64e
9e325f06b90a530c8f494625d63dc0e1
# 佣兵移动判定
int main_fly_npc( object me, int x, int y, int d, int flag ) { object map, *user, *user2, *npc, who; int z0, x0, y0, z, dx, dy; int p, i, size; z0 = get_z(me); x0 = get_x(me); y0 = get_y(me); if( abs(x - x0) > 10 || abs(y - y0) > 10 ) return 1; if( !inside_map(z0, x...
1
8dd2819730b9f2aff5bae031f4ae6ecd
3caa24e2f1d860ba8f002bad7793fc6a
装载密钥
SecretKey key = null; InputStream stream = EncryptUtils.class.getClassLoader().getResourceAsStream(KEY_FILE_NAME); File file = new File(KEY_FILE_NAME); try { FileUtils.copyInputStreamToFile(stream, file); } catch (IOException e2) { e2.printStackTrace(); } if (file.exists()==false) { try { Key...
1
bbaf8520b492481ab26e92464bdf2dec
6bb689c74cba9d774915a96e393bfd86
This tests the case where the sync source metadata is behind us but we get a document which is equal to us. Since that means the metadata is stale and can be ignored, we should accept this sync source.
self.assertTrue(self.countShadowDocuments() == 0) changes = {"ref": "this is a different value"} response, status = self.put( self.item_id_url, data=changes, headers=[("If-Match", self.item_etag)] ) self.assertGoodPutPatch(response, status) self.assertDocument...
0
73eb5cabfc55f36576ae6f1dd3874300
ab03b38d8e814954e162c98d5c50427f
turns reverse-linear history into a dependency map
{ int i, j; ccv_sparse_matrix_t* exec_dep = ccv_sparse_matrix_new(symbolic_graph->exec_symbol_info->rnum, symbolic_graph->exec_symbol_info->rnum, CCV_32S | CCV_C1, CCV_SPARSE_ROW_MAJOR, 0); int* buf = (int*)ccmalloc(sizeof(int) * symbolic_graph->exec_symbol_info->rnum * 2); int buf_size; #define for_block(x, val) \...
1
f73f38cdcf049abd08f97aabdb99d86f
be4323c6cf6d23e9f377af0e38a9e04e
This test ensures that we get errors from callbacks correctly and in particular that we do not segv when callbacks fail
class TExceptionTest: public TTestBase inline void TestMixedCode() { const int N = 26082009; try { TestCallback(&CallbackFun, N); UNIT_ASSERT(false); } catch (int i) { UNIT_ASSERT_VALUES_EQUAL(i, N); } }
1
3deabe412705e33503524f665e66cec6
fbe62c853ebc5b34cc442ea8c4761318
Gets only the usernames of the participants of a booking.
public class EventSystem public List<String> getAllAttendeeUsernames(int eventId) throws EventNotFoundException { return eventHandler.getAttendeeNames(eventId); }
1
7acee7d6829d00036af33bcd3f34ae24
5e59fcb7256d49415e4b052c732a680c
实现一个简单的HTTP服务器,在浏览器里输入http://127.0.0.1:8080即可浏览文件, 这些文件正是当前目录在HTTP服务器上的映射目录。
def serve(port=8000): import os from SimpleHTTPServer import SimpleHTTPRequestHandler import SocketServer os.chdir("./build/dirhtml") httpd = SocketServer.TCPServer(("", port), SimpleHTTPRequestHandler) try: print "Serving documentation on %d" % port httpd.serve_forever() exc...
1
f1a98f1d4886201b6d000086bb6e1909
43751d78f360bd1ce142510ba2e5a6f5
区分HK站点和CN站点文件
{ parent::__construct($label, $config_file); if(defined('CURRENT_MODULE_NAME') && (CURRENT_MODULE_NAME=='www_hk' || CURRENT_MODULE_NAME=='center_hk' || CURRENT_MODULE_NAME=='api_hk')){ $this->_prefix=$this->_prefix.'hk_'; } }
1
ee668563e8d9c5703008f35c064acfd5
751543af020de7311346f62db6c6da97
指定日期与当前日期的间隔秒数 added by wangzhe
Date todatToMills = new Date(); Date paramDateToDays = DateUtil.stirng2Date(DateUtil.Date2String(paramDate,"yyyy-MM-dd"),"yyyy-MM-dd"); Date todayToDays = DateUtil.stirng2Date(DateUtil.Date2String(todatToMills,"yyyy-MM-dd"),"yyyy-MM-dd"); int intervalSesc = 24 * 3600; if(paramDa...
1
4ed71b17eb0268d422f2bbdd20edf53b
7b210976144ae3fde2044f1020e040e1
Method called to request an input action; returns whether or not the player input action is in sync with a beat as well as the beat synchronization type.
[ExecuteInEditMode] public class PlayerInputManager : MonoBehaviour, iInputManager public iInputSource CheckInput(InputActions action) { if (_inputWitheld || _inputFlushFrame == Time.frameCount || !_actionMappings.ContainsKey((int)action) || _disabledActions.Exists(c => c == action)) { return _wipedInpu...
0
0e1854062d1dca4bcf8993f76de55e25
c117459891d26c33070866b8d48cb593
Set the MPL3115A2 sensor to Barometer mode
void MPL3115A2::setModeBarometer() { char tempSetting = IIC_Read(CTRL_REG1); tempSetting &= ~(1<<7); IIC_Write(CTRL_REG1, tempSetting); }
1
040bcdc2cc0d4424d7a74f13a7337df4
2cb24833b92fdcf838697dc49abe9d27
对扫描对象设置列簇
Scan scan = new Scan(); scan.setCaching(1000); scan.setFilter(new PrefixFilter(Bytes.toBytes(table))); scan.addColumn(Bytes.toBytes("info"), Bytes.toBytes("server")); return scan; }
0
b129f92f2f2d87e0f264efd7ae989a3b
d0de314354092bdb7cd7ac7e73c43ecc
ゴールしている数を調べる
{ int i; int number = 0; for(i = 0; i < game.crossNum; i++){ if(game.isThereEnemy[i] == 1) number++; number += 2; } return number; }
0
0596b9ff0d47cbc5860e6eb8630f0548
1d7c871f9f9abc2887bf959da8f919bf
Returns the last ID of a player connected to the board.
public class ServerData implements Serializable public byte getLastUserId() { return lastUserId; }
1
8154d9d93e5e6f0bd69e0e8117c265ff
e1aac473fda3c22f011ae0ec996cc029
联系人性别编码组ID的取得
namespace BLL public partial class Bll_TB_STA public string Get_NC_ID(string C_ID) { return dal.Get_NC_ID(C_ID); }
0
d05cf78f7641b41220dde63171b7482f
0958782f488aeb1644cc8ea316ab24f2
顶级角色不能分配权限
@Service public class RoleManagementService public List<String> listAuthorityByRoleId(String roleId) { if (SUPERADMIN.equals(roleId)) { return null; } return profileRoleAuthService.listProfileRoleAuthDtoByRoleId(roleId); }
1
16c7773fd80572c4b521391c81ea813a
1a0a81e53d7264b1a4e3a0715a35f962
定时触发
\swoole_timer_tick(1000,function(){ try{ self::run_job(); }catch(\Exception $e){ self::write_log('注册定时器失败:'. $e->getMessage()); } }); }
1
312b0d372667b479933196a947516881
e5c1683871a7911b2fbe357f63727264
设置玩家投票状态UI
{ Debug.Log(isjiesan); if (isjiesan == 1) Event_ReciveVoteResult(false); else Event_ReciveVoteResult(true); }
0
565b6445ea409e0e4204c7f2e471e956
35add8a1648c675a20eec1ce75589851
Vapor pressure over water. Heymsfield formula
def VapourPressure(dewp_temps_cent): return 611.2*np.exp(17.67*(dewp_temps_cent/(dewp_temps_cent+243.5)))
1
9321b3d96d90b99a8dc3efd35a9eab57
f8920ecc4657eb7ffba5cd7d1aa84427
get a parabola that goes from source to destination in specified time
destination = dest; Vector2D prod1 = (destination - location); double prod2 = (speed / GetDistanceBetween(destination, location)); delta = prod1 * prod2; }
0
5d6442cd3aca6e16c499f51fde670f8a
20e67a4f7bbd4ce2cf1d94a12a4a751a
Set the Cart Web URL
SET_CART_WEB_URL(state: CartState, webUrl: string) { if (webUrl) { state.webUrl = webUrl; } }
1
0c4e57a7253429ca266ae8a6b61fc2ee
71804282bc689ce5ef59c7078d1ae557
删除之前的操作 在删除博客操作之前先删除对应的图片
Article::event('before_update', function ($art) { if ($_FILES['articlePic']['tmp_name']) { $articlePic = article::get(['articleId' => $art['articleId']]); $articlePicPath = $_SERVER['DOCUMENT_ROOT'] . '/blog/public/static/' . $articlePic['articlePic']; ...
0
17b79aa9a8023fc549f9f24cec549bf3
6eb256610ec4dc9071e91786a4d84f16
Dado un árbol binario, imprime sus nodos en En Orden
void printIn (Tree* tree){ if(tree != NULL){ printIn(tree->getLeft()); cout<<tree->getVal()<<" "; printIn(tree->getRight()); } }
1
cdaa669f47bbf91dba620a1a4366e5d4
7dff31a6d6b6008fe977500f3b3adf07
Скомпилировать бинарную логическую операция (&& и ||)
namespace vsl VISIT_FUNC(LogicalExpr) { const auto left = VISIT_EXPR(ctx->left); const auto right = VISIT_EXPR(ctx->right); const auto [resType, refStr] = Ops::CheckOp(ctx->op->getText(), { left, right }); if (!resType) { ERROR(ctx, Ops::LastError()); } return MAKE_EXPR(refStr, resType, 1); }
1
378a21a8ef132b6352b79785123e9fb0
53a23845b20f1bff4c303d6f00658665
获得最近十个登陆的用户
t := time.Now().AddDate(-1, 0, 0).Unix() list := make(map[int64]AuUser) err := Db.Where("status = ? AND user_exp > ? AND change_level_time <= ? ", 1, 1000, t).Desc("user_id").Limit(limit, offset).Find(&list) return list, err }
0
ba7be1b30526285bf42519b2da6a1fde
63942a50c3847132628158181bd5f536
Get audio Downloads and gets audio for all videos in a playlist and stores the files in the specified folder. For more information about the format and quality, check out: https://github.com/rg3/youtube-dl#post-processing-options.
class YoutubeService(BaseYoutubeAPI): def download(self, video_url="", threads=2): meta = ytdl.YoutubeDL({}).extract_info(video_url, download=False) quality = '' for fmt in meta['formats']: if fmt['format_note'] == '720p': quality = '136' elif fmt['format_...
0
f928422866dc028956311f1c0bbeab39
0418c5251ca45fc3a3b877bd707dd5bf
Returns the meta object for the containment reference '{@link PaymentsApp.Formula#getFormulaReturn <em>Formula Return</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getFormula();
0
b55868c3da618d6c9ae141396325d99c
bbae03fd105b31626cea384b0a8e3437
Initiate the parameters either from existing checkpoint or from scratch.
def _init_weight(sess): if FLAGS.resume and FLAGS.fine_tune: raise Exception("There should be only one mode") if FLAGS.resume: step = FLAGS.checkpoint_all.split('/')[-1].split('-')[-1] print("resume training from step {}".format(step)) saver = tf.train.import_meta_graph(FLAGS.che...
1
01573fd3093b20fb41963274d5e8dda7
2d21382207f712ad8bfb0d9f773fcfbc
This closes the document window without saving it whether it has been modified or not.
public class MSWordManager public void closeDocument() { if (document != null) { Dispatch.call(document, "Save"); Dispatch.call(document, "Close", new Variant(saveOnExit)); document = null; } }
0
c9d42c77de5e9987092ccb3fb6d6c25e
5ae521c85e51aadf683d0a1f898ae960
Returns the state of lax parsing.
namespace QuercusDotNet.Env{public class DefinitionState public bool isStrict() { return _isStrict; }
0
e7e9f3900df08c649ba84cd1c47d8eb2
10ce0acbc51c235fd33be473c548e5c4
AboutHandler handles the /about command
func info(c echo.Context) error { return c.String(http.StatusOK, types.Info) }
0
c704a26418c3f863f7256b0b514c4587
35e487ec3309fbecff65eec486788e62
Normalizes to 2 digits after the point.
fun rounded2(number: BigDecimal): BigDecimal { return number.setScale(2, RoundingMode.DOWN) }
1
c0643b7edaa0d8190c25b98f0054aef3
433baf1036da52a146de96f1b8fa0786
Gets the workflow record object by a given workflow track ID The workflow track ID <pre> ApplicationException with the following message codes will be thrown ErrorConstant.DB_RECORD_NOT_FOUND_ERROR - No matching record found ErrorConstant.ErrorConstant.DB_GENERAL_ERROR - General caught SQLException ErrorConstant.DB_SEL...
PreparedStatement preStat = null; ResultSet rs = null; StringBuffer sqlStat = new StringBuffer(); synchronized(dbConn) { try { sqlStat.append("SELECT A.ID, A.WORKFLOW_RECORD_ID, A.STEP_SEQ, A.STEP_NAME, A.ACTION_TYPE, A.ACTION_ID, A.DESCRIPTION, A.WORKFLOW_RULE, A.FORM_SECTION_ID, A.PRIORIT...
0
4967e44deaf87263bd37d97946a7d7de
38879e0e132cd77726252136b5a7e60f
Find all leaderless transcripts after reads were mapped to a gene identifier. Only choose gene identifiers where the number of mapped reads is below threshold.
total_counts = np.sum(E,axis=1) cell_filter = total_counts >= min_reads if np.sum(cell_filter) == 0: return None, cell_filter else: return E[cell_filter,:],cell_filter
0
9d67028934bdc579b219dfdfe70e330f
b5bc52f835115579c90aa8d01614695b
Identifier of this type of TraitExtractor
class CommonTraitUtils(_HasS4CLClassLog): def get_trait_id(cls, trait_identifier: Union[int, Trait]) -> Union[int, None]: if isinstance(trait_identifier, int): return trait_identifier return getattr(trait_identifier, 'guid64', None)
0
ffad555d54dca194053901e7abee0b7d
c296e7c1ad5f1c1d22420c7d859f8cb7
Find nearest pickup places by zipcode.
{ $postcodes = Postcode::nearestByLatAndLng( new Point($request->input('lat'), $request->input('lng')) )->paginate(); return PostcodeResource::collection($postcodes); }
0
04bc8a714695d7c447f10e3184f72d19
649faf0cab987f9a5edcefba05a2de5d
Number of LSN TCP Received packets.
class lsn_stats(base_resource) : def lsntottcptxpkts(self) : try : return self._lsntottcptxpkts except Exception as e: raise e
0
e187536666914614199095902b543b95
a5415daf27d4e425eb0528928964451a
使用文件名筛选出来的错误街景点
if($names == null) { return false; } foreach($names as $name) { if($name == null) { continue; } $regex = new MongoRegex("/".$name."/i"); $result = MDScenicModel::find(array('scenic_region_name'=>$regex), ...
0
6a27454d63ff58552f4d4137dafea2f4
b0baca16c6be4ce6820e9d9cc894d23e
[getContinueSignDay 获取连续签到天数]
{ $creditRule = CreditRules::getCreditRuleData(CreditRules::EVENT_SIGNIN); $i=0; $curDay = time(); $isCurDaySign = false; $continuousDays = $creditRule['continuousDays']; try{ self::_validate($user); $i++; $continuousDays = $continu...
1
9ee5cb9c818c72e3af11b55713052a4b
01e3bc9438484449f21ad91067759788
change parallax images on scroll
var scrollTop = $(window).scrollTop(); var offsetX = Math.round(scrollTop / parallaxXSpeed); var offsetY = Math.round(scrollTop / parallaxYSpeed); var offsetX_small = Math.round(scrollTop / parallaxXSpeed_small); var offsetY_small = Math.round(scrollTop / parallaxYSpeed_small); $(".puppies").css({ "back...
1
67135dceb3618b6486708cc50418ade2
a7a972e901b89fc35473ad62897db820
Builds the five hours led row.
led_light_array = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] if buses_in_progress_1 != None: for i in range(len(buses_in_progress_1)): if buses_in_progress_1[i][1] < 5: led_light_array[buses_in_progress_1[i][1]] = 1 if buses_in_progress_2 != None: ...
1
c0a6c17ec9023bfa7f1203b53fec0472
010cd8d04364c71c8778d5f9555cb57d
Create a list of chunks. Each chunk is a list itself, with size `chunksize`.
def _gen_chunks(values, size): values = list(values) for i in range(0, len(values), size): yield values[i:i + size]
1
7b608ce365705944e1d17d56900bfedd
dda8236900f807f100db2a63901bba16
Configure the toolbar. each window, sort of like you need to do after a resize. This is because the height of the toolbar may change, so the positions of the other widgets may change. Returns ElvTrue if the screens all need to be reconfigured, ElvFalse otherwise.
static void redraw_win_toolbar(win_T *wp) { vimmenu_T *menu; int item_idx = 0; int item_count = 0; int col = 0; int next_col; int off = (int)(current_ScreenLine - ScreenLines); int fill_attr = syn_name2attr((char_u *)"ToolbarLine"); int button_attr = syn_name2attr((char_u *)"Toolb...
0
c344f1eafdd90f25642b8c285e060c8c
e0f338aa481d82e10cb940015d1e89b6
Этот метод отрабатывает при нажатии кнопки "поиск" на софт клавиатуре
public class Analyster extends JFrame implements ITableNameConstants, IColumnConstants{ private void textFieldForSearchKeyPressed(KeyEvent evt) { if (evt.getKeyChar() == KeyEvent.VK_ENTER) { filterBySearch(); } }
1
a60369e05c4a4e6ac8dd69e0527579bf
3a3185b02b4a91977c2746de6f6090d7
尝试释放锁,不可重入锁
public void releaseLock() { ReentrantLock lock = new ReentrantLock(); lock.tryLock(); try { System.out.println( "do something" ); } finally { lock.unlock(); } }
0
31d32a4445f5b16c1e62fbb072c24fd8
5642beb31c5672fd93afea15fbd798cc
Configuration block for encrypt at rest options. Only available for [certain instance types](http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-supported-instance-types.html). Detailed below.
class WorkgroupConfigurationResultConfigurationArgs: def encryption_configuration(self) -> Optional[pulumi.Input['WorkgroupConfigurationResultConfigurationEncryptionConfigurationArgs']]: return pulumi.get(self, "encryption_configuration")
1
0b5bd687c4880d99f44435c0d690abd3
574b28b89bf5024de106ca75b2744a1e
通过打印ID获取套打模板
{ $content = Db::name('admin_printing')->where('id', $id)->value('content'); $contentArray = json_decode($content, true); return ['id' => $id, 'content' => $contentArray['data']]; }
1
976a9b1a98ea9aac94e2473aabc2dc0b
ad22c4dbeebb06805d078f6cc5e02ccb
Создает голову нового потока в стриме с указанным смещением. Задаются также длина begin-блока и координата первого блока.
strutil::addHex(stream, recordLength, 2); stream << curRecord; stream << "\n"; curRecord = ""; initLocCtr = curLocCtr; stream << "T"; strutil::addHex(stream, initLocCtr, 6); }
1
21f094f6162d975e40b3fa4755547c0a
55eb8df6a9f2e5879744cfa9f22986c4
Create an empty `name' xml element within the specific namespace
public class IntendedXMLStreamWriter implements XMLStreamWriter @Override public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException { writer.writeCharacters(indentation.toString()); writer.writeEmptyElement(namespaceURI, localName); writer.wri...
1
40b14fbe3d4662bd4d55e21af4f35642
10bd930757b4383eb09828a76f309773
Fill the screen with dots as a way of making PR_* displays show up without forcing them to draw anything themselves by some more complex mechanism.
void drawScreen(){ for(int i = 2; i < HEIGHT; i++){ for(int j = 1; j < WIDTH; j++) mvprintw(i, j, "."); } return; }
1
73df40994d840fd6fc78f7bf2d132227
a647f9da005595140f3de641fcdb339e
按首页推荐标志查询新楼盘(用在主页显示)
@Path("home") public class HomeController @SuppressWarnings("unchecked") @Get("zuixinkaipan") public String getZXKP(Invocation inv, @Param("cityId") int cityId, @Param("device") String device) { try { DictCity city = cityService.getCity(cityId); cn.focus.dc.focuswap.model.SearchC...
1
f23cb5c163d3edb509ca2bb69407c72f
856a4a2943307245d2fffe77044d4883
Retrieve the captured value as an array. An error is generated if no value is captured or if the value is not an array.
public function GetCapture ();
0
42da801e3d7f6cd230f9833e451c38b6
772340934deb42ff1b32a7387de4d5cc
Method for validation request type value
class Validator public static function validateAuthnRequestType($authnReq) { self::checkByValue($authnReq->getID(), self::$BankId_MerchantReference); self::checkUrl($authnReq->getAssertionConsumerServiceURL()); self::checkByValue($authnReq->getRequestedAuthnContext()->getAuthnContextClassRef()[0...
1
27158c53c4574ee934032166f5ad21b5
dd64c70c134ba4370b3b8781e3d03800
读取合约佣金列表以JSON方式
public async Task<JsonResult> ReadContract(ModelRequest request) { return Json(await obkRepo.GetContractList(request, true), JsonRequestBehavior.AllowGet); }
1
85933159279e0e855f03754c69d12705
b427808f9c773f38a2aa45563459b24b
Sets the operational mode to decimal instead of binary
class Calculator: def dec_(self): self.display_mode = 'dec'
1
59e868797a127e738ef586f0780a6859
9cbbc32a133c8d26252db2896edbc038
移動ルート上の障害物(Obstacle)の有無を確認
bool ObsDetector::checkObstacle() { return collisionFlag_; }
1
1590496bece5db0dfc9fa8487b58e0fc
150a8f0b195c85affa897a7591ed5683
Swap two of the children, if possible.
namespace BraneCloud.Evolution.EC.GP.Breed [Serializable] [ECConfiguration("ec.gp.breed.MutateSwapPipeline")] public class MutateSwapPipeline : GPBreedingPipeline private static void SwapSomethingTypeless(GPNode node, IEvolutionState state, int thread) { var x = state.Random[thread].Next...
1
c1c1f2cf3141aa78547d99d2e7feaa9f
727c42927d2cb41d09fb4f86c3cb59a6
Call all tasks that registered on the initialize request
void initializeTasks();
0
f338867f6c595888cf5ba89f3c77cf41
dce2c29c80255b36c444ee2a546c25c5
获得当前光标所在的region的名称
def syntax_area( ): command='synIDattr(synIDtrans(synID(line("."), col(".") - 1, 1)), "name")' return vim.eval(command)
1
84feaab6222ae640bb7953255cf39812
6fc3dd8b8f7f44d90c3011ef80a18b1b
Form page with subdivisions according to the number of items per page and page number
eval('$view = new '.$this->config['view_class'].'();'); $url = $this->getPagerUrl(); $view->assignArray($this->getConfig()); $view->assign('url', $url); $view->assign('total_pages', ceil($total_items / $url->get('per_page'))); $view->assign('total_items', $total_items); return $view->getOutput(); }
1
0f81fa699d20fa3f7e97d36d5acc0b53
ab866f43070517a3d3234422718bc3d3
@brief Pull out a row of a matrix.
for (int i = 0; i < BLOCK_SIZE; i++) { out[i] = (float32_t) in[i][col]; } return; }
0
82e8eb93f7576ab8d5db5660dfd4a7d1
b9eb28504050c52f9750279b570b8fdc
判断是否是客户端发送来的心跳包,此判断影响 KeepAliveRequestTimeoutHandler实现类
{ return msg.FrameCount == 1 && msg.First.ConvertToString() == Commons.PPPHeartbeat; }
1
5103d13bf64b7482f609eb2e56409ea5
bb00615f694607ba989570eec7597283
Returns the meta object for the attribute list '{@link org.sheepy.lily.vulkan.model.process.PushConstant#getStages <em>Stages</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Stage_interneAffecte_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Stage_interneAffecte_feature", "_UI_Stage_type...
0
2e05a2ee68fb1ac967f6659550c503b7
035d19f0694bb61357e6e1cbb289acc4
Tests that two end points can be established (both unique)
class EzDiscoveryTest(testing.KazooTestCase): def test_register_endpoint(self): ezdiscovery.register_endpoint('foo', 'bar', 'localhost', 8080) path = '/'.join([ ezdiscovery.NAMESPACE, 'foo', 'bar', ezdiscovery.ENDPOINTS, 'localhost:' + str(8080...
0
27916c356a00eb4daf27d178c229c354
a6a4cdf07347890f08e841ca6ac63073
fjern det givne antal af den givne vare fra lageret.
namespace MadspildGUI public class Beholdning public void SletVare(Vare v, List<Vare> liste) { if (liste.Contains(v)) { liste.Remove(v); } }
0
9620ea38a15e2881e135e9569bf096d1
cdc1451b3ce7231df4a9c0d1406a1f3e
Ввод элементов списка с проверкой на корректность введенных значений
Dictionary<int, string> DictionaryItems = new Dictionary<int, string>(); int i = 1; foreach (string ItemItem in items) { DictionaryItems.Add(i++, ItemItem); } return InputList(DictionaryItems, title, question, errorMessage); }
0
37e8614110385b1c979136864ee93fc4
ec3f357cc56674e9aebfec89821824cc
選択アイテムの付箋データにアクセスして代入
public class BookmarkListItem : MonoBehaviour, IPointerClickHandler public void SetData( BookmarkData data ){ PreviewImage.sprite = Sprite.Create(data.GetImage(),new Rect(0,0,TEXTURE_SIZE,TEXTURE_SIZE),Vector2.zero); TextLabel.text = data.DataName; Data = data; }
1
d103a7bf4a8a181fe53c5d0ba8b7a7da
3a0a15a604981520c0643034a4db66c0
We are static linking, so just store the function addresses
{ DWORD proc32; proc32 = (DWORD)GetProcAddress(getNTDLL32(), "NtDelayExecution"); memcpy(scWorker32 + 8, &proc32, 4); proc32 = (DWORD)GetProcAddress(getNTDLL32(), "LdrGetDllHandle"); memcpy(scLoadDll32 + 15, &proc32, 4); proc32 = (DWORD)GetProcAddress(getNTDLL32(), "LdrLoadDll"); memcpy(scLoadDll32 + 35,...
1
a91cc283957b65c01aa6de7de2d6f28d
82a0eb338df65d5dd6662fbb74344a5f
根据订阅配置,设置推送周期时间,推送采样数据到服务端的采集器
scheduledExecutor.execute(new Runnable() { public void run() { if (!isRun) { log.warn("DiamondSubscriber不在运行状态中,退出查询循环"); return; } try { String configInfo = getCon...
0
ee68f69d136aa3d3cbf99c55d8cb91d9
4d0265fcaa3c0145fe11126465b18203
履歴をグラフとして表示し、保存する
class ModelMgr(): def draw_history_graph(self, file_path='saves/result.png'): print('\nvisualize results : \"{}\"'.format(file_path)) draw_result(self.history.history, file_path=file_path)
1
97ac0e9aaef517ebcafacb6a15c90837
17260dc0a11d73d1867c00e2afb205bb
---------------------------------------------------------------------------------------------------------------------- @brief Set the coefficient of restitution for our walls @param _x Value we wish to set to
double coefficient_of_restitution_bridges(const struct reb_simulation* const r, double v){ double eps = 0.32*pow(fabs(v)*100.,-0.234); if (eps>1) eps=1; if (eps<0) eps=0; return eps; }
0
b8f08b22e6667595135e493003c098b7
a2862e587ade28ac1e960e5b66dbc9dd
用手机号注册用户 如果手机号已存在,那么只需要更新手机状态和密码
{ $verify_code = $params['verify_code']; $mobile = $params['mobile']; $user_obj = new UserModel(); $verify_code_obj = new VerifyCodeModel(); if (!$verify_code_obj->checkVerifyCodeValid($verify_code, $mobile)) { ApiModel::returnResult(40051, null, '无效的验证码'); ...
1
6b2f700e421c02d2a6b9984e4b89e72a
0ee3cf5fd957e785e98099c770f217ee
是否需要更新本地的版本
isNeedUpdate(project) { return semver.gt( this.ctx.lastVersion, this.ctx.temDb.get(`${project}.version`) ); }
1
25b58b731630f3a82b5d7f5faf024116
2c666553fd5b3f7407cd162fde5dfd64
FetchHeaders extracts specified headers from request
if len(headers) == 0 { return nil } m := make(map[string][]string) for _, h := range headers { m[h.key] = h.values } return m }
0
2fabdce7abf6c6cd6df698a5aa9991bc
9bd5c6ebc1645401989c79e8cd7c8da0
更新当前菜单待办事项数目
const filterRule = topic => !topic.done; switch (menuItem?.menuInfo) { case MENU.all: return this._itemList.filter(filterRule).length || null case MENU.plan: return this._itemList.filter(top => top.deadlineDate).filter(filterRule).length || null case MENU.done: return n...
1
09d84fb73d96db47adb2c09ff136c334
52b241ed98cc9f0c546f745e0b098be1
Prediction of sequence of tags using Variable Elimiation algorithm.
tagging = [] for i in range(len(test_data)): Osequence = test_data[i].words for word in Osequence: if word not in model.obs_dict: model.obs_dict[word] = len(model.obs_dict) model.B = np.insert(model.B, len(model.B[0]), 10**-6, axis=1) path = model.viterbi(Osequence) tagging.append(path) return tag...
0
da9d15b3eb8f2e4e7c5bd69561b07602
c06dbfccf2bb4e5f1eab59160c86e5fb
Checks whether the <code>is-duplicate</code> property is set. <code>false</code>.
public class CmpAttachmenExample public boolean isDistinct() { return distinct; }
0
19502fc14654d868abcd71be060e0f5b
374dc2f945adf5956983b8bdd6360e82
Return the VirtualBox object associated with this VirtualMachine.
public class Application public VirtualMachine VIRTUAL_MACHINE() { return d_VirtualMachine; }
0
a40496199236f2571a61fbbc0e17ea70
5a107b32a6d1904374878d2fd9dac67e
* lncli: `listchannels` ListChannels returns a description of all the open channels that this node is a participant in.
class PullClient listChannels() { return this.jsonRpcAdapter.executeOutgoingRpcCommand("listChannels", {}); }
1
a378b54d30139c4721dc97411846647c
8addcd0925125bdcb2308a595bd72af4
Returns the MongoClient object (the database connection itself). It will create one based in the given connection string if it doesn't exists.
const client = new MongoClient(connection.asURL(), { useUnifiedTopology: true }) await client.connect() return client }
1