query_id
string
corpus_id
string
query
string
code
string
label
int64
19cb4e42ac9d2b16eae20ba562ef876c
724c1d4ddc2cf8d1b34fc042d4a072cc
生成由四元组拼接成的字符串
String concatWordStr = se1 == null ? "null" : se1.text; concatWordStr += se2 == null ? "-null" : "-"+se2.text; concatWordStr += se3 == null ? "-null" : "-"+se3.text; return concatWordStr; }
0
74f248ba26dc0940d7bb753fdcd108a4
09b05486fb612303968658f86db1eb41
移除所有为空,或已经销毁的Activity
activities .filterNot { it.isDestroyed } .forEach { it.finish() } activities.clear() }
0
1023fa45c3a7cfe0cde4ab46bc96cb21
f4139f923d447dbac8eabaff1d8158ce
Sets the default rule description.
class SubscriptionDescription public function getDefaultRuleDescription() { return $this->_defaultRuleDescription; }
0
c0c2777573800706877101b367a5571e
b12bf7dbbbbeb08cde1e3f6cf2ccc429
Calculate capital recovery factor.
indicator = abstract.Function('ROCP') if not utils.check(inputs, [price_type]): raise ValueError('') return indicator(inputs, timeperiod=period, price=price_type)
0
b8fa478aa30ce7915e2a731d4f0180b1
26b5f07da8f3d948b686734d261bcb4a
获取_id为member_id的member对象。
function load($memberId){ $member = $this->system->loadModel('member/member'); return $member->load($memberId)?$member:false; }
1
7c1523e051535c6546a8830d9a208fca
8efb4b2f9c7d929e439f73ef057b39dc
function to simulate spread with temporal BFS
class pandemic: def spread(self): self.age+=1 S,E,R,C,D=self.sort_ppl() self.plague=np.vstack([self.plague,self.plague[-1]]) self.quarantine=np.vstack([self.quarantine,self.quarantine[-1]]) self.quarantine[-1][np.ravel(np.argwhere(self.quarantine[-1]>0))]-=1 self.incuba...
0
7825df7eda33f6ad2bd20e3714421e9a
acdb7e6aa0bb86ac91ae5d33ed4c22cc
获取所有bgm
{ string str = @"select bgMusic from dbo.c_music"; str = string.Format(str); DataTable dt = DBHelper.SqlHelper.GetDataTable(str); return dt; }
1
7ed7cc3b9bf52eb356a4c2e011e482d5
ad28f3130891e1d621fd5e2ffb3f9636
创建2个framebuffer作为每次渲染结果的叠加专用纹理
void MyGL::createRenderBuffers() { glGenFramebuffers(1, &m_frameBuffer); glGenTextures(1, &m_renderedTexture); glGenRenderbuffers(1, &m_depthRenderBuffer); glBindFramebuffer(GL_FRAMEBUFFER, m_frameBuffer); glBindTexture(GL_TEXTURE_2D, m_renderedTexture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, t...
0
c8f4398cd570e059a704c97a5f30f21a
644cc5bc931a31e87ff12805519ed89b
Select who to attack next
class Ghosts(pygame.sprite.Sprite): def pickturn(self): if self.weak == False or self.hit == True: self.nextturn = self.checkdirection((self.rect.center[0]/12,self.rect.center[1]/12)) elif self.weak == True: self.nextturn = self.randomturn((self.rect.center[0]/12,self.rect.center...
0
70b7407ce9652a6058f9277b52d00aea
6197f02d99fd60f923d459314a35a255
Start the debug helix token flow.
namespace Com.Mobicage.Rogerthat public class Api public StartFlowResponse StartFlow(StartFlowRequest request) { return StartFlow(request, Guid.NewGuid().ToString()); }
0
7c2750d055920ff459152837731d8707
f096c68b2511279a6fb5c16f6a7d8b17
Displays the enabled state of a mod.
namespace ModIO.UI [RequireComponent(typeof(StateToggleDisplay))] public class ModSubscribedDisplay : MonoBehaviour, IModViewElement, IModSubscriptionsUpdateReceiver public void DisplayModSubscribed(int modId) { bool isSubscribed = LocalUser.SubscribedModIds.Contains(modId); this...
1
ad7e44ac062da1bc85c93e33b7b4e085
3f046eeeee6718be10360614b03f2365
Initialize the SHA256 data
void __cdecl f_sha256_init(PHASH_CONTEXT context) { context->h32[0] = 0x6A09E667; context->h32[1] = 0xBB67AE85; context->h32[2] = 0x3C6EF372; context->h32[3] = 0xA54FF53A; context->h32[4] = 0x510E527F; context->h32[5] = 0x9B05688C; context->h32[6] = 0x1F83D9AB; context->h32[7] = 0x5BE0CD19; context->size = 0; ...
1
3752f11bc773503028b49c73c9892577
35b5bf2549881c2ff369bc8956e029c1
This adds a property descriptor for the Elem Type feature. <!-- begin-user-doc --> <!-- end-user-doc -->
itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Element_owner_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Element_owner_feature", "_UI_Element_type"), UML...
0
d3689b3f09d35f3661cc9c1f649aa46a
99db40c7fb62bd4f898ca7c89f221b0c
----------------------------------------------------------------------- Bind Comments settings -----------------------------------------------------------------------
namespace Cross.Modules.Article.View public partial class UserArticleManage : ArticleModuleBase private void BindControl() { ctlUserAttachment.Visible = true; ctlUserAttachment.LoadData = true; ctlUserAttachment.UserFolderRootPrefix = LocalUtils.UserFolderRootPrefix; ctlUserAttachment.UserDiskQu...
1
449e0c2e88fdff8db4436290a2f1db7b
391efdf896b02433b81b3c60abb42ea1
当 doodle view 没有准备好时,将触摸事件处理为 cancel 事件
public boolean dispatchTouchEvent(MotionEvent ev) { if (isAnimating) { return false; } return super.dispatchTouchEvent(ev); }
0
39b5b25f74973356849e93de983852d6
621ec57ce70f37015770e4d3d72ece05
****************************************************************** Autocomplete para las labores de sinv
public static string[] acxPer_Personal_GetByLikeNombre_List(string prefixText, int count, string contextKey) { Scope s = (Scope)HttpContext.Current.Session["Scope"]; FEL.PER.BO_Per_Personal adp = new FEL.PER.BO_Per_Personal(); var lista = adp.GetByLikeNombre("Nombre", s, prefixText); ...
0
52f936418e068755cd5b2b2966b5a213
957fb1fcc338f2da236af271681bc172
指定字段进行默认升序排序
public class QueryCriterion implements Serializable, Cloneable public QueryCriterion orderbyAsc(String fieldName) throws DbException { orderby(fieldName, "asc"); return this; }
1
9984a8fd3e876e8c0721a2fd15282a00
ffd11f715eb6e2b11c80408f804359b3
排序产品参数
class Alipay extends Object{ protected function argsSort(array $param){ ksort($param); reset($param); return $param; }
1
1387a65dd033a4e79c7a4fe28a837a52
90d7b3bdba42e6637fb9ccef4a097f18
Implements the JSON-LD Framing Algorithm.
$this->test = $test; $input = $test->readUrl('input'); $frame = $test->readProperty('frame'); $options = $test->createOptions(); $test->run('jsonld_frame', array($input, $frame, $options)); }
1
ca220a579eaf1148e653462029058041
2a1bc02e5687e0a0cbe1068eab8a5d81
Callback message: export file epilog section. Progress 0-100.
class DocViewCallback : public LVDocViewCallback virtual void OnExportProgress( int percent ) { CRLog::info("DocViewCallback::OnExportProgress() called"); jboolean res = _env->CallBooleanMethod(_obj, _OnExportProgress, (jint)(percent*100)); }
1
6f2da76a1ba283c4e96933dc2dbc19c7
cb72423f0c6bdc8e68ce40b16d72a89d
PriorityQueue's test suite
def unit_tests(): m = IndexMinPQ() assert m.count == 0 m.insert('zebra', 10) assert m.count == 1 assert m.min == 'zebra' m.insert('bat', 4) assert m.count == 2 assert m.min == 'bat' m.insert('frog', 22) m.insert('cow', 34) m.insert('snake', 33) m.insert('dog', 5) asse...
1
b77e6f2cdb9d01e709e4e3c11cf4a2c4
5e8c8561b25efff7db5d229d29a9c48d
array of fields to ignore when updating
public abstract class PojoTest<T> protected abstract String[] ignoreFields();
1
ba184bec73052ab24cac7731ac67d657
e7e5d1482736dfb3b234bdf5028bfd47
Tests the correct cleaning of trailing spaces.
public class UnixFTPEntryParserTest extends AbstractFTPParseTest public void testLeadingSpacesNET566() { final FTPFile f = new UnixFTPEntryParser(null, false).parseFTPEntry("drwxr-xr-x 2 john smith group 4096 Mar 2 15:13 zxbox"); assertNotNull(f); assertEquals(" zxbox", f.getN...
0
a19144761bd1f96ae4919d17f77ded94
ce6d226a30c4e1c9bc467fff09bfe7cb
GET: FilterByAlphabaticalMembers
namespace DVDRentalSystem.Controllers [Authorize(Roles = "Manager,Assistant")] public class FilterByAlphabaticalMembersController : Controller public ActionResult Index() { return View(); }
1
d0a4682c522419687d60645b45ff8d45
c7eae11e9756624072c5649fb5f88ae3
Generate the memory usage tree.
total_sec = root.time_spent.total_seconds() def func(node, **kwargs): node_sec = node.time_spent.total_seconds() frac_of_total = node_sec / total_sec sec_per_day = timedelta(days=1).total_seconds() * frac_of_total time_per_day = timedelta(seconds=int(sec_per_day)) parent ...
0
0cd0b14789d1ddd6778ff59b62e3f345
9180032266e30ecdac2287741616e346
Copies a source buffer to a destination buffer, and returns the destination buffer.
namespace Microsoft.Windows.Controls.Specialized.TextModel public abstract class TextBuffer : ITextBuffer public abstract void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count);
0
5d39c83138d54330ea941e5288708ac4
c816c2f8ef00f2529f9841dc216d4b04
Keyboard interactive authentication sequence.
int sudo_securid_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_conv_callback *callback) { SDI_HANDLE *sd = (SDI_HANDLE *) auth->data; int ret; debug_decl(sudo_securid_verify, SUDOERS_DEBUG_AUTH) pass = auth_getpass("Enter your PASSCODE: ", SUDO_CONV_PROMPT_ECHO_OFF, callback); ...
1
8fe9ce6903c67c76ffee866c98e44961
9533b73c93e0d14a52d2f21878cc0abf
Updates an existing ActSactAsigna model. If update is successful, the browser will be redirected to the 'view' page.
{ $model = $this->findModel($id, $codigo_gestion, $cod_ciclo, $territorio, $codigo_linea, $cod_visitador, $codigo_producto, $grupo_salida); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id, 'codigo_gestion' => $model->co...
1
881e9b66b198c8a354a2bd06957983e0
959f9b6a8f38a143a99e7d6fbdc43b5e
逻辑回归
function logistic_regression(train_data,train_label){ const iterations = 200; const learningRate = 0.1; const optimizer = tf.train.adam(learningRate); const num_labels = Array.from(new Set(train_label)).length; const num_data = train_label.length; const w = tf.variable(tf.zeros([2,num_labels]));...
1
c2a99ae4d86ecfdf5b8d0a428386830a
275ebc3f0c3ad3aa66877f508fdea7bd
获取屏幕截图,保存的是base64的编码格式,在HTML界面输出截图的时候,会用到
class Base(object): def get_screenasbase64(self): return self.driver.get_screenshot_as_base64()
1
70ab10ea2fab05d162c0e9d1ba743953
bc859b3f21e73313c29168347048e19f
Copies and converts the provided PyTorch GRU weights into this layer.
decompose_weights=True, decomposition_kwargs=dict(), fixed_rank_modes=None, **kwargs): padding = conv_layer.padding out_channels, in_channels, *kernel_size = conv_layer.weight.shape stride = conv_layer.stride[0] bias = conv_layer.bias is not None instance = cls(...
0
c54d8110bf06b03ef824629e786af921
c8073c7262b284a76b15780c53c57bb2
Проверяем кеширование результатов запроса score_request.
response = self.authorized_client.get(reverse('index')) Post.objects.create( text='До сброса кэша', author=self.test_author, group=self.group, ) response_before_cleared_cache = self.authorized_client.get( reverse('index') ) ...
0
1866f0d271ed5c7074ba0969dd49fc5c
62a69afd6db6eca9b6d1a81896a09443
Subscribes the given method to the "OnHeartRateChange" event. This event will be fired when continuous measurement is enabled and a new heart rate is received.
public class MiBandConnectionManager extends ConnectionManager private void startHeartRateMeasurement() { addCall(enableHeartRateNotifications()); addCall(sendHRCommand(COMMAND.START_HEART_RATE_MEASUREMENT_CONTINUOUS)); }
0
1cda1cefa63c97b5d212f60220a8a0f4
dc9a68966f823e4a76a723604b72c3e2
Добавление основной настройки SimpleInjector
namespace DatingTime.Services.Api public class Startup public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddCors(); AddSimpleInjector(services); }
1
80727a859ad8b24559845f2452736e78
3099fd80e5ab10589810ce8788c78bf7
查询试读长度
$sql = "select cw.cwlength,rc.looktime from ebh_coursewares cw left join ebh_roomcourses rc using(cwid) where cw.cwid=$cwid"; return $this->db->query($sql)->row_array(); }
1
8bc4601eef8b0fd17d7fecbc171121b5
a9447a5d3a0ad507a9f08c01c6740a3b
更新退貨單主檔AdjustNo
{ try { DbCommand cmd = db.GetStoredProcCommand("PKG_VDS_VGR_RETURN_DATA.UpdateMainAdjustNo"); db.AddInParameter(cmd, "V_ID", DbType.Int32,int.Parse(MainID)); db.AddInParameter(cmd, "V_AdjustNo", DbType.String, AdjustNo); i...
1
7057ca7aa42359b491c51d6fc82afbdc
93afe875db04f0b0e3d18e4ee0cf6cb6
Reflect linedir in the plane spanned by planedirs
class REngineThread (QThread): def intersect (self, orig_v, dir_v, pl): e1 = pl[1] - pl[0] e2 = pl[2] - pl[0] p = QVector3D.crossProduct (dir_v, e2) p_dot_e1 = QVector3D.dotProduct (p, e1) if p_dot_e1 == 0: return None inv_p_dot_e1 = 1.0 / p_dot_e1 t...
0
c2fc4a6e8026963831c279b0fcfab640
1210b37b733f68f3334991c45e16f3a9
labrl文字被点击时,对应的表单获得焦点
function focusLabels() { if(!document.getElementById) return false; var labels=document.getElementsByTagName("label"); for(var i=0;i<labels.length;i++) {if(!labels[i].getAttribute("for"))continue; labels[i].onclick=function () { var id = this.getAttribute("for"); if (!document.getEle...
1
d2d4c19d7f187683666f992f4955408a
1e54f6136c203bf7652518739623b20d
Called when the user changes the search type
{ if (isLoaded) { searchValues["tourTypes"] = Convert.ToString(comboBoxSearch.SelectedItem); allChanges(); } }
1
d16a3caaaaf0da893d8e89c145356551
d51e99259700650e0795b279976e70f3
Open a file on the remote server. The arguments are the same as for python's built-in C{file} (aka C{open}). A file-like object is returned, which closely mimics the behavior of a normal python file object. The mode indicates how the file is to be opened: C{'r'} for reading, C{'w'} for writing (truncating an existing...
if self.islocal(): filename = self.real().local() else: filename = f"/{self.scheme}/{self.server}{self.path}" return misc.module(self.openread().read(), filename, name)
0
cc67de5d345eb74c4d34ff38028ed648
0221d3c449f88eb1397167a01300d5f1
Fits an AdaBoost classifier.
namespace Accord.MachineLearning.Boosting public class AdaBoost<TModel> where TModel : IWeakClassifier public double Run(double[][] inputs, int[] outputs, double[] sampleWeights) { return run(inputs, outputs, (double[])sampleWeights.Clone()); }
1
0359bca19c86a32ea1333ca4dc22d967
99d259c9f385425f3502f8c9dd56c230
convert float hours to 12h format with no suffix
def suf2(h): if int(h) < 10: return '0'+str(h) else: return str(h)
0
a896fb7c581f68e0bc917b5c49f195c6
b140039e13eabd4b9530cc10c12e9c51
Dadas duas posições calcula o rumo da primeira para a segunda
int aux; if (*b == *a) *b += PRIM_PASSO; else if (*b < *a) { aux = *a; *a = *b; *b = aux; } while (((f(*a) < 0 && f(*b) < 0) || (f(*a) > 0 && f(*b) > 0)) && *b <= (max - PRIM_PASSO)) { *b += PRIM_PASSO; *a += PRIM_PASSO; } return; }
0
1df69533047b0d1f3458e82441d17d50
715c1e7b6e2a833712f31c0f2f5ce6b1
混合方法去噪
def MMF(enhance_img): mutil_img1 = applyMultiMatchFilter(enhance_img, 5, 5, 12, 0.03) mutil_img2 = applyMultiMatchFilter(enhance_img, 5, 5, 12, 0.06) mutil_img3 = applyMultiMatchFilter(enhance_img, 5, 5, 12, 0.09) res = cv2.multiply(mutil_img1, mutil_img2, scale=0.1) res = cv2.multiply(res, mutil_im...
1
6d9b1bb3bb3dbb2f2122870bc1e753e4
db04c69b2f6f735df9113460992c2112
获取DataTable第一行,第一列的值
namespace System.Data internal static class DataSetExtend public static object GetData(this DataTable dt) { if (dt.Columns.Count == 0 || dt.Rows.Count == 0) { return string.Empty; } else { return dt.R...
1
585073031304c5a212e8d7548cca9c62
4a3da075d4cf1ab04402c64145cc8c20
直接暴力法,循环之后根据曼哈顿距离排序。
val edges = mutableListOf<Pair<Int, Int>>() for (i in points.indices) { for (j in i + 1 until points.size) { edges += Pair(i, j); } } edges.sortBy { Math.abs(points[it.first][0] - points[it.second][0]) + Math.abs(points[it.first][1] - points[it.second][1]) } val father = ...
1
a212ab661f8740571eaa655d08108ef7
8149070bd185d09c088128bd67f39896
在PLSetting中插入内容。有可能会插入创建人、时间、修改人、时间
{ string sql = "insert into pl_sx(sxId,plman,plcon)values(@sxId,@plman,@plcon)"; SqlParameter[] pars = { new SqlParameter("@sxId", Id), new SqlParameter("@plman", name), new SqlParameter("@plcon", con) }; return sydb.ExeCUD(sql, pars); }
0
00cf73588e9770e97f6da5c37c9539b7
d16463b81d3b64117a94666b7eb3b19a
Poistaa yksittäisen muistiinpanon.
class Admin extends Kysely public function poistaSukulaissuhde($id) { $piilota_sukulainen = $this->valmistele("DELETE FROM sukulaisuus WHERE id = ?"); return $piilota_sukulainen->execute(array($id)); }
0
9652a90eb15b2abbc6c41868c8d3742f
e77cf75e34ff34b17c3271d529cde9a0
获取缓存的model实例
{ $result = self::get($cacheName, $key); if (is_null($result)) { $data = $model->get()->toArray(); self::set($cacheName, $key, $data); return $data; } else { return $result; } }
0
f61431971986a8ad8e14c8bdeee9f0f1
fa232145a7f556d35973f59be331769c
Reqûete permettant de supprimer un album grâce à son id On met à jour également les images contenus dans cet album, l'album de l'image devient null
class AlbumDAO{ function deleteAlbum($id){ $requeteDeleteAlbum = $this->db->prepare('delete from album where id=:id'); if($requeteDeleteAlbum){ $requeteDeleteAlbum->execute(array( 'id' => $id )); }else{ print "Error ...
1
bf0ef15ea725571c120a669a01ef33ab
a96c4536959d8a397fe59c1dad4419b8
마이페이지 결제수단
class user extends front_base public function my_mch_service() { if(!$this->sessionCheck()) { $this->session->set_flashdata('message', '로그인이 필요한 페이지입니다'); pageRedirect("/user/login"); } $tpl = 'user/my_mch_service.html'; $skin = $this->skin; $this->template_path = $tpl; $...
0
cca2259be1d429b5f72c69f98ce5b9ec
401b35bcb14c9210d475560efa67cfba
Feature selection based on the scores given to the features by the RandomForest algorithm.
order = np.argsort(-self.scores_) if features is None: return X[:, order] else: return X[:, order], features[order]
1
98a40a5bdd04e38b9f64792762c0700e
3400623204afa13b4ff7dde7736af013
Accessor for retrieving the current size of the available buffer space, in bytes.
size_t BBufferIO::BufferSize() const { return m_buffer_phys; }
1
8184fe47639e727a6a7ebddc864d270c
00c402a753d74c1aa8dc41089be0af81
根据学校id获取流程计划 create by dale 20181127
class SchoolModel extends Model public function getActivityBySchoolID($sid) { return Db::name('icr_activity')->where('sid',$sid)->select(); }
1
c6269ad97252af1f319c0d40980b24b3
6c0a195ceeec29889afcadd6ef33a5c7
테이블 헤더에 툴팁 설정
{ if (e.Row.RowType == DataControlRowType.DataRow) { for (int i = 0; i < e.Row.Cells.Count; i++) { if (!String.IsNullOrEmpty(e.Row.Cells[i].Text.Trim()) && !(e.Row.Cells[i].Text.Trim().ToLower() == "&nbsp;")) { e.Row.Cells[i...
0
00c7529ed519eefae606fd750a5647ef
1b62d2c7f709759eead266da96208348
Gets the edge between two vert indices. If the two verts are not adjacent, the edge is technically known as a diagonal.
{ return edge.Item1 / 2 + edge.Item2 / 2; }
0
f6c23b0580aec7ca3525ea54f0acfd32
bcb8b8d3f7d84a7fee029de46b716f52
Add a new wiki site into this family.
if force_new or (self.versions[-1].get_raw() != raw): w = WikiVersion(page=self, author=author, title=title, raw=raw) if set_date: w.set_date(datetime.utcnow()) self.versions.append(w) self.watchable_changed(w.date) if author: ...
0
5d43a6524ed58d12e993cadc52cebf83
d10a8784f67c42a52e361648b835bd91
This Function checks for an ace, and asks the user Whether they want to count the ace as 1 or not.
class Blackjack: def countaces(self, hand): hand2 = str(hand) aces = int(hand2.count("A")) return aces
0
546f71e5e52c366202976cedebbc80c8
b82c992bae032d5b2c7d94a08b84ab41
Checks if the tranaction in cdp is open. If it is, warn and optionally closes it.
protected void finalize( ) throws Throwable { if ( _nStatus == OPENED ) { _logger.error( "The transaction has not been commited" ); closeTransaction( OPENED ); } super.finalize( ); }
1
d0a8b827c5d160910328394aab3a8a91
07634ed4e0024dcaf626157128e298f9
Creates linked list sequentially according to name of footballers
{ ofstream outfile("football-in.txt"); for(int i=0;i<num;i++) { outfile<< lis[i].FirstName <<endl << lis[i].LastName << endl << lis[i].Attempts << "\t" << lis[i].Completion << "\t" << lis[i].YardsPassing << "\t" << lis[i].TouchDowns << lis[i].Intercptions <<endl; } }
0
48017c0d654ab1730c25e660482c9629
4787b8b8beb8cb5da081ffc2271424b4
Sets the bottom right bounding box corner coordinates :math:`(x,y)`.
class BoundingBox: def top_left(self, value): assert isinstance(value, (list, tuple, np.ndarray, torch.Tensor)) and len(value) == 2, "invalid input type/len" self._bbox[0], self._bbox[1] = value[0], value[1]
0
41822346826cd41ae4793f8d9af20788
2b60d69ef6003cd15b4ab9bee1fd4db3
Copies the output arrays into the array that is displayed
void Plate::copyTempArray(){ for(int col = 0; col<10; col++){ for(int row = 0; row<10; row++){ current_plate[row][col] = temp_plate[row][col]; } } }
1
2e6b10ebbb2073833dc7b26d0a812abe
7825fd8b2f0d3160e8febf1b5449439b
power function to find the biggest eigenvalues in magnitude
EIGS = np.linalg.eigvals(A); idx = EIGS.argsort()[::-1]; eigenValues = EIGS[idx]; print "EigenVals ", eigenValues[0:10], "\n" return eigenValues[0:5];
0
5ff1f058ac49f90bf879fabc30fb9089
59dadcb4571718f9b8f0c67837363fb1
Opens authentication page and prompts user for key.
email = self.auth.data["username"] pin = input(f"Enter code sent to {email}: ") result = await self.auth.send_auth_key(self, pin) self.key_required = not result
0
2144ed56ace50590df98249adcc763d5
39759e4b22d9b2327ed14241688bff2a
This method pops the backstack till the specified fragment
public class SupportActivity extends AppCompatActivity implements ISupportActivity public void popTo(Class<?> targetFragmentClass, boolean includeTargetFragment) { mDelegate.popTo(targetFragmentClass, includeTargetFragment); }
1
a385e0b05f7d12cb9c1d92ee4924d975
94c3e0851a6d6314bfc210b4e07d0961
Disables the negative words filter.
public function disable_censor();
1
b1315ea6145b2b778032618c94e57aa8
88a62def91877080b23d2371366e7d86
This function closes a currently open message queue.
{ ErrorCode ret = EC_NOERROR; QUEUE_CLOSE_OPEN_CURSOR_PARAMS param; param.queueID = qhandle; server->put((char)QUEUE_CLOSE) << param << flush; if (server->good()) { ret = getResponseCode(); } else ret = EC_NETWORKERROR; return ret; }
1
fc7d1072735a988df670c70b90e5ab1c
def20ddfecc4ebdf0da8ca2d17373f91
Store identity TaskIns and retrieve it.
AsyncQuery<Identity> query = new AsyncQuery<Identity>(callbacks) { @Override protected Identity onExecute() { return getIdentity(identity); } }; query.execute(); }
0
a584e381c4a5d7b0c8a66896b29ac3dd
37b79e03f0c95bca1c5b95b634122b9a
把秀图设为顶部轮播图
if (newListFrament.getVisibility() == View.GONE && typeCode != null && typeCode.equals("tjwz")&&newListFrament!= null) { newListFrament.setVisibility(View.VISIBLE); } imageSlideshow.clearImageList(); for (int i = 0; i < advertisingWheel.getTop_slide_ads().size(); i++) { ...
1
c84d2160cb6e799cfc5f821d9fd30bfd
cab1795b5f2b85fee185a4e800975146
See if the user is currently a driver
function isUserDriver(){ include 'db_connection.php'; $sql = "SELECT * FROM usercar WHERE `UserID`=".$_SESSION['userID'].";"; $result = $conn->query($sql); if($result->num_rows > 0){ return true; } else{ return false; } }
1
1655f7ad28a26773fe395e1eadf692bd
58965a557f9960d1928e0d46bb0a0ee0
Replace user code with dummy values
global $sugar_config; if (isset($additionalData['link']) && $additionalData['link'] == true) { $body = str_replace('$contact_user_link_guid', $additionalData['url'], $body); } else { $body = str_replace('$contact_user_user_hash', $additionalData['password'], $body); ...
0
05b72093b96959c69dc8186ef226fae4
ca755fca06be1d3cbf59f57a2f5209ec
deleteWebhookById Delete a webhook by ID.
log.Traceln("Deleting webhook") tx, err := _db.Begin() if err != nil { return err } stmt, err := tx.Prepare("DELETE FROM webhooks WHERE id = ?") if err != nil { return err } defer stmt.Close() result, err := stmt.Exec(id) if err != nil { return err } if rowsDeleted, _ := result.RowsAffected(); rowsDel...
1
4346c113af9191b51d00cb35f1fdb220
9d6340589acf631203759ac4de468fd2
首付比例验证
class ShopModel extends Model public function _checkLegal() { $first = I('first_percentage', 0, 'floatval'); $second = I('second_percentage', 0, 'floatval'); $third = I('third_percentage', 0, 'floatval'); if ($first < 0) { return false; } if ($second < 0) ...
1
afd3757af59ca72fa9fd6cf9b0e9ed89
272f2cb555209fd16620218c26918560
Refreshes the scroll layers.
{ var rectTransform = scroller.GetComponent<RectTransform>(); var size = rectTransform.sizeDelta; rectTransform.sizeDelta = new Vector2(size.x, float.MaxValue); _calculateLayout = true; scroller.ReloadData(); rectTransform.sizeDelta = size;...
1
0ea7533595b1f2fc73f6a3abe07d6ad5
ffeff161de3509ed3856f82da366f87a
定义一个函数接受尺码和字样两个参数,且都有默认值
def large_shirts(size = 'Large', message = 'I love python'): print('A ' + size + ' shirt is made with the message ' + message + ' on it.')
1
5223fe37426b0752acef7c040db11023
3d5e7f6da7ac2ccc5d98dbaa50dbfff3
单式 10 秒不交易,取消交易
function TradeMainView:onCancel() self.money3.editable = true self.money4.editable = true self.suo = false proxy.TradeProxy:send(1260205,{tradeType = 2}) cache.TradeCache:removeTimer() self:closeView() end
1
386be4ca0878bbb79b9bdd1224a548ae
1574d57841ebabb68b4e53865b68087b
测试SpringBoot的日志
@Controller @RequestMapping(value = "/hello") public class HelloController @ResponseBody @RequestMapping(value = "/spring", produces = { "application/json;charset=UTF-8" }) public String logbackWelcome() { LoggerUtil.info(LOGGER, "欢迎来到spring boot,这是info日志。"); LoggerUtil.warn(LOGGER, "欢迎来到spring ...
1
caecdc43e73afbf5d831a4b4dcad4ab8
eadf0ebdf3789f1f36fd56a4828f4cce
Creates an ErrorFormatter.
self._diff = diff self._default_error_handler = DefaultStyleErrorHandler( configuration=configuration, file_path=file_path, increment_error_count= ...
0
17026385f77b5d0203db1d7012cc2dc8
9d9f859709557ad43c73a284dfddffc4
Get the result summary for the plagiarism detection for the files.
return this.http .get<TextPlagiarismResult>(`${this.resourceUrl}/${exerciseId}/plagiarism-result`, { observe: 'response', }) .pipe(map((response: HttpResponse<TextPlagiarismResult>) => response.body!)); }
1
f25dbfcbe462535bacc0562e19531b49
2dc5e7f5e4f88ae79154ebb03e0ed035
检查修改系统设置权限,如果未打开则跳转设置页面
public class JumpHelper public static void startSettingActivity(Context context) { if (!StringUtil.isValid(UserData.getverifiCode())) { JumpHelper.startLoginActivity(context); return; } create(context, SettingActivity.class).startActivity(); }
0
122e93cca41f69bee6dabd1ca749f84d
13844bb3154aa6576154bd8a382af5d1
根据日期进行排序
function date_sort(a,b){ var dateA = new Date(a['date']).getTime(); var dateB = new Date(b['date']).getTime(); return dateA < dateB ? 1 : -1; }
1
160c7ffb38edd9c4a85e64ff77d2bd54
6225af18feb32ff9059b5d1d4cd4955a
用于处理获取全服元宝排行的请求
playerMB = param["playerMB"] dbid = param["dbid"] page = param["page"] pageSize = 7 start = pageSize * page end = start + pageSize rankList = [] for i in range(start, end): if len(self.moneyRankList) > i: rankList.append(self.mo...
1
c3da49deab434a5c2a862208ba0e0c7a
e8bf940c5ea8a3ce3be7cae8b0ad06d4
invert bit order in each bytes (crc does that before computing the real CRC!)
VO_VOID CPCMRawData::BETOLE(VO_PTR pBEBuffer, VO_U32 dwSize) { VO_BYTE tempByte; VO_PBYTE pBuffer = (VO_PBYTE)pBEBuffer; for (VO_U32 i = 0; i < dwSize; i += 2) { tempByte = pBuffer[i]; pBuffer[i] = pBuffer[i+1]; pBuffer[i+1] = tempByte; } }
0
6c3b3824d1ed929091d2ff2960388c91
6b5038b67d44e7deeecea99417c6532b
=================================================================== Method : OutputRB1_Putn (component RingBuffer) Description : Put a number new element into the buffer. Parameters : NAME - DESCRIPTION elem - Pointer to new elements to be put into the buffer nof - number of ele...
{ uint8_t* ptr = NULL; uint16_t curElementSize = 0; uint8_t elemSizeStorageRoom = 0 ; uint32_t curBuffPosition; uint32_t i; uint32_t NbBytesToCopy = 0, NbCopiedBytes = 0 ; uint32_t eob_free_size; ...
0
716a673fcd27134a46382ecdf0397e8e
abf9b6f4694764a7c5a7d8120f176475
找回密码,从邮箱点击过来的链接
def index_reset(request): if request.method=='POST': username=request.POST.get('username') if username == '': return HttpResponseRedirect('/') else: user=User.objects.get(username=username) password=user.password password=password.replace('pbkd...
0
77380b054d16ce71c4052c3ea97361f4
68cabd8ee799a9014bc31cae4763a8b8
Adds a randomly generated value between 0-10, inclusive, to the input
int add = rand() % 11; x =+ add; cout << add << ", " << x << ", " << &x << endl; }
1
85b64c3ee6ca965f4d2f2e321884d196
ff32a45e71ae6d5318f0b0c2838c8fa4
Bouton semaine dernière
public class Controller implements IServiceController @FXML private void lastWeek(ActionEvent event) throws Exception { emailsList.setItems(email.getLast("week")); }
1
79d7bce11b8d5906477a5399b601a72e
f3bdc0a7cae1e2056691f15c2b894da2
根據Stage的收片時間Input Time先後來排序
void sort_top(void){ char tmp_name[10][11]; float tmp_time[10]; int cnt_stage = stage; cnt_stage = stage; int x = 1; if(top_cnt[cnt_stage] == 0){ top_time[cnt_stage][1] = gap_time[stage]; strcpy(top_name[cnt_stage][1], name); } else if(top_cnt[cnt_stage] == 1){ while(1){ if(top_time[cnt_stage][x] >= ga...
1
f8ca3edd3538a70805d37090cc8c1d26
a62e73eb50fc42357137554b09330ea2
獲得圖片的Base64編碼
{ Bitmap mBitmap = new Bitmap(pic); byte[] imgbt = BitmapToBytes(mBitmap); string base64 = Convert.ToBase64String(imgbt); return base64; }
1
1e18de731525a7f892cf6334fe07dc83
f6399c2441f4f240a2e9fe29e13f79b2
启动一个update协程,并且可以指定间隔时间,停止条件
local timer = InnerGetTimer(self, delay, func, obj, one_shot, use_frame, unscaled, ...) assert(not self.__coupdate_timer[timer] and not self.__coupdate_toadd[timer]) self.__coupdate_toadd[timer] = true return timer end
0
83fea12ef20d380dc94ddf7511117a9b
dc8f099913c9c86cb890dfaeed87020a
Given a serial number, find the Teensy device that is running the bootloader.
def get_usb_hub_address_from_serial_number(serial_number): devices = find_matching_connections( {"serial_number": { "include_regex": serial_number }}) if devices: return devices[0].usb_hub_address return None
0
52df7eb131049e6c8b2fe7aad5f68409
c0b3b3efde6b42d40f1cea48de81df03
Return a python list where each item in the list is a tuple (index,value) containing the index of the list position and the value at that position, in the same order as the referenced list model.
return tuple( ( self._qwidget.item(i).text(), self._qwidget.item(i).data(Qt.ItemDataRole.UserRole), ) for i in range(self._qwidget.count()) )
0
15bdd49074a269502aae5e3511f62a66
f21ef1f8e136cad4ad7aedca024ccaaf
将哈夫曼树结点按照weight从大到小的顺序插入线性表
public class HuffmanTree private void buildTree(long[] weight) { LinkedList<HuffmanNode> nodeList = new LinkedList<>(); HuffmanNode tempLeft, tempRight, tempRoot; for (int i = 0; i < weight.length; i++) { nodeList.add(new HuffmanNode(i, weight[i])); } for (int i = 0; ...
0
b96ef1225a5e03d34f8de9591a044b76
5767576984ec1c6f2b9d7d9626e97dd4
Specify from within an instantiation routine that the current routine is dependent on some other tag, which may or may not have already been specified.
const TagTraitArray& deps() const final { return m_deps; }
0
f5b933a01a7230d5fce7ec45da60de61
b25ca43cb5576166e447976956e82c6b
Gets an owned book from the user's collection of owned books
function displayOwned($username){ global $conn; $i = 0; $sql = "SELECT OwnedTitle, OwnedAuthor, OwnedDesc FROM Owned WHERE Username = '$username'"; $result = mysqli_query($conn, $sql); $data = array(); while($row = mysqli_fetch_assoc($result)){ $data[$i++] = $row; } return $data; }
1
a6b3724a8c31dba023a500d7efb1d57e
cc454a59c1842c5d33f85b282e58757d
replace newlines with invisible character (to save newlines in textareas for example)
function pk_fixnewlines_textarea(val) { if (val.indexOf('\r\n')!=-1) ; else if (val.indexOf('\r')!=-1) val = val.replace ( /\r/g, "\r\n" ); else if (val.indexOf('\n')!=-1) val = val.replace ( /\n/g, "\r\n" ); else ; re...
0
b34f2d49bd11c42b04d734c0ce7dffbf
e56004e4322258a8b30ad70c44a2f146
基于输出值得绝对值之和计算覆盖
double sum = 0; for(const auto &d : data) { double result = getOutput(d.in_); printf("actual: %lf expected: %lf\n", result, d.out_); sum += (result - d.out_) * (result - d.out_); } return sum / data.size(); }
0
3e300b3e20274603be3a8f2609e37576
a4c35aee361a5a1035cf90ef4d351a8d
Gets the number of ideas by their status
{ global $db, $ecs; $count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('idea') . " WHERE " . get_idea_children($cat_id) . " AND is_open = 1"); return $count; }
1
92b5f00f9dcf17dc4a0535fcd64f9399
1d794631f48709f080a1157083dc35b0
This method supports a work around for bug JDK-8046290, which causes the transient display of garbage pixels.
public class UIManagerConfigurer implements PropertyChangeListener protected void doInstallCustomDefaults() throws Exception { System.setProperty("sun.awt.noerasebackground", "true"); }
1
17fa0e2e006d402a5dfdb84bc721a9fc
480a9bb32636f3919b12224b92456fe4
过滤菜单,将关闭的菜单过滤
class Helper extends Component{ private function filterMenu($route){ if(!isset($route['url'])){ return $route; } if(!isset($route['items'])){ if(static::filter($route['url'])){ return $route; } }else{ $menus=$route; ...
1