query_id
string
corpus_id
string
query
string
code
string
label
int64
684a96984d768fc8fe2448563118a06c
9abc2426ceb1b4aad8ed7475a4a057b9
Returns the primary investigator.
class FHIRResearchStudy extends FHIRDomainResource implements \JsonSerializable public function getPrincipalInvestigator() { return $this->principalInvestigator; }
1
1ff2dd5fabc9a8d36e983b387823f175
779df6f26ad0287fc5b8c86160b2ec30
Return underscore case key from camel case key.
$underscore = preg_replace_callback('/[a-z0-9][A-Z]/m', function ($x) { return $x[0][0] . '_' . $x[0][1]; }, $camelcase); return strtolower($underscore); }
1
2151dd0b06c1e03f72f4c5a58b837b98
78597d2a1ff5cfc16f82061f2be3babc
Get the pilot pay, but include different overrides
class hr2_payroll_register(osv.osv): def calculate_payout(self, salary_deductions, value6): values = {} if not salary_deductions: salary_deduction = 0 else: salary_deduction = sum(salary_deductions.values()) if sal...
0
3ae9d647c1f694bd1446c7b48850b519
498c07765295d00e34b3ca30f8c5462f
Scale down the text on a set of axes
for ax in g.axes: for c in ax.get_children(): if isinstance(c, PathPatch): p = c.get_path() verts = p.vertices verts_sub = verts[:-1] xmin = np.min(verts_sub[:, 0]) xmax = np.max(verts_sub[:, 0]) xmid...
0
f9f13190109f1115172fb2adfa4af737
87a30ec483ce849b43981166552b25c1
Função que faz alocação de memória e trata os ponteiros soltos acerca de nós da lista encadeada.
void *ff(size_t size) { free_node_t *ponteiro = HEAP->head; if (ponteiro->free >= size + sizeof(free_node_t)){ } else { while(ponteiro->next != NULL){ ponteiro = ponteiro->next; if (ponteiro->free >= size + sizeof(free_node_t) ){ break; } } } if (ponteiro->free < si...
1
5f0c00ef8de0e4aa62e336875d5a9b12
d57ce83ef44312ecb856f13a1474f24e
Finds the size of a word
if (word == null) { throw new IllegalArgumentException("Word is mandatory"); } if (trie.contains(word)) { switch (word.length()) { case 3: case 4: return 1; case 5: return 2; case 6: ...
0
ccaa10d1941fb5fc8b54c5e290cf5f77
82e338e480d51caef43df5a61c0f7039
从数据中找出给定下班之前或之后的第一个非null数据
long?[] EarliestByOffsetAllowNulls(Func<TSource, long?> selector, int earliestN);
0
84dd4b12396cd55c4f10db973c93acad
bf3f9ab6d8284de81f8041531ffe2e8d
Get the current rotor state
inline int8_t readRotorState(){ return stateMap[I1 + 2*I2 + 4*I3]; }
1
ae8a1d6e0832f5c0748ac1757fafce14
6c912c69b13c443102904da50fe3b0c4
如果pages数组中的内容小于2个
function isPagesError() { if(pages instanceof Array) { if(pages.length === 0){ console.log(chalk.red(`${__dirname}/page.config.js is empty!'`)); return true; } return false; }else{ console.log(chalk.red(`${__dirname}/page.config.js format error, except Arr...
0
c158c7be9cb4ed49edda9b2ddc1d550e
0d50fd62d733552217b08ad7a55b2836
Creates direcotry path given a string (/my/directory/path/) and unix permissions mode (i.e., 0775)
function m_create_path($_path, $_chmod = 0777) { $path = rtrim(preg_replace(array("/\\\\+/", "/\\/{2,}/"), "/", $_path), "/"); $myPath = ""; if (mb_strpos($path, $_SERVER['DOCUMENT_ROOT']) !== false) { $myPath = rtrim($_SERVER['DOCUMENT_ROOT'], '/') . "/"; $path = str_replace($_SERVER['DOCUM...
1
fdc2a0392023c793fd03e3334c17b6dd
c4e5a2f9f6ed27862a76a1e9d982943f
액티비티가 화면에서 사라지는 시점에 API 호출 객체가 생성되어 잇다면 API 요청을 취소합니다. accessTokenCall?.run { cancel() }
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, OnFragmentInteractionListener public void stopAccessTokenTracking(){ if(accessTokenTracker != null && accessTokenTracker.isTracking()) accessTokenTracker.stopTracking(); }
0
a39112d731a4c747c1a1224befff040a
690c67fb90d80dc241c73fd0ebcb04b2
Negate the top value of the stack.
namespace Apache.NBCEL.Verifier.Structurals public class ExecutionVisitor : Generic.EmptyVisitor public override void VisitDNEG(DNEG o) { Stack().Pop(); Stack().Push(Type.DOUBLE); }
0
2b9633a2509e2f436051815c676452eb
23dff8f01f51e045a5cd76fa89601355
Yards to miles
class Metrics public static double toMile (double km) throws NegativeDistanceException { if (km < 0) throw new NegativeDistanceException (); double mile = km / 1.5; return mile; }
0
fca85741c16eae047dbad102d614a7ff
33b336007459ac6ff9ba319d38ca0e0c
this function returns a group of label and input/select/textarea elements
function selectNodes() { const sidebar = document.querySelector('.side-bar') const subTasks = document.querySelectorAll('.todo-list-items .list-group-item') const submitButton = document.querySelector('.input-group-append button') const taskList = document.querySelector('.todo-card .todo-list-items') ...
0
84bcfaac8d1054aea57efebf4c6119d6
78f482fa89471dc742e8f65ceb0188fb
devuelve cuantos pagos atrasados tiene el cliente
class PaymentItem extends Validation public function getDiasAtraso(): int { return $this->maxOverdueDays; }
0
7d9527365df761e532bf0a46073cf9d1
025d89c9416e9ecd77a24ec7b094ba24
Returns various count statistics from the mapReduce command.
class MRJob(object): def parse_counters(self, counters=None): if self.stderr == sys.stderr: raise AssertionError('You must call sandbox() first;' ' parse_counters() is for testing only.') stderr_results = parse_mr_job_stderr(self.stderr.getvalue(), counters) ...
1
072d5b529392cfe54f14fa75e91b83fd
5261de273b1b19bf46b980245e389e89
Pre: Post: The audition information is deleted from the database @returns true if the audition is successfully deleted and false otherwise
namespace AA.HRMS.Domain.Services public class PerformanceManagementService : IPerformanceManagementService public string ProcessDeleteAppraisalInfo(int appraisalId) { if (appraisalId < 1) { throw new ArgumentOutOfRangeException("appraisalId"); } ...
0
f6dd93883b270afee7a245a3698a6989
1ff847722a685b2b6118336db87c236a
This method is called by a drop target when it accepts this instance when it is dropped.
public abstract class DraggableTarget extends WebMarkupContainer protected abstract void onDrop(String input, AjaxRequestTarget target);
1
f529014d5a1a319a7734d050f1fcde2f
eee6cb1cfbb913b53a61c593ea909104
Generate name of the file based on letters, digits, length and extensions
{ $charBank = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; $rndString = ""; $explosion = explode(".", $originalName); $extension = end($explosion); for ($i = 0; $i < 20; $i++) { $rndNum = random_int(1, 61); $rndString = $rn...
1
2767a1943f8b00374239b30e32a61ea3
437db76bfdd8eb6c2502091ddf372fc0
将单个 DO 转换为前端适应的 VO
ExpensePolicyDTO dto = mapperFacade.map(domain, ExpensePolicyDTO.class); SetOfBooksInfoCO setOfBooksInfoCO = sobClient.getSetOfBooksById(domain.getSetOfBooksId()); if (setOfBooksInfoCO != null) { dto.setSetOfBooksName(setOfBooksInfoCO.getSetOfBooksName()); } ExpenseTy...
1
d374b82e2d7bc00772123b52732a3aa8
f36b7f10f4db19e994d2eece35249077
写入文件,自带目录存在性检测
function write(srcPath, body, flag="w", encoding="utf8") { checkDirPath(srcPath); fs.writeFileSync(srcPath, body, {flag: flag, encoding:encoding}); }
1
a5203017785b61a413201b6fa5d03290
6177f985927a778c26703c65b9d448bd
解析UV Cookie
{ $up_cookie_arr = []; if (is_string($up_cookie)) { $cookie_str_arr = explode(';', $up_cookie); foreach ($cookie_str_arr as $cookie_str) { $cookie_name_offset = stripos($cookie_str, "="); $temp_cookie = new SetCookie(); $...
1
fb4b082937e9b2c75f2b255b6a35ccee
cc81a0acee02a148e0622ee3cf094745
when zoomed and mouse is dragged, move the image around to see different portions of the image
namespace sdkPhotosCS public partial class AddMember : PhoneApplicationPage void CropImage_MouseMove(object sender, MouseEventArgs e) { p2 = e.GetPosition(DisplayedImageElement); }
0
5ab21939404ef4c9900e663e0c588dad
097dd4552d9af0e00bd310f5922967a6
Validate that the product has been successfully uninstalled
class TestUninstall(unittest.TestCase): def test_product_uninstalled(self): self.assertFalse(self.installer.isProductInstalled( 'plonetheme.booster'))
1
92f8cb0765230c93c2b5191ee17e9100
4423d3c3b47d7ddcfd01aff0a5d17051
Find what side of gradient plane Point is on (gradient plane to waypoint line)
public class MathUtils public static float PointOnWhichSideOfLine( Vector2 _lineStart, Vector2 _lineEnd, Vector2 _point ) { Vector2 diff = _lineEnd - _lineStart; Vector2 perp = new Vector2(-diff.y, diff.x); float d = Vector2.Dot(_point - _lineStart, perp); return d; }
1
efe1587a65cdaf6c77280bf12a8c7dab
73eae0a59d367287f89fe2e1c7439d90
资料库回收站删除文档
$id = $this->getRequest()->getQuery('id'); if ($id) { $data['status'] = 99; $data['updatetime'] = $_SERVER['time']; if ($this->db_document->document_trash($id, $data)) { $redisKey = 'article:detail' . $id; $this->cache->delete($redisKey...
1
f4b54dd8bcc2db1629fcb190fb38171b
d78d8b850d404722258c94dd617ab28c
得到指数的市值加权pe
HashMap<String, StockItem> stockDataTable = StockData.getInstance().getStockDataTable(); BigDecimal allShareIndex; BigDecimal priceProduct = new BigDecimal(1); for (StockItem stock: stockDataTable.values()) { priceProduct = priceProduct.multiply(stock.getPrice()); } double allShareIndexDouble = Math.pow(...
0
d0ccff02d8b3fc6d6d6a87255a4dec8c
5b0a3618446826680c69622def143e81
Sends info about terminating a file session.
char * short_filename, char * file_type, char * file_size) { PyObject * cInfo; if (pyphapi_sfp_inviteToTransfer) { cInfo = Py_BuildValue("(issss)", cid, username, short_filename, file_type, file_size); pyphapi_lock_and_call(pyph...
0
170a8cc79b91e137a04d5a6568f6850b
ba87a0b850f0ad893398855b3d5ca77e
ペアになっていないサロゲートコードポイントの削除
namespace NetSCADA6.HMI.NSDrawObj public partial class DrawCombine : INodeEdit private static void RemoveSinglePoint(ref List<PointF> ps, ref List<byte> ts) { for (int i = 0; i < ts.Count - 1; i++) { int type = ts[i]; int nextType = ts[i + 1]; if (type == 0 && nextType == 0) { ps.RemoveAt(...
0
26eae6d3ab59ed7d0c0541cddd172c9a
296776800d4d65ae9ba78513f4d887da
If frame is greater than certain size it will be decoded differently if unsynchronized to if synchronized Frames with certain byte sequences should be unsynchronized but sometimes editors do not unsynchronize them so this method checks both cases and goes with the option that fits best with the data
{ boolean answer = false; if ( this.isSynchronized == true ) { throw new StegException( "An internal error has occurred in the steganographic program.\n" + "The Decoder was ordered to synchronize twice; the Decoder should only " + ...
0
c19bc9656522ca3cc2f1f19c1a988cf7
6dcbbcac87f8a369a1ebda7e446c77f4
Returns an url to the character's profile on tibia community.
return $url = $this->urlProfile[$this->getBuild()->_characterRg] . strtolower(str_replace("#", "-", $this->getBuild()->_characterBt)) . "/hero/" . $this->getBuild()->_characterId; }
1
78c2d9fb4926163c73636eee173da2e9
d77520dc21dfeaf1e039def67292bf05
The canonical id for this location. For example: "us-east1"..
class GetInstanceResult: def current_location_id(self) -> str: return pulumi.get(self, "current_location_id")
1
a44ffee44b22b340a4a7949062c58e51
3295a95aff744767e738355b69099ab4
Set the minimum magnification that the camera can be set to with this event handler. Setting the min mag to <= 0 disables this feature. If the min mag if set to a value which is greater than the current camera magnification, then the camera is left at its current magnification.
public class SoDragger extends SoInteractionKit public static void setMinScale( float newMinScale ) { minScale = newMinScale; }
1
f0d521e2d972c50b018a12d6dd8832a3
83aee98367fd30bc98e2d6b107936efe
Fires probe event related to the fact the given jdbc connection pool has got a connection freed event.
public class ConnectionPoolEmitterImpl implements PoolLifeCycleListener public void connectionAcquired() { poolProbeProvider.connectionAcquiredEvent(poolName); }
0
9c55b9e1be452b704e114d650a90de56
e3c71ce43062c4ac6bd641fcbea13bc4
Compute number of times collatz function is called iteratively
def collatz_loops(n): if n <= 1: raise ValueError count = 0 while n > 1: if n % 2 == 0: n = n / 2 else: n = (n * 3) + 1 count += 1 return count
1
aec6cea9dcea6a62af4bf869f41a605c
a00769ead1d9f60d2e97887dc48fdbfe
Returns whether or not the RPC not be retried upon encountering a problem.
@SuppressWarnings("serial") public abstract class NingClientException extends RuntimeException public abstract boolean isRetryable();
1
398260a7b8b4e09180b1842040839a93
6f12ea5440973a121e23fd4a366e7fdd
Add our server ports/hostnames to the ArrayList
Message.hostNameValidation(host); Message.portValidation(port); if (!serviceList.contains(host + ":" + port)) { serviceList.add(host + ":" + port); this.sortResponse(); } }
1
8d78f1bcde551ebaf8a43cdd293604a6
67d82b413da844aedfe4aa5c9988da9c
各単語の(アルファベットの)文字数を先頭から順に並べたリストを作成
num_list = [] for word in word_list: num_list.append(len(word)) return num_list
1
8a3a527a1c65bc7e85e4f899350ee9b0
75e18ef9f476d693cd9e285bc94c4a0f
Sets up the page and wraps it in a transition group that provides transition animations when switching between different chapters (for instance through direct links).
chapterId: number, state: ?ChapterPageLinkState, setPage: Function ) { const firstRender = useRef(true); useEffect(() => { if (firstRender.current) { firstRender.current = false; } else if (state != null) { setPage(state.jumpToPage); } else { setPage(0); } }, [chapterId, s...
0
210fa39ca3a62c4284794d99666004c1
dcd03fca8e7d33ea82a8b2e759787ec8
Find all and don't respect Storage
$list = $this->getStorage() ->getQuery() ->accessCheck(FALSE) ->range($offset, $limit) ->execute(); return $this->getStorage()->loadMultiple($list); }
0
3d46c50f1bc921a304f0b373b2b26390
5112053b29a0dc77a1e4247f481d758d
функция выхода из ВК
if (!this.access_token) return fetch('https://login.vk.com/?' + encodeToSearchString({ location: encodeURIComponent(window.location.hostname), token: this.access_token, do_logout: 1, act: 'openapi', oauth: 1, ...
1
22ff2631ffcc56822251a3e928b097bc
9ca86ca20a2f78a7ebcedeceaa113d6b
Returns the bit pattern of a ulong4 as a double4.
FillPrimitiveBuffer( 8 ); if( BigEndian ) return (ulong)( (ulong)pbuffer[0] << 56 | (ulong)pbuffer[1] << 48 | (ulong)pbuffer[2] << 40 | (ulong)pbuffer[3] << 32 | (ulong)pbuffer[4] << 24 | (ulong)pbuffer[5] << 16 | (ulong)pbuffer[6] << 8 | (ulong)pbuffer[7] ); return (ulong)( (ulong)pbuff...
0
9daf57cf6003a8b37cf3657accc79b9f
0fbab5a8679e7005dde7970c7107d85d
Push the game object out side the snap zone.
namespace ZNA public class ZObject : Microsoft.Xna.Framework.DrawableGameComponent public void MoveOutside(ZObject mo, float dir) { while (Collision(mo)) { MoveDirection(dir, 1); } }
1
77f657a9f0066aae3e7cdd6c723d463a
857312bb6db996db8c6257ec57ed049e
删除一行的方块
function clearLine(arr) { $(arr).each(function () { $(this.elem).remove(); aTetris[this.fatherIndex].aDiv.splice($(this.elem).data('index'), 1, 0); }); }
1
0fd1b713a37fbadbea4c5cdd9dbacadd
f10dae3384b2077a07507ca74ef7ad85
Load a JPG image from a file
def load_jpg(fdir): image = tf.io.read_file(fdir) image = tf.io.decode_jpeg(image) image = tf.cast(image, dtype=tf.float32) return image
1
05dcc2f1c28b9e4935614ee44a9457b6
0001168f420e88a1519543150b444292
Add the current instance to configured ELB Target Group. Assumes that this code is running on an EC2 instance.
def add_instance(lbname, instance_id): elb = connect() return elb.register_instances(lbname, [instance_id])
1
6f22dc924914532c516e8606f282a883
474959bf5f3a4fc8340fa3bf84275ed8
Sorts the composite serializers according to their priority.
this.systems.sort(function (a, b) { if (!a.Priority && !b.Priority) { return a.AddOrder - b.AddOrder; } if (a.Priority === b.Priority) { return a.AddOrder - b.AddOrder; } return a.Priority - b.Priority }); ...
1
b12c0ec3be4e53686f116174432972d4
ec26199a94a3aacb52aa7935a631383d
zoom out of display image
class XRayViewerGUI(QMainWindow): def imageZoomOut(self): self.imgZoomInB.setChecked(False) self.default_img_zoom = None self.img_zoom = None self.refreshImageTab()
1
cb883c21e0d931e246192c98c69439aa
2243c8478f0ad7b8f8785d88a637f6d0
更新微信群的persona设置
def update_zg(text,**kwargs): try: wumis.Update_zgname() return '更新成功' except BaseException as e: logger.debug('update_zg') logger.debug(e) return '更新失败'
0
2b85d9b64be8254b3db41e7d2f636026
95177882a0d6e0743d837c63be99cad2
reloadFixtureList() Method: Completely empties and (re)loads the fixture list.
export class TestUtils public async reloadFixtures() { await this.cleanAll(); await this.loadAll(); }
1
3908311f94b51084a113d794db0c6cef
de45a7b1f489ad5cd9c8053bdb6707e3
Loops over payload items. For each item: - applies methods given in methods list. - calls function reference given in function argument using item as argument.
for function, paths in self.functions: if item.match(*paths): args = len(inspect.getfullargspec(function)[0]) if args == 0: content = function() elif args == 1: content = function(item.data) elif ...
1
00cb8f7a696921d627b1d1f7ac9b7c46
e0ec54fe6e3542aa8fe76c8f6adb495d
将html字符转译成html字符实体(只适用于浏览器客户端)
function transferHtml(params: string) { let str = params.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); return str; }
1
ebaee713b8797aa02055f4088f6a0b7f
35d552302691337e28273e8b587cbb2c
https://stackoverflow.com/a/1909355/2925169
def progressbar(it, prefix="", size=60, file=sys.stdout): count = len(it) def show(j): x = int(size*j/count) file.write("%s[%s%s] %i/%i\r" % (prefix, "#"*x, "."*(size-x), j, count)) file.flush() show(0) for i, item in enumerate(it): yield item show(i+1) ...
1
d82f7d51314ff533feb892ed2f7be5ba
c371909ed7f02197f58e0fcc75389c41
Give another user permission to use an app, or give another user system administrator privileges. Usage: deis perms:create <username> [--app=<app>|--admin]
args = loads(json) print args caller = self._whoami(args["caller"]) target = self._whoami(args["target"]) if (caller is None) or (target is None): return dumps((False,)) if not caller.admin: return dumps((False,)) target.admin = True db_session.commit() return dumps((True...
1
d5c54dd1d432ac229d0cac06a687ac91
db190a8a71c496fed07a724241592d15
Collect all the info that we need and forward to the gateway
class MIGS extends WC_Payment_Gateway public function process_payment( $order_id ) { global $woocommerce; $customer_order = new WC_Order( $order_id ); $protocol = (!empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $payment_fields = arra...
1
d7b260d4c3f68bbd6c290d1a9341a3d2
d4dcd23a5bac64ce30e9db45ad7b7f62
Loads all of the data in a csv file and returns the data and header
with open(filename, 'r') as out: data_csv_reader = csv.reader(out) headers = next(data_csv_reader, None) raw_data = [row for row in data_csv_reader] return headers, raw_data
1
780032ab71ba950de48e812186f26e97
f29d9798b5432eb2900013e97eb9739e
Returns the meta object for class '{@link org.shaolin.uimaster.datamodel.pagediagram.DynamicOutType <em>Dynamic Out Type</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getDynamicOutType();
1
a497da62d59c8134c54fa8ef56c8f295
8d6b6669be0d669aad1c53ae1ff92ada
purge assertions that say something is contained within itself
def assertion(assert_text): return "(assert\n" + assert_text + ")\n"
0
efaf6313604a7a83098259aca15632c0
81592f718c3016c1c4c0fa1bf7c4d886
# Number of estimates
nmeasures.sentomeasures <- function(sentomeasures) { NCOL(sentomeasures[["measures"]]) - 1 }
1
0f6430e86cc68d187f19bd2e7a05ae4f
2f2532b21baf2fd1ffe03c563a50a0c8
输入该课程的主页地址,得到所有视频的下载地址
def get_videos(self, url): video_urls = self.get_video_urls(url) print(video_urls) self.save_video_urls(video_urls)
1
182a2c6399c3784dcc07598a5b5ac192
f83b8dff25d185cc001554b0cd469ad5
Actually the same for now.
void CentralBureaucracy::forSakeOfCoplien(void) const { return; }
1
5112475c1d3a49e5f8e25e64d5a07f9f
c41eabec38440abbe6f335e3b9ed7186
------------------------------------------------------------------------------------------- Check Player画面に移動する。 -------------------------------------------------------------------------------------------
function movePlayer() { if (player.mx < 0 && player.my < 0) return true; var x2 = DISP_COL * TILE_W / 2; var y2 = DISP_ROW * TILE_H / 2; var ax = player.mx - x2; var ay = player.my - y2; var x = player.x, y = player.y; if (Math.abs(ax) > Math.abs(ay)) { x += (ax > 0) ? 1 : -1; } else { y += (ay ...
1
75940c38209ffd629999023835b335c0
88ec208c25a56e3ef0a279f4d71d5fbd
画像の傾き検出
{ if (this.pbImage.Image != null) { Bitmap bmp = (Bitmap)this.pbImage.Image; int theta = processor.Hough(bmp); pic = processor.RotateImg(pic, -theta); this.pbImage.Image = processor.Ostu((Bitmap)pic.Clone()); } ...
1
570c065135b604bb0894ef50e2680054
afa7ff5afe1f931043760dc924dda127
分不同身份执行审核通过的操作
var selectList = table.getSelecteBeans(); if(InfoBaseRPC.passInfoStatus(selectList,LoginUserBean.user_id)){ top.msgAlert("审核操作成功"); }else{ top.msgWargin("审核操作失败"); } reloadInfoDataList(); }
0
5c7c74e0701161a0eb9653737496b360
3059da7803a29a10c331f378af2cd455
Multi-Publisher Console redirect
{ $this->authorize(); $consoleViewPath = $this->getConfigItem('console_view_path'); Helper::$sharedTemplateVars['config'] = $this->getConfig(); echo Helper::template($consoleViewPath); }
0
61336ea283d303befce26ba20a8ce5da
5147ba8c7ffb0535115454e97557811c
转换阿拉伯数字为汉字
public class NumberConventer public static string ChnToArab (string word) { string e = "([零一二三四五六七八九十百千万亿])+"; MatchCollection mc = Regex.Matches (word, e); foreach (Match m in mc) { word = word.Replace (m.Value, Word2Number (m.Value)); } return word; }
0
a22dfb1ccde578850f436a0f2e173eb9
7ed455f7e4fae74da3d0aa8fa084c37e
Calculate the term frequency–inverse document frequency for all tokens
self.doc_size += 1 tf = compute_tf(tokens) self.tf[doc_id] = tf for k, _ in tf.items(): self.df_corpus[k] = self.df_corpus.get(k, 0) + 1
0
e9d0927867d809e9dfdc26d2cc2d30f4
95430d77aabf495427c975e03eb3c0c0
コマンドを指定して行を終了。 行サイズとコマンドを出力した後、pending状態の行を出力
{ $lastLine = system($command, $status); if ($status) { if ($lastLine) { $this->out($lastLine); throw new \RuntimeException($lastLine); } $this->out('An unknown error occurred'); throw new \RuntimeException('An unknown error occurred'); } return $lastLine; }
0
3c5fd5f3dc8d886218b230199e285add
ba278b805ad14d0ecde4feb73619e91f
Sets the value for bids_meta/SpacingBetweenSlices.
public class BarType extends AnalysisOption implements Serializable, Cloneable, LineTypeConstantsIfc, AnalysisOptionConstantsIfc public void setSpaceBetweenBars(double arg) { this.spaceBetweenBars = arg; }
0
83c55f2f82fa8b0b1807904a5bfca8f0
87f07a8b6819a72a37bff110c7d0266f
获取约见个数
public class ConferenceInformationFragment extends ViewPagerBaseFragment private void getActualNum() { GetActualNumRequestBean getActualNumRequestBean = new GetActualNumRequestBean(); getActualNumRequestBean.setMeetingId(meetingId); networkBroker.ask(getActualNumRequestBean, false, (ex1, res) ->...
1
6f8ed265b5174d0908efa8261a2d2a6b
21cf7bbfe053b97af2ce1e8244cbf61f
@brief The function is to add one vlan classification rule
traffic_classifier_name = 'c_vlan_%s' % vlan_id traffic_behavior_name = 'b_vlan_%s' % vlan_id traffic_policy_name = 'p_vlan_%s' % vlan_id acl_number = str(int(vlan_id) + self.__acl_number_shift) input_expect_pairs_list = [ ['traffic classifier ' ...
1
57fe5cbc3ecc8216172ddaf70f9995bb
7f9afe3605e6273789c0e734eea611c0
Tick down invincibility
public class Player : Entity private void ResolveHurtCounter(){ if (GetInvincible () && hurt_ticks_ == 0) { GetComponent<SpriteRenderer> ().color = normalcolor_; SetInvincible (false); } if (hurt_ticks_ > 0) { hurt_ticks_--; } }
1
37560d738762b98bc0c1fbdb8c714ba8
70e4afa38cf3badef103585f24362f79
Updates a piece's move set by request.
namespace EZNEW.Cache public static class CacheManager public static async Task<CacheCommandResult<SetMoveResponse>> SetMoveAsync(SetMoveCommand command) { return await ExecuteCommandAsync(command).ConfigureAwait(false); }
1
6aafc25e4228412c127f1dd72ef50bcd
b327a1443a9b3e436e557978bad34cb4
Retrieves a list of all the threads running in the process.
namespace NtApiDotNet [NtType("Thread")] public class NtThread : NtObjectWithDuplicate<NtThread, ThreadAccessRights> public static IEnumerable<NtThread> GetThreads(ThreadAccessRights desired_access) { return GetThreads(desired_access, false); }
1
3e1d1c5aa5554dc3bba8fae819df36c0
932a658f7b3e836d24c8c30ebaae51f4
Request domain registration. Should return an operation ID.
void registerDomain(RegisterDomainRequest registerDomainRequest);
0
e31aa9fd7646fc83e71cba2bb029de42
a144e1c7a24613a3bf4b08c77b30e5cf
Get the configs for the {@link KafkaProducer producer}. Properties using the prefix {@link #MONITORING_INTERCEPTOR_PRODUCER_PREFIX} will be used in favor over their non-prefixed versions .
kafkaProps.clear(); kafkaProps.put(ProducerConfig.ACKS_CONFIG, DEFAULT_ACKS); kafkaProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, DEFAULT_KEY_SERIALIZER); kafkaProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, DEFAULT_VALUE_SERIAIZER); kafkaProps.putAll(context.getSubProperties(KAF...
0
ab57ed405c1b96be57fcd168ffd0541d
81efaeb240b58d7e3249f2d071c1abde
ゲージの表示非表示を設定する
public class UIManager : MonoBehaviour public void SetActiveWindGage(bool isActive) { windEmptyGage.enabled = isActive; windGage.enabled = isActive; }
1
466303d4e78206033ef4eaf2ca2b9ded
69e84be991ce4ac74bc120e85f795f22
获取表单名称
class FormTable public function GetName() { return $this->mForm->GetName(); }
1
15f51941de2f3bf27ccde8af51c72167
541101e0da210e55afd357e635d6a49f
Get the value of Caminhao
string Caminhao::getTipo() { return "Caminhao"; }
1
e61bbd497a170fa1d430b9336ff1059b
c7f398fd50f2470be87c3787462cef5b
Draw square using path at (x, y).
pts = array(((x, y), (x, y+sy), (x+sx, y+sy), (x+sx, y),)) self.lines(pts) self.close_path('rect')
1
af6e620b67d43530da0963d1c48f0678
6cf2d09624f87a5b2dee6acd1e7b6635
Count the number of now playing.
{ FILE* file = popen("pgrep -c play", "r"); int val = getc(file); if (val <= '0') return 0; if (val == '1') return 1; if (val == '2') return 2; return -1; }
1
8a1378e77db85b16910fbab3db00d577
ac30af4a29d5aebc3e8ab05f135755f9
(number) -> number Returns the area, in square miles. Argument: sqMeters -- any number, representing square meters
n = AsNumber(sqMiles) if n: return (n*2589988.1103) else: return 0
0
04c1cad8ee7949443fdd2479d20eeb95
951dc7dae60acc13080e71a5cb3c43d1
获取一个竞赛团队下的作品及其对应分数
class teacherInterface{ get_teambyComp(keys,CompId,limit){ return new Promise((resolve, reject) => { let bkeys=keys let akeys=['IsPass','teamCompId'] let on={teamId:'teamId'} let condition={CompId} let sql=sql_func.query_multiple('teamcompetion','team'...
1
a900aa47fb204e976c2e49a50c2a7974
4f137f5b89c978e7b6f7b23d55bb2e66
Performs assertions shared by all tests of a test case. This method is called between beforeEach() and test.
ForTestAssertion forAssertThat();
0
179fd89c8cb359305f24cf5f16e5843c
2770b1558aff81aa0ebf9c164fb70281
Create weighted array of simulated emission line along one line of sight (LOS)
temp_arr, vel_arr, dens_arr, vol_arr = data_arr weights = np.array([]) weights = np.resize(weights, (NUM_BINS-1, 1)) for q_coord3 in range(len(temp_arr)): cell_temp = temp_arr[q_coord3] if HI_filter(cell_temp): vel = vel_arr[q_coord3] mass = M_AVG*dens_arr[q_coord...
1
970618c9c3241df904ebc45450be049d
25611a9269dfa0d277f1d7ddea3e506f
функция выводит блок капчи
{ $captcha = new \Lib\Captcher(150, 65); $captchaImage = $captcha->generate(); $captchaText = $captcha->getCaptchaText(); $_SESSION['captcha-protection'] = $captchaText; $picture = base64_encode($captchaImage); $data = array('status' => 1, 'picture' => $picture); $this->dataPrint($data); }
1
e2ef3ad3354fcdf7fff4fd9a7f463789
ef6ea6cf41c231b335f36839e03996ba
ニュースレターを送信する
mail_send_rslt := []entity.Mail_send_rslt{} mst_ssmlknr := []entity.Mst_ssmlknr{} Rslt := entity.Rslt{} db := open() count := cnst.ZERO sendno1 := cnst.ZERO db.Find(&mail_send_rslt).Count(&count) sendno1 = count + 1 sendno2 := sendno1 + 1 tnntid := cnst.TNNTID u, err := uuid.NewRandom() if err != nil { fm...
1
396314cd0c2c54e2cbc9b414947badfa
60095f630ef23e5ccf8f82cc387e449d
Unzips zip file <code>zip</code> to directory <code>workingDirectory</code>. <br/>Uses {@linkplain FileTreeCopier}
public class IOHelper public static boolean unzipDirectory(File zipFile, File outputDir) { try { if (!zipFile.isFile()) { return false; } if (!outputDir.mkdir()) { return false; } start = System.currentTimeMillis(); ...
0
d5170dcf7cb2f72fb02b4938eb303874
f60e924f9d001ae3cae15bdea4cc64f2
是否开启UTP带宽控制(默认是关的,开启后下载速度会变慢,不要开)
public class MainActivity extends SlidingFragmentActivity implements Icloseable private void setUtp() { if ("no".equalsIgnoreCase(LetvApplication.getInstance() .getVideoFormat())) { PreferencesManager.getInstance().setUtp(false); } if (PreferencesManager.getInstance().getUtp()) { p2pService = new LeServ...
1
29116bbb96641f2a9a58c8949dc40d6b
a9bf1b6ab7dd195df976d93e31f8a892
按照出发城市,到达城市,出发时间查询航班
List<Flight> findAllByDepartureCityAndArrivalCityAndTakeoffDate( City departureCity, City arrivalCity, Date takeoffDate );
1
5f137a6c735ba3bdf56a963c8296dc5f
eb786d3000f36b8f07bbcc31d2037548
Test that LCA on null graph bails.
class LowestCommonAncestorTest @Test void testEmptyBST() { BSTLowestCommonAncestor test = new BSTLowestCommonAncestor(); Node output = test.lca(null, 0, 0); assertEquals(null, output); Node output2 = test.lca(null, 3, -1); assertEquals(null, output2); }
1
7c99243f6db818eec25c188fd6ba15b8
cf16d33b7f10f05ea257af36808fbe26
检查是否有解锁提示
try: tip = fin_ele(driver, 'id', 'com.oceanwing.battery.cam:id/tip_top') print(tip.text) result = True except: result = False return result
1
7576a63afa3e5575ce6e9e9f170464b0
7e30d084e9f861e0c2d478e3968b6998
生成全部结果线性图
plt.figure(1, figsize=(14, 8), dpi=90) count = 1 for k, plot_n in enumerate(out_plot,0): plt.subplot(330 + count) for i,item in enumerate(metric_source,0): data_path = item[2] data_path = os.path.join(PROJECT_DIR, "CDGAN/cache", data_path,"metric.json") da...
1
8e0f52c51f3958c8fcc7226563f89382
b910fec0436c54ac09a17b07cd5b8474
@brief Chek if collected data is OK
bool RUNTEST::isCollectingData() const { return m_dataRefrTimer->isActive(); }
0
02dab5e085c3e58e986d41b6b2504f61
6118e03b90cda281573b00e5b4abeb6a
Checks if slurm is available.
if (find_process_name('vertica') is not None and find_process_name( 'spread') is not None): self.available = True
0
9a126f0c25d70c025ff2a8a4fe8ca63a
11207ca0b4923142893f2f0469bf318e
Decodes instructions starting with 0x0.
public abstract class InstructionFactory protected abstract Instruction uncheckedDecodeInstruction(ByteScanner scanner);
0
2ee9d774d47613ba0923d831f8f8339a
48bd1e6b2f68943f4074d2efc50c4466
拼接单价信息
String value=""; for (int i = 0; i < produceDetail.getSizeQuantityList().size(); i++) { String name = produceDetail.getSizeQuantityList().get(i).getSizeName() + ":" + produceDetail.getSizeQuantityList().get(i).getQuantity(); value = name + " " + value; } total = p...
0
9d5d481d364174a2f44af9049c175ee3
3b06eaac14926dd77f69f102384559fd
Set the input types for Maps.
public function mapTypes();
0
2582857e73c9b095a23dc6ed7520fb65
3340aa09b50562d40af2c15577637fd7
返回生成树的权值和和生成树的父亲节点列表 根节点父亲节点为-1
node = 0 while self.V>0: parent.append(node) node+=1 self.V-=1 return parent
0
9e119679949867b3aca5ec3223176229
c7eb67e68237dfea4eff03fd71001c89
Alaphelyzetbe állítja a játékteret.
namespace Menhely [DataContract(IsReference = true)] public class Allat public void SzabaddaTetel() { Allapot = OrokbefogadasAllapot.Szabad; Orokbefogado.OrokbeFogadando.Remove(this); Orokbefogado = null; }
0