query_id
string
corpus_id
string
query
string
code
string
label
int64
563d6632b4a451ff1b47399e8ca7c73a
367d9cbe0441b85b6d0ab08cae61039d
主要測試函數,透過迴圈把不同題目類型的題目進行填答。
{ $array = []; $sourceUrl = env('APP_URL', 'https://325a54bd419f.ngrok.io/fbchat_api/') . 'source/'; $question = [ 'Q1' => [ 0 => [ 'txt' => "My youth, my youth is yours🎵Trippin' on skies, sippin' waterfalls", 'btn' => [ [ "type" => "postback",...
0
021c5d3a69a65257c67d1b15e0536ef6
43f44b6bf3ba02b0262ea931a5cc05c9
familyNameKanaを設定します。
public class GoMypageDTO public void setFamilyNameKanji(String familyNameKanji) { this.familyNameKanji = familyNameKanji; }
0
1924e41b8da9da8402206c9d1efdfac7
4486594e11313c5b52f3e333abf39bf6
通过状态编码查询逾期设置
Map<String,Object> findSts(String ordNo);
0
8a900282c9d4c3d1b744026a66e56516
afa8e47c126cab0ed9249928cdb9742f
whether report has valid table
{ if (rt == null || rt.getReportTypeId() == null) { return false; } else { return true; } }
0
7c3cf42c546e563400b1e2977db63cde
c3b8e5c26eb99414ba7c0e75f4a1d14c
Gets a string of a particular length from the text sequence as a string.
{ if (string.IsNullOrEmpty(inputText)) { return string.Empty; } string outputText = string.Empty; try { outputText = inputText.Substring(startIndex, length); } catch (ArgumentOutOfRang...
1
c73bcf6a86ef91ae9236ff855ea39227
2631bb308276e1be1c35cb0c4e0f7737
设置航材数据
function TaiGuXuanJingCache:setTaiGuData(data) self.TaiGuData = data end
0
fc797edabf81147d87ca06adf75a356f
b9cf35d46d13e1eda2267d05a8fcba7e
获取String值。若key不存在返回null。 若share问价中不存在key,则返回null。
public class SharePreferenceUtils public String getString(String key) { return preferences.getString(key, null); }
1
ce681fd17ceaca880eab0fc83f045caf
653db834682600446745a81123bb3f22
Hides or shows the Q Set Explorer.
class uiSettings(object): def _toggle_settings(self): self.q_widget.setVisible(not self.q_widget.isVisible())
1
f3714137d84b46653b1497d57746e6b6
0167a3de141a2c4527c78cbdba5e8abe
DEVUELVE TODOS LOS LIBROS FAVORITOS DE UN USUARIO
class User extends Authenticatable implements MustVerifyEmail public function books(){ return $this->belongsToMany(Book::class, 'users_favorites'); }
1
247832bfe96f29791235ce6eb1884fc6
06af505041c7eda475c95b21beb6fa97
Build from cube ID.
namespace HexagonalMap.Domain.HexMap public static QRCoordinate FromCube(int x, int y, int z) { return new QRCoordinate(x, z); }
1
2591f402f7e774f971108970faae2120
218bf4a51515a41653c490b6301e4bd1
根据书号和销售任务id判断是否买过此书
List<Borrow> isBorrowed(@Param(value="userid")String userid,@Param(value="bookid")String bookid);
0
9fe7e1f815f90a9396e10523c32ecb9a
0538da03674aed72b5d68808748b0ba3
Registers the <paramref name="serviceType"/> with the given <paramref name="instance"/>.
namespace System.ComponentModel public static class IServiceContainerExtensions [SuppressMessage( "Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated by a code contract." )] public static void AddService<TService>( this IServiceContainer serviceCon...
1
46d90159fb1ab8ae4d7dded39a1d4c5d
3c6f0a1b10176e27fc0841dc2b3076d3
Set if the message of the UPnP Stack should be reported or not
class Monitor public function setReport($bolReport) { $this->_bolReport = $bolReport; return $this; }
1
fa68e026f235b0b4206179e103ab319c
2f61b1d51c42913696d0e665419b4e6b
Reader for datasets. Allows to iterate over the the rows in a dataset. Rows are lists of values, one for each column.
for fields in islice(reader(get_file(f), delimiter=delimiter, quotechar=quotechar), header_rows, None): yield fields
1
9f493a177eccdad6a9aac21ca935cff3
a88e195564442ac348cc7131cf5d675e
Get ImageResizeDefinitions for all defined widths
class Lazy_Resizer public function get_image_sizes() { static $sizes = array(); if ($sizes) { return $sizes; } global $_wp_additional_image_sizes; foreach ( get_intermediate_image_sizes() as $s ) { $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => false ); if ( isset( $_wp_additional_image...
1
ce8ef2fb6d620a2a4265b9e8ae0f64d5
ff97c7880bb259f39a81e895b9dfa124
Move the face along the normal.
namespace PixelEngine.Utilities public void Translate(Vector3 translation) { distance += Vector3.Dot(_normal, translation); }
1
7113d2f9a4ad3a4c46811e3d37b2dc61
5cac64bdfc7fbd16338717f7fab7cc3c
Checks food preferences versus a recipe
if ((color_selection === "Blue") && (animal_selection === "Cat") && (food_selection === "Pie")) { return "Beach"; } else if ((color_selection === "Red") && (animal_selection === "Dog") && (food_selection === "Cookie")) { return "Adventure"; } else if ((color_selection === "Yellow") &...
0
20fe7ba087dccf6f289f52f338d793f1
f830187f02cb42d756ab84930ff7d595
Verificar a exibicao ou nao da caixa de exclusao
public class PlcExclusionBox extends PlcSelectionBox @Override public void encodeEnd(FacesContext context) throws IOException { if (getValorChave() != null && getExibeCaixaExclusao()) { super.encodeEnd(context); } }
1
60a7f3dcac4c7654cd28f8893d22c559
82162c4dce5a7231113f05b84eb8ed77
Reject friend request or ignore follow request
[Authorize] public ActionResult FriendRequests(RequestResponseFormValues values) { if (!ModelState.IsValid) { Response.StatusCode = (int)HttpStatusCode.BadRequest; return this.View("BadRequest"); } if (values.Accept)...
1
452f88db47bc1025d196f6350bd398c8
37a0e18e2f721c2c07a1e5d5b8b1e904
Set the selection type on the selection column.
class MultiframeList(ttk.Frame): def _cnf_selection_type(self, _): self._selection_clear()
0
91254397016a33d65abeacccc067d4da
eeaecf9ee8b458d037fea5943fcd9c82
插入元素,并调整使维持大顶堆的性质
public class HeapMin public void insert(int elem) { size++; Heap[size] = elem; int current = size; while (Heap[current] < Heap[parent(current)]) { swap(current, parent(current)); current = parent(current); } }
0
44f2b7391f1e7e079037374ae2eba7b6
25f03e6c3f7e2eb7c0e11e5753661518
得到utf格式的字符串,可应用于下载文件时,对文件名的处理
public class DBDownloadAction extends ActionSupport public String getFileName() throws UnsupportedEncodingException{ try { fileName=new String(fileName.getBytes(),"ISO8859-1"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return fileName; }
0
913d2cffc4065131ecb884d29d93660c
ecb5fb483145fb735de339ba0674b2fc
Subtracts counts from another counter.
{ $result = new static(); $bothMember = (new Set($this))->union(new Set($other)); foreach ($bothMember as $elem) { $newcount = $this[$elem] - $other[$elem]; if ($newcount > 0) { $result[$elem] = $newcount; } } return $result...
1
76dfb4a75285417e1122d904ebcb1cab
2074bf298bfd5586d80a0cec789b2f5b
Prepare the element to be displayed
$attributes_property = ($this->hasWrapper($element)) ? '#wrapper_attributes' : '#attributes'; if ($webform_submission) { $element['#webform'] = $webform_submission->getWebform()->id(); $element['#webform_submission'] = $webform_submission->id(); if ($this->isDisabled()) { if ($webform_...
1
8c08bb731d8694c43a26245b3a9b3395
38fc30b8d7d1c8383f375862131339e0
获取收货地址的行政区划编码,《sys_region》的区县行政计划编码
@Service("Order") public class Order public long getAreaCode(String receiveAddress) { long receiveRegionId = 0L; JMap param = new JMap(); String[] arrAddress = receiveAddress.split("/"); param.put("city", arrAddress[1]); param.put("area", arrAddress[2]); List<JMap> da...
1
a282997099a1a7e6e8cd1d684c7a3487
d24a34ef9bc3a3dc1e9792823bc74f3e
Gets (as xml) the "Label" element
public class MSVSSLABEL extends MSVSS public String getLabel() { return m_Label; }
0
a0440bae878a476699df150829f3ef11
b39cfe7a324aa6f47cc6907d041143b4
ucloud host 信息字段 与CMDB 字段对照,转换
host.setAlias(hostBean.getHostAlias()); host.setHostId(hostBean.getHostId()); String hostAlarmCode = hostBean.getHostAlarmCode(); if (!TextUtils.isEmpty(hostAlarmCode)) { if (TextUtils.equals("000", hostAlarmCode)) { host.setIsAlarm(false); } else ...
1
8a87dcb1b7bf8ffb8e03a8f7e62ce895
5e425cf013ac4b527b1f25d839218ff5
Returns the meta object for the containment reference '{@link net.sf.smbt.osc.oscDsl.VarDecl#getInit <em>Init</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getVariableDeclaration_Init();
1
ad595b71bd6b9c580bc6a3c90318ee51
4d03125e73f545225925dcf334f59c25
Set the delay expression
{ if ( delay < 1 ) this.delay = 1000; else this.delay = Math.round( delay * 1000 ); }
1
212368eabb0ccfbc61b32b4c67392e2e
6217808c61b50ac299e64a80517a1d80
异步增加一个帖子的分享的次数。
class RegisterController extends Controller public function actionAjaxaddsharenum(){ $config=StrasbourgConfig::model()->findByAttributes(array('name'=>'h5sharenum')); $content=$config->content * 1 + 1; $config->content=$content; $config->save(); }
1
f8be2c298b8ddc64fd92f6ccf7d17ceb
ad12edbc622e39a2185d4141e2ca255b
Enables or disables the queue store.
class Connection(requests.Session): def queues_enabled(self, value): with self.lock: self.__queues_enabled = value
1
334ad8b14d0d4c5b423432f79d066db6
c3a9b3305b78310e7eef6f4dcd9f9c36
케임브리지에 거주하는 거래자의 모든 트랜잭션값을 출력해라. -- 맞긴함
public class TestLambda1 @Test public void fun6() { transactions.stream() .filter(t -> t.getTrader().getCity().equals("jdz2")) .map(Transaction::getValue) .forEach(System.out :: println); }
0
b5c7e1dafaaf036763cd4affcbe3a240
a7c90485b7e008725d984af4db9c4e70
Check if the 2 dates are on the same day
function isSameDay(first: Date, second: Date): boolean { return first.getFullYear() === second.getFullYear() && first.getMonth() === second.getMonth() && first.getDate() === second.getDate(); }
1
c0a69e587d28b7a1f2e9367187d93f51
646217230040071d0320a8298e1867c2
When running the parser against real content a silly mistake was found where an "ELSE" inside a comment would be treated as a real ELSE and result in an exception being raised when the real ELSE keyword was encountered
def test_fparser2astprocessor_handling_if_construct_errors(f2008_parser): from fparser.common.readfortran import FortranStringReader from fparser.two.Fortran2003 import Execution_Part reader = FortranStringReader( '''if (condition1) then elseif (condition2) then endif''') fake_pa...
0
eb55bdfc56fd0e0e6def897a635ffbb6
75a3b08031ea656e6914f1dbe1efd123
按照字母顺序排序(不区分大小写)
func sortString(str string) string { bytes := []byte(str) sort.Slice(bytes, func(i, j int) bool {return bytes[i] <bytes[j]}) return string(bytes) }
0
c34c281aeb6f612b99614d929ed44700
38181a3ca8eda6a04e855d853a68c5b3
Check Latvia VAT number.
if len(vat) not in (10, 12): return False try: _posint(vat) except ValueError: return False if len(vat) == 10: coefficients = (2, 4, 10, 3, 5, 9, 4, 6, 8) check_sum = sum(i * int(n) for n, i in zip(vat[:-1], coefficients)) return (check_sum % 11) % 10 == i...
1
dc8a0902600d929285a8ef759c73e515
57679b19fd893586a0c3a5001912d0ca
\callgraph \brief get pH and EC readings and return a pointer to the variable holding the measurements.
bool Sgp30Device::getRawSignals( unsigned short * h2, unsigned short * ethanol ) { if (!getValues(Sgp30Features::MEASURE_RAW_SIGNALS)) { return false; }else { *h2 = m_buffer[0]; *ethanol = m_buffer[1]; return true; } }
0
158273e28489efc2690bc362d6b7d240
717dcc4e0de91de640c6119f8c626a57
Продлить подписку локации на категорию
{ if ( ! $userID) return; $user = Users::model()->userDataByFilter($userID, array('shop_id')); $shop = array(0); if ($user['shop_id'] && ! Shops::abonementEnabled()) { $shop[] = $user['shop_id']; } foreach ($shop as $shopID) { $limits = $this->...
0
0962a23d0204754b466c0600409da9a5
aed75c681a759fb5d9877862531c82b6
Normalize a matrix using the previously calculated aggregate statistics
class STGCN(pl.LightningModule): def _normalize(self, mx): rowsum = np.array(mx.sum(1)) r_inv = np.power(rowsum, -1).flatten() r_inv[np.isinf(r_inv)] = 0. r_mat_inv = sp.diags(r_inv) mx = r_mat_inv.dot(mx) return mx
1
2065b748a4eeb57c886d91d9bdbf9fb6
7e101719e4f60735b7f9c5ab547b7159
Returns the meta object for the containment reference list '{@link org.eclipse.xtext.xdoc.xdoc.TableRow#getData <em>Data</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getTableRow_Data();
1
2d358254ef6355f9b58a665dbc96b307
c99b95817b876c0e1da2156aac846728
Puts single quotes around a string
class Access private fun String.q(): String = "'$this'"
1
fd1854afaf07f476e93dcb8943c84a8c
16113455d2d1b9237224c06b700e970a
Delete the specified job log
void deleteJobLog(SJobLog sJobLog) throws SJobLogDeletionException;
1
18c1e30133b37293ad528df18fbf6341
1c33ed4c60b862bb2fd8ef99460d2ec1
When our app loses activation, close the drop window.
namespace REST_SampleCode sealed partial class App : Application private void OnWindowActivated(object sender, Windows.UI.Core.WindowActivatedEventArgs e) { if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated) { settingsPopup.IsOpen = ...
1
46895a1bcd5f6c6dfb800b50795d469d
6c985d4e8cbc55a57497387fd5d07bbd
Set the turret type. -1 is no turret.
public class Bullet : MonoBehaviour public void setTankType (TankType type) { tankType = type; }
0
819f05566d3837fb2bbe6a57cf5aa525
7f3ee60a893f2d186c9f9729d85f5912
Removes the binding that the cancel button will have to <see cref="LoginOperation.CanCancel"/> while an operation is in progress and makes it enabled again
namespace SystemPlus.ComponentModel void ResetCancel();
1
91a2828b326a0d4fd17e8b82e6dcfd7a
9dd2f8af29f006d5a30f687b98c19f63
# This script will initialize global variables with the names/paths of working directories
go_JHU_GACD <- function() { setRootWD() setwd("./JHU-GACD-ProgrammingAssignment") print(getwd()) }
0
38217b6f2da8f0d45b4fcdedc96e538f
b51910809c4b64bfbe3cf6afd427617c
Replace '/'s with '.'s and add '[*]'s as required by jsonpath_rw
return _.map(path.split('.'), segment => { if (/^\d*$/.test(segment)) { return '*' } return segment }).join('.') }
0
6ff60b46509609ccc26ef81242ed4c1e
c03137e46ecaf3873c9ff88ccafeb298
Returns Operand Index for the constant extended instruction.
impl OpCodeInfo fn mvex_conversion_func(&self) -> u32 { self.info.mvex_conversion_func() as u32 }
0
e5cf19e1d4aa35e7fd4e52bab8a13dcb
80eb0aec8b667b84a4cee832d7d3b4a7
преобразование view->data
class ProducerHelper extends SoapHelper public function processBeforeView($rows, $viewTableFields) { $list = []; foreach($rows as $key => $row) { $oneRow = ['id' => $row->id]; foreach($viewTableFields as $fieldkey => $field) { if(isset($row->{$fieldkey})) { swit...
1
aded938583cf00e408cdcb9a63d24d23
fc50faba7084554a389828b3ace9414e
prints the linked list at the given index of the hash table
{ HashNode *pHarshNodeHead = NULL; if (pos >= SIZE) return; pHarshNodeHead = hashtable[pos]; if (NULL == pHarshNodeHead) printf("NULL == pHarshNodeHead\n"); while (NULL != pHarshNodeHead) { printf("Position:%d, key:%s, value:%d \n", pos, pHarshNodeHead->pkey, pHarshNodeHead->value); pHarshNo...
1
74ac4c8656decf62ca14e0e3afb767a9
3e9f254546efa3b2aec97f9d405067df
Translate host into ip
{ struct hostent *hp; unsigned long host_ip = inet_addr(host); if (host_ip == htonl(INADDR_NONE)) { hp = gethostbyname(host); if (hp) host_ip = *(unsigned long *)(hp->h_addr); else return INADDR_NONE; } return host_ip; }
1
7db4f49db49a12d71fa93a6ba83c614f
0a2989160a4b3396f24f56a6d5d0c999
添加出款服务重试计划表【WithdrawRetryPlanDO】对象信息
@Service("withdrawRetryPlanManager") public class WithdrawRetryPlanManagerImpl implements WithdrawRetryPlanManager @Override public int deleteByPrimaryKey(Long planId) { int rows = withdrawRetryPlanDAO.deleteByPrimaryKey(planId); return rows; }
0
45f8832803237a5343289a6dc6a4694d
b4ad5b1b4b6a7b7d13491596f5631a3b
Método que remove um item necessário do sistema
class ItemController extends Controller public function destroy(Item $item) { $return = $this->service->destroy($item); if ($return['status']) { return redirect()->route('requisicao.show', $item->requisicao->uuid) ->with(['codigo' => 200,'mensagem' => 'O item foi apagado...
1
c521a3a45cb019df970349dff72e91c3
22fb712bda697891df04c4f686d31cee
expresion : resta expresion %prec UMENOS | not expresion
double res=0.; returnAST = null; ASTPair currentAST = new ASTPair(); AST expr_r_resta_AST = null; double e1=0., e2=0.; try { { switch ( LA(1)) { case IDENT: case OP_PAR_I: case LIT_REAL: case R_REAL: case RATIO_WB: case RATIO_POINTS_WB: { e1=exp_r_mult(); astFactory....
0
d6b0bef72049bbe8b631c750410f3dd7
0d9e56b4359d41c56bd188aac0140236
GET /inquiry_qnas GET /inquiry_qnas.json
{ $inquiries = Inquiry::all(); $inquiries->load('incidents'); $this->cssFiles = $this->getContent('assets.index.css'); $this->jsFiles = $this->getContent('assets.index.js'); $this->content = $this->getContent('inquiries.index', ['inquiries' => $inquiries]); return $th...
0
1bb05f52bbf24b4f42c2df167f4731a9
b74dac55e495e592a0315b272d0c0767
Remove leading zeros for datepicker component.
function trimDay(currentDay){ if(currentDay.startsWith("0")){ currentDay = currentDay.substr(1); } return currentDay; }
1
620e87785a85c9922f115d4d44d0e6cb
4733a71d227780b150624889d29a0d4b
{EV_GTK_WIDGET_IMP}.is_displayed
EIF_TYPED_VALUE F2008_24633 (EIF_REFERENCE Current) { GTCX char *l_feature_name = "is_show_requested"; RTEX; EIF_REFERENCE loc1 = (EIF_REFERENCE) 0; EIF_TYPED_VALUE up1x = {{0}, SK_POINTER}; #define up1 up1x.it_p EIF_TYPED_VALUE ui4_1x = {{0}, SK_INT32}; #define ui4_1 ui4_1x.it_i4 EIF_TYPED_VALUE ui4_2x = {{0}, ...
0
43b784284b4f0f977801960244a6f63b
d3c588e70a241c8ad778c410a2b8172b
Generates a public key given a private key and compression option
if len(priv) != 66: raise Exception("Wrong length of compressed private key") if priv[-2:] != '01': raise Exception("Private key has wrong compression byte") return bin_to_b58check(binascii.unhexlify(priv), 128 + int(vbyte))
1
2492f645e34d2fd021b0829ce227e08b
78dd95867579687dea0df04e3e5dda32
automatically uses grammar rules to change things to past tense
class DAList(DAObject): def does_verb(self, the_verb, **kwargs): language = kwargs.get('language', None) if ('past' in kwargs and kwargs['past'] == True) or ('present' in kwargs and kwargs['present'] == False): if self.number() > 1: tense = 'ppl' else: ...
1
8f07d3f3d891ad41e852be43b70ce23d
6d0508862faa536db4f6ef39c23c68a7
give player money for defeating opponent
public void lootDeadEnemy(EnemyDeadEvent e) { int lootedMoney = e.getDeadEnemy().getLootValue(); addMoney(lootedMoney); addScore(lootedMoney); }
1
71fe38fc27467fe3905afe8b9bd3f582
2bf1c9421cc411d899adb2b45179bdee
Return the local or subscriber number.
fun localNumberFromRegister(register: L2Register): Int = locals[register.registerKind]!![register.finalIndex()]!!
1
d1349a3deb8728d183495f665f6c5f81
511609f71f429bfb73126e03282a4e3b
Условие для поимки сигнала
if self.signal == "all_digits" and signal_is_digit(signal): return True elif self.signal == "all_signals": return True elif self.signal == "*" and signal_is_star(signal): return True elif self.signal == "Y" and signal_is_Y(signal): return T...
1
52e4cbd0d4dbee44562b24c3975d4345
1ed9377704d267bf55a4a429975bbb07
Pass configuration data from server to client.
var config = { url: "http://"+serverip+":8040/request", data: JSON.stringify({"Command": "REQ", "Data": {"CmdType":"GETCONFIG"}}), type: "POST", contentType: "application/json", dataType: "json" }; var done_fct = function(json) { set_client_config(json); ...
1
34a9f6b5f93091e570f878a5fe3a2d73
ce7ee9ac47db960cbffafba2344e91af
设置伤害只对敌人生效
public class PlayerAnimationEvent : MonoBehaviour public void EnableAttackDamager(string name) { if (m_Player.IsFocusToDropShadow == false) return; m_Player.EnableAttackDamager(name); }
0
bb9bb74518e9dcd0f3483e4d7d47572f
84f15f6fc8e6c463c24027a919a0cb2f
MLME Poll Confirm
void ZDO_PollConfirmCB( uint8 status ) { (void)status; return; }
1
5019f4ddc39ff2b82e7f462f3e25293b
7419fb8a4a29b0667adad0f88100fefd
Authenticates the subscription request for a private channel.
person = get_person() socket_id = flask.request.form.get('socket_id') channel_name = flask.request.form.get('channel_name') match = re.match(r'private-(\d+)', channel_name) building_id = match.group(1) if building_id not in person.buildings: logging.error('User %s is not allowed channel %s!', ...
1
da418f684150ac155522ca4fe8be44d0
a00226f70a72a9dfc459bc23be84d9fc
Makes sure input is detached from any window before being destroyed
{ if(rw == mWindow_) { if(inputManager_) { delete inputManager_; } } }
1
d57c40cbb438397b7bb48b44e361a860
87a2de819393c7f8fb2201c03277aa45
Check binlog opened
config.InitConfig() if config.CommonConfig.Debug { logrus.SetLevel(logrus.DebugLevel) } else { logrus.SetLevel(logrus.WarnLevel) } binlogSyncer := new(syncer.BinlogSyncer) binlogSyncer.Start() defer binlogSyncer.Close() select {} }
0
8a5b81aa5dd8441261985ab7da3b4059
9b294fbf1915bcb60fc9954cec69177d
Set the UI elements to the info in the building scriptable object
public class BuildingShopEntry : MonoBehaviour void Start () { }
0
a35317a4d3237d800f72baeca9aa88bc
275de3176746d4a7ecb77d6a89cfe2be
Recalculates link prediction probability for nodes, affected by last prediction.
class Xmrs(_LnkMixin): def preds(self, nodeids=None): if nodeids is None: nodeids = self._nodeids _eps = self._eps return [_eps[nid][1] for nid in nodeids]
0
e3a031879007baa1cf480a05b77a39e0
10526c2435b956c48e72d0b3df6ba6dd
Converts a possibly complex polygon into a set of non-overlapping trapezoids
tris=[] N = len(poly) reflex = set() v = list(range(N)) if area(poly)<0: v.reverse() for i in range(N): x = poly[v[(i-1)%N]] y = poly[v[i]] z = poly[v[(i+1)%N]] if ccw(x, y, z) < 0: reflex.add(v[i]) if len(reflex) == 0: return [ (0,...
0
5313ee0a6de204e05ffe4d50217ac3ec
7e732d0cede63f34eb797dcaded5bb5c
Autocomplete, busca usuário por email/nome
result1 = Usuario.objects.filter(primnomeusuario__icontains=pesquisa) result2 = Usuario.objects.filter(ultnomeusuario__icontains=pesquisa) result = result1 | result2 result = result.order_by('ultnomeusuario', 'idusuario') return result
0
4ae92924aa74b96d03aa1dc3336d35b2
4f589325db1d14052eb344a8148ceba1
链表数据生成器(正序)
n = self.head.point while n is not self.head: yield n.data n = n.point
1
c7f1eb6edcdf854e1a599adcef84a129
4ec88c6da6123c10bd8b73d043ee81e1
找出数组里3个数字乘积最大值
{ if (nums.Length < 3) return 0; int Max1 = int.MinValue; int Max2 = int.MinValue; int Max3 = int.MinValue; int Min1 = int.MaxValue; int Min2 = int.MaxValue; for (int i = 0; i < nums.Length; i++) { int temp = nums[i]; ...
1
fb19d754bbc27f277fe3ef6f80175e75
c8c85c104c98a87732e1219f342abe86
Set 视频宽度。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。
public class VideoParams extends AbstractModel{ public void setBitRate(Long BitRate) { this.BitRate = BitRate; }
0
14093a6cd8461e6bf99273c72891d4db
6f8b587bda31e2b1fde2a30679d5f31a
Calculates the lease tax amount based on method of taxation
if ( $tax_amount > 0 ) { $calculated_tax_rate = intval( $tax_amount ) / intval( $total_amount ); if ( $calculated_tax_rate > 0.20 ) { $tax_rate = 25; } elseif ( $calculated_tax_rate > 0.09 ) { $tax_rate = 12; } elseif ( $calculated_tax_rate > 0.02 ) { $tax_rate = 6; } else { $tax_rate =...
0
90f7fe38ecae58d47a9ced8b16a5a6fc
2978a92856bd183172af641287b8bbb3
Hàm tìm khách hàng theo mã (tìm tuyệt đối)
public class BangKhachHang extends TruyVanDuLieu public KhachHang layKhachHangTuMaKhachHang(String maKhachHang){ String sql = "select * from khachhang where MAKHACHHANG = ?"; try { PreparedStatement preStatement = connection.prepareStatement(sql); preStatement.setString(1, maKhac...
1
f632336b9c5a31df63c1ec4d42b980f9
063a8f2b543252f408d9b59318dadac7
Internal function to clone the DomDocument and append all webelement-nodes
wc.group("Button._fetchElements"); this.dom = this.dom || []; this.dom.content = this.innerHTML; wc.groupEnd(); }
0
42b61473a05a17e06d35400fab0936d2
84ed551149c6a14f40f173460656e985
IFormatProvider implementation.
public static string ToString(string value, IFormatProvider provider) { return value; }
0
0d44d4e381234d4ca29407ef7f6167e2
d4bd6f59ceee602afc275a96a12b97e9
今週の月曜日を取得する関数
function get_thisWeek_monday() { $today = getdate(); $wday = $today["wday"]; if ($wday == 0) { $diff_day = 6; } else { $diff_day = $wday - 1; } return (mktime(0,0,0,$today["mon"],$today["mday"] - $diff_day,$today["year"])); }
1
3f6f5a2366d989d8a8b5993dada91bf4
453f6984a53bf369cf1bc44980510a01
Lorentzian to describe a mode.
self._mode = mode self._amp = np.ones((NUM_SAMPLED, 1)) * amp self._phase = RAD_SAMPLED * self._mode + phase_center
0
94d7d37ffb11ff603ab1650fe87e30ca
282a2880f4547eea23a0b4cc0ace578e
Generate channel player shortcode
{ return '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" width="' . $width . '" height="' . $height . '" id="clip_embed_player_flash" type="application/x-shockwave-flas...
1
c5527d3fb23bb2f89c13bf35ef3967e8
5cbeeb0fa0eccec5bdba1349829625b2
Starts short break timer
function startShortBreakTimer() { time = Date.now(); timerEnd = time + SHORT_BREAK_DURATION; setTimeout(refreshBreakTimer, UPDATE_TIMER_EVERY); updateTable(true); let buttons = document.getElementsByTagName("button"); for (let i = 0; i < buttons.length; i++) { let button = buttons[i]; button.setAttr...
1
c87f2b0a7e75f71f022514eab5ef7c9b
8996473401323d2d112f1e37ddab9cd0
Display the customer ID field(s).
for Child in self.CustomerDetails.winfo_children(): Child.destroy() self.CustomerFields = ['ID', 'Firstname', 'Surname', 'Contact', 'Address'] self.CustomerAttributes = Order.GetCustomerAttributes() for Field in self.CustomerFields: self.Label = Label(self.Custome...
1
5a7725ad32e1008790c3d55051d36aca
6c781e6c4c1de97bba5b2b0d2edee7e3
# Describe: Ebcdic character to Ascii character
unsigned char _etoa_chr( unsigned char ebc ) { unsigned char asc; asc = TAB_ETOA[ebc]; return(asc); }
1
757e3388474444b76caf1b5ba92ae08c
260bca70a8456864d34afe1c195d6008
get time passed in seconds from text in the format 'xx hours, xx minutes'
def get_time_delta(time): hrs_mins = re.findall(r'\d+', time) assert len(hrs_mins) > 0 and len(hrs_mins) < 3 hours = int(hrs_mins[0]) minutes = 0 if len(hrs_mins) == 2: minutes = int(hrs_mins[1]) time_delta = datetime.timedelta(hours=hours, minutes=minutes).seconds return time_delta/...
0
4f984c242c739b167e611bb9ebbda898
7fdc30595a798a4b201bbb2e498195c0
当前游戏账户是否在限游戏流水平台列表
function check_casino_account_online($casino_member, $debug = 0) { global $api_column; $check_result = false; $casino_accounts = json_decode($casino_member->casino_accounts); $API_data = array( 'account' => $casino_accounts->{$api_column['casinoid']}->account, 'gamehall' => $api_column['gamehall'] ); if ($deb...
0
516f2aef995064b0ee48652192472564
2083df2f9abbe34f41d7fb21f7b381b1
Función que comprueba que todo este correcto en el registro y guarda al usuario en la base
$result = array( 'code' => 0, 'errors' => array() ); $firstName = $pFirstName; $lastName = $pLastName; $email = $pEmail; $pass = $pPass; $state = $pState; $gender = $pGender; $arrayParams=array("name"=>array("NameValid"=>"USERNAME", "NameParam"=>"name",...
1
d11b0428e1c0fdf59291ef278d0a1323
2fdd0fe7c89b79f6906f179256cc9db1
List all stacks matching the given filter criteria.
if 'constraints' in request.args: constraints = json.loads(request.args['constraints']) return docker.query_stacks(constraints) else: return docker.query_stacks()
1
84da675823fbb69704b93e81310603b1
7e6dd655cde2f654659ab67924baec12
Returns the volume of buffer to transfer to a library pool rack.
def get_pool_transfer_volume(number_designs=DEFAULT_NUMBER_MOLECULE_DESIGNS, stock_concentration=None): if stock_concentration is None: stock_concentration = \ get_default_stock_concentration(DEFAULT_LIBRARY_MOLECULE_TYPE_ID) dilution_factor = float(stock_concent...
1
975797b78bbae4c15e821548c6a44340
1548318ba544ab8294e1fd767ea9d61d
Given a route regex extract any complete site names
def extract_domains(line): return re.findall(r'(?:\w+\.)+\w+', line) or None
1
6da150f34faf8f566adbd600ec948ac0
932554e59d64d01aca23ecbcd91ddc2a
Test that adding data triggers a rebuild
class TestMPTT(TestCase): def setUpTestData(cls): super().setUpTestData() StockLocation.objects.rebuild()
1
52ff3849b3536c7b20c59099ed30f4c8
d296de637bf52a032a5a1fcac9eee526
判断是否击中了球
export default class Ball extends Component checkBall(check){ this.setState({ check:check },()=>{ }) }
0
937f47238158ffbe0ad5ba55b217e86a
6f83d38e878b205e088ac974d756090e
Function Name: Round Return Value: None Local Variables: Initializes the class private variables: m_winnerBonus - bonus granted to the winner m_winner - round winner m_nextPlayer - who's turn is to move m_exitGamePlayer - name of the player who exit the game. m_computerPoints - total points for computer for the round m...
{ int roundsToWin = 3; int playerRoundWins = 0; int computerRoundWins = 0; char playerChoice = NULL; char computerChoice = NULL; char playAgain = NULL; string playerInput = ""; do { playerRoundWins = 0; computerRoundWins = 0; while (playerRoundWins < roundsToWin && computerRoundWins < roundsToWin) { ...
0
0b9fff4cee76fdfcd9045d1e0a531c23
f093e31c17c45019a3c50e521811ab77
maps email to institution
class MarineGEOAPI private function map_institution_code($institution_code) { switch($institution_code) { case "USNM": return 'Smithsonian Institution National Museum of Natural History'; default: echo("\nInvestigate institution_code [$institution_code] no mapping...
0
70421031c0c4db79b9d5433665c7de91
17eadde01d5da6dbe3183c2ee3270190
Update the local files with changes from the VCS. Returns whether any of the updated repos have changed since the last sync, based on the revision numbers.
try: drive_changes = self.retrieve_all_changes() if self._force_refresh or len(drive_changes) > 0: self._refresh_file_cache(self._build_changes(drive_changes)) except (Exception, GDriveError) as e: logging.error(e) raise e return se...
0
1074c03310d36464457e54ed4441e68d
23a029a9e69b2c19a1b627d7f094b85e
@brief 设置扬声器启用状态。
{ if (ulHandle == BT_DEVICE_HANDLE_INVAILED) { return false; } return _BTManager.SetDevA2dpEnable(ulHandle, bEnable); }
1
6c83a9f9c657145d82c32186e6df2bc1
c13eff6e60fbb3d3abec26ef41562a93
Returns a lower case version of the internal name.
class Theme implements Arrayable public function getLowerName() { return strtolower($this->name); }
1
fa19c9cf9a4518cbf9f5214db9e5e6df
8790ce023891415607d21e2138587424
单位转换,kg到lb(英镑)
func Kg_to_lb(kg float64) float64 { lb := kg * 2.2046 return lb }
1
6298880a2e1d730e085b327babdb11d8
6751fd21a2892a4c6175955bb0b1a911
=============================================================================== Webremote handling, get values and change values ===============================================================================
var shape = document.getElementById("shape"); var t = this; switch(t.id){ case "range_translate": tran = t.value;break; case "range_rotate": rot =t.value; break; case "range_scale" : scal = t.value;break; case "range_skew" : ske = t.value;break; ...
1