query_id
string
corpus_id
string
query
string
code
string
label
int64
81392cb811cb73740d8a7d11e3454720
8871db07baf35c4929a56b0443d85b46
获取创建表的DDL。根据列参数创建, 当列参数为空时, 显示已经存在的表DDL。 <br/>
String toSqlCreate(Dialect dialect, String defaultCatalog, String defaultSchema);
0
256c271ee58c2cb25db77de36a69040b
58b9876ef1a8b16efaf4252ceccde02b
使用协程连接池
class Mysqli public function createCoroutine() { return new \Aha\Storage\Db\Coroutine($this); }
0
ce6d9ed1a2826ea9f37e08278bf9942c
d6d993f6b2e63f4eb3200f0b388acdcc
Mark the given index as an available value
{ for (int i = 0; i < freeBlocks.Length; i++) { if (freeBlocks[i] == index[i]) { freeBlocks[i] = 0; } } }
0
a2f95d0ea2862aa2830e9f987c94bcd7
21c831ae0db34b82b4180e6adf0ead1f
规范化buff中当前指针处的字符
const char = this.source.sub(this.ptr + offset, this.ptr + offset); return char; }
0
2a74baa40147e49dcb7a10be1409d980
8952a01a21a6fac6366062d4ebc94811
@brief Obtener símbolo no terminal
Parser::terminal_symbol_t Parser::lexer( char c_ ) const { switch( c_ ) { case '+': return terminal_symbol_t::TS_PLUS; case '-': return terminal_symbol_t::TS_MINUS; case '^': return terminal_symbol_t::TS_EXPO; case '*': return terminal_symbol_t::TS_MULT; case '/': r...
0
54530850a8e5a057fb2f145640849ed2
e5d31c6d95cf030c5a1b872a3bfd3cfc
Saves the stream to file.
namespace Common.Services public class LocalFileSystemManager : IFileSystemManager public async Task SaveStreamToFile(Stream stream, string filePath) { if (!Directory.Exists(Path.GetDirectoryName(filePath))) Directory.CreateDirectory(Path.GetDirectoryName(filePath)); ...
1
ef6178ca3b77defe9574fe12def56201
9b5f9b6b306b2f0981cd8f93ad8ee261
Used to add a new client into a room. If the room is empty and a client is added, the client is the party leader.
public class Cave public void addParty(Party newParty) { parties.add(newParty); partyKeyValue.put(newParty.getIndex(), newParty); }
0
3a647a0e6b36afa8e9b5221fc2d158d2
14a01680aae72586f0cafc14177e7aab
# Calculate the features for classification from the output
{ outcomes <- data %>% group_by(as.factor(data[,catvar]), as.factor(data[,target])) %>% summarise (num_cust = n()) colnames(outcomes) <- c(catvar,target,"Count") outcomes2 = aggregate(outcomes[["Count"]], by=list(Category=outcomes[[catvar]]), FUN=sum) colnames(outcomes2) = c(catvar, 'no_of_zero_and_ones') out...
1
e6556a585c961ebde99ce14604241b75
9d271e68ad472928fe47d0ffa0733ba1
Creates the Payment Instance for the given order based on the current Payment Method policy.
{ $payment = $order->getPayment(); $method = $payment->getMethodInstance()->getCode(); $modelRef = Mage::helper('cmpayments/config')->getPaymentMethodItem($method, 'model'); return ($modelRef !== null) ? Mage::getModel($modelRef) : null; }
1
78cfe2620dbd2e02ada6f73fb8992d1c
bf8f26039e30efb419c4df7246608bcc
Function to get Quantile Regression Averaging Forecasts from point forecasts of different models.
data = temperature_data.transpose(1, 0, 2)[:, :, 0] num_samples, num_output = data.shape n_test = int(round(num_samples * test_ratio)) n_train = num_samples - n_test train_data, test_data = data[:n_train, ...], data[n_train:, ...] scaler = StandardScaler(mean=train_data.mean(), std=train_data.st...
0
cb48c97820208f4709e581c115b74290
c1255c0ff03e49cc6527ba8e73665d04
字串是否包含字串集合中的某一个字串
namespace Kane.Extension public static class StringEx public static bool Contains(this string value, params string[] keys) => keys.Any(key => value.IndexOf(key) >= 0);
1
21c09af066a15333140d1b2f3d8e5c2e
5515e48ecd45144d73b08bc86a9b6389
si_snr loss with zero-mean in pre-processing.
def si_snr(preds: Tensor, target: Tensor) -> Tensor: return si_sdr(target=target, preds=preds, zero_mean=True)
1
1b9d3f124f271256ed5a5205c9b08e0e
85558e5cebe75e93e2186966eef9da26
栈模拟递归
class Solution70 public int climbStairs2(int n) { if (n <= 1) { return 1; } return climbStairs2(n - 1) + climbStairs2(n - 2); }
0
a0daf4cd332bdc088dc00f165268daa2
3e79d03a9efb85861bd5135978efb981
The maximum number of results the query object was set to retrieve. Returns <code>Integer.MAX_VALUE</code> if <code>setMaxResults</code> was not applied to the query object.
public class Response<E> public int getMaxResults() { return maxResults; }
0
a2c8aac7c7d76b04d5899d6af6c74048
d86784dd9a2d2f2c3e488c5588ecc6ee
Gets the xml of this FileImportSettingsCreateDto. # noqa: E501
class FileImportSettingsCreateDto(object): def idml(self): return self._idml
0
867c532173437e1a61914bfbbb128ea9
4294e18285480b09c974ffebfa1aadc9
Starts the video when the object is enabled.
namespace VideoSys public class DefaultVideo:IDisposable, IVideoPlugin public void Start() { _video_timer.Start(); }
1
3bd9e82d5503908839c1848ff9a88500
8768ece9219af614851beaa41b515a4e
Set the key lock status. Valid options arguments for `lock` are: 'ENAB' (control over USB connection only) 'DIS' (local control via oscilloscope front panel keys)
class debyeflex3003(HardwareLayer): def lock_keyboard(self): self.write("KB:0")
0
866096fa7bdcc1d123df5c20a9de6846
75e7adc2e6b31305da1e393570e65284
A private helper function to convert seconds (since Unix epoch) to chrono DateTime
namespace Hikari.Common [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never), System.ComponentModel.Browsable(false)] public static class IntegerExtensions public static DateTime FromUnixTimeSeconds(this in long @this) { System.DateTime dtStart = System.Ti...
1
48428c4728602888d0eaa05bb7851173
d3afb0ea088deee0a724785ca0219673
Fetches the set of commands that can be used on a text component that is using a model and view produced by this kit.
class Contao2BackendViewDefinition implements Contao2BackendViewDefinitionInterface public function getModelCommands() { return $this->modelCommands; }
1
1abd6f26af6ea1c5b7de80469a28d11f
8be9e879592a1c6541016bc941fccbca
测试向student表中插入一条记录
connection = pymysql.connect(host="localhost",user="root",password="123456",port=8888,database="woniudb") cursor = connection.cursor() cursor.execute("insert into student values(0,'{}','男',19,100.0)".format(sname)) connection.commit() cursor.close() if connection: connection.close() ...
1
a9568319c525a4b5aa429993b6452897
205d734d0cc0a4b6545adee1e3f353a0
ブロックが徐々に消える描画処理
{ float vanish_ratio = Mathf.InverseLerp(this.block_root.level_control.getVanishTime(), 0.0f, this.vanish_timer); if(vanish_ratio < 0.1f) { vanish_ratio = Mathf.InverseLerp(0.0f, 0.1f, vanish_ratio); vanish_ratio = Mathf.Lerp(0.0f, 1.0f, vanish_ratio); } else if(vanish_ratio < 0.5f) { vanish_ratio = Mat...
1
8a96166894a1d19441c44115b04d7355
95e485ec28860db000fc7e231ec7771e
reads a vcf file into a pandas dataframe
def read_sbs_from_vcf(vcf_file): if vcf_file.endswith('.gz'): vcf_opener = gzip.open else: vcf_opener = open variants = [] with vcf_opener(vcf_file) as vf: bases = {'A', 'C', 'G', 'T'} for line in vf: if line.startswith("#"): continue ...
1
712988fe0718f41a3c5f910c2c66853a
58db8c0bc9ba4339d85448163b3b4fd1
Entry function of this program - Run the quick_sort function - Print the before and after list
int main(void) { quick_sort(a, 0, 13); prt(14); return 0; }
0
3980b0d14aad8f678b5b6e573eff38f3
ab30ae046b9ec3eac37cdce2638bba78
Devuelve las emisiones de gases de efecto invernadero de un plato.
@Entity @Table(name = "COPQTVPL") public class TvvValuedEsDepPGL extends BaseAggregateRoot<Long> public List<TvvValuedPollutantGasLimit> getPollutantGasLimit() { return pollutantGasLimit; }
0
501b131ee61602194279290fa9b89879
0714f292eae9812ae5e7628a3d74a617
Set the total number of page requests rejected or not responded
void setRejected(boolean rejected);
0
8d4153793acb6ba82597ef42982d6054
d2c7a256816fa1e063dec3a131c1e39e
模拟ntohl函数,网络字节序转本机字节序 若本机为大端,与网络字节序同,直接返回 若本机为小端,网络数据转换成小端再返回
uint32_t Endianness::ntohl(uint32_t l){ if (is_big_endian() == true){ return l; }else{ return ((l>>24)&0x000000FF) | ((l>>8)&0x0000FF00) | ((l<<8)&0x00FF0000) | ((l<<24)&0xFF000000); } }
1
1b2aa1fbf051d470a29638fca1f0601e
23bea9d38ea65ade0df9362d4d3a1723
GET: UnidadesDeMedida
namespace SystemMartinezCV.Controllers public class UnidadMedidasController : Controller public ActionResult Index() { return View(db.unidadMedida.ToList()); }
1
2bc73421fb88435f7ab231ec8785c4e1
e72b9c0c1f7bc5ded2471f2df5db63ca
UpdateRaw does a complete update of a model.
func UpdateRaw(r RepositoryProvider, id interface{}, object interface{}) error { return r.GetQueryRunner().RunWithDB(func(db *mgo.Database) error { return db.C(r.GetCollectionName()).Update( bson.D{ bson.DocElem{ Name: "_id", Value: id, }, }, object, ) }) }
1
417078f803af2a9abbb305bcb4f64507
bb54cd61e5ad56636c8d1274dbd62a4d
Tasumi at-surface reflectance
class Profile: def R(self): return unp.nominal_values(self.reflected_intensity)
0
bdfea70d525121409c6a6202c91c111a
b09e3a46a7cc99b1596b63026c2fce93
Places a space between punc and surrounding characters.
class Eaf2JSON(Txt2JSON): def add_punc(self, words, text, prevText, startOffset): if len(text) <= 0: return if text[0] in self.bracketPairs and len(words) > 0: if self.bracketPairs[text[0]].search(prevText) is not None: words[-1]['off_end'] += 1 te...
0
c9c519537faa9f9eebd5b08feab34921
59d0e5a7cb4b17e2357907722b060fa2
Confere se os tipos de argumentos especificados conferem com os parâmetros da função
def arg_type_check(types, *args): if len(types) != len(args): return False for arg, type_ in zip(args, types): if not isinstance(arg, type_): return False return True
1
2c62cb6fdda2d9cf0cfd88b5715a6eb9
4063c4f9a887d4d1757bb7e12d999763
Implementation of preprocess_block().
class Predictor(ABC): def _process_block(self, pred_image: np.ndarray, x: int, y: int, labels: np.ndarray, label_nodata):
0
ee82314918984c369b6addd249b8414d
cb6e9d3121c859957ebc00b6d2f0f152
render the librarian view
class libraryController extends Controller public function index() { $username = \Auth::user()->username; return view('library.libraries')->with('username',$username); }
0
7ecb3bdd760a152a171c2fc195779faa
f0fbc367fd58ccd1ee76414bf38af1c5
Add all items to the 'on' list and remove them from the 'off' list
void insertIntoOnList(ActiveNode *newNode) { ActiveNode *node = newNode; bool done = FALSE; int index = 0; do { if (sysStatus.onNodes[index] == (ActiveNode *)NULL) { sysStatus.onNodes[index] = (void *)node; sysStatus.onNodesCount+=1; done = TRUE; } else { ActiveNode *listNode = (ActiveNode *)s...
0
7e3cdd9739325b950689dc480825e10b
24bef3ccaccfc303a72726f9817e5a03
ロックフリースタックにプッシュ
static void lockfree_push(pmath_stack_t stack, void *item) { assert(have_cas2); do { ((struct _pmath_stack_item_t*)item)->next = stack->u.s.top; } while(!pmath_atomic_compare_and_set( (pmath_atomic_t*)&stack->u.s.top, (intptr_t)((struct _pmath_stack_item_t*)item)->next, (in...
1
2f0af7013a866b407094bfeb4bdbe6ff
212aa5efaad3e4c174704a0c42f5034b
Maximum violation margin for positive demonstrations, supports squaring
super(LDAMLoss, self).__init__(para_dict) s = self.para_dict['cfg'].LOSS.LDAMLoss.SCALE max_m = self.para_dict['cfg'].LOSS.LDAMLoss.MAX_MARGIN self.max_m = max_m m_list = 1.0 / np.sqrt(np.sqrt(self.num_class_list)) m_list = m_list * (max_m / np.max(m_list)) m_list...
0
7a426651bb0b2fc31d598e243b0220d8
b87fb52562fbc4152021dc32446ce5c5
Private helper to create an analytics handler with mock functions.
function detectHandler(): AnalyticsHandler { if ( typeof window !== 'undefined' && window.AJS && window.AJS.EventQueue && typeof window.AJS.EventQueue.push === 'function' ) { return hermentHandler; } return () => null; }
0
f7b09ba1b41a54f32b2daa4ac76c9ed4
5fd003bd2eceb4fd8870f633d42c26df
Get RxJava {@link io.reactivex.Completable} source that observed on IO scheduler and subscribed on main thread of Android scheduler
return Observable .create(new Observable.OnSubscribe<BaseResult>() { @Override public void call(Subscriber<? super BaseResult> subscriber) { try { if (!subscriber.isUnsubscribed()){ ...
0
f9e52f2f7d9598339f19cf21e50e43c6
b62673e06659c6f18a8b9939af7b892d
Fetches the window's caption (WM_NAME property). It will be stored in the client's caption().
namespace X11 public class X11lib [DllImport("libX11", EntryPoint = "XGetWMName")] extern public static TInt _XGetWMName(IntPtr x11display, IntPtr x11window, ref XTextProperty textProperty);
1
8ad2d99970f955204f04421138a0cf52
224e21a1de80c73194eea847cf0e6a5e
Передача параметров в POST-запросе и получение ответа
{ request.ContentType = "application/x-www-form-urlencoded"; request.Method = "POST"; ASCIIEncoding encoding = new ASCIIEncoding(); StringBuilder postData = new StringBuilder(); foreach (var parameter in parameters) { postDa...
1
2675b5c3839f164e6f3b6fcddee07e2c
11d82c145c865c6acbd1fe19d0d77149
判断两个用户是否有父子关系
{ if ($uid_child == $uid_parent) { return false; } $log = new Logger('passport'); $log->pushHandler(new StreamHandler(\Kerisy::$app->config('config')->get('log')['runtime'] . '/passport/' . date('Ymd') . '.log', Logger::INFO)); if (empty($uid_parent) || empty($uid...
1
861abc2f55b68fc0c971697faf35f813
80363953792ea3a3502648c7b2dedd33
Calculates the distance between the transmiter and the receiver, considering the altitudes and the coordinates. The receiver must be in a fixed position.
int calcRssi = this.rssi; if (fromAverage) { calcRssi = getRssiAverage(); } int txPower = -55; if (beacon != null) { txPower = beacon.getTxPower(); } return calcDeviceDistance(calcRssi, txPower); ...
0
44c07d10026a25414ac852e32df7c498
cd7c4bc57ca27e39bf4d908c21ad7761
Send a pong frame to the server
public class Client extends Thread private void sendPong() { sendToServer("pongg&" + player.getUsername()); }
1
2609eb866fcde071fab052d9f775267c
4eb4eaed60582a5fb6eec3c2e0c8309f
解析 url,並存入 gameUrlParameter
parameter = new ArrayList<>(); parameter = getIntent().getStringArrayListExtra("parameter"); loadUrl = parameter.get(0); }
0
7ca4a044afdfb3e9e63dfe4f2028d54f
45befab6bb393a8aa0879341c98ea95b
Print args to current file with level indents
def print_with_indent(*args): if INDENT_LEVEL: print("\t" * INDENT_LEVEL, end='') for arg in args: print(arg, end='') print()
1
4750f433c854cbeee04c11aa17012f94
e3fbf1946a23a7065fc77e098e85e3d3
leetcode 122 无限次交易的解法
int leetcode122_1::maxProfit2(vector<int> &prices) { int ans = 0; int n = prices.size(); int dp[n][2]; dp[0][0] = 0, dp[0][1] = -1 * prices[0]; for (int i = 0; i < n; ++i) { dp[i][0] = max(dp[i - 1][0], dp[i - 1][1] + prices[i]); dp[i][1] = max(dp[i - 1][1], dp[i - 1][0] - prices[i]); } ans = dp[n...
1
d7cbeff5f8db08d7748bab475d21550d
a17f8ff0c8ed39d60aa961164d6aff8d
Returns the redirect URL after an oauth callback
def oauth_return_uri(provider, dest_left, dest_path) "#{oauth_uri_left_part}/account/oauth_return/#{double_escape_path_element(provider)}/#{double_escape_path_element(dest_left)}/#{double_escape_path_element(dest_path)}" end
1
9974fe40973ca563c919d44214dfc647
c60ceb92eaa7812126f4a54f01ae2db9
Print the C implementation to the CASE 4gl statement.
print_put (char *cname) { int n; printc ("{\n"); n = print_bind ('i'); printc ("A4GLSQL_put_insert(&ibind,%d);\n", n); printc ("}\n"); }
1
709c8ac3582254911948810d00fa9ade
6bc362af03553bae49b65c35f106e860
Returns the bounding box each unique label in `regions`. NOTE: a region must be a connected area with the same ID, where ID are integer values larger than zero.
def map_clusters_to_bounding_boxes(labels, coords, n_clusters = None): if n_clusters is None: n_clusters = len(set(labels)) - (1 if -1 in labels else 0) buds = [None] * n_clusters for label, coord in zip(labels, coords): if label == -1: continue t, l = coord if bu...
1
aed2eba9fc60a6a8b42e3349030484e0
aed283bed3c316f4289b4283dd565931
Add a new element to <resetinfo>
public void setInfoElement(String elem, Object val){ Map extinfos = getMap(FLD_EXTINFO); if (extinfos != null) { extinfos.put(elem, val); setMap(FLD_EXTINFO, extinfos); } }
0
f74bc0bfbd3330a11813bf1e3073f06f
3da906e82cb50b0878fe82603aa672d3
base just returns the same name and doesn't mutate
fn fold_name(&mut self, n: Box<Name>) -> Box<Name> { n }
1
b8f1202a1f9658eddb020a0d8bcead5c
b7fa7359ae25ea3a56ac22430c6c8543
This is the basic enemies hit box.
hitBoxWidth = 26; hitBoxHeight = 76; hitBoxOffsetX = 85; hitBoxOffsetY = 59; }
1
dfb74feaa0142000d548bba56c803bb5
64584161d1367ce03720f0e99220f30e
列出没有同步的元数据
@Service public class SwitchSensorService public List<SwitchSensor> getNoSync(){ return switchDao.getNoSync(); }
1
667442ea108034ae4bf2eed5c537fb27
2493e22189f59ec38c4bde7ad5d4fd2b
读cpu卡
public class YctFragment extends BaseFragment implements OnOpenSerialPortListener private void readerRsp(final byte[] bytes) { if (bytes[2] == 0x25) { updateRes = true; update = bytes; return; } if (updateRes) { byte[] newByte = TUtil.byteMergerAll...
1
cff2f095766d1dcadd363978f2d22a19
9ecd7c1dea3c5f2ca9dd02c7e56a4a0c
This function executes one cycle of the AGC engine. This is a wrapper function to eliminate showing the passing of the current engine state.
{ SND_DEBUG_MSG("SND CMD: SND_AGC_CTL=%d", cmd_ptr->agc_ctl.on,0,0); sndhw_agc_ctl(cmd_ptr->agc_ctl.on); if (cmd_ptr->agc_ctl.hdr.callback_ptr != NULL) { cmd_ptr->agc_ctl.hdr.callback_ptr(cmd_ptr->agc_ctl.hdr.client_data, SND_SUCCESS); } }
0
7ec00ae3c5c0dcd5731c0828beb1dfb9
f29b53cfa5402b6056b0aa112544d45b
Override method to add other content to main control.
public class NewLegacyLesson extends LessonAdapter protected Element createContent(WebSession s) { Element ec = super.createContent(s); return (ec); }
0
f588d37673c87898a9539f286f29c745
da2ee9ffdcdc72fa12bc7091a873e3b0
A set containing every GI that was found and that had a source text associated.
public List<String> getFoundEntities( ) { return new ArrayList( _listFoundEntities ); }
0
2501425720506d3af2d71325e979350d
70033bdb233937dde5ff7336fbec9437
用户数据打包
@Service @Slf4j public class UserService private void packFamilyData(UserInfo userInfo) { List<FamilyInfo> familyInfos = new ArrayList<FamilyInfo>(); FamilyInfo familyInfo = new FamilyInfo(); familyInfo.setAddress(userInfo.getAddress()); familyInfo.setBirthday(userInfo.getBirthday()); familyInfo.setCity(userI...
1
ff6928fbeb7b936a08aea8a11dae78e0
b1932b671568de8309559bc643b129bb
Extract the bot command from the message
const text = message.text; const entities = message.entities || []; const commandEntity = entities.find(entity => entity.type === 'bot_command') || null; const command = commandEntity != null ? text.substr(commandEntity.offset, commandEntity.length) : null; const args = commandEntity != null ? tex...
1
5b6579a9dd464d5f991bd19282e43107
a984e800e5bfa29b2f238f69353dfd5a
reconstructs data matrix using d-rank approximation
data = adj_mat(datafile, n) A = np.asarray(data.tocsr()[:n, :n].todense()) e = np.ones(n) for i, v in enumerate(A.sum(1)): if v == 0: A[i] = e K = ((1./A.sum(1))[:,np.newaxis]*A).T K *= - d np.fill_diagonal(K, K.diagonal() + 1) R = la.lstsq(K, (1-d)*e/float(n)) ma...
0
85517a51d66887c746b860bd41ba75b7
b8933bfbb766a05be34c8d75cd058ade
设置"收货人邮编"
public class ConsigneeAddVO public void setCon_zip(String con_zip) { this.con_zip = con_zip; }
1
5eee72a24ae60d01bc4d217a5f5b292b
6c4a9fbbad0bcecc24fb0180882e9beb
Function that successively bubbles down an element as far as it will go.
class Colleen: def __bubbleDown(self, loc): swapLoc = self.__smallest(loc) while swapLoc != loc: self.data[loc], self.data[swapLoc] = \ self.data[swapLoc], self.data[loc] loc = swapLoc swapLoc = self.__smallest(loc)
1
eae2a3a7ba5aa0873118db116dcf5e34
92a2f21496c932299d602970909dc755
Выводит пронумерованный список созданных вагонов.
{ this.WagonInfo = ""; this.WagonInfo += "Поезд № "; this.WagonInfo += ContextKeeper.Trains .Where(t => t.Id == trainId) .Select(t => t.TrainNum) .First() + "\n"; this.WagonInfo += "Вагон № "; switch (_cu...
0
5213f8d7eeba362e37de0775eff31e3b
41f1400f2d96b1235f6cf1fc2873daba
Gets chain id if object has chain
class NodeData getChainID(){ return this.netChainID; }
1
f3bf2655e1227139c9d1a4285a269c6b
a051dc1b538679e523c04b6673dd2eff
Create and setup QLabel lblEMailAddress
class EmailAddressMetaControlGen extends QBaseClass public function txtAddress_Create($strControlId = null) { $this->txtAddress = new QTextBox($this->objParentObject, $strControlId); $this->txtAddress->Name = QApplication::Translate('Address'); $this->txtAddress->Text = $this->objEmailAddress->Address; $thi...
0
552a960872e5d26c880170fd34cc6daf
8f954847b40fa75cf6ae136ecdfa6ff2
从Kafka接收数据,放入队列
public class BkdataMetric private static class QueueToKafka void flush() { while (true) { KafkaStat stat = msgs.poll(); if (stat == null) { break; } else { String key = stat.getKey(); String value...
0
a19a7f689d148b2e877f1aedc438bbd3
2a54419a0f5c403904c9a535e9c93efa
Attribs : Attribs Attrib
class DataClass : def getAttributs(self) : return self.attributs
0
a21340479e318a1e861065c3009ccc3c
ee37d8d9853a932dd68b204e9846119c
Enables all View in edition mode
{ btnMvPViewItems.IsEnabled = true; btnMvPAddItems.IsEnabled = true; btnMvPUpdate.IsEnabled = true; btnMvPDelete.IsEnabled = true; }
1
ff4d9b8c0353ed66f9d462d8937297e0
0e4f4afec79f706bab1433d8382b476b
generate an array with n elements from 1 to n Then, shuffle elements and get a random permutation
const arr = Array(n).fill().map((_, i) => i); while(n > 1) { const randomNum = Math.floor(Math.random() * n); n--; [arr[n], arr[randomNum]] = [arr[randomNum], arr[n]]; } return arr; }
1
bbe7dd5e1caf09b4deb58a1ed1da49c7
27c2b8e31647e6eefb5ddb8877058093
Turn off humanized labels.
class HydrationOptions public function disableFormatters() { $this->params['disable_formatters'] = true; return $this; }
1
1eedc7c3942b62232d16bc7064a73d19
b4c37ea65d35b98a9f6376011363e4c5
\brief Returns the index of the arch to keep in the mach file.
DUK_LOCAL duk_ret_t process_arch_getter(duk_context *ctx) { #if defined(__x86_64__) duk_push_string(ctx, "x64"); #elif defined(__i386__) duk_push_string(ctx, "ia32"); #elif defined(__arm__) duk_push_string(ctx, "arm"); #elif defined(__nios2__) duk_push_string(ctx, "nios2"); #else duk_push_string(ctx, "unknown"); #...
0
ad24f19529f926d910b50ce7152bc704
08b02f0f23508228daa36b811c790bdf
GET: api/Parking/totalParkingEarnings
{ totalRevenue = 0; foreach (GameObject parkingLot in parkingLots) { totalRevenue += parkingLot.GetComponent<ParkingLot>().totalRevenue; } }
1
102bf3a99da8fe01e77e78afe5fd5837
fad2f96c41188946b3766fa86ff6fea9
Returns the meta object for class '{@link edu.ustb.sei.mde.bxcore.dsl.bXCore.IndexPart <em>Index Part</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SampleInPatternInfo_partList_feature"), getString("_UI_PropertyDescriptor_description", "_UI_SampleInPatternInfo_partList_feature",...
0
e510bc2a7047c080cc839c830c9e3e2d
1bcc8a652854e3b47871ecd45afec70e
查询所有课程的名称
@Select(("select courseId,courseNameCN from t_course_base_info order by CONVERT(courseNameCN USING gbk)")) public List<Map> findAllCourse();
1
eaf854e8844699a6607bbaac33d0e986
c66eb4caf7acf471f6c8d2c227249d5c
功能描述:通过传入一个二维数组,调用指定方法将列表中的数据生成一个JSON规格指定字符串 列表对象
public class SalesPromotionAct extends AppBaseActivity implements SalesPromotionFragment.IDataCallBack{ private void json2List(List<AttrName> attrNameList) { multiItemEntities.clear(); for (AttrName attrName : attrNameList) { multiItemEntities.add(new SpecificationMultiItemEntity(Specificati...
0
ebb655d2a8817af7de2831acd08b864b
0d3e48bc2e26a16bb75c552bbd855a3a
电梯初始化函数
void Initialize(void){ double cost1,sint1,cost2,sint2,cost2mt1,sint2mt1; m1 = 1; m2 = 1; l1 = 1; l2 = 1; m3 = 1; u=0; theta1 = 45; theta2 = 0; dtheta1[0] = 0; dtheta2[0] = 0; theta1 = theta1 * M_PI / 180; theta2 = theta2 * M_PI / 180; dtheta1[0] = dtheta1[0] * M_P...
0
8532fc87e8cc1f0b86c65740d413fec8
77f2db6059d3b0db8ae69c2358dc9f59
Getter for the cancel nested actions flag.
public class BCWaitGameBModel extends Observable implements Observer public boolean getCancelEnabled() { return this.cancelEnabled; }
1
c563229b93f83d3f9f18da40021fa4f5
5c330c4b4513ccf98646477c03ddece0
Check if the current Image state is firing.
MMP_BOOL mmpCapIsFire( CAP_DEVICE *ptDev) { CAP_CONTEXT *Capctxt = (CAP_CONTEXT *)ptDev; return ithCap_Get_IsFire(Capctxt->Cap_ID); }
1
e85a6e76d0aa32aa4e6764276661ae88
0521a7602b79f05ee7063a81a9d9314e
把syscall函数地址放到syscall数组里面
static void init_syscall(void) { syscall[SYSCALL_SLEEP] = (uint32_t)do_sleep; syscall[SYSCALL_BLOCK] = (uint32_t)do_block; syscall[SYSCALL_UNBLOCK_ONE] = (uint32_t)do_unblock_one; syscall[SYSCALL_UNBLOCK_ALL] = (uint32_t)do_unblock_all; syscall[SYSCALL_WRITE] = (uint32_t)screen_write; syscall[SYSCALL_CURSOR] = (u...
1
0333b50fc5048cb56405779e0af54724
4dc99d4518ce4bc8b44ccb5874161743
Setup the LCD device driver and its backlight
void init_lcd(UART_MODULE uart, UINT32 peripheral_clk_freq) { lcd_uart = uart; init_pmod_cls(lcd_uart, peripheral_clk_freq, 9600); set_display(lcd_uart, DISP_ON_BL_ON); wrap_at_16(lcd_uart); lcd_clear(); }
1
bac980d89f015d9f50d21b7d042032c4
f1b02c625423f3abd30a2fe2b934e9ff
从每个页面提取出新浪站内link,返回一个link列表
page = get_page(url) page_urls = set() if not page: return None for x in page.findAll('a', href=True): url = x.get('href', '') if not url or url == '#' or url == '/': pass if url.startswith('http:'): page_urls.add(url) else: if ...
0
9db48454113d0265af4daf23c90c9d23
85a40ccab7362dd708bf66c0fc432ec4
Union the current shape with the other object, with operations defined in :doc:`../notes/shape_operations`.
combination = Shape(self.get_height(), self.get_width()) for y in range(other_shape.get_height()): for x in range(other_shape.get_width()): if other_shape.is_occupied(x, y): combination.set_box(other_shape.get_box(x, y), x + x_overlay, y + y_overlay) ...
1
f7731a7e48474cca8ffe6b873b7ba70a
caa0687b10b3aff30c04d5d45fdb4332
@brief Configure the MAC-SA of LL-FC and E2E constructed packets
( IN GT_U8 devNum, IN GT_PHYSICAL_PORT_NUM portNum, IN CPSS_DXCH_FABRIC_HGL_FC_RX_E2E_HEADER_STC *e2eParamsPtr ) { GT_STATUS rc; GT_U32 value; GT_U32 regAddr; GT_U32 portGroupId; PRV_CPSS_DXCH_DEV_CHECK_MAC(devNum); PRV_CPSS_NOT_APPLICABLE_...
1
5bbe584797868eec1e2f57e5bde33678
526a9649917c61fe95951025e82b4fa5
先初始化商品详情和联系信息
fragment1 = new VerticalFragment1(); fragment3 = new VerticalFragment3(); intent =this.getIntent(); tv_contact = (TextView) findViewById(R.id.tv_contact); tv_price = (TextView) findViewById(R.id.tv_price); tv_xiangqing = (TextView) findViewById(R.id.tv_xiangqiang); tv_shop = (TextView) findViewById(R.id.t...
1
4c7de04a19d8dd7d7bf17c5f693d0c67
15f5f370306a0fb5aad35dc3eda6f6a8
改变模式,通过监听收支类型的combox,从而改变事物和支付方式
export class UserAccountTypeComponent implements OnInit filter_pay_type_change(value){ this.choise_pay_type = value; this.search(); }
1
9f02c29d2df3c04688e71fd7d6f74639
7a13373f9e20df71ee6b2b939d604c9e
Check if lambda function exists return True if it does, return False if it does not
def check_alb_exists(alb_name, access_key, secret_key, region): return True if get_alb(alb_name, access_key, secret_key, region) else False
0
f877922098b4d75fe51a4dfb0dd6f850
d279ab76f2ab2af68e44d499314c88a8
Parse AUDIT log file line into tuple.
words = line.split(" ") parts = None if len(words) < 11 else int(words[10]) return int(words[1]), int(words[3]), int(words[6]), words[8], parts
1
b9ec82cff3c8d4d1973385af8a888281
3cd5beb4271f8dae9984b2047132f854
Returns how many seconds has to pass between each loop for this synchronization to happen.
public abstract class LoopingThread extends SpyThread public int getMsPerLoop() { return(msPerLoop); }
0
878b46b1d2a63874f5520879ee5afe15
e6cef852ef81413ad8123a93b2d18171
Creates and links managers/controllers together
namespace Clyde public partial class Form1 : Form private void CreateManagerObjects() { workSpaceManager = new WorkSpaceManager(formsWindow, animationWindow); navigationManager = new NavigationManager(navigationCntrl); messageManager = new MessageManager(messageCntrl); ...
1
7ec4f8b36a220e359f853fe9d4762766
71a5510bc0addcdff63ff39f3d1a81a4
Gets parent categories tree for dropdown
public function getParentCategoriesOptions(): object;
1
bcb44f6f6c2713730ffe3062e360a76f
f54b7811ea4d45d02211c39771bd78b5
If cookie value is invalid, `null` will be returned. (Error is not thrown.)
class secure_cookie public function __get($key) { if (($data = $_COOKIE[$key]) === null) { return null; } $crypto = new Protocols\AES256($this->settings->secret_website_code); if (($value = $crypto->decrypt($data)) === false) { return null; } return json_decode($value, true); }
1
80454e470161657d410704fe05ee4a5a
6444615f1c3dde26906045b20c0baed8
Returns a urlpattern accessible to an authenticated user.
class D2LUserContext(AuthBase): def create_authenticated_url(self, api_route='/d2l/api/versions/', method='GET'): scheme = netloc = path = query = fragment = '' scheme = self.SCHEME_P if self.encrypt_requests: scheme =...
1
8801d2b85e28e7bb3dca50673d03fce7
dbef4db0695fe8d3d4030626c77697b3
大小写字母随机字符串
class Random public static function alphaNum(int $length): string { $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; return self::str($pool, $length); }
1
ea363fb372924bd29edd38c9db44aacf
22777bcc68fddf3862bc48594d5ce2bd
Get SKU Data by PO_Id
$db = Zend_Db_Table::getDefaultAdapter(); $select = $db->select() ->from(array('in' => $this->_name), "in.*") ->where("in.id = $invoiceId"); $poInfo = $db->fetchAll($select); return $poInfo; }
0
8e7184e683b746d9152f3df813302832
116b7847097c03e43ed7b04374318066
根据时间排序分页取文章
class Article(db.Model): def get_all_by_date(start_time, end_time, page_no, page_size=10): app.logger.info('get article by paginate and datetime ....') articles = db.session.query(Article).filter(Article.deleted == Constant.UN_DELETED.value, Article.da...
1
0795fac58f37ca86cc46dcd4374facd7
82b0f46fae378f723acd377159b222cf
GET: QueriesController/Create
ViewData["ClientID"] = new SelectList(_context.Client, "ID", "IdentityCard"); ViewData["UserID"] = new SelectList(_context.User, "ID", "Name"); return View(); }
1
c1fbc6747d6009eb9987dd827a7988ff
f6828fa76bb952df4cbdd592a7fbaa67
Given a sequence y, infer P(x_t | y). Both the smoothed and filtered posterior are computed, one is returned.
assert np.all(np.linalg.eigvals(o.Q) > 0), "ffbs non-ergodic for degenerate Q" ts = [ t for t in y ] if x0 is None: x0 = ( np.zeros(o.dx), sla.block_diag(1e9*np.eye(o.dy), 100*np.eye(o.dy)) ) xPrev, PPrev = x0 obs = [ (t, yt) for t, yt in y.items() ] nObs = len(obs) xf = np.zeros((nObs, o.dx)) Pf = np.z...
1
d7745708d219fb3324bc59cb2155c090
dcd22598ba43094b309684d24f551e0f
店铺红包授权码生成规则
public int createLevelRedEnvelopeMoeny(int rateCount, int count, List envelopeMoney, Integer sendEnvelopeId, Integer orderId, Integer vendorId,Integer ruleId,String startTime, String endTime, RedEnvRule rule, RedEnv redEnv,Double rechargeMoney) { int i = 0; List<Integer> listRateMoney = new ArrayList<Inte...
0
604ac7dd2de0f91398b30a18105d49d1
0272a99ee18974474ff37911e0cd9603
Synchronously read service definitions.
return this._cache.getAll() .then(cachedServices => { if (cachedServices.length === 0) return this._loadAllServices(); this._loadAllServices(); return cachedServices; }); }
0
6b4f05bfe6d1b068118177683c1cf0fa
ca726103b5f29658dd45be99ba8e3af3
## returns the values in vector 'x' above 'n'
maxN <- function(x, N){ len <- length(x) if(N>len){ warning('N greater than length(x). Setting N=length(x)') N <- length(x) } sort(x,partial=len-N+1)[len-N+1] }
0