query_id
string
corpus_id
string
query
string
code
string
label
int64
187890d734cdd94e5ca9364fa6880242
0ca354677acdf3827a7ba6b780fea574
Has the iSCSI Target enough resources to accept more incoming PDU? <code>false</code> and hold out for sending.
return ( this.inventory_.lease.length >= this.flowControl.maxMessages || this.inventory_.bytes >= this.flowControl.maxBytes); }
1
af7ae1ac5fae563c3e6e1fd9cf2587e2
f3b8ac6aa6e3dcd42d49fee623e8f3ea
Event handler for when the page finishes loading.
function onPageLoaded() { window.requestAnimationFrame(update); }
0
c58e0b4e41379e464032b61c303cf880
501cc98681600184d5630eed251f3d96
Metodo che permette di tornare alla scheda carrello da quella di checkout.
this.eventsService.emitShowBack(true); this.router.navigate(['/t/' + this.trialTreatmentService.getTreatmentID() + '/s/' + this.trialSubjectService.getSubjectID() + '/shop/cart']); return; }
1
03b5683f624d47bace35b19a11bee64b
7d381289d9e5b1ea4450b781e7f38793
Build the title section of the image
{ s.AppendFormat("<div><svg viewBox=\"0 0 {0} {1}\" width=\"{2}\" align=\"center\">\n", width, height, Math.Min(width, 960)); SvgRect(s, 1, 1, 1, width - 1, rowHeight * 2, Colors.TitleBackColor); s.Append(" <text text-anchor=\"middle\" x=\"15\" y=\"23\" width=\"30\" height=\"30\" font-size=\"22\" fill=\...
1
b347e8692fe4b450d8a2630e67608487
5b54d33a99e268fff7a6afe7b9a0b956
Return coordicate of given address.
lst = self._getColNameA1List() beg = 26 end = -1 step = 26 if addr[1] in '1234567890': beg = 0 end = 26 step = 0 if end < 0: lst = lst[beg:] else: lst = lst[beg:end] for col, nm in enumerate(lst):...
1
aafd73508b57e114aaad4ab5652ac803
f1f7117de59b3ea19161ed1ecd5e3549
Get the test e-mail address.
class MailDataSource extends Base public function getEmailAddress() { return $this->getProperty('emailAddress'); }
0
be274b7799ba84faf9d165be7ed1b97e
3e1da00f0065d05dd7fd1dd1610d342a
Get the mission data bean.
@Controller public class PlayerController extends BasePlayerController public ChessPlayerMissionDto getMission() { ChessPlayer player = chessPlayerManager.getRequestPlayer(); return new ChessPlayerMissionDto(player.missionHolder); }
1
6dbde26b7295b5eb7c4d3a5034803d4c
cbf9ed5118b8200744589adeaa0011d5
Loop through all markers configured and find which one to teleport too
if(currentTarget != null && currentTarget.gameObject.activeInHierarchy) { DisplayMarker(currentTarget); } else { currentTargetMarker.enabled = false; offscreenIndicator.SetActive(false); } GameObject[] objectsInRange = Gam...
0
2987de0da1c0b99536a3438de841e4d4
da925e61e4fa04402b9d483116147a41
Function to set a matrix value with option for transposed matrix.
if isinstance(item, (int, str)): index = None if isinstance(item, int): index = item elif isinstance(item, str): if item in self.names: index = self.names.index(item) else: raise ValueErro...
1
b05361e383f3819fed09f35d862085b3
f7a7d1a5aa264188fc7cd9dd370618ca
将host和port保存到PlayerPrefs中。
public class MainScript : MonoBehaviour void SavePrefs() { PlayerPrefs.SetString("Nickname", ifNickname.text); PlayerPrefs.SetString("IP", ifIpAddress.text); PlayerPrefs.SetString("Port", ifPortNumber.text); PlayerPrefs.Save(); }
1
1c62dd26eb81241cdb4de2c3e82e6fa3
d6d8e4e156853ee863276accabad4307
Create a swagger definition from data-service resource details.
service_definition = { "name": self.name, "description": self.description, "category": "RANCHER " + self.category, "cost": "0", "cost_type": "One Off", "lead_time": "15", "lead_time_unit": "minute", "questions": [], ...
0
4c2f1fc6c9e36815e2fbb1a1aee65c06
e4f1988d84326ed27e4087ca9cfdb168
Returns a new object of class '<em>Constrained Instance Object</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
ModelicaPart getInstanceForConstrainedBy();
0
9ccbea08bd68e4d7a314ae820eaaf601
bd65c2e551e836337843f878f9d5036a
Test whether there are external networks configured in the region
class CloudRegion: # TODO(efried): Doc the rest of the kwargs def get_external_networks(self): return [ net['name'] for net in self.config.get('networks', []) if net['routes_externally'] ]
1
20f7bede7ccffd085f635c0df0158e98
4a15ed6b0c4b2395d65aec47aae6158b
Converts the value of the current <see cref="TimeOfDay"/> object to its equivalent string representation using the specified format.
[NotNull] public string ToString(string format) => $"{_FormattedLength.ToString(format)}{_Unit}";
0
58a526ddcea7af4549764cf92098eace
38c54fc6ca854d61ec648bdbaea90ab1
判断线段覆盖的地图部分是否可行走,返回线段上最远可到达的点坐标
{ int prev_wp = -1; while(s > maps_s[prev_wp+1] && (prev_wp < (int)(maps_s.size()-1) )) { prev_wp++; } int wp2 = (prev_wp+1)%maps_x.size(); double heading = atan2((maps_y[wp2]-maps_y[prev_wp]),(maps_x[wp2]-maps_x[prev_wp])); double seg_s = (s-maps_s[prev_wp]); double seg_x = maps_x[prev_wp]+seg_s*co...
0
23c0322974588d47f193f4f719b84de0
7968cc830ba81f0dc84ab7fa16de07ac
converts >8 bit samples to unsigned 8 bit
public class Helpers public static int promoteSigned24BitToUnsigned24Bit(final int sample) { return (sample+0x800000)&0xFFFFFF; }
0
363730fc3a73069381b06c2ee0d6b181
d966566a11843e85fc951f131a3bf102
解析thrift命令生成的目标文件,得到方法列表
minfo_dict = {"package":"","class":""} while True: str_line = self.file_stream.readline() if str_line == "": break str_line = str_line.strip() token_type = self.get_token(str_line) if token_type.get_token_type() == "imp_token": ...
1
9feb5e8e61052f88b722a8ee4da6f8d3
99a9b77592f52381064d30e7dafc4386
show info about chosen tank
{ $currentUser = Auth::user(); $tank = Tank::find($id); $scripts = " <script src=\"/plugins/datatables/jquery.dataTables.min.js\"></script> <script src=\"//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js\"></script> <script src=\"//cdn.datatables.net/plug-ins/1.10.11/sorting/datetime-moment...
1
a6c9c139c7ee0c971cb22da0d7c17075
ee7cfa4d6c224be68167caa47bc55259
this function tells the computer what to do when the powerball button is clicked
public class PowerBallSpent extends AppCompatActivity @Override protected void onCreate(Bundle savedInstanceState) @Override public void onClick(View view) { pbCount=pbCount+1; displayPbCount(pbCount); }
1
d58d9539b7925fd9e2ab1c00709f204f
4a42922fbabaf683690a825c8ecf2aa4
计算用户推荐的鑫拍档好友佣金 单位分
class AgentController extends Controller public function ordinaryCommission($id){ $nowuser = User::findOrFail($id); $users = User::where('pid',$id)->get(); $usercommissionsum = 0; foreach ($users as $useritem){ $bro = Brokerage::orderBy('created_at','desc')->first(); ...
1
cff3ff34fd4cb75b69035b010e862ffb
602a8d13eeb4e3bb1f01a50779cb3fdf
Generate URL Signature Keys for a Delivery Service by xmlId. :ref:`to-api-deliveryservices-xmlid-xmlid-urlkeys-generate`
class TOSession(RestApiSession): def add_ssl_keys_to_deliveryservice(self, data=None):
0
6a268942687a15301eac406681151d72
1f84fcf6d5bdda84c0f9259d1c13966b
Obsługuje kolizje jednostki z jednostką.
[RequireComponent(typeof(SphereCollider))] public class Unit : MonoBehaviour protected virtual void OnTriggerEnter(Collider other) { if (!other.isTrigger) { if(other.GetComponent<Unit>() != null && CanAttackIt(other.GetComponent<Unit>())) { if (other.tag !=...
1
323206c57392eec3a82ea34639b7152b
ca21ab0d3aac1de04d1b6d4447e1e26d
更新经营城市
class Com extends Controller public function comcityupdate() { $id = Session::get('u_id'); $comcity = ['comcity'=> input('post.comcity'), 'comselect'=> input('post.comselect'), 'commax'=> input('post.commax'), ]; db('user_com')->whe...
1
2a2d64b1d55fa96c17a5677d9fbcfa6f
226ac3cbb0201cfae0e0e0297003b5ff
获得指定时间段,门店,所有款式试穿数据
{ using (var dao = new TrendDbContext()) { var source = dao.Set<MarkSixSpecifiedLocationPurchase>().AsQueryable(); source = source.WhereDateTime(nameof(MarkSixSpecifiedLocationPurchase.OnCreated), dto.StartDateTime, dto.EndDateTime); if (dt...
1
c95384d712c935c57fca928236888ee3
a31e9f5187cc1f2357895d35f5f86fb3
得到需要背的单词的集合 包括state=0和时间=今日时间
class DBUtil fun getTodayWords():List<Word>{ val current = System.currentTimeMillis() val zero = current-(current+TimeZone.getDefault().rawOffset)%(1000*3600*24) val words = LitePal.where("time > ?","$zero") .order("time desc") .find<Word>() return words }
0
0e4c56e7cc532b68c75ad32bc1421c19
148b6ad1107dda4c5666c00de907fb7d
If the player is in the menu, set bool accordingly
bool BattleMenu::isInMenu() { return inMenu; }
0
5ea8661944f9b64265515508811e5b6b
9d38897c2170bd50829cbd761c079fd8
generates a matrix of z3 states e.g. "x_1_0", ..., "x_1_9" with the number of states equal to the number of steps wanted
class System(): def state_names(self): return ['x_' + str(i) for i in range(self.n_states)]
0
2d4124b89cd2acf4b9191cdc70d7d488
543ee76e66aac7131c45f8c6204f4183
Defines the coordinate system for the contents of the "pattern". Note that this attribute has no effect if attribute "viewBox" is specified. If patternContentUnits="userSpaceOnUse", the user coordinate system for the contents of the "pattern" element is the coordinate system that results from taking the current user co...
void setGradientUnits(GradientUnitsType value);
1
886df657b1a100c10d3b8570b295a26d
107cf7dfb4abe3c8d7df9bcf69d7c282
propagates the dependencies for each equation
class Grids : public vector_set<Grid*> void Grids::findDeps(IntTuple& pts, const string& stepDim, EqDepMap* eq_deps) { PointVisitor pt_vis(pts); cout << " Scanning equations for " << size() << " grid(s)...\n"; for (auto g1 : *this) { if (g1->getNumEqs() == 0...
1
eeb3429dc42e2a9d19658b4a79d3a33a
cdb0004f925cd0d9ebe99290248c7c99
Do we have configuration for releasing to at least one pypi-compatible server?
if repo.private: return (False, "private") if not repo.get_pulls().totalCount: return (False, "no PRs") return (True, None)
0
2a789a1d435caeca1035e13e1051c98f
fc963ebe89a641d9e2993d50f7c13b8a
unique modulo M = lcm(xi). Returns (z, M), m = -1 on failure.
mp_mod(mp_int * a, mp_int * m, mp_int * c) { mp_err res; int mag; ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG); if (SIGN(m) == MP_NEG) return MP_RANGE; if ((mag = s_mp_cmp(a, m)) > 0) { if ((res = mp_div(a, m, NULL, c)) != MP_OKAY) return res; if (SIGN(c) == MP_NEG) { if ((res = mp_add(c, ...
0
ae36718d9ba9e480b98980e05a3d18f5
110f03f7d25f39d3abd58f9288067f30
Handles the Click event of the InfoButton control.
namespace MSDN_Voice_Search public partial class MainPage : PhoneApplicationPage private void OnInfoButtonTapped(object sender, System.Windows.Input.GestureEventArgs e) { var sourceButton = sender as Button; if (sourceButton != null && (this.CurrentSearchState == SearchState.ReadyFor...
1
356d22c618f80bb704c26b12d65c331f
ef19ba5c700ed7e22c9c731efd658ebf
Sets the ISO 3166-3 code.
class Country extends AbstractEntity implements CountryContract, JsonSerializable public function setIso3Code(string $iso3Code): Country { $this->iso3Code = $iso3Code; return $this; }
1
9711ed085778091684a62581a0aa8581
9a1519c035fd4d20da1d1806a3c7e808
Set the costs per month
class SubscriptionType extends DataObject function setCost($cost) { return $this->setData('cost', $cost); }
1
8880d0c67b6c9992fb8fa32aa75504ef
1f0271f9a8e3fe9557d8b1f17ef343f9
停止拍照并且释放资源
if (mCamera != null) { mCamera.stopPreview(); mCamera.setPreviewCallback(null); mCamera.release(); mCamera = null; } if (saveImgDisposable != null && !saveImgDisposable.isDisposed()) { saveImgDisposable.dispose(); } }
1
1256d9e85b169aa87ccf0874cc813b7c
c767412f919bc7db9b2886d876541d3f
Return a new token with "snapshotted" positions.
def _mk_token(ttoken, span): if ttoken.offset != 0: span = Span(span.char_start + ttoken.offset, span.char_end) return Token(ttoken, span)
1
8db1e14d5fba001a342199096ad531a1
b8c6e7844f147c97434d8c88918175ef
Make an HTTP GET call to the server passing in the {@code url} and returning a result of type {@code T}.
{ if (string.IsNullOrEmpty(url)) throw new ArgumentException("url can't be null or empty"); using (HttpClient httpClient = new HttpClient()) { HttpResponseMessage response = await httpClient.GetAsync(url).ConfigureAwait(false); ...
1
562f8f737b3923df5720ca3d9c412c5e
11413e5f31937c81aab58b7f6b57b66c
Computes an array of infall parameters for a set of subhalo IDs from a given simulation run.
if not cc: cc = h5_read_dict(outfile, 'coredata') if 'x' in cc.keys(): idx_filteredsatcores, M, X, Y, Z, nHalo = SHMLM.core_mask(cc, M1, M2, s1=s1, disrupt=disrupt, idx_m21=idx_m21) else: idx_filteredsatcores, M, nHalo = SHMLM.core_mask(cc, M1, M2, s1=s1, disrupt=disrupt, idx_m21=idx...
1
432716fd73de8d724ac457eb38c2c999
00ae109a54b3576cac734527bf80876b
\ | function: GetCompatibleLaptop | | | | Purpose: | | Check for allowed laptop drive crossflashing ...
{ hidMessageStruct msg; LCR_PrepWriteCmd(&msg, LUT_VALID); if(LCR_SendMsg(&msg) < 0) return -1; LCR_PrepReadCmd(LUT_VALID); if(LCR_Read() > 0) { memcpy(&msg, InputBuffer, 65); *pStatus = msg.text.data[0]; return 0; } return -1; }
0
8874629e2b1ab70fd18f6441996ef101
14bf9fde495c76f8318ac673c513d185
Writes a string to the controller. Calls writeCONEX() with a default location of the string to write and a default timeout.
static void send_write(char * str) { char * p; int len; len = strlen(str); p = ts_tmalloc(len+2); p[0] = '0'; p[1] = CONSDRV_CMD_WRITE; memcpy(&p[2], str, len); ts_send(MSGBOX_ID_CONSOUTPUT, len+2, p); }
0
bdcc1b8166a55ebf1693207ed8982d95
c4f8944e630766e879d61f2f3956e673
Simulate one time-step of the process using the Euler method.
class Dahlquist(Application): def step(self, u_start: VectorDahlquist, t_start: float, t_stop: float) -> VectorDahlquist: z = (t_stop - t_start) * self.lambda_value if self.method == 'BE': tmp = 1 / (1 - z) * u_start.get_values() elif self.method == 'FE': tmp = (1 + z) * ...
0
e67fa4fa8f3b30c3ab229e625d71ddda
7ed977b88503ea7d2155cb9dae87d295
set entity set name for odata entity
class UnpretentiousRepository extends JModelDatabase protected function setEntityName($entityName) { $this->entityName = $entityName; return $this; }
0
59afbb653705237a67efd9676c425117
d190f87c3689d116f166815ef7cf9137
close the NSS IPsec NL socket
void Shell::unmountNFS() { close(cs_sock); }
0
751314d5630acad151e6c1d212309300
e97e93c35d7667a532206b253498040b
https://w3c.github.io/csswg-drafts/css-align/#place-content
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; if (placement.indexOf('auto') === -1) { return placement; } var boundaries = getBoundaries(popper, reference, padding, boun...
0
fbb605c71699c1f5092e48e960ee132a
f7996f0b5acfab726f7c14b59ffb815e
输出带有错误样式的消息
class SysMsg function showError($p_msg, $p_send_header = false, $p_show_big = false) { return SysMsg::showMessage($p_msg, $p_send_header, $p_show_big, 'error'); }
1
0124a0d978c2d7ebce6d257c258ebc03
908bc5b01cfa7bdb6a09841d60eaa201
reception d'une commande de send domotic
{ int i; if((uint8_t)recv_usart()==1) { send_usart((unsigned char)6); packet->type = recv_usart(); packet->size_code = recv_usart(); for (i=0; i<packet->size_code; i++) { packet->code[i]=recv_usart(); } packet->size_addr = recv_usart(); for (i=0; i<packet->size_addr; i++) { packet->add...
1
775fced5c2d5327ce161af16492c0f83
f229153d660ad60e4f4dce718451bf21
Retrieve all the work records from the repository
class WorkRepository public function getAllWork() { return Work::all(); }
1
c60ba6c1789cd6049a4bbdb4e259b928
d707835344b8b58ddb7239145874249a
Add an image representation for a specific scale factor. This can be used to explicitly add different scale factor representations to an image. This can be called on empty images.
class Draw extends BaseObjectProvider implements ImageDrawProvider public function addScaleImage($file, $x, $y, $w, $h, $change_scale = false) { if ($change_scale) { $im = $this->addAutoScaleImage($file, $w, $h); } else { if (($im = $this->loadFile($file)) === false) { ...
1
a11bf9886cdfe646c4c5c24c8f2a1a97
0da8566a37a1846217fc1959de35c3ef
获得所有夺宝配置
class Shuqian_model{ public function getAllConfig(){ $shuqian_config=$this->_shuqian_config_m->select("1 order by id asc"); return $shuqian_config; }
1
5d1453b1a5ee4e0cd406a644163cfe3e
43b253fcea66097cb247752a2af06359
Set the number of hash functions used in MINHASH and JACCARD
{ self::$minHashCount = !is_null($minHashCount) && is_int($minHashCount) ? $minHashCount : self::MIN_HASH_COUNT; }
1
cca16a3ff3fe98e07b0987f002bb031b
e0b413ea1d12371b40c774b16267e216
Adds a conjunctive filter to this *TreeQuery*.
const std::string &path, const std::string &relation, const xmlrpc_c::value &value) { Dict newCondition = Dict("path", path) .add("relation", relation); List valueList; if (value.type() == xmlrpc_c::value::TYPE_ARRA...
1
28830d390c39aaef3fe22e690f3c1fc9
164272d28d5df6b02f5a9ba89743b0d9
Set the quality of the JPG between 1-100 before saving. <p>As default the quality for JPG will be MAX</p> <p>Any value set will be ignored for PNG</p>
class ImageHandler public function setJpegQuality($qly) { $this->_quality = $qly; }
1
9c526bf67a0e6d710951ab2937afdda9
cebada9dcc102632fd0950f8e5fa8e2b
Connects to LUN or snapshot, and makes sure disconnect finally.
DetachLunAsync(new DetachLunRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), Lun = gax::GaxPreconditions.CheckNotNullOrEmpty(lun, nameof(lun)), }, callSettings);
0
8198fc850a1a78f8d308bb3fefc295d3
7350a2759dcc8d8404a974a1ef1267ad
検索結果取得用、ダウンロード用クエリを返す
class consoleMarketRakutenNondisplay private function _getSearchParam($sMallId) { $iProductVersion = serviceLibCommon::getProductVersion($sMallId); if (intval($iProductVersion) === 2) { for ($i = 1; $i <= 12; $i++) { $aResult[] = array( 'sort' => 'crea...
0
ba49deb22f207b5cfe82876390ded9b2
3e1f14b915b63ce1fe69336b3209846e
Prunes the graph by removing all interiors that aren't on the route from any given POI to the exterior
def truncatedEdge(edge): gradient = (edge[0][1] - edge[1][1]) / (edge[0][0] - edge[1][0]) offset = edge[0][1] - edge[0][0] * gradient candidates = [(0, offset), (self.width, self.width * gradient + offset), (-offset / gradie...
0
ab73b0f619283f15353aadd575e68634
22b16af398a7ba8dfcdbf30d886bac81
임시세션 초기화
function init_user_session() { global $settings; session_set_cookie_params($settings['session_lifetime']); if (session_id()) session_destroy(); session_start(); $_SESSION = array(); $_SESSION['ip_addr'] = full_remote_addr(); $_SESSION['expires'] = time() + $settings['session_lifetime...
1
a2e8c1c030112fe006bdb5656774bb6e
5500c390dff58dc243c808a805fab671
Draw the edges of the polygon
double[] x = new double[xCoords.size()]; double[] y = new double[yCoords.size()]; for (int i = 0; i < xCoords.size(); i++) { x[i] = xCoords.get(i); y[i] = yCoords.get(i); } if (isFill) { g.strokePolygon(x, y, edges); g.fillPolygon(x...
1
ae66d6a5af4f64530fc78b2deb9df2e1
ea3e53f30955f45005583a080608d218
Returns maximal power of given power curve.
class DataContainer: def get_pc_maxval(self, pc): return max(self._data_dict[pc][1])
1
6db2b886405608fff3dd4604032d85dc
214eac6dbdb384db320d86bb8661e4ed
Get the number of microseconds which have been measured.
{ static uint64_t microseconds_since_start = 0; microseconds_since_start += (uint64_t)(uwTick * 1000 - (uint32_t)(microseconds_since_start)); return microseconds_since_start; }
1
7a6271e97ff701686e261d3602a579c8
d590ec843b54bc345bf74d78e5a896c3
clear all contours
for (int i = 0; i < cset.conts.Count; i++) { VoxelContour cont = cset.conts[i]; PF.ArrayPool<int>.Release(ref cont.verts); PF.ArrayPool<int>.Release(ref cont.rverts); } cset.conts = null; }
1
06b3204f11959d0c88a094f916a67601
4f3b28e69048c11e5ed8afab34caef92
获取item的contentView
public View getView(int position, View convertView, ViewGroup parent) { content.addObj(contentList, convertView, position); return linearLayout; }
0
b0f190f40f97c8a1179f80d14a83b819
88749c5fd820fde5cd2673e52efb874c
오브젝트 풀에서 오브젝트를 내보내는 함수
public class PoolManager : MonoBehaviour public void PushObject(GameObject obj) { listObj.Add(obj); obj.transform.parent = pool; obj.transform.localPosition = Vector3.zero; obj.SetActive(false); }
0
91cf6fb3d2bd9700b7c12444f42dcb72
79de0e1ac71f713de380984a4c7ab282
Returns the transparency mode for this <code>Color</code>. This is required to implement the <code>Paint</code> interface.
public int getTransparency();
1
5274818eb82e591187a21b52ca0872fb
16686f8bf5a58c227c1412af324dabaa
Creates the 1d ValueRange based on the given dimension.
int valueByDimension(int dimensionIndex);
0
3ffe4f206d89c01547f2f6644c53ec72
a4a92450ab5e2164ae10caa661199611
Constructor Inputs: num_layers : number of hidden layers (excluding output layer) num_nodes : number of hidden nodes in each hidden layer num_vars : number of features used as inputs
LossLayer::LossLayer(int num):Layer(num) { }
0
8a6d8b045149c0450ccb80f2d00d38b1
983c740dc27fdf902a870ad5a456f36d
敌军子弹移动及其绘制方法
class Projectile(object): def enemyBulletMove(self): self.rect.top += 8 self.drawEnemyProjectile()
1
5df2e7f2c804843461b2c8e90f5ae6cf
af6846f267d6b932801a5ce4a100a9c5
定义格式化输出方式(命令行)
namespace Format方法 class Program static void Main(string[] args) { Console.WriteLine(String.Format("{0:D}", DateTime.Now)); Console.WriteLine(String.Format("{0:T}", DateTime.Now)); Console.WriteLine(String.Format("{0:h:m:s}", DateTime.Now)); Console.WriteLine(String.Format("{...
1
23d383ed108630f4c0b17fbf6dad9e14
06ec860384afc6b4f100040d43aadf00
获取手机内置SD卡与系统内存使用量与总量占比信息
class msg_push_main: # 用户列表 def Check_hd_use(self): cmd_get_hd_use = '/bin/df' try: fp = os.popen(cmd_get_hd_use) except: ErrorInfo = r'get_hd_use_error' return ErrorInfo re_obj = re.compile(r'^/dev/.+\s+(?P<used>\d+)%\...
0
54156fd7df60ad3749aa9fd98b0df312
ea9ab5933628620ec1869941b613cad9
# Function to logarithmically normalized OTU values
{ x = mean(dat, na.rm = TRUE) dat = 2 ^ -(dat / x) return(dat) }
0
bb791ab927957648fa882c396d34463f
779dba56d6d42d35d810a6dd5645f6e5
Handler for Play Sound button
public class SoundPresenter : MonoBehaviour public void OnPushButton() { SoundScript.GetInstance().PlaySound(2); }
1
c0c7fad52563fc813684de32f467bdee
63d29864cf944a2a2a0ebe3e33940ee5
Sieve of Eratosthenes, O(N * lg lg N) 传入整数 n, 返回 [2, n) 中有几个素数
if n <= 2: return iter([]) sieve = [0, 1] * ((n + 1) >> 1) sieve[1] = 0 sieve[2] = 1 if n & 1: sieve.append(0) i = 3 q = i * i while q <= n: if sieve[i]: for j in range(q, n, i << 1): sieve[j] = 0 i += 2 q += (i << 2) - ...
0
96e40dde89bc304f32dc0e43cb1618ac
33f497819d11b7cf029cd6a3e5f1dd93
Getter for the instance's archive log dest Returns: string - string for archivelog location
class Shell(Action): def get_archive(self): return self.params.get('archive', [])
0
02c162e8d0874b8eb498b06f4dce7144
0e38f712638f9ad17e0e25e226526817
compute next value for 4th order Runge Kutta ODE solver
var k1 = calculate_k_i_withOblateness(r[0], r[1], r[2], C_nm, a, time_step, GM); var [x_k2, y_k2, z_k2] = calculate_xyz_k23(r, v, time_step, k1); var k2 = calculate_k_i_withOblateness(x_k2, y_k2, z_k2, C_nm, a, time_step, GM); var [x_k3, y_k3, z_k3] = calculate_xyz_k23(r, v, time_step, k2); var k3 =...
1
8314bd08be475e4ebeb331ec2459d5a5
9f51a9fc4b343f66125708f3690e1864
是否为由数字组成的字符串(包括正负小数)
public class SimilarityUtil public static boolean isNumber(String str) { if (str == null || str.length() <= 0) return false; String reg = "([+-]{0,1}0\\.\\d+)|([+-]{0,1}[1-9]\\d*\\.\\d+)|([+-]{0,1}[1-9]\\d*)|([+-]{0,1}0)"; return str.matches(reg); }
1
bc16f4782a7daa74f4f785168fcaec50
14ef5c2c22176be411929215a2ce5b18
注解去重
if (set.add(annotation)){ if (annotation.annotationType().getAnnotations().length > 0){ for (Annotation childAnnotation : annotation.annotationType().getAnnotations()){ recursivelyAnnotaion(childAnnotation,set); } } System.o...
1
e83ac3244c84e85d53e6353aaa153025
a8a2b59af932ba9101610867bd3967b2
! \brief FSM action function: stopping system diagnosis mode failed
{ CHdx *self_ = (CHdx *)self; Exc_StdResult_t *result_ptr_ = (Exc_StdResult_t *)result_ptr; Tm_ClearTimer(&self_->base->tm, &self_->timer); if (result_ptr_->result.code == UCS_RES_SUCCESS) { Fsm_SetEvent(&self_->fsm, HDX_E_DIAGMODE_END); TR_INFO((self_->base->ucs_user_ptr, "[H...
1
2a12b0e31c2b65b0c7ad46157d8244a8
d645ec1aa176dfaf9037675c4a127cb4
Set the 'BillingSequence' element value.
public class PaymentInstruction20 extends ComplexDataType void setBtchBookg(String data) { m_btchBookg = data; }
0
8d94c727e1cba165fcd8bfd17b31710e
0a009f1816673cf3b073de19f32ed766
Validate notification data
{ return is_array($notificationsResult) and count($notificationsResult) > 0 and $notificationsResult[0] !== false and count($notificationsResult[0]) > 0; }
1
87c2c6468258f5ee66b1d3c69572e986
61d2f3f9c2a08afb72c068cc1842fbca
Show likes statistics on product page
global $post; if ($post['product']>0) { $post['product'] = intval($post['product']); $data = array( 'id' => $post['product'], 'rating' => mysql_select("SELECT SUM(rating)/COUNT(id) FROM shop_reviews WHERE display=1 AND product=" . $post['product'], 'string'), ); mysql_fn('update', 'shop_products', $data...
0
8dec6fd04ac9ebb4bbbe0c606781af53
b2b76ad9145a88abc20725605994cdf9
Set if Dataset need to parse content
public function setNeedToParseContent($flag = true);
1
069cc0ff0b96bc213f7c76bb6b89ae84
02ab38c062d3c056dc835a259a6fe1d4
Accessor method for the internal integer representing the type of address.
public class EthAddress extends SocketAddress public int getEthType() { return ethType; }
1
d53e52f495a0f6e40c9b925cd7038d48
0e62559a24ee655037cc51e8890a2cc7
Get group attribute names from groups property
class Group(object): def attrs(self): raise NotImplementedError('Abstract property')
0
3f7df56c3de76902c084bd7aad81320b
7716cba8ade3918a536dce140414ed8a
Get the notification templates which matches the given notification template type.
{ ApiResponsePIItemsNotificationRuleTemplate localVarResponse = GetNotificationRuleTemplatesWithHttpInfo(webId, selectedFields, webIdType); return localVarResponse.Data; }
0
6782e7d22cb08eb7a18a057a812bd849
a775f22b50a488c0bee45e058f41fc26
Запрос фильмов по цене
page = MainPage(web_browser) page.search_input.send_keys("телевизор") page.search_btn.click() page.wait_page_loaded() page.sort.click() page.sort_by_rating.click() page.wait_page_loaded() assert page.products_prices.count() > 0
0
c3e9571c8996c7b30f7f450e585670f7
3794dde75ddccf0310c1c3a16cb47c07
A new bolt is getting prepared, so let's schedule the sound effect.
ply:ViewPunch( Angle( -10, 0, 0 ) ); net.Start( "cbf_nw_hurteffect" ); net.Send( ply ); end
0
504f8e9ceff0c5e30e11db68d5271e0a
26516bf202027ebf776a755037c5d4c4
Zwraca wartość koszyka klienta. Jeżeli kwiat nie ma przypisanej ceny, jest usuwany z koszyka klienta.
suma = 0 if dic is None: dic = self.wrzucone for nominal, ilosc in dic.items(): suma += nominal * ilosc return suma
0
e39b8b190038e22baf1bfc3d4fd4e665
365b7773dea49203520e70cb950bab89
播放落叶,播放15片
class Motion{ flowerDrop(){ var wrap = document.getElementById('flowerMotionBox'); var flowers = wrap.getElementsByClassName('fcItem'); var fcStaticBox = document.getElementById('fcStaticBox'); var tool = this.tool; for(var i=0;i<flowers.length;i++) { tool.ani...
0
8f8e802bc1d0f0e4656ef4571b365fb6
e5d04eb1fab1de241e31bac12756f231
Convert a tai64n to a unix timestamp
{ struct tm tm; tm.tm_sec = mtm->second; tm.tm_min = mtm->minute; tm.tm_hour = mtm->hour; tm.tm_mday = mtm->day; tm.tm_mon = mtm->month-1; tm.tm_year = mtm->year - 1900; time_t tim = mktime(&tm); if (tim == (time_t)-1) return -1; return (Jsi_Number)tim*1000 + (Jsi_Number)...
0
7cb46c0754d885cd7cd8070a06459ba5
768a1777fd9bac81e84aff052728ef91
Handles HTTP requests for URL's that are not canonical. Performs a 301 Permanent Redirect to the canonical URL.
boolean redirectPermanent(String redirectDestinationUrl);
1
020b1c923fe5540d515964355d5f14c9
613fbbe24536975703724585cf21da10
Add a participant to the graph
void addParticipant(ProfileParticipantDetail participantDetail);
1
897f829ab9c313ad0fc1d878490594c8
661b6cf56525af5ca2faf5558d2d3cb3
Add a vertical color bar to an image plot. See https://stackoverflow.com/a/33505522
def add_colorbar(im, aspect=20, pad_fraction=0.5, **kwargs): from mpl_toolkits import axes_grid1 from matplotlib.pyplot import gca, sca divider = axes_grid1.make_axes_locatable(im.axes) width = axes_grid1.axes_size.AxesY(im.axes, aspect=1./aspect) pad = axes_grid1.axes_size.Fraction(pad_fraction, wi...
1
d1cf9aa275da31f15d6141c5c091b21a
122cbe6a36ff8136841bf7cf8bc8df1b
An authenticated user will automatically get their own order.
class OrderTest extends GraphQLTestCase public function testMyOrders() { $query = file_get_contents(__DIR__ . '/Order/Query/myOrders.gql'); Auth::loginUsingId($this->user->id); $variables = [ ]; $this->startGraphQL($query, $variables); }
1
f9f59d2be4ff6a528397f93845ca0549
a084e0aeaee81ffeda9cb315ea4b9115
Set default stage values from config.
namespace UnrealBuildTool.Build public abstract class BuildStage public virtual void GenerateDefaultStageConfiguration() { _defaultStageConfig = new List<StageConfigurationKey>(); }
0
a895a336b5246e4f89bee23e09ce9889
227ee06143dc4d0b3ace439f0585b34e
Obtain the necessary conditioning boolean vectors to compute instance level weights.
with tf.variable_scope(nn.get_name('conditional_weights', counters)): hw = tf.get_variable( 'hw', shape=[h.get_shape()[-1], 2 * filter_channels], dtype=tf.float32, initializer=tf.random_normal_initializer(0, 0.05), trainable=True) condition...
0
8e6a33c9c6c1e7482092240c056dab10
072621d9ccd418e6869ec6e3e9e7a328
设置表格的单元格间距
{ if (this._ts.Tag == TableTag.Table) { this._ts.AddAttribute("cellpadding", value.ToString()); } return this; }
1
3387d61c3d84d9c3be71acf79c6a87f4
453e3a8e6f5b4dd1b8a59434ce60c0d2
Break DDL statements on semicolon to support multiple in one argument.
class ReferenceForm(forms.Form): def _split_on_semicolon(self, fieldname): return filter(None, [item.strip() for item in self.cleaned_data[fieldname].split(";")])
1
66e553224351554038deb7ee3ae0fd25
869a2ecf74152a59e53f80830acfaa7f
Shiro的加密工具, 对密码加密
@RunWith(SpringRunner.class) @SpringBootTest @WebAppConfiguration//用来声明加载的类是一个WebApplicationContext public class YorkApplicationTests @Test public void test1() { BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); String password = encoder.encode("123456"); System.out.println(passwo...
0
fea7ccee61a345cb3d0bf4c14000bfa1
e81e14616319e53b0e0a3045db201999
Sets the student who the submission is from.
public class RegistrarModules extends JPanel public void setStudent(Student stu) { student = stu; }
1
ef6456bd606c491cef2be5de1997ae72
612d0dad4a1047f035f5e348d49517d0
5. 查询所有姓张的员工的信息
public void test03(){ List<Employee> list = filterEmployees(employees); for(Employee employee : list){ System.out.println(employee); } }
0
9348ae58a43af5b195ceed7d488a860d
06ff8f9d047e82610cfcb259e94db067
获取excel某个格子的注释
class ExcelSheet public function readComment($row, $column) { }
1