query_id
string
corpus_id
string
query
string
code
string
label
int64
9bcc63a4b6a14246c9a784c7c9dff5d0
d6462b75d67d5d4b11243eab5581baf2
@brief Enable the LPS22HB pressure sensor
{ if (lps22hh_press_flag_data_ready_get(&reg_ctx, Status) != LPS22HH_OK) { return LPS22HH_ERROR; } return LPS22HH_OK; }
0
3ced1ed70643822874977cc14ae99d6b
c5c343b93efc38680630a28fa11c9127
Finds element matching the expression, extracts specified context property value and returns it.
namespace Orchard.ContentManagement public static class XmlHelper public class XElementWithContext<TContext> public XElementWithContext<TContext> ToAttr<TProperty>( Expression<Func<TContext, TProperty>> targetExpression) { Element.ToAttr(Context, targetExpression); ...
0
4fc40529259c992e9ed2072088d06672
4a5bbd98eac82eb0c443d4c29822be49
设置指定大小的延迟队列的实例
@Configuration public class LazyConfig @Bean Queue dlxQueue(){ return new Queue("delayQueue"); }
0
edc4d1f58486b4acbfd1f568b6c3fb48
cb952801674115aaba3f4445f2a3beb8
Called from 'thread', or with the world stopped. Collects EMUs allocated by the thread onto the global list.
void gcollect( int i, void *v1, void *v2 ){ void (**fp)(int); int red; for(;;){ ppause(1000L); switch(availmem()){ case 0: continue; case 1: red = 0; Yellows++; break; case 2: red = 1; Reds++; break; } for(fp = Gcollect;*fp != NULL;fp++) (**fp)(red); } }
0
cb44ca521b159b84568dba2ee288f529
7ca8a5bf0e8919dc2901acb31c7d9fe1
takes input from user for directions through the arrow keys
void gameMap::getDirectionInput() { cout << "Enter w, a, s, or d to move: "; cin >> dInput; }
0
396256e941b3c12536900c3163767b05
aedb5d22098060be2afd93926e1321a5
Gets location of empty tile slot.
{ for (Int32 x = 0; x < this.Width; x++) for (Int32 y = 0; y < this.Height; y++) { for (Int32 tileY = 0; tileY < oam.Height; tileY++) for (Int32 tileX = 0; tileX < oam.Width; tileX++) { try ...
1
3ebe35862478e6f769a56cb927c37529
278b89fa6d884d53a4d2b6ed17bbab32
根据索引值获取问题内容
function getQzContent(qustionID){ var contentMp = parent.paperShow.getUserAnsMap(); return contentMp[qustionID].content; }
1
76a71c482d12d3763854193cc2cc8e5c
ef27aeb8f5e0277617903363eb564013
Initiates the asynchronous execution of the TerminateTargetInstances operation.
{ var options = new InvokeOptions(); options.RequestMarshaller = TerminateProvisionedProductRequestMarshaller.Instance; options.ResponseUnmarshaller = TerminateProvisionedProductResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); ...
0
e96c227b4803b59943a76d855d574aa0
d84b21db9b0ee1a04790d7ce2fdbd3d8
Build Blade edit & create form fields
class Extended_Taxonomies static function taxonomy_edit_form_fields( $tag, $taxonomy ) { global $post_ID; $_post_ID = $post_ID; $post = get_post_for_extended_term( $tag, $tag->taxonomy ); if ( !$post ) { return; } $post_ID = $post->ID; do_action( 'flawle...
0
736baf0881d07f4dda4b26b94837c974
d25b01423b4a3efefed5d2007539cb43
Serialises the results from the querries to their own file for offline viewing.
String pathForResults = path + "/singleResults.txt"; File file = new File(pathForResults); FileOutputStream outputStream = new FileOutputStream(file); OutputStreamWriter writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8); for (String result : singleQuerySortedR...
1
f2a7a496cbdb6da8b724451ea7308f49
5b031649fba33cf03d05fa4c349044ad
检测是否为自然字符串(可是中文,字符串,下划线,数字),不包含特殊字符串,只支持utf-8或者gb2312
if (StringUtils.isNotBlank(str)) { str = str.trim(); for (int i = 0; i < str.length(); i++) { String ch = String.valueOf(str.charAt(i)); boolean isDigest = Pattern.matches("[a-zA-Z0-9_\\-\\s]", ch); if (!isDigest) { bool...
1
8f87e43d076e07fee980d91cf116ffca
ec31fa5b2962f13eab7cb0cc894742a9
@brief Activates the current chip select pin
static void ETHSPI_SetChipSelect(bool value) { if (value) { GPIO_PinOutClear(SPI_CS_PORT, SPI_CS_PIN); } else { GPIO_PinOutSet(SPI_CS_PORT, SPI_CS_PIN); } }
1
0ded540774215333994cbd113baef96e
b155ca4839e1fa63932f498e5bf2b54e
POST /tipoocorrencia POST /tipoocorrencia.json
[HttpPost] public IActionResult Post(TipoEvento novoTipoEvento) { _tipoEventoRepository.Cadastrar(novoTipoEvento); return StatusCode(201); }
1
355384563baaa0d0445457333d540187
f8285882753f83f5422a8d7dbf9b118b
Устанавливаем период действия купленного премиума
class PremiumMobileProduct extends AbstractPremiumMobileProduct public function setPeriod($period) { $this->period = (int) $period; return $this; }
1
212e3bd5555989a2c72dfe94e8037dad
e4fcbf7a9b99948fe5681a9e6356c720
This method handles events fired by the Codes list box when the selection changes
namespace FTI.Trialmax.Forms public class CFFilterBuilder : CFTmaxBaseForm private void OnCodesSelIndexChanged(object sender, System.EventArgs e) { if(m_ctrlCodes.GetSelected() != null) { m_tmaxCaseCode = (CTmaxCaseCode)(m_ctrlCodes.GetSelected()); OnCaseCodeChanged(false); } }
1
f00bea6e700b50d4a18944d9ad73611e
9ae727b383606c1829ec085832f53d24
Resets the default output format. By default the output format is "%.*f", where * gets replaced by the output precision.
namespace CodeFactory void ResetFormatter();
1
41340be7a457358b864a6736bc3276a9
456b7687af41b971daf91189dfaf1311
显示LR1项集族
cout << "-----------------------" << endl; for(auto& item : items) { printLR1Item(item); } cout << "-----------------------" << endl; }
1
6b0bea99fa5755502838b15b6756a1a3
ae024e1f8d7f353fe42be5ce49cf1e57
Lists all AuditEntry models.
class AuditController extends Controller public function index() { }
0
9b372c6e86a35a4f8aee6dd4466386ba
077c4221f5a3ca5380b70c3b8373db5f
Exit a parse tree produced by {@link BSVParser#moduleprotoformal}. @param ctx the parse tree
fn enter_moduleprotoformal(&mut self, _ctx: &ModuleprotoformalContext<'input>) { }
0
40f51035a511f311193f0d50bb8f3000
75b098c073f9c91bf1ec6fbe0c777752
outputs attribute levels so the user can view them.
class DiffExp: def return_attribs(self): return (self.diauxicshift, self.heatshock, self.logarithmicgrowth, self.plateauphase)
1
f0a5b2c9168e08023591fa87a66cd63d
241f98c215ae23aebf7d2853df7b9328
配件改造是否满级
namespace UI.MainUI public class GoodsOperateArtificePanel : View public bool CheckIsFullLevel(ItemFielInfo itemFileInfo) { bool flag = false; return flag; }
1
ad1b193da4879695f6d9425cc1789376
1cd14e60556840723e415cd360106f24
==> INSERT
func TestInsert(t *testing.T) { p := sqlparse.NewSQLParser(` insert into table1 (a,b,c,d) values (1,2,3,4) `) r, err := p.DoParser() if err != nil { t.Error(err) } else { t.Log(r.String()) } }
1
0a2ae7a63c2115d96ee5c0322387aba4
c14a87806afb18661b55d98a2455ffe9
Creates a <see cref="Task"/> that completes when the provided <see cref="Task"/> completes, regardless of the completion state (success, faulted, cancelled).
{ if (task == null) throw new ArgumentNullException("task"); return new TaskObservable<Unit>(task); }
0
f5816a402b41864a277a550e51e74feb
87a0a52df59d80c7225c1e14ca8e1c3f
See zstd.h to mirror implementation of ZSTD_COMPRESSBOUND
pub fn compress_bound(src_size: usize) -> usize { unsafe { zstd_sys::ZSTD_compressBound(src_size) } }
1
8c67afb33ebe62038a05d8078e8c3cb1
d66cf47f13e7cdb387a0411971dc17db
打印一条信息,来显示车子的行驶里程
class Car(): def read_odometer(self): print("骑乘行驶了 %s 公里!" % str(self.odometer_reading))
1
3e484f6ce4982f63d481d0ebdadf619e
a5a059e0ba5d9ab155cc5c55baee5264
Provide a signed signature validation report based on ETSI TS 119 102-2
{ var currentNodeList = networkConnection.NodeList.CurrentAndRecentNodes(); const int lenT = 132; var signedTimestamps = Convert.FromBase64String(TimestampSignature); var ts = new List<byte[]>(); Node firstNode = null; var nodes = new List<Node>(); do { var timestamp = signedTimestamps.Tak...
0
ce497fed95e9a1d66428e1f0cb103b7a
98b81a144ccd8b2340f107598b18bd10
Returns the number of times we dropped a broadcast packet. These are usually duplicate sequence numbers (aka broadcasts we've forwarded before.
class NetworkStatisticsClientImpl : public NetworkStatisticsClient, public MsgDest virtual uint32_t getNumDrops() { return _numDrops; }
1
a7fa416ead242e478fb409bd072d75d0
6f8da349bd05319833c10f833ff0a48b
Run into items
var roll = Math.random()*100+1; if (roll >= 66.6){ callback = function(){ $('.runInitial').hide(); encounterBattle('enemy'); } messagePlayer('alert', 'Ambush!', callback); } else if (roll >= 33.3){ var mod = (player.tacticSkill/150); if (mod > 1){ mod = 1; } var damage = player.he...
1
67beaf16d79e98aaa72877641911860b
315a4cf684dbd8f0f472ac336c079315
窜货分析
class Index extends Controller public function saleAnalysis() { return view(); }
0
0e9467a677a4b702484c33eb1950192d
2df27a697cfd264f4e95eac9a1e49d4e
カクテル登録用のバリデーションを実行する
$validate = array( 'crm_customer_id' => array( 'numeric' => array( 'rule' => array('numeric'), 'message' => '機関名は、セレクトボックスから選択してください。', 'allowEmpty' => false, ), 'customerDbExist' => array( 'rule' => array('customerDbExist',array('crm_customer_id')), 'message' => '機関名は、セレクトボックスから選択してください...
0
d88b48d7d947213f292be31e58be49ce
48c276984d44fad3d74fe9dbac69c8c2
保存最后停留的页面
if not os.path.exists(settings.LAST_PAGE_HISTORY_PATH): os.makedirs(settings.LAST_PAGE_HISTORY_PATH) last_page_path = os.path.join(settings.LAST_PAGE_HISTORY_PATH, 'last_page.txt') with open(last_page_path, 'w') as lp_file: lp_file.write(str(page))
1
44c231f196854a1cbd77216f6d3ef2a1
f84d255a51bd58d36b066833365a36b3
返回某技能项目的使用人数
{ $factor = 0; if (!empty($this->people)) { foreach ($this->people as $person) { if ($person->hasSkill($skillId)) { $factor += 1; } } } return $factor; }
1
9cadc3ee1e3aaed5349bd0f373101b48
b4fde0a17d65ee11ee82d66c1b5d1a62
行番に紐づく行を隠す
for (let i = 0; i < lineNumbers.length; i++) { for (let j = lineNumbers[i]; j > 0; j--) { let tr = document.getElementById(rowIdPrefix + j); let overTr = document.getElementById(rowIdPrefix + (j - 1)); for (let k = 0; k < tetrisBoardMaxCol; k++) { let from = overTr.childNodes...
0
0ae21eceda5274415c9307e25c370c8d
6e85c461ecd4789ad3f14a2a9a99ee0c
Gets the session associated with the id admin service. return: (osid.id.IdAdminSession) - an ``IdAdminSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_id_admin()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_id_admin()`` is ``true`...
class AssessmentManager(osid_managers.OsidManager, AssessmentProfile): def get_bank_admin_session(self): return
0
05b78b6f5312a5ce43de4be3e3f53dba
e02064e48ee838c83f85e09ac675d7c9
查询access数据库,会返回datatable形式查询结果
public void QueryDataTable() { var db = new Smart.Data.EF.EFDbContext(); var users = db.QueryDataTable("select * from SysUser where SysUserId=@0", 1); }
0
f97273efa77ea53cb257c746a86b61dd
cfca337afab929bc47292485fc330a40
Check if all parameters are present.
namespace lti bool parametersManager::validParameters() const { return notNull(params_); }
0
0a4550852521084d157dd69888a4b6fe
4ced000723be4a105858f64bd23b0f06
Sends Data to Socket. If socket is not ready it will wait until it is and send it.
public class Client : MonoBehaviour public void Send(string data) { if (!socketReady) return; writer.WriteLine(data); writer.Flush(); }
0
b1ea15175dc8c000411920f80997aae4
9a8250849384630db88cf44b619c2b3c
Toggle the collider and sprite renderer on/off.
namespace ActionCode.Renderers [RequireComponent(typeof(SpriteRenderer))] public class SpriteGhostTrailRenderer : MonoBehaviour public void Toggle() { enabled = !enabled; }
0
cb2a07acdb1586c988563ad14e0f772a
453ca0d9cb8fe2a3fde636f4e5ca257f
使用中文验证码
if (width < 0){ width = CommonConstant.VERIFICATION_CODE_WIDTH; } if (height < 0){ height = CommonConstant.VERIFICATION_CODE_HEIGHT; } if (len < 0){ len = CommonConstant.ARITHMETIC_LEN; } ChineseCaptcha captcha = new ChineseCapt...
1
cb107fa7aa245d1c3b72a9c8d19febd6
470097bedcfd69c7ce4fa66dcb2007ca
Solution to finding character in a string
bool found = false; int i = 0; while (!found && i < s.length()) { if (s[i] == c) { found = true; } i++; } if (found) {return (i-1);} else {return (-1);} }
1
ab6ed639c203058a0f2d47a2b7f72c4e
dfa7a6af79ff1c41e8d0d27801e89458
Returns if target is a record
class SDS(object): def isrecord(self): return _C.SDisrecord(self._id)
1
b327c2769788a41a768430b01e4cb3a5
6cf4484aabc6515448e95a30e4824a1c
Begins execution of the plugin. It must be triggered from 'plugins_loaded' to ensure 'scbFramework' works correctly.
register_uninstall_hook( __FILE__, array( 'BrochureTools', 'uninstall' ) ); if ( is_admin() ) { add_action( 'plugins_loaded', array( &$this, 'load_language_file' ) ); add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 ); add_action( 'admin_notices', array( &$this, 'disp...
1
b1991a3510a7c94840c8d1835aa71bff
2d4f8bf482bf597e0efa5d7fe675104e
処理済み画像をバックアップフォルダに移動させる
{ String[] Imagetomove = Directory.GetDirectories(ConfigurationManager.AppSettings["ZipPath"].ToString()); string prosesFolder = ConfigurationManager.AppSettings["imagetoproses"].ToString(); String[] zips = { }; String FileArchieve = ConfigurationManager.AppSettin...
0
0b1c02c7529e25635ebf913b38a0913c
19950d911132fecc4416327b37888264
removes leading and trailing whitespace from lines, and removes blank lines.
func removeIfBlank(file string) error { contents, err := FSUtil.ReadFile(file) if err != nil { return err } s := string(contents) s = regexp.MustCompile(`(?m)^\s*$[\r\n]*|[\r\n]+\s+\z`).ReplaceAllString(s, "") if len(s) == 0 { e := FS.Remove(file) if e != nil { return err; } } ...
1
7ae998783e9a5c247d538e33b35a1eb1
2e22d2d33789fbce7d23205e92a3e635
Gets the manager handling dimensions.
namespace SurfaceHelper.Drawing Dimensions GetDimensions();
0
e6ace6b6cab689269855055c30f71a3e
d518cc35d7c95ae67b4d4a43f9b29576
Loads image from HDD and loads it to the GPU VRam.
namespace guiex int32 CGUITexture_opengl_base::LoadFromFile(const CGUIString& filename ) { TRY_THROW_OPENGL_ERROR(); IGUIInterfaceImageLoader* pImageLoader = static_cast<IGUIInterfaceImageLoader*>(CGUIInterfaceManager::Instance()->GetInterface("IGUIImageLoader")); if( !pImageLoader ) { GUI_THROW( "[CGUIText...
1
b44f08f3c37f3b047707429e7b5fef66
4af89c44e5d1f16c3b52152e6fdddc39
The MQTT server name
class MQTTConfig: def server_name(self) -> str: return self._server_name
1
e3962ed7db0c3ceef204681d7d7a5bad
f9ab4e56c8bc0a10f902865fe4436320
获取学期跑步成功的次数
public class RunningUtil implements SensorEventListener public String getRunningTimes() { return runningTimes; }
0
d5718189e99d5da39b45af92d57f866f
8def8edfdc437ac684b6dc3d97060447
卖家ERP从平台获取在平台回复的记录
{ $platform_code = Yii::$app->request->getQueryParam('platform_code'); $models = AfterSalesOrder::find()->where('account_id is null'); if(!empty($platform_code)) { $models->andWhere(['platform_code'=>$platform_code]); } $models = $models->limit(100)->all()...
0
ea850b02415a74fc026a258a9d57816d
9acd451084dd9aa75bd0e1d563bc7e9a
读取M4要素的映射配置
quantmap = {} maplist = basereader.get_element(consfile, 'mapList') for mapitem in maplist: quantmap[mapitem.attrib['label']] = mapitem.attrib['id'] return quantmap
1
c968923e30c619d460f7b8618c005f90
50138f1c1979f495da6acb82f3241759
Shape of small m:
def drawMi(): turtle.penup() turtle.fd(27.5) turtle.pendown() c = pow(27.5*27.5+50*50, 0.5) a = 27.5 b = 50 d = c-5 angle= 90-math.degrees(math.acos((a*a-b*b-c*c)/(-2*b*c))) turtle.right(angle) turtle.fd(d) turtle.fd(-d) turtle.right(-angle) turtle.right(-angle) ...
1
d34fdaa6a4bb76a82824adef4d98a5b6
e3fcaea052e1cfd195871811f86e4d1a
Mark letter as read
try { $this->mailHandler->markMailAsRead($id); return true; } catch (\PhpImap\Exceptions\ConnectionException | \PhpImap\Exceptions\InvalidParameterException $ex) { return false; } }
1
f98f673ea8bf9fe5b0bfb6b652aed135
3473c475c2d0a3407783f79840f04868
Generates defined amount of records
async function generateRecords(database) { return generate(database, 100, 10) }
1
aa9eed5afc0439dbd1798108c9d2b939
582c4db42d217a3f2828955192c100d1
add function to perform cleanup (such as unchecking checkboxes) on hide
function markClean() { window.onbeforeunload = null; }
0
f6fb9b203ef37859f4483e3a4a815bde
b375832294db44d92f37e3aee805a363
根据gid来重新更新nodeid信息,使得缓存数据库可以直接供本地打开
void initializeRedis(long gid);
0
0ba375c53ef9c4dbdb42d26f52d91625
7f61448ad6da3ef0f9cb03f40c5be655
generic template - should never be called
cases like (1)
0
d126bfd4ada2101e545d6b22ceaa2dbf
6dc7d0886978e6c50db47e3f02c55d4c
Checks if this topic has already been reported by the current user
{ $conn = connectToDB(); $query = "SELECT * FROM UserReportedQuestion WHERE userID = '".$userID."' AND questionReportedID = '".$postID."';"; $result = mysqli_query($conn, $query); $alreadyReported = false; if(mysqli_num_rows($result) > 0) { $alreadyReported = true; } return $alreadyReported; }
1
8910102c9ebb173e8fec63b0f77808ae
0c6e0424a7f5e5a4539fb9e19790a552
Obtiene todos los estados de las campañas
namespace OCM.Bussines.Laws public class GeneralesBLL : GenericBll<Dato>, IDisposable public DataTable ObtenerTablaEstados(string conexion, long campaniaId) { using (var context = new GeneralesDALC()) { return context.GetDataTable(conexion, "Proceso.EstadoRegistro", n...
1
0b11a3d5e024c6f1ad7bcd3482d9a81f
806277cfe504277aaa36dd0a414dc38e
Wait for all other threads before resuming execution of the current thread.
static VOID ResumeOtherThreads() { INT nOriginalPriority = GetThreadPriority(GetCurrentThread()); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); for (DWORD i=0; i<g_nThreadHandles; i++) { ResumeThread(g_hThreadHandles[i]); CloseHandle(g_hThreadHandles[i]); } free(g_hThreadHandles); g_hT...
0
748cc211de72d597917f424ded019877
c44fb443ca52e1c6e0b4c153b3e33c4c
получение задержки реле
{ static GPIO_TypeDef *oldGPIOx = 0; static uint16_t oldkpin = 0; static uint8_t secend = 0; if(GPIO_ReadInputDataBit(GPIOx,kpin) == Key_Signal) { Delay_ms(60); if(GPIO_ReadInputDataBit(GPIOx,kpin) == Key_Signal) { if(oldGPIOx == GPIOx && oldkpin == kpin) { if(secend == 1) Delay_ms(480); else...
0
e141ceb50543d4ca4c69de534582dba6
10b7acde1b0ea13825f3deae6e5eeb01
Does this instance handle the given equipment
namespace SE_CSHARP_Vers class Equipment public bool IsEquipmentForSession(SpecialSession s) { foreach (SpecialSession x in specialSessions) { if (x == s) return true; } return false; }
0
497b093b52dd95ca7beee5d54aec11ee
6833a84699ea56227cada3b7a1df1deb
Computes border of an image block used to compute its complexity
rows = img_edges.shape[0] cols = img_edges.shape[1] border = min(rows, cols)/border_proportion row_pixel_counts = np.sum(img_edges, 1) top,bot = np.where(row_pixel_counts > count_thresh)[0][[0,-1]] top = max(0, top - border) bot = min(rows-1, bot + border) col_pixel_counts = np.sum(img_e...
1
c22d9bbdc89c3992f5610d5790e15395
7c597f77783e825855ba3165d5ec22a1
現在のカーソル位置にあるKAGのタグ一式分の行文字列を取得する
{ if (document == null) { return null; } string tip = ""; string word = TextUtilities.GetWordAt(document, document.PositionToOffset(new Point(colNumber, lineNumber))); KagTagKindInfo info = KagUtility.GetTagKind(document, lineNumber, colNumber); if (info == null) { return ""; } ...
0
c5395e5df520a1b31d71dcb1a1cc6ec5
2ad26dcff1e7b7b7eebb7592fd46d2c6
Disable warnings as the protobuf headers have problems (well Microsoft thinks they have problems). See the vsprojects\readme.txt for information in the Google Protocol Buffers release
void initProto(){ GOOGLE_PROTOBUF_VERIFY_VERSION; }
0
0e2d4352a10c7a423ec3fe8629c99acb
01c170c54f57d99a2899ef19417a930e
does nothing because we want to be as fast as possible
void EndingLayer::update( float deltaTime ) { }
1
ca522aad7b356ac7d27b29713f30f38c
cd3f2328857d5c296625e174f107cf79
Serves up the 'public' directory if it exists. Should be the same as what you'd see once live.
def index(): return send_from_directory('.', 'index.html')
0
fa503263a5a3a26c5314bf1bee01d3a2
2442c34ed62e3bfcdd20521403d496ae
Finds leftmost item in tree
int currentIndex = rootNode; while(!isNull(leftChild(currentIndex))) currentIndex = leftChild(currentIndex); return treeArray[currentIndex]; }
1
776eb4f226ede1b9adc86d6293104797
cf8adf670d4229605e2e3d52193909cd
GET /water_rain_ducts GET /water_rain_ducts.json
{ if($this->request->expectsJson()) { $models = $this->model->with('parameters')->get(); $modelsTransformed = $this->modelTransformer->transformModels($models); Log::debug("WATERSHED MODEL CONTROLLER - SENDING JSON:"); Log::debug(json_encode($modelsTransformed...
1
3e4272d6ea0a46850f4f556b19aeb8af
54ddac7a1525ecd6ad4029b9676e1658
Merge 2 arrays, delete duplicate item and print in string format.
String d=""; String c=s1+s2; String str[]=c.split(","); List<String> slist=new ArrayList<String>(); for(int i=0;i<str.length;i++){ if(!slist.contains(str[i])){ slist.add(str[i]); } } for(int i=0;i<slist.size();i++){ d+=slist.get(i)+","; } return d; }
1
72ddad0525cc9a43fdc1c29b694ead12
21f159573a99458dd854d6e6fe728a6d
判断松开手指时,是否达到末尾即可以开锁了; 是,则开锁,否则,通过一定的算法使其回退。
if (clickNum > lastClickNum) { lastClickNum = clickNum; try { lock.acquire(); } catch (InterruptedException e) { e.printStackTrace(); } isWaitForRelease = true; if (period ...
0
de4ee0439121a99209682c07c5ec8868
0f61792a5b45cc6456ed93049acc380b
See how much user and system time this process has used so far and return the sum.
try: r = resource.getrusage(resource.RUSAGE_SELF) return r[0] + r[1] except resource.error, e: raise SysInfoError('getrusage() failed: %s' % e)
1
91dd1b57934d751c59d332ce7fe23b4c
840cdd908e7e282528abff896de75145
Replaces tilde prefixes to home directory.
function replaceExpansions(input: string) { return input.replace(/(?<=^|\s)~/g, Deno.env.get("HOME") ?? "~"); }
1
6305ff6449dd424047bd778cc2367e91
a50444d390d37825ddb93f35c117d62e
Installs Widevine CDM on ARM-based architectures.
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Method install = multidexClass.getDeclaredMethod("install", Context.class); install.invoke(null, getTargetContext()); }
0
a424b6b893839d9137edcb72f8a7e4eb
51947ff8a2965b72adc1e1449c7f90aa
获取可用的扩展属性以及它们的配置.
Map<String, Object> getExtensions();
1
4ac5fc67f2996c2093416183884bbdb1
862a30ef88b1f3c1d3621bb1806d15c0
用户协议变色可点击
class LoginActivity : BaseActivity() private fun getClickableSpan():SpannableString { val spannableString = SpannableString("登录即表示同意用户协议") spannableString.setSpan(object : ClickableSpan() { override fun onClick(widget: View) { startActivity(intent.setClass(this@LoginActivity,...
1
47234a2a26c64bc544cda5f27158d519
58d6ab02c69320b5f0d75524cd46d661
XSPEC analysis of the total, average spectrum (RGS1+RGS2) of the observation. The steps are all logged into a file called XSPECLogFile_average_spectrum.txt. The fit is performed on two different models: logparabola and powerlaw. The plot of the spectra and residuals is done using matplotlib. The plotting function is wr...
def plot_specs(num, run, res = 3000, plot_reg = [6000, 9000]): cwd = os.getcwd() wl, spec = np.genfromtxt(run + '/specs/spec_{}.txt'.format(num), unpack = True) wl, spec = mft.broaden(wl, spec, res) res_element = np.mean(wl)/res spec_spacing = wl[1] - wl[0] if 3 * spec_spacing < res_element: factor = (res_eleme...
0
ab45472cb14ed663ecaa4b3982269b6c
59abac558336a780da02a1c0b32edee6
Prompts the user to choose an ideology (returns a 1-indexed number)
{ char *input = prompt(message); if (input == NULL) { return -1; } if (strcmp(input, "1") == 0) { free(input); return 1; } else if (strcmp(input, "2") == 0) { free(input); return 2; } else if (strcmp(input, "3") == 0) { free...
1
323dd8b655609f05d5f9b8143a0b1450
1640703a6c6f9fe763742bc97dd42616
Gets an writer from the origin with open options.
{ if (Path == null) { throw new ArgumentNullException(nameof(Path)); } if (Path.Length == 0) { throw new ArgumentException(OpenEnvironment.GetResourceString("Argument_EmptyPath")); } var w = new S...
1
13bf9a56426a484193277a9c45e08c41
246796a4e21e47ca1a58a6b9e6becd94
Change upside-down
global in_image, out_image if is_empty_image(): return equal_image() out_image = np.flip(in_image, axis=0) display_out_image()
1
b5526a0aff9a33d4ab1ef356c5ce2224
d4820dcb7d62c4e8310e42b6fda08fdc
Implementacion de la transformada de Fourier
N = len(x) X = [None] * N l = 0 wExponent = 1j*(-2)*pi/(N) for l in range(N): k = 0 temp = 0 for k in range(N): temp = x[k]*exp(wExponent*k*l) + temp X[l] = temp/N return X
1
659039e1941d43b7a1476963cc09168c
409169e4e414645b117f171d461cd4fa
Осуществляет проверку параметров формы редактирования записи о расходах на ТО и обновляет запись
class OtherExpense public static function updateFromPost (array $arPost=null) { try { if(is_null($arPost)) { throw new Exception\ArgumentNullException('$arPost'); } } catch(Exception\ArgumentNullException $e) { $e->showException(); return false; } $arUpdate = array(); Fields::validat...
1
e2e0ce25325b1cf634273534caa5a2aa
e2de361b60d7b3e3971cb386d215e85e
Cria um panel-heading de cabeçalho para o calendário
function createMainHeading() { var conforDM = $("<div>") var container = conforDM[0]; var con = document.createElement('div'); con.style.margin = "0 6px"; setClass( container, 'mainheading ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all'); if (self.showTimeType == "4") { co...
1
b67c222e9dc4ffc034acc115cf5bf7dd
30adc78f43efa7b7fa9e27146abeb942
This method receives a string with a file name, reads the shelters from that file and... ...returns a Shelter Catalog containing the read shelters
public class FileParse : MonoBehaviour public void ReadShipSchematicCatalogue() { string[] shipSchematicCatalogueRaw = System.IO.File.ReadAllLines(Application.dataPath + "/Text Input/ShipSchematics.txt"); List<string> shipSchematicCatalogue = new List<string>(); AddToCatalog(shipSchematicCatalogue, shipSchematic...
0
c2b3086724a23ef5d0c9268da70af7d2
0c2d372cfb1eacdc096d8b33a4638b4a
NewClientWithLogger 创建一个数据库客户端
conn, err := newWriteToConn(addr) if err != nil { return nil, err } return newClient(conn, 0), nil }
0
8114b3d1fe8d70f34bbc7b608c7465a0
db5132ca0804e924e720e63d13b7c2a5
Generate a link in the TOC for each post.
function black1_generate_category_link($category) { return bloginfo('url').'/?type=postlist&category='.$category->term_id; }
0
a88c19f62b6ba3e39a6b042c17e06795
98034cf6dc0dd228df0e2a57f87859f9
Para este trabajo se usó FNV-1a de 32 bits.
const FNV_PRIME: Hash = 0x1000193; const FNV_OFFSET: Hash = 0x811c9dc5; bytes.iter().fold(FNV_OFFSET, |hash, byte| (hash ^ *byte as Hash) * FNV_PRIME) }
1
a7509c90a13f5e4318cc8dcadb16109f
8a5d9bf4b62a8b7989730fe1c7d7a7f0
通过来源与目标类型获取序列化器。
RpcSerializationTypeEnum serializationTypeEnum = RpcSerializationTypeEnum.findByType(type); switch (serializationTypeEnum) { case HESSIAN: return new HessianSerializationImpl(); default: throw new IllegalArgumentException("serialization type illega...
0
40462928d8ea31478dd81d0cc1ea2539
c84683f0ed79dbbfb50b18ee98a29d40
Função que converte metros por segundo em km por hora
class Metro msToKmh(speed) { return speed * 3.6 }
1
22bda6b4e5706e76f614c8c44083325a
ab428d86fe68c9ef99a0a36b07224bb0
Aktualizuje prywatnu trening użytkownika
[SwaggerResponse(404)] [Authorize(Roles = "Admin,Moderator")] [HttpPut(ApiRoutes.Training.UpdatePublic)] public async Task<IActionResult> UpdatePublic( [FromRoute] int trainingId, [FromBody] UpdateTrainingRequest request ) { var training = await _t...
0
699b0ade02e3420a98c3d1ba2c5d7633
d53453d1552b0d7fadc399ef0853550b
发送https post报文,并且接受响应信息 (安全性高)
function curl_post_https($url,$data){ $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($curl, CURLOPT_FOL...
0
159d87489be5f78e0988ee174abd2f09
1016fb08983ebf5466c3c62a3fe44cbc
Toggle PHY operation status is 0 - PHY is OFF(powered-down) status is 1 - PHY is ON(normal operation)
{ atpl360_spi_data_t x_spi_data; uint8_t uc_value; x_spi_data.us_len = 1; x_spi_data.us_mem_id = ATPL360_PHY_SNF_ID; uc_value = (uint8_t)b_enable; x_spi_data.puc_data_buf = &uc_value; cpu_irq_disable(); _spi_send_cmd(SPI_WR_CMD, &x_spi_data); cpu_irq_enable(); }
1
af576a046442223b8e4fe0891b1d3c92
25c9edf88e0bd5433adc8c2a9e22dbfd
通过多个字段名和值,查询多条记录,字段之间用简单的AND连接,只查询指定的字段
public abstract class CommDB extends SQLiteOpenHelper{ public Cursor queryAndAll(String table,String field,Object value,String order){ return queryAndAll(table,null,new String[]{field},new String[]{String.valueOf(value)},order); }
0
dbbf3eed10964939c91b0f965bd29bee
a3fc5d582813d4df267822b1acf0e407
Returns an unique ID to track changes.
public class NotificationHandler private static int getID() { return c.incrementAndGet(); }
1
e08c682b1a464d19df13367e6322abb4
e6f35693efa57c4c697a9ce32923efba
r"""Get np.array representation of the data.
class Registration: def __array__(self) -> np.ndarray: return self.image
1
c410d6c49cfd6651a42c65e1ac2d3262
cdae78e0acf31c313253eca138296c1a
Returns the number of related SWarehouseData objects.
public function getWarehouseCount();
1
23f58d5c63163e86206f48a031e20f07
2acb4f5ac2d4b331ed4b2fe9bdb24bfe
Called everytime a new square enemy is made to tell the UI how many there are now.
[System.Serializable] public class FireModeUI : MonoBehaviour private void SetEnemiesRemainingUI(int EnemiesRemaining) => inGameWaveUI.waveCounterUI.SetEnemiesRemaining(EnemiesRemaining);
1
695870850c21e7f8ac88bebc75d849a6
1cfc80939cb7d5c5332673043f3f4ddb
# Metodo que obtiene los datos de la computadora
class PublicView public function showComputerMark($computadora) { $this->smarty->assign('datosComp', $computadora); $this->smarty->display('templates/computersMark.tpl'); }
0
fcda547dbda10ba3b7838ccb7ef8256d
74e18c57a3147c3715938e5b8fc45100
Retorna o endereço padrão ou o primeiro da lista
public function handle() : ?Endereco;
0
af8d6f727960621b1cfe4be5f314894a
8816b27941e5ec462a0e98171f285b29
Convert a motion event to a format suitable for sending over the wire to remote frame buffer coordinates. ALT meta state flag is interpreted as second mouse button
handle_motion_event(X_MB_runtime_t *rt) { redraw_man_t *rdman = rt->rdman; int x, y; int state; shape_t *shape; coord_t *root; int in_stroke; x = rt->mx; y = rt->my; state = rt->mbut_state; shape = find_shape_at_pos(rdman, x, y, &in_stroke); #ifdef ONLY_MOUSE_MOVE_RAW ...
0
7dee7aaa55f3734632211696abcca2c3
0d0ea5f5c4a554c15df44fea463caccc
Find the kernel size given the desired factor of upsampling.
psize = math.ceil((stride*(osize-1) - isize + ksize) / 2) oosize = math.floor((isize + 2*psize - ksize)/stride + 1) assert oosize == osize,\ f"{isize}-{osize}-{ksize}-{stride}-{psize}-{oosize}" return psize
0