query_id
string
corpus_id
string
query
string
code
string
label
int64
73a0b7c26ee13eb7093ec3583d434bb3
85abf16bc851ae2cb0ffdaa458650fec
<p> 跳转到测试主页面 </p>
@Controller @RequestMapping("/admin") public class AdminController @RequestMapping(value="/main") public String test(Model model) throws Exception{ return "home_page"; }
1
34be629b2dfd7c6f71fe667a6d5e78df
5b617f9b7f4856bbecbc194a93f50b9d
Set 付费模式。取值范围:<br><li>PREPAID:预付费,即包年包月<br><li>POSTPAID_BY_HOUR:后付费,即按量计费。
public class Cluster extends AbstractModel{ public void setPayMode(Long PayMode) { this.PayMode = PayMode; }
0
22d1c124ceb6e623631ffaf0e83e2ab7
ae84b8e1d1c0d25bebc577f909d1cf99
Disables Calibration Table
class AppCalibVM: def vDisableCalibTable(self): for row in range(NO_OF_POINTS): self.RBEntry[row].config(state = DISABLED) self.RBEntry[row].deselect() self.EntryADC[row].config(state = DISABLED) self.EntryVoltage[row].config(state = DISABLED) self.BtnSaveCali...
1
c7c207f21eacffe05a9dcb4362e6d258
2a6ba1397b04918c83424230dd15e330
根据ID集合查询列表集合(异步)
Task<List<TEntity>> FindByIdsNoTrackingAsync(params TKey[] ids);
1
cc2203b3431130b62beee2314e2c7add
603075d80cee45f1951ec917e72ef427
Inserts the number into the array so the array is in sorted order
namespace SearchSort public static partial class SearchAndSort private static void insertToSortedArray(int[] arr, int n, int num) { int i; for (i = 0; i < n && arr[i] < num; ++i); for (int j = n - 1; j >= i; --j) arr[j + 1] = arr[j]; arr[i] = ...
1
d163d82360724dc59a2d8e5895188d4a
5fab46d7d732d76fe7631d6a38953b0f
addアクションのGETテスト(作成権限あり)用DataProvider #### 戻り値
class BbsArticlesControllerApproveTest extends NetCommonsControllerTestCase public function dataProviderApprovePut() { $data = $this->__getData(); $dataError = $data; unset($dataError['save_1']); return array( array( 'data' => $data, 'role' => null, 'urlOptions' => array('frame_id' => $data['Frame'][...
0
d1f114340dace2da48fbc4a84b2b50a9
08ef5e51d9fa44ac8bd0cce47b20935d
Get the populated fields for the current context. If no context has been established using {@link #openContext}, returns {@code null}.
public Map<String, Object> getContextEntries();
1
fd75435e5b9fd23b7f56cebac9ed9173
6f11c0fd70c9ccf5f43c3cadfad50504
Rename client's tab
scr = scr or capi.mouse.screen idx = idx or tag2idx(awful.tag.selected(scr)) if not idx then return end local t = capi.screen[scr]:tags() if idx > #t or #t == 1 then return end if #(t[idx]:clients()) ~= 0 then return end if t[idx].selected then awful.tag.viewnext() end table.remove(t, id...
0
4360d5cea12acdecc2efec80530d7471
91a412f3bc5df0bef30889c4947e511f
Sets the name in the current project as the moving data set filename
public class DataSet implements Serializable public void setFileName(String fileName) { this.fileName = fileName; }
1
552e37d03797e38d6ae5ade7d11a81d7
3407b8387e551aaf00e63e9b67834bad
Parses the the rule SingleType according to the following production rule: <p> [48] SingleType ::= AtomicType "?"? . </p>
class SLICC(Grammar): def p_typestr__single(self, p): p[0] = p[1]
0
cc62bf5915983815f439ac3457495fa3
93f69720bd868bb5c0375ad88e77e3b1
获得vip级别对应的能购买的pvp挑战次数
function FuncCommon.getPVPBuyCount(vipLevel) return FuncCommon.getVipPropByKey(vipLevel, "buySn") end
1
9f346d6102c84c3d47dff4df8ed54f8f
13ace70ae5fcb081c1a457b5b42f71b4
通过filters获取单个api error code信息
function apiErrcode($key = 'ok') { $arr = Config::get("apiCode.{$key}"); if (!is_array($arr) || !array_key_exists('errcode', $arr) || ($arr['errcode'] != 0 && empty($arr['errcode']))) { return -1; } return $arr['errcode']; }
0
ec372ecfadbc09b816a558e81426045c
5e245de7509e628ea604b48dde07de9d
Set the dynamic descriptors for the transaction, these are set by the admin in the gateway settings
class WC_Braintree_API_Transaction_Request extends WC_Braintree_API_Request protected function set_dynamic_descriptors() { if ( ! empty( $this->get_order()->payment->dynamic_descriptors ) ) { $this->request_data['descriptor'] = array(); foreach ( array( 'name', 'phone', 'url' ) as $key ) { if ( ! empty( $th...
1
c257c93df8d78516193f2e70bb341dbe
447926699ff5df686ac9272b5413b525
Mutliplies the radius and gravity param of a body by a given factor.
self._gravityScale = scaleRatio if self._body and self._body.SetGravityScale then self._body:SetGravityScale(scaleRatio) end end
0
855c62284859631b909972530b94030b
55c4d42e397ec90f31482f375f8ec976
MessageEditActionInterface constructor.
Context $context, Registry $registry, ScopeConfigInterface $config, TypeListInterface $cacheTypeList, Escaper $escaper, ManagerInterface $messageManager, AbstractResource $resource = null, AbstractDb $resourceCollection = null, array $data = [] ...
1
dfdfa3b354d58fe7b20e047aad8b07f7
db3b4fac51a3b6f41d7ce067c439efc2
Applies damage to himself.
namespace ShooterGame.GameObjects.SpriteObjects.Enemies public abstract class BaseEnemy : SpriteObject public abstract void ApplyDamage(float damage);
0
f784e194da6ddf0527d95499daefc907
46f1b6d8016b947ccbe45f8d8850decb
takes a string and integer as parameters, prints the string the given number of times
def print_string_n_times(string, n): print str(string) * n
1
0fe213c4567f33cc3fb665e00cde7d2e
a2dd5c43b60e3955d693192109584f8f
Allow users to save events to a personal Events array.
function createEvt(title, start, end, note, file, lector) { var event; if (arguments.length === 1) { event = arguments[0]; event.id = myStorage['freeid']; event.allDay = false; } else if (arguments.length === 6) { event = { 'id':myStorage['freeid'], 'title':title, 'start':start, 'end':end, allDay:false, 'no...
1
904f27912ea0aedb97e2ffcc6a049363
2f0e19503f777e2e0b8835daf284fef7
判断指定的double值是否是有穷的<br />
namespace Mariana.AVM2.Core [AVM2ExportModule] public static class ASGlobal [AVM2ExportTrait] public static bool isFinite(double num = Double.NaN) => Double.IsFinite(num);
1
0bcaa0ad8811a7b34ea74dac6ea68e85
9c0009a503bec665ba0b496b111abfb3
Clear the canvas and redraw the blocks
function render() { ctx.clearRect( 0, 0, W, H ); ctx.strokeStyle = 'black'; for ( var x = 0; x < game.board.width; ++x ) { for ( var y = 0; y < game.board.height; ++y ) { if ( game.board._table[ y ][ x ] ) { drawBlock( x, y ); } } } for ( var y = 0; y < game.currentBlock.he...
1
d2595989be510756583c98422d0aafb6
f1753c58a4d45ec994e457cb15935441
给定出生日期毫秒数,返回当前年龄
public class DateUtil public static int getAge(String strbirthDay) { return 0; }
0
c5564425eb2240822e897078ffa60c32
af734fc3398f0bceb57b200fcc168513
Debug procedure to test stuff in all images in a list of file names.
void main() { ProcessFolder("Images/broken"); }
0
6a71b8a447f2ee8c17aaa0f7d6e808ce
95c6f267f0f9ed552e32404b8af66a41
user watch or unwatch a pet
if (!is_numeric($petId)) { $this->_data['msg'] = 'bad pet id'; return; } if (!in_array($type, array(0, 1, 2, 3))) { $this->_data['msg'] = 'bad type'; return; } if ($friendUserId == -1) { $petModel = new PetModel(NULL, $...
0
1ff5ce1c9360240f7dceb2d8be916155
709b6f4a8e4e46283003d0bcdf448581
Returns getter and setter accessors of the property.
function getter(name) { return { get: defaultGet(name), configurable: true }; }
0
96b3fc06ad961aca253b4792446e532e
b1e9f7af44ee7a6c1d9110b8dd5f4f48
returns allocation if defined, otherwise, allocation set target
class OUSpreadModelOutput: def alloc_a_pct(self): return self.m_opt_alloc
0
f44ed38efb0323e319fced6713e93af4
6b9c6f2bc7f1d79f94fb32dcb02b8045
Bad Things: aka Vomit, Pit, Flames====================================
def whathappened(): delay_print("\nThe bartender tells you that you had one too many drinks and ") delay_print("ended up passing out on the table. He tells you that he didn't ") delay_print("have the heart to tell you to leave because you seemed really") delay_print("out of it. He gives you a couple of ...
0
cfe8ef8150b44eadde73769644cf34aa
0530b3da821819556bc870d554eeb784
检查登录web界面,判断是否会显示向导页面 输出:有则返回True,没有则返回False
soup = BeautifulSoup (driver.page_source, "html.parser") if '收件箱' in soup.text: print ('login successful') return True else: print ('Login failed') quit ()
0
0841793b7fe5d1a15067db1d7053c79c
e1c2786808e156c35771215b08c330f6
Compute the segments length and removes the segments which are shorter than a tolerance.
def one_line(s1, s2): s1, s2 = s1.flatten(), s2.flatten() angle = vectorial_angle(segment_to_vector(s1), segment_to_vector(s2)) if angle > half_pi: angle = math.pi - angle if angle > thresh_angle: return False distance =...
0
cf7b22911fdf47725fcc6e6baf8077a9
d68a905405e6997a346af192798991d6
Shows the mesh in the scene.
class PreprocessorAPI(BaseAPI): def show_mesh(self): self._call_femm('showmesh', add_doctype_prefix=True)
1
eb77a2a06d972cd24391fbcbf9ee83e8
bc0b8e061d4c5293475387197e5e19f2
Determine what Player is aiming at
public class PlayerOneController : MonoBehaviour void Aim() { if (movementDirection != Vector2.zero) { attackingDirection.transform.localPosition = movementDirection * 0.5f; } }
0
d2fc194da0cdbe42450b66f4ddd40170
0dd6a2608b1ab974548c41c01a0a4d36
<p>Gets the signer's certificates.</p>
class CPSignedData public function get_Certificates() {}
1
34aa4329a3613be04ee0ca1e9bebd371
c79e689f7fa3f0ce4b7037682dc187b2
Reads from log and clears it
i = 0 while i < 25: txt = self.ser.read(1) self.update_log(str(txt)) i += 1
0
b4853395e9a30f1027d51218f8473778
69e686c1458a2c54bc37a95773fb4cb9
Test computation of segment tick mappings. Check integers, list and function types.
assert BaseSegment.class_is_type("base") assert not BaseSegment.class_is_type("foo") assert not BaseSegment.class_is_type("foo", "bar") assert DummySegment.class_is_type("dummy") assert DummySegment.class_is_type("base") assert DummySegment.class_is_type("base", "foo", "bar")
0
5f1b890fd3fc36d8db13a31e9e8ea56a
e89efbb72df3542bc4c07088101f475c
Read one integer from the selected inferior's memory.
intend_value mem_get_int(intend_ctx ctx, unsigned int argc, intend_value *argv) { memblock *mem = intend_resource_value(argv[0]); char *pos; int *get; int offset = intend_int_value(argv[1]); if (!is_mem(argv[0]) || !mem || (mem->size && offset + sizeof(int) > mem->size)) { return...
1
8f1c403904404366e77176ccda8a6170
12c85adf3c5b4fc2ffc68eb96fa105c5
处理非ajax异常
HttpServletResponse response, Object handler, Throwable ex, boolean isajax) { log.error("全局处理异常捕获:", ex); if(isajax){ return processAjax(request,response,handler,ex); }else{ processNotAjax(request,response,handler,ex); return null; } }
1
b97cd79cc73c899119576025d05b84f5
2387ae38045ce80151a3d68070ee327f
Serializes the given object into json. Returns the json string if successful. If serialization fails, then returns null
@Nullable byte[] serialize(@Nullable Object obj) throws Exception;
0
f188138db0da1a464d2927aff0b970cb
365ef034755611320d6cf236c5dfde66
Decodes `joined_encodings`, which is a concatenation of RLP encoded objects.
def decode_joined_encodings(joined_encodings: Bytes) -> List[RLP]: decoded_sequence = [] item_start_idx = 0 while item_start_idx < len(joined_encodings): encoded_item_length = decode_item_length( joined_encodings[item_start_idx:] ) assert item_start_idx + encoded_item_len...
1
f257ecaa198ce0f59158344379de6fbc
35e278bd8aad01b5595cca17b4c6ae94
Равно ли число float нулю с заданной точностью?
float_data = float(field.data * 10 ** places) int_data = int(field.data * 10 ** places) return math.isclose(int_data, float_data)
0
d94d421732e229925219f3e5881cac26
3b6ce17900ffc0b55327af2ab0f58409
Add pre-string formatting
class FormatterLatex(Formatter): def pre(self,txt): self.writeln("\\begin{verbatim}\n"+txt+"\\end{verbatim}") return self
1
5bde5d59b490bf16354f922b2c982fce
ba4581684316637189673aa5bed29435
由日期字符串得到该日期为那个月的第几天
long m=dayToDayMonths(strdate1,strdate2); m = m / 3; long m1 = m % 3; if (m1 > 0) m1 = 1; else m1 = 0; return m+m1; }
0
01e289f0dc4a78a459b7c2348164ab3d
01197d3a01948256b183160d75d2047e
Signs-out of Chat MEme
export class UserInfoService signOut() { return this.chatbot.get('api/logout').pipe(catchError(this.errorHandler)); }
1
2f557d29620fd78f8ade5516b2df7ce4
ed21c2e5b5c96d4cdcd3dc3f5dadafce
处理数据格式,已存在的数据在地图上selected=true
let layer = this.layer; if (layer._map == null) { layer = this.egovaMap.innerMap.getLayer(layer.id); } for (let i = 0; i < layer.graphics.length; i++) { const gg = layer.graphics[i]; MapUtils.changeSelectedState(gg, this.getIconName(gg.attributes), !se...
1
d96f9edd0252ae323b0b9d11ac24e8ce
1761c80ad8b4315473fb012978202412
结果页得分分布图
plt.figure(figsize=(14, 5)) bins_ = list(np.linspace(min(train_good_score.min(),train_bad_score.min()),\ max(train_good_score.max(),train_bad_score.max()),11)) all_data = pd.cut(reject_score, bins_).value_counts()/len(reject_score) all_data = all_data.to_frame('reject') a...
1
b954bfb2fabb95bd42cae03282defd03
cc52c577b9688e2a06debea41999bfcd
定义特征提取器函数,检查给定单词的后缀
i = 0 cur = self.root while i < len(word): char = word[i] if char not in cur.children: return False cur = cur.children[char] i += 1 return cur.endOfWord:
0
1449137a6c84ae30a3c14427baded07c
3d04c0dc2012a4ce9604de5dab050412
1.判断是不是左括号
function isLeftParenthesis(ch) { return /\(/.test(ch); }
1
a9e2595e878e53f92341efd45eef73e8
0f15c7c4d380f910fd1183b41a6ae3ad
Enter a parse tree produced by {@see sdpParser::ipvfuture()}.
public class HTTPMessageBaseListener implements HTTPMessageListener @Override public void exitIpvFuture(HTTPMessageParser.IpvFutureContext ctx) { }
0
50ade3ccb248fd3715ae9b67ee06444a
9c41724d2fc93b6fff246fe82ead5e10
計算p點更靠近哪個keyPoint,並回傳KeyPoint
int neighbor = -1; double minDist = INFINITY; for (int i = 0; i < descriptors.rows; i++) { KeyPoint pt = keypoints[i]; if (pt.size < KEYPOINT_MIN) { continue; } Mat v = descriptors.row(i); double d = euclidDistance(vec, v); double pixel_d = norm(pt.pt - keypoint.pt); double obj = d + pixel_d * 0.2; if ...
1
5905abb461187e773b16a9ed8f169eb1
1a35652fcebab2b9a3c667bd611b774c
Gets a backup policy belonging to a backup vault
function getBackupPolicyOutput(args: GetBackupPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetBackupPolicyResult> { return pulumi.output(args).apply((a: any) => getBackupPolicy(a, opts)) }
1
92121efaa9ae8734ba9ddf75de0095c5
3179cf29a7aabc4775aa4e9d22e93145
This method is used by the server to encrypt the server's secret key with the client's public key. This is a safe way to transfer the server's secret key.
A = (self.sharedBase ** self.clientSecret) % self.sharedPrime message = 'AES#' + str(A) self.sock.sendall(message) B = self.sock.recv(1000) veryfied_B = self.rsa.verify_sign(self.server_public_key, B.split('#', 1)[1], B.split('#', 1)[0]) if veryfied_B: clientS...
0
f3d324234426a6f551c3d40e8b7e2d37
6477637360e0f6bb0b4aeb06ed32df30
摄像头ip有效性验证
def check_camera(rtsp_url: str) -> bool: try: o = urlparse(rtsp_url) res = ping(o.hostname) if (res != False) & (res != None): return True else: return False except: return False
1
b40b6c04ae8cab12407392ac7e1d22cb
097e764c11bf279289345236918a9dda
This forces the tests to run in a single thread. This is required for use of the mocks as we run mocked binaries.
class TestReduce1DSingleThreaded( TestBaseRemote, CoordinateAssertionsMixin, ReductionMixin): def setup(self, android): android.push_prop('debug.rs.max-threads', 1)
1
d84089c5419732469a11639cc9e212e2
93a550340efdc833e67aa33196f67f19
判斷tfrecord文件是否存在
files_queue = tf.train.string_input_producer(['../Data/tf_io_stat.tfrecord']) tfrd_reader = tf.TFRecordReader() _, serialized_example = tfrd_reader.read(files_queue) features = tf.parse_single_example(serialized_example, features={ ...
0
24a5c2a27c5cc0fd374187845f491650
052105739f7cc7927922c191bf618c7a
Redirect any non-API calls to the Angular application so our application can handle the routing
if ((requestPath.indexOf('/api') === 0) || (requestPath.indexOf('/nbextensions') === 0) || (requestPath.indexOf('/files') === 0) || (requestPath.indexOf('/static') === 0)) { jupyter.handleRequest(request, response); return; } response.statusCode = 404; response.en...
0
9cb18989a1341d5ad09fc2bfc224c6fc
56dfe1470525eb2a6737539b8349de5c
returns a tuple containing the time interval over which the reconnection rate is calculated
class NavRtp(object): def select_interval(self): return
0
1e299788eabba9c6b21e1068255aa4ab
935a6404bfd928374ff9b23d54cc6bb3
初始化四个方向向量
myDirections = new ArrayList<Integer[]>(); myDirections.add(NORTH); myDirections.add(SOUTH); myDirections.add(WEST); myDirections.add(EAST); myDirections.add(NE); myDirections.add(NW); myDirections.add(SE); myDirections.add(SW); }
0
5c3b40b2d1b6bdce2ef2d7bfdf498956
85291614cd26189100cba06840fcc982
Checks to see if this function failed to run previously
public class RerunnableScenarioRunner extends ParentRunner<ExecutionUnitRunner> protected boolean hasFailedBefore() { return this.lastEncounteredFailure != null; }
1
e97178a32821d0e2eaadab8e7322acdc
658cbb0a44656ee7ce729704e9e15042
获取每个月的最后一天时间
Calendar calendar = Calendar.getInstance(); calendar.setTime(dateTime); calendar.set(Calendar.DATE, 1); calendar.add(Calendar.MONTH, 1); calendar.add(Calendar.DATE, -1); calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(calendar.MINUTE, 59); calendar.set(cale...
1
d9dee35b479c3105e0791fe26a70566f
4792763f9da87854994818246f643ef7
Writes the current value to the output, using the specified format. IF this extension cannot write the value, returns false, otherwise true.
namespace Unify.Framework void WriteValue(TextWriter textWriter);
0
9bf9dd9750681b1ef2aa27804a796c7c
848e4ab414b2b83a8bc9b4477808beb4
Run a multi-stream TCP bandwidth between two VMs.
server1 = util.rpc_client(node1[0], node1[1]) server2 = util.rpc_client(node2[0], node2[1]) br_name1 = None br_name2 = None servers_with_test_ports = [] try: interface_node1 = server1.get_interface(node1[0]) interface_node2 = server2.get_interface(node2[0]) if server1.is_...
1
72f6095f34521756e69e7228031cc6cf
6a36fc3ca66cc1b84646eea48e1b219b
https://www.hamayanhamayan.com/entry/2020/06/06/230814
fn main() { input! { n: usize, p: [(i32, i32); n] }; let mut map = HashSet::new(); for i in &p { map.insert(i); } let mut answer = 0; for i1 in 0..p.len() { for i2 in i1 + 1..p.len() { let p1 = p[i1]; let p2 = p[i2]; for p3 ...
1
4d0dac7f658d4733d28b72433cbb1073
5671c674f2e91c904f09c94f398bb96c
在绘制管道的时候,应该根据不同的方向 绘制不同的管道
public class Pipes implements Runnable{ public void draw(Graphics g, MyPanel myPanel) { if(this.pipeType == PIPE_TYPE_UP){ g.drawImage(UP_PIPE_IMG,x,-y,myPanel ); int bx = MyPanel.bird.x; int by = MyPanel.bird.y; if(bx > x && bx < x+UP_PIPE_IMG.getWidth(null) && by > -y && by < -y+ UP_PIPE_IMG.getHeight(n...
1
eedeafc9aa1d72b94faffd2974c5884b
4c1583007a54df99148347fc97a3b88c
Adds name to the class stack, for the duration of the block
public class ErrorSyntax extends DefaultStyledDocument public void addClassName(String name, MutableAttributeSet attr) { _classes.put(name, attr); }
0
8bbf909bf7322cab94e4468ed2311809
7e31932a062a73b08cf04470749f7ce0
Deletes the given entities in the database using a transaction.
public abstract class BaseSqliteModel<K, T> public void deleteInTx(T... entities) { mGreenDao.deleteInTx(entities); }
1
8ee0f09ac604c765a60b83618c5d4c8e
23ff5c371822052090c301f498953676
クエリ文字列から指定されたキーを削除する
namespace arunes public static class Functions public static string RemoveValueFromQueryString(string key, string queryString) { string currentQueryString = queryString; string retVal = currentQueryString; if (currentQueryString != "" && currentQueryString != null) ...
1
0dd5b1e89b9a5accf177524dfd425b94
fd99f3463546f3617a5ef9f29986e8dc
Broyden-Fletcher-Goldfarb-Shanno approximation of the Hessian.
C = data.sample_cov R = C - Sigma Sinv = np.linalg.inv(Sigma) D1 = _invech(dSigma.T).T D2 = _invech(d2Sigma.T).T R = C - Sigma A = Sinv.dot(R).dot(Sinv) A1 = np.einsum("hi,ijk->hjk", A + Sinv/2, D1, optimize=True) A2 = np.einsum("hi,ijk->hjk", Sinv...
0
f25c613717ea8e257ce0f88be8ea196c
40284869bcccb4a4005b97563b51f132
Permanently removes this stored procedure from the database.
namespace Savchin.Data.Schema [Serializable] public class TableSchema : INamedObject public void RemoveProcedure(string name) { Procedures.Remove(name); }
0
5ca9e3c1a242d77d339e6175dc906f1a
65a6ebb81d3057a160ea8c4669d9753e
有ID记录获奖者,并移除列表
if id then table.insert( self.rewardIdList, id ) self:Fire(ConsumConst.ChangeCtrl, id) end end
0
a35f83bd28fa3edbf54ae6cf68a6f45a
a09321ee074313a29480b9c6e305f19a
возвращает всех авторов
class Author extends Model public function getAllAuthors() : Collection { return DB::table('authors')->select('*')->get(); }
1
711b78b5f391f6e2e1b00bf5db531387
9e35c5a991b35ed6a6695e8fc9bba48c
Converts a timestamp string of the format '02:14.667' to an integer representing the total number of milliseconds from 00:00.000
def convert_to_seconds (timestamp) : time_components = re.findall(r'(\d{2}):(\d{2}):(\d{2}),(\d{3})', timestamp) if not len(time_components) == 0: hrs, mins, secs, msecs = time_components[0] hrs = int(hrs) * (60 * 60) * 1000 mins = int(mins) * 60 * 1000 secs = int(secs) * 1000 ...
0
c08355a19fdb5ace50526b99f4c85004
0e9199e43dbb48d52bab735cb01c92c6
returns a list of file names from firebase
val storage = Firebase.storage val listRef = storage.reference listRef.listAll() .addOnSuccessListener { it.items.forEach { item -> listItems.add(item.path) } it.prefixes.forEach { prefix -> listP...
1
451f9e37de18f279f743eece5984576b
6a81bbf628e4d0238b43262e540edc42
Makes a new table that is a copy of the table parameter (does not modify the original table), but with rows removed from the table that have missing values in the column with label col_name
def drop_rows_missing_required_cells(dataframe, col_names): dataframe.dropna(axis=0, subset=col_names, inplace=True)
0
d7effb69ab207850be1df23368858cb5
72a322c576f9788d4649746b131895d1
Quoting is done when rendering the error in the template.
class Quote(models.Model): def __repr__(self): return 'Quote({!r}, {!r}'.format( self.author, Truncator(self.text).chars(32, '...') )
0
abf2d684b0b404b497a90a02c009c96b
93b6a2e3279a3140c27ff4903ab49994
This walks you through the basics of objects, and demonstrates that each object has its own distinct storage space.
int main(int argc, const char * argv[]) { std::cout << "Hello, World!\n"; { char name[] = {'b','m','w','\0'}; Car *car = new Car(100,name); car->display(); delete car; } { Car car1(100,"bmw"); Car car2 = car1; } return 0; }
1
6ca4156c882a03f34bad049caedc61a7
05fed5cc1feb326163554c86ba66b050
Вызывается когда процесс, открывший файл устройства пытается считать из него данные.
static ssize_t device_read(struct file *flip, char __user *buffer, size_t size, loff_t *offset) { ssize_t len = (ssize_t) min(size - *offset, size); if (len <= 0) return 0; wait_event_interruptible(my_queue, msg_buffer != NULL); if (copy_to_user(buffer, msg_buffer + *offset, len)) return...
1
f52f57883708bd6999edecbd28afb2e7
dc1ce51537f5b4bb2c89296f43252e43
计算年龄, 以365天为一年
function computeAge(date: string | Date | number): number { let now = new Date() date = new Date(date) let newDate = now.getTime() - date.getTime() return Math.floor(newDate / 1000 / 60 / 60 / 24 / 365) }
1
7a11e59444ed61b8166881da90985a91
f0d9e999cdc82dad9d7e602fe2b215c1
# Email Alert to distributor for Payment Receipt
if(type == 'create') { var customer_id = nlapiGetFieldValue('customer'); var salesrep = nlapiLookupField('customer', customer_id, 'salesrep'); if(salesrep) { var invoice_id = ''; for(var i = 1; i <= nlapiGetLineItemCount('apply'); i += 1) { invoice_id = nlapiGetLineItemValue('apply', 'internalid', i) ...
1
a3c6b79698eea884f227839d91aa7c5c
e54d62cc895240ecffb81c00e2515017
VERIFICA SE A SALA ESTÁ CHEIA
public class Les public boolean isFull(){ if(this.total == this.tamMax){ return true; } return false; }
1
94522c332389ba89a5c6ade232b7f858
d2b9a8d4778f21bbddfff1810e92f334
获取单号1输入框
QString Out_stock::get_number() { QString number; number=ui->out_number->text(); return number; }
1
d779fc0e86d360a71191c481f1d8f5b0
471f2848d05518ea01899bc6c4ae5102
gets the list of moves, as an array
class HexUI: def get_move_list(self): return self.move_list
1
57ce01dafc3271589dee53a47e5ab7c6
eca9d008ded7ec442d31a23f87feeea7
移除所有键盘
export default class CustomInteractionManager{ public static removeAllKeyDownEvent(){ if(!this.keyboardEventMap) return Object.values(this.keyboardEventMap).forEach(event => { window.removeEventListener('keydown', event) }) }
1
db0e05adf5fade9f409215ece81b9591
9c8e5b49820ceaa04164e5932d9bcb43
Restore size of Sysquake main window (no effect on all platforms).
while utility_process_list: utility_process_list.pop(0).kill() window_x, window_y = self.MainWindow.get_size() remembered_size = """sed "s|\(main_window_size = \)\ (.*)|\\1(""" + str(window_x) + "," + str(window_y) + """)|" -i """ \ + pref_path + 'setupcenter_pref.py'...
1
c99599d8fa69d5a4527ca12791385451
ebd51eeafd5d4bda6f3964dbebe4e6d5
根据根是否相同判断是否相连
bool isConnect(int a, int b) { return root(a) == root(b); }
1
d07174654992f6648b086c6f0567eb76
c710388a63fc1339c3393daf7d370fdc
TMPricesCommand constructor.
class PriceChanges extends Command public function __construct() { parent::__construct(); }
0
2d48ed85cce8dd7bd70a77cc792a8edb
877aa540faa547deae567e6fc54ad3e0
只复制.meta文件
def copyMetaFilesTree(src, dst): try: names = os.listdir(src) except OSError: return for name in names: srcname = os.path.join(src, name) dstname = os.path.join(dst, name) if not os.path.isdir(dst): os.makedirs(dst) shutil.copy2(srcname, dstname) ...
0
7bb9198a672539b0edce2975768e648b
061eca87aaf4a40289f63dbe1642895d
Frame time must be positive.
{ ossimVideoSource* video = dynamic_cast<ossimVideoSource*>(getInput()); if (!video) return false; if (frameTime == m_frameTime) return true; m_frameTime = frameTime; if (m_frameTime > video->duration()) { m_frameTime = 0; return false; } video->seek(m_frameTime, ossimVid...
0
edba665e661e8daa132907054fb4ccaf
c3ba6ec02f83199c49086878bba00720
Draw node group. The node group is drawn when layout debugging is enabled only.
const node = node_in.node; const width = 40; const height = 20; const centerX = -width / 2; const centerY = -height / 2; const isRoot = node.depth === 0; const isParent = !!node.children; if (isRoot) return <RootNode node={node} />; if (isParent) return <ParentNode node={node} />; return ( <Grou...
0
c0d83ed98df13d520efcf222a065c0b1
5fad2faf538348200833d2040c4819ab
Test ham tim kiem user trong csdl:
List<NguoiDung> nguoiDungList = new ArrayList<>(); String sql = "SELECT * FROM USER WHERE username LIKE '%" +timkiemusername + "%'"; Cursor cursor = mySqlite.getWritableDatabase().rawQuery(sql,null); if (cursor.getCount()>0){ cursor.moveToFirst(); while (!cursor.i...
1
b828df7cf508140c8c89af1182672e1e
0070a234059f8edf11b63a3a5538cbb4
软删除权限
@Service("permissionService") @Transactional public class PermissionServiceImpl implements PermissionService @Override public int disable(PermissionSearchVm searchVm) { PermissionCondition condition = searchVm.getCondition(); PermissionEntity entity = new PermissionEntity(); entity.setDelete...
1
7ef33942db08a776af9a65fc1141da85
365dbed61bcd962e2628561c1364a9d1
solo mostrar los objetos del usuario, o todo si es superuser
class TipoItemAdmin(admin.ModelAdmin): def queryset(self, request): qs = super(self.__class__, self).queryset(request) if request.user.is_superuser: return qs; return qs.filter(proyecto__usuarios__id=request.user.id)
1
51ae802387b0c49fa14d7c49a09229b8
75b901e1bcf243c5dbe94dafdb888c10
是否為中文字符串
namespace ServiceBridge.extension public static class ValidateExtension public static bool IsChinese(this string s) { return ValidateHelper.IsChinese(s); }
1
d1c1128ab5451b5798a339d7e683bdfa
d4536ab0ec2787e9846a93214180d652
Called when a capture object has been created, it configures the camera for the capture process
{ capture = cvCreateCameraCapture(0); cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, width); cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, height); }
1
043ad9ee1277a3a98b132057faf73d38
39071b9303d1211f1d119b9ae7e85c11
初始化病人缓存
public class PatientInfoHelp public static Patient initCurrentPatient(Context context) { SharedPreferences sp = context.getSharedPreferences(Constants.SP_NAME_PATIENT, Context.MODE_PRIVATE); Patient patient = new Patient(); patient.setCreateTime(sp.getLong(Constants.SP_KEY_PATIENT_CREATE_TIME, 1...
1
1e8cd895d057608aa95cc839be1615ae
142f9f6d3b5f33ae4774bcc89fcf68a1
Used to redirect a logged in user to the user path with their id
class ApplicationController def after_sign_in_path_for(resource) user_path(@user.id) end
1
ee4e1352ef98806e54949104cb34f9ab
3188dd28dfed4994221dc1c09746ea3b
Iterate over all the actions and compute their q-values. Then return the action with the highest q-value.
for i in range(self.iterations): index = i % len(self.mdp.getStates()) state = self.mdp.getStates()[index] top = self.computeActionFromValues(state) if not top: qval = 0 else: qval = self.computeQValueFromValues(sta...
0
7a4c9e138817019688ad1054fd4edd15
4b7c7899757d47214d5f110abac170a2
解决SwipeRefreshLayout包含ViewPager时的滑动冲突
@AndroidEntryPoint class MainActivity : AppCompatActivity() private fun setupViewPager() override fun onPageScrollStateChanged(state: Int) { if (!binding.swipeRefresh.isRefreshing) { binding.swipeRefresh.isEnabled = state == ViewPager2.SCROLL_STATE_IDLE } ...
1
969c6eabf383ffd689ca08302824cd30
bbae27963ed9fa5643e1fe11df8d4812
Compute the current limit magnitude by dichotomy
crits = [] for line in self.lines: if line.end_type in ['maximum', 'minimum']: crits.append(line.end) if len(crits) != 2: return None else: return mag(n.array(crits[1]) - n.array(crits[0])) * self.dr
0
b5675f531379113c2dbff48f664cabcd
27c7dd437546935bde0014110d959302
Método que obtiene todos los Servidores de Archivos.
ArrayList<String> getFileServers() throws RemoteException;
1
4e120cd0022a5dc5e326a4e790afc9e5
781e6a6efe2d766bbac4e7f06f1891ed
Lists all employees in records in order of hire date
print("Showing all employees Alphabetically") print("==-==-==-==-==-==-==-==-==-==-==-==-==\n") sorted_employees = sorted(employees, key=lambda record: record[0]) for record in sorted_employees: print_full_name(record)
0
94029e2c826ecdc62a31d6fd6aae76d4
9abd035520b1e44c90944df4bef3d317
Sets the fecha nacimiento.
try{ $fecha_nacimiento = date("Y-m-d", strtotime($fecha_nacimiento)); $this->modelo->setFecha_nacimiento($this->getUD, $fecha_nacimiento); }catch(Exception $e){ throw $e; } }
1
ad7c52621561a456ba153da8d7a85503
2d7d06cfcbb6225c83f0c1067771a59d
Returns the Amount in Cents
public class BoletoTransactionData public Long getAmountInCents() { return AmountInCents; }
1