query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
dbb879fcce1b0b52dc8306d4e5131930 | c2931b3cc9dd7bc03b437079c3903d9c | Perform several MCTS searches. | for _ in range(0, num_simulations):
leaf = self.select()
if model is None:
leaf.expand_mcts()
child_node = leaf.random_child()
if child_node:
simulation_result = child_node.rollout()
child_node.backpr... | 1 |
f1e3719584ede5761bfafe646648698e | 684ebc14a96aa1d1761b4b4abcc35fb9 | Returns the bounding rectangle for a specified tab in this tab control. | public class WebTabbedPane extends JTabbedPane
implements Styleable, Skinnable, Paintable, ShapeProvider, MarginSupport, PaddingSupport, LanguageMethods, SettingsMethods,
FontMethods<WebTabbedPane>, LanguageContainerMethods
public Rectangle getBoundsAt ( final Point point )
{
return getBound... | 0 |
93711ee9c1ff85ccff916be920117c09 | 501ceb808afd0a0a36bd6d988bfc401a | Total number of Runnables, running or pending. | public class ForkJoinPool extends AbstractExecutorService
public int getRunningThreadCount() {
return workerCounts & RUNNING_COUNT_MASK;
} | 0 |
ba59e9994bbcf5f5498bba0d2f787b8b | ce5372720062b1dc56d04ea0a9536561 | Отдать предмет из инвентаря | public IItem takeItem(IItem item) {
if (inventory.containsKey(item)){
dropItem(item);
return item;
}
return null;
} | 1 |
c478bff24322569523c08a73c3095dfb | 2859c7090065219d817f60f831accc51 | Getter for the users minutes cycled. | class CircularProgressBar(object):
def getManHours(self):
return self.spentHours | 0 |
3df658d1e8161e61a8c8efd755f7eb2a | f3e77bf944a2508d95e34566bbf5da29 | 查询当前坐标center附近的目标,由近到远排列(距离单位为弧度),球面距离 | List<int> rangePos = QueryRangePos(centerPos);
List<int> stepList = new List<int>();
for (int i = 0; i < rangePos.Count; i++) {
int step = GetStepByPos(dict, rangePos[i]);
if (step >= 0) {
stepList.Add(GetStepByPos(dict, rangePos[i]));
}
... | 0 |
06d326cd0592080a87f735193f9da36a | 72e4ee2214a11aa08ad55f137dc9e52e | Remove a condition from an existing Rule object | class SlipperBaseEstimator(BaseEstimator, ClassifierMixin):
def _pop_condition(self, rule, condition):
temp = rule.copy()
temp.remove(condition)
return temp | 1 |
fa7b236e97aa1c3c7cc93dc48f53be74 | e17f30fdfad18d57031d4ceab7f68b2c | Generate the report with the grand winner. | def create_report():
report = generate_report_data()
print_formatted_report(report) | 0 |
cbf84d418829b3ddce93a65b1d54d592 | 01101f817b7f3c4f098ae36badf81644 | 构造函数,可使用模板初始化 | class DedeTemplate
function DedeTemplate($templatedir='',$refDir='')
{
$this->__construct($templatedir,$refDir);
} | 1 |
1cadd1c4f1e7a21e0d06f0e0c964980c | de319ab977667e72c572c02d8ac26185 | 检查参数名称是否重复 | $name = $this->input->request('name', 'trim');
if(!$name){
return Response::json('', 0, '参数名称不能为空');
}
if(ApidocCommonInputsTable::model()->has(array(
'name = ?'=>$name,
'id != ?'=>$this->input->request('id', 'intval', false),
))){
... | 1 |
f58b9f2ba0ff6662bfaf88490966689f | 96cf3eacedac652f5c7744e084a57a9f | clear all mark bits in the header | public class RowHeader extends View
protected void resetAll() { _markers = null; repaint(); } | 1 |
bbeada844714ffd44b6faa6206b5fec7 | dd8533d20e6c0bfc5441b44c3cb20dd5 | 获取一定包含数据类型的表达式所指的列特性 | {
T t = (T)Activator.CreateInstance(typeof(T), true);
t.ColumnExpress = columnexpress;
t.BelongToObject = belongto;
t.ConditionValues = new Dictionary<string, object>();
return t;
} | 0 |
a02b22071d5e3d493ce1683a5d2f8d39 | 467164e63846925f4670f1097ba89071 | Tries to shift the active piece right | if(checkingLines)
return;
bool hasPieceInRight = false;
for(int y = 0; y < pieceStateSize; y++) {
if((pieceY + y) >= height)
break;
for(int x = pieceStateSize - 1; x >= 0; x--) {
if(pieceState[x][y] > 0) {
if((pieceX + x) < (width - 1) && d... | 1 |
c04ad0ffcc99982013a95a4b8398a266 | 61539bbaf24ad6f9e2ec25de993ee9de | Handles both PyLong and PyInt. Notice that `PyLong_AsLong*()` supports both PyLong and PyInt | bigint::Impl **high, bigint::Impl **low)
{
const Py_ssize_t size_n = abs(n->ob_size);
Py_ssize_t size_lo = std::min(size_n, size);
Py_ssize_t size_hi = size_n - size_lo;
std::auto_ptr<bigint::Impl> hi(_PyLong_New(size_hi));
bigint::Impl* lo = _PyLong_New(size_lo);
memcpy(lo->ob_digit, n->ob_digit, size_lo * size... | 0 |
5b1f916198b17e843d6f8df223b1e53c | a0be02c56828af7db7b891695c4706a9 | Creates a new contact in the account
See https://developer.dnsimple.com/v2/contacts/#createContact | return this.contactDAO.create(params)
.then((id) => {
return {
uri: internals.getPath.replace('$id', id),
id: id
};
});
} | 1 |
4ef3e2e0baf39d98477e0a082f652cf4 | 4362889ca6ed60157627c37e89dad6db | Padding between the pie and plot edges, legend, etc. | class ChartSeriesDefaults extends SerializableObject
public function gap($value) {
return $this->setProperty('gap', $value);
} | 0 |
cf0de74745eebb02523f3ff613497d4a | 4941e2e0340f6f81581a8a2820156e2a | ChapReceiveResponse - Receive and process response. | {
UCHAR reply = FALSE;
UINT reply_timeout;
UCHAR cur_addr;
ch_interface[cur_indx].ReceiveUserFct();
if (((cur_ch->flags & DONT_REPLY_MSK) == 0))
{
if( CheckHeader(slave_unit_addr, &reply))
{
if( CheckCRC())
... | 1 |
3d15a4c3c2d7a2dcecb58e98bbdb4bcf | e580cf19b189c45e9eb25b46022dcb91 | Get all the cancellations from log that has been cancelled by phone | namespace Romontinka.Server.Core
IEnumerable<CancellationDocDTO> GetCancellationDocs(SecurityToken token, Guid? warehouseID, DateTime beginDate, DateTime endDate, string name, int page, int pageSize, out int count); | 0 |
3468999a5dcc370916769f360d34c17e | 35f949a337f9ca846878c781543dc71f | 默认关闭逻辑:在监控后台关闭时被调用一次 | class Monitor(object):
def OnShutdown(self):
pass | 1 |
5a64ade2c4d2e3e5f47b7faadac4d360 | 771cac8f982fc68bd493293f3d0efedb | Returns the meta object for the containment reference '{@link org.uppaal.xml.description.description.UABitOrAssignmentExpression#getRight <em>Right</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getETBitAndAssignmentExpression_Right(); | 0 |
9001be64599368866f64fcbc2e089ce0 | a01c9575c3421f9e3398eed63c039e13 | This saves the filter of the specified table. | if (fFilter == null) {
return;
}
if (selected) {
fTableViewer.addFilter(fFilter);
} else {
fTableViewer.removeFilter(fFilter);
}
} | 0 |
23ef13433660fdae8e511a4095001354 | 5c38f6a66ae2732b867a46fecdee42bb | 获取当前时间秒和毫秒,并保存到参数中 | void getSeconds(unsigned long *par)
{
*par = time(NULL);
return;
} | 0 |
eebfd824301085976758a52c0cfb8580 | ebd77c36f17708a2a2b71bd835b6037d | 基于string 构建IndexRequest | public class EsDocument
public void buildIndexRequestWithKV(String indexName,String document){
IndexRequest indexRequest = new IndexRequest(indexName).id(document).source("user","diyaguang","postDate","2019-07-30","message","Hello Elasticsearch");
} | 1 |
ab6de51d16eef49587679ee3cc00ee22 | 56983fe36710cf945db4b501cfbf086c | function that returns a sample space for expected wins, draws, losses for player A | scoreA = self.dat[2][iA]
valA = self.dat[3][iA]
probA = self.prob(iA)
x = np.sum(probA)-0.5
y = np.sum(probA*(1-probA))-0.25
if x == 0:
exit()
return self.dat[3][iA]+((self.dat[2][iA]-x)/y) | 0 |
0de637b188fdf81b53565a9fad798826 | 239bb2f061315a9c1d46d6195f49fe4f | Given an array of integers,
calculate the ratios of its elements that are positive,
negative, and zero. Print the decimal value of each fraction on
a new line with 6 places after the decimal. | fun hackerRank03(arr: Array<Int>) {
val format = DecimalFormat("0.000000")
fun printNumberAsLine(number: Double) = with(format.format(number)) { println(this) }
fun calculateRatio(predicate: (Int) -> Boolean) = arr.filter(predicate).count() / arr.size.toDouble()
fun calculateRatios() = listOf(
... | 1 |
9e32a7e1ff1897dfda0cdf19d77dbf60 | 2954153c62dcffa171a7662f5c65865b | Handles a bold start or end. | class Tokenizer:
def _parse_bold(self):
reset = self._head
try:
stack = self._parse(contexts.STYLE_BOLD)
except BadRoute:
self._head = reset
if self._context & contexts.STYLE_SECOND_PASS:
self._emit_text("'")
return True
... | 1 |
692cc369885fc40e262e66a101115b61 | 784e7e2fbf515644e33fd175fb39470c | 分页请求文章列表 | let url = '/api/articles'
let params = new URLSearchParams()
params.appendIfExists('page', page)
params.appendIfExists('search', search)
const paramsString = params.toString()
if (paramsString.charAt(0) !== '') {
url += '/?' + paramsString
}
return request({
method: 'get',
url: url
})
} | 1 |
82f9731a98409c8e3053a16c4be1d775 | 7c459124f839ef36ac5510066f2bee38 | collect all columns from the current table and convert them to another format | {
$columnValues = [];
$columns = (array)$columns;
while ($row = $this->fetchAsArray()) {
$ref =& $columnValues;
for ($i = 1; $i < count($columns); $i++) {
$ref =& $ref[$this->applyColumnTransformation($columns[$i - 1], $row[$columns[$i - 1]])];
... | 1 |
e714abacc0817f096006c6e630ed49e0 | 8ccabfdf838ceeebe4d8937be361b323 | 网点配车情况柱状图 | CangNetPcEChart = echarts.init(document.getElementById('net-pc-bar-c'));
var realCk = wdPcYck;
var noCk = wdPcWck;
CangNetPcoption = {
color:['#5461a4','#576167'],
title:{
text:'网点配车情况',
textStyle:{
color:'#fcaf17',
fontWeight:'nor... | 1 |
bf8c774cd48cd214919be6722b0e4878 | 3830d4a4b2c62eb51a01d5fee0190421 | https://pintia.cn/problem-sets/994805342720868352/problems/1038429908921778176 | int main(int argc, const char * argv[]) {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
scanf("%lld%lld", &a[i], &val[i]);
}
lld sum = max(0ll, a[0] - val[n - 1]);
for (int i = 1; i < n; ++i) {
sum = sum ... | 1 |
19ba403b838ee2dd2f760f247a323031 | db704f5f394a62d656ce7d5b38abe3f1 | DetailView | function DetailView() {
var osname = Ti.Platform.osname;
var self = Ti.UI.createView({backgroundImage: 'images/bg.png'});
var title = Ti.UI.createLabel({top:'10dp', left:'5dp', width: 'auto', height: 'auto', font:{fontWeight: 'bold', fontSize:18}, textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER, color: '#333'});
self.add(tit... | 1 |
31bee39bbfb61c559fc58626b29112f8 | 12153ff16b3b63964f171c1358678dda | Override original save method to set order number | class OrderItem(models.Model):
def save(self, *args, **kwargs):
self.order_item_total = self.product.price * self.quantity
super().save(*args, **kwargs) | 0 |
12e94727fbc8cbdf409cf962b3cec6fb | 693662e0b06aec146d5860fbf765a7a5 | Pass on textbox text changes to the selected control | namespace D23000
[SmartPart]
public partial class F28000 : BaseSmartPart
private void Control_TextChanged(object sender, EventArgs e)
{
try
{
this.EditEnabled();
this.ExemptionGridView.EditingControl.TextChanged -= new EventHandler(this.Contro... | 0 |
6bf716e219a45f3053d73e15af1bcb2e | 9ca2a0c2557a88fc04b6eac895afc46c | すべての著者名を重複無しで取得します | {
var names = new Dictionary<string, int>();
foreach(var name in Titles.Select(x=>x.Author))
{
if (names.ContainsKey(name))
{
names[name]++;
}
else
{
names[... | 0 |
f11b6e9f8c38c334a582197c89294319 | 40640050b81866e2c80b5eb873caa161 | Set accessor for persistent attribute: flag_pet_curso | public abstract class BaseAcCursoAperturado implements Serializable
public void setCurapeAperturado (java.lang.String curapeAperturado) {
this.curapeAperturado = curapeAperturado;
} | 0 |
88f94f9521d2f83db7f615deb970c83a | efc45c30a2e33c194ede0325dee0bb09 | This function provides the UI of the operation of reinstating. | public class CommonActionFunctions extends AutomationBaseClass
public void reinstatementPolicyCA(int waitTime){
selectDropdownlistByLabel(PolicyActionsUiIds.SELECT_ACTIONS,"Reinstatement");
clickAndWait(PolicyActionsUiIds.MOVE_TO, waitTime);
waitForElementPresent(PolicyActionsUiIds.REINSTATE_AUTHORIZED_BY, waitTi... | 1 |
eaa435ebd7efb92be01dd705fa8f96a4 | 6f4b368276af04bbabf5495a2c1b9442 | Adds a check passed listener. | public class BaseInstrumentationTestRunner extends InstrumentationTestRunner public class SkippingTestResult extends TestResult
public void addSkipCheck(SkipCheck skipCheck) {
mSkipChecks.add(skipCheck);
} | 0 |
fade6fa4cd8d695b3cf1dc593f5162b1 | bdc3bcc25011653d689d671b081283b2 | 设置是否自动调整字体大小,以显示完全
是否自动调整字体大小 | public class HEditText extends EditText implements AutofitHelper.OnTextSizeChangeListener
public void setSizeToFit(boolean sizeToFit) {
mHelper.setEnabled(sizeToFit);
} | 1 |
5aae5378fe75e604433ed7e4582718bf | 1407abe6eafd4d18786e32cb24ed90b7 | 电视节目观看/预约记录接口 | class Video extends Base
public function fangyuan_list()
{
$keytype=input('keytype','fangyuan_title');
$key=input('key');
$opentype_check=input('opentype_check','');
$fangyuan_columnid=input('fangyuan_columnid','');
$diyflag=input('diyflag','');
$sldate=input('reservation','');
$arr = explode(" - ",$slda... | 0 |
b3f4f22a6e268dcd2bb6ef9238b66d57 | 64ea175a0a15eeff6d4e0d4c0ff9bd58 | Configure PHY for link status interrupt gen | uint32_t Eth_Link_PHYITConfig(uint16_t PHYAddress)
{
if (!(ETH_WritePHYRegister(PHYAddress, 21, 0)))
{
return ETH_ERROR;
}
return ETH_SUCCESS;
} | 1 |
e9ef169333b9ca8e8794d5f8ec893060 | f2351e2f2fb36cc6e3a96481272d1978 | サーバーへの接続数が上限だった際に呼ばれる接続コールバック | public void onOpen(Session session) {
retryCount = 0;
if(isDisconnedtedNoticed){
isDisconnedtedNoticed = false;
NotificationUtility.notify(NotificationUtility.NOTIFICATION_CHANNEL_SERVER,
this,
android.R.drawable.ic_dialog_info,
... | 0 |
22f2c81d5a45db7982e2c679b76b0808 | e78be2985565a6ddbc61c491e0630853 | Vector subtraction and addition.
z = z - v'*x;
r = max([norm(y,inf), z]);
for vectors of length 12. Output z is of course scalar. | void difz(const fpair &vin, fpair &vout, dftstruct dft, const fvector &rkz, float dz, int iadd)
{
int nx = vin[0].size();
int nz = vin.size();
int ieo = nx % 2;
int num = ((nx + 1) / 2) * 2;
float *a = (float *)dft.in_dz;
for (int k=0; k<nz; k++) {
for (int i=0; i<nx; i++) a[k*nu... | 0 |
d72f5b3a093ec0f9aac8698d97799056 | 9fde832c000d7686e22095177e04bac0 | 打印速度 | if (speed > 10) {
System.out.println("\b");
} else {
speed++;
}
} | 0 |
9e55bbfda8cbe0eeb9e13995607fe343 | 60232acd29dffcf9a8c33d3bd56edf23 | 设置角标外边距-右,单位px | fun setMarginRight(view: View, rightMargin: Int) {
setMargin(view, NOT_SET, NOT_SET, rightMargin, NOT_SET)
} | 1 |
5332ad5b14335b464a0410d55cf1099a | 0b8296d5383c45f5d01228819863bea1 | Clear build env vars. | def clean_env_vars():
for key in global_vars.keys():
global_vars['Env'].pop(key, None) | 1 |
e14d93a2ea3a9f4f8a1ee2e92b129460 | 716de2f2c171f71cd6f1602df2452f5e | Récupère en bdd la liste des membres actifs | public class Listes extends Controller
public static String listeMembres(){
List<Membre> membres = Membre.find.all();
if(membres.isEmpty()){
return "";
}else{
StringBuilder res = new StringBuilder();
for(Membre m : membres){
res.append("'"+m.toString().replaceAll("'","\\\\'")+"',");
}
res.delet... | 0 |
0dc5534b06cbf05a8db1b2c9167566f0 | 40a2854ae9cada2efb48dbc3dc82cb1a | Method to show the checkin form | def checkin():
return render_template("scanQR.html") | 1 |
2392eb554d6b7a041b10161c1be07491 | 6584622a5e960d41555e47c038a9ad73 | Factory method for invoking CognitiveVRPlugins.SessionTransaction methods | class CommentingManager(osid_managers.OsidManager, osid_sessions.OsidSession, CommentingProfile):
def _instantiate_session(self, method_name, proxy=None, *args, **kwargs):
session_class = getattr(self._provider_manager, method_name)
if proxy is None:
try:
return session_class... | 0 |
6e093c1daa4c51ace9f8b78c342d8b97 | 66d5d8fa1bd9cfbd9a63426a6c01e2c1 | 获取彩妆路径 | img = self.getImageUrl(file_path, suffix, isLocal)
rs = self.DetecFace(img)
if(0 == rs):
color, la = self.Lipstick_color(img)
si_color = self.tool.Get_similiar_color(color)
if(si_color == -1):
return -2
rs = {'color':color, 'brands'... | 0 |
8f9f4a3b873d3e113fd69a40907884a7 | cdb007071c57ea1d400f123f8e7bff42 | Calculate the maximum index | public abstract class AbstractPattern implements SettingsListener
protected int maxIndex(int[] list) {
int x = 0;
for(int i=0; i < list.length; i++) {
if (list[i] > list[x]) {
x = i;
}
}
return x;
} | 1 |
f9bf02b81ae43101abcb7b699d095369 | 4fe51cae6f052396721fe7bff6ff333b | u"""Encontra o menor caminho usando A*. | class GetSolution(object):
def get_a_star_path(self, graph, source, destination):
aStarSchedule = AStar(graph, self.Floyd, self.gama)
return aStarSchedule.aStar(source, destination) | 1 |
e9be329c32aa79921fd92f0b99d54e12 | d3435d7db95692eff940006cf32332aa | Explicitly mark ATS agent(s) as not configured. If any of the agent was not previously configured, no error will be thrown<br>
Note that this method does not perform any operation to the actual agents, neither checks if agent is still running in the provided address | public void cancelAgent(); | 1 |
a50c4c98271ba80de46c492170552e3b | f24d81d4d6d128b32836d0918cb636f6 | Save array of bytes into isolated storage | {
using (IsolatedStorageFile storeFile = IsolatedStorageFile.GetUserStoreForApplication())
{
string fileName = sf.FileName;
using (IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(fileName, FileMode.OpenOrCreate, storeFile))
... | 1 |
e34825b99caa96a364c655129d0ebf23 | 6286a128bd6e6e598010246146c13a63 | Returns the databaseProductName value. | final class ConnectionOptions
public function productName()
{
return $this->productName;
} | 0 |
0fbdad8b8e8b928e8720f46bd516e6d2 | cbda63c82ba9e7f298ce47b17d71390f | Funcion para devolver una persona dado un id de Usuario | ConexionDB conn = new ConexionDB();
Person per = new Person();
try {
String sql = "Select idperson, name_per, address, phone, email from person where idperson = '" + idper + "'";
PreparedStatement ps = conn.getConexion().prepareStatement(sql);
ResultSet rs = p... | 1 |
42f43b48da52ad48a1d3155a1b2adb24 | 8664241f72e762db0b59b9c7088565ee | 是否只扫描实现类 | CallClass::CallClass()
{
setIsScan(false);
} | 0 |
9adffe960d8e2b9c0acaeb79b676435f | 2215e56206cfe940dc9fc1619300ebb8 | Set the color by priority flag. | class PriorityPartitionResult extends PartitionResult
public function __construct(array $value)
{
$value = static::applyOrderValue($value);
parent::__construct($value);
$this->colors(static::getPriorityColors());
} | 1 |
66a9cfcad5574d0df448e532413104fc | 420fddf07393fbacf1b33541e966cf01 | Shooting from the whole array of fire points | public class Tank
public void superFire(){
Direction dirs[] = Direction.values();
for(int i = 0; i < dirs.length-1; i++){
fire(dirs[i]);
}
} | 1 |
b78b9faa5baf006d3e3e43ca40a2eb7a | 3bfe81b204328b0d71753d3a8e2d260d | special constructor for simplifying single transfers | func NewScTransfer() *ScTransfer {
return &ScTransfer{ScBalances{assets: NewScAssets(nil)}}
} | 0 |
b9949cd74e6cd248b3a619e865c44e6e | 7d22a11ff22706829313d411689957ba | Проверка работоспособности мока | namespace Tests
[TestClass]
public class BlogControllerTests
[TestMethod]
public void CheckMediatR()
{
using var scope = serviceProvider.CreateScope();
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
Assert.IsNotNull(mediator);
} | 0 |
a4d4d1407045ef79479dc7488d4f71f5 | 09ca0f35fb54e3c50b994909ca32cf1c | 重写更新Z轴,防止当前视图太靠前 | void ZPlotter::zp_updatePlot()
{
zv_plotView->update();
} | 0 |
df3db8349150586a39f4ad289b65c846 | e22b3d91509b957f246b18bf1ff5db2e | 删除开关锁清单 | var sendLockIdArray = new Array();
var eles = document.getElementsByName("check_lock_ids");
for (var i = 0;i<eles.length;i++){
if(eles[i].checked) {sendLockIdArray[i] = eles[i].value};
}
var sendLockId = JSON.stringify(sendLockIdArray);
$.ajax({
url:"/LockWebServer/login/getAndO... | 1 |
11d090c395801f84869605de1a37189f | 489b0fc6d536749fec760f0a7ba94ae8 | Sum-product belief propagation until convergence. | class LoopyBPInference(object):
def decode(self):
beliefs = self.unary_messages.copy()
for f, (var_i, var_j, pert_radius) in enumerate(self.edge_factors):
beliefs[var_j] += self.lat_messages[0, f]
beliefs[var_i] += self.lat_messages[1, f]
assignments = np.zeros((self.n_po... | 0 |
26ca7563400ff37094ab8e2c744a065b | 03b65de2ab160c9d4cf021a027723177 | Gets read-only memory from current file's input stream from the beginning of the stream. | {
byte[] bytes = new byte[input.Length];
input.Seek(0, SeekOrigin.Begin);
input.Read(bytes, 0, (int)input.Length);
return bytes;
} | 1 |
8182445f516f9eacbfde87498b435944 | 1db1e6f7a6b55a78f101ab8aae7a2be1 | Fill combo with the names of all the Look and Feels in
alpabetical sequence. | void I18nManager::fillLocaleCombo(QComboBox& combo)
{
QSignalBlocker blocker(&combo);
combo.clear();
for (QLocale const& locale: supportedLocales_)
{
QString languageName = locale == QLocale::English ? "English" : locale.nativeLanguageName();
if (!languageName.isEmpty())
languageName[0]... | 0 |
7730dfc1fc8e5cd6375ce659e909e976 | bea141583df0e91e6a5ba09c04d69c25 | Retrieve user IDs of members/owners of any of the given groups
transitively. | class Chain
def group_members_of_owner_ids_only(owner_ids)
owner_ids.present? ? where('group_owner_id.in': owner_ids) : none
end | 0 |
f26bf5a4007bcec3b474d6c2a5373be9 | e389999d5eb4a776696b74601215e115 | Test binary regression get number of parameters | class GetRegressionTest(unittest.TestCase):
def test_reproducible_non_custom_binary(self):
self.mock.is_custom_binary.return_value = False
self.assertEqual('', fuzz_task.get_regression(False)) | 0 |
68e120b6089bc8fb661fc1f014f791c9 | fca2a5d582c639dfb8b97ebfdd8f9f41 | A profile is a root profile if it is not a sub-profile
of another profile. | class ProfileIPIP
def is_base_profile
super
end | 0 |
cfc222d872484d0adabe9b380deae3bc | 667fc4e523ea2290f4dab06d2bfaf5ed | Refresh the list of registered classrooms | public class MainView implements View
public void refreshClassroomListPane(List<Classroom> classroomList) {
classroomListPane.getChildren().clear();
Iterator<Classroom> classroomItr = classroomList.iterator();
while(classroomItr.hasNext()) {
Classroom classroom = classroomItr.next();... | 1 |
66b76a30d1a0a55b65d67b3cd76d734d | b1117e02314a6397139e13caa87a84d7 | Editing scrapper from DB by its id. | ScraperTargetRequest scraperTargetRequest)
{
Arguments.CheckNonEmptyString(scraperTargetId, nameof(scraperTargetId));
Arguments.CheckNotNull(scraperTargetRequest, nameof(scraperTargetRequest));
return await _service.PatchScrapersIDAsync(scraperTargetId, scraperTar... | 1 |
16612f23d31df8429f61b97b779243a3 | 6684a607aaf5f4fc392278ef166c006e | 设置RedisTemplate, 用于刷新过期时间. | @Component
public class MvConsumeServices
public void setStringRedisTemplate(StringRedisTemplate stringRedisTemplate) {
this.stringRedisTemplate = stringRedisTemplate;
} | 1 |
1db5fc4a5feda524b3cddd24a9306a69 | e9515376dc5c81c4e2e19aa9221045f1 | CORE ALGORITHM: parse and markup sentences in the given paragraph | line_parts = re.split('(\d+([a-z])*\))', line)
sentences = []
for part in line_parts:
if part is None or part == '' or self.is_page_number(part):
continue
if self.is_delimiter(part):
delimiter_count += 1
if delimiter_count >... | 1 |
bc1ee5cbca918ad64c68df23da3f457f | 07cb4f9798c734f33c31a47b24d156f1 | 开启ICE | static void icu_init(void)
{
HVA0_DUMMY_WRITE();
#if defined(__ICCARM__)
asm("cpsie i");
asm("isb");
#elif defined(__CC_ARM)
__enable_irq();
__asm("isb");
#elif defined(__GNUC__)
asm("cpsie i");
asm("isb");
#endif
} | 0 |
86da67fada24f85cbf25c61ff102425b | 9c11c9ca3573be7205b2c90528864e61 | 모든 지뢰를 밝히고 끝낸다. | function revealAllMines() {
for (var i = 0; i < gBoard.length; i++) {
for (var j = 0; j < gBoard[0].length; j++) {
var cell = gBoard[i][j];
if (cell.isMine) {
cell.isShown = true;
renderCell({ i: i, j: j }, '💣');
}
}
}
} | 1 |
d7c3768c7e9f8f1c0a9780d3e00d367c | 9a198c3de19ba46c778ae53309de264e | Trivially done by the transformation method, since
the distribution is analytical:
x = \mu - \frac{\log \left[ -\log P(S<x) \right]}{\lambda}
where P(S<x) is sampled uniformly on 0 < P(S<x) < 1. | if not self.trainable:
raise ValueError('Cannot transform parameter not of instance `Distribution`!')
return self.bijection.inv(self.values) | 0 |
cdc126448f5eafdb246aed7cb88861c2 | 4a97cf0b325b96bb4d73956e6f6df62d | Select Paper as the player choice. | def input_faked_paper(prompt):
print(prompt)
return 'paper' | 1 |
16a423d65ea8fc10427df82157c1ec6f | 90d288bcfa0e040ba5be89fec35d2837 | Verify unique keys and order is maintained | test = OrderedDict()
test[5] = 'foo'
test[4] = 'bar'
test[4] = 'baz'
l = list(test.keys())
assert(l[0] == 5)
assert(l[1] == 4)
assert(test[4] == 'baz') | 1 |
3f8b6ff3cd5141d3c844597524fb4649 | 67f606912b812dd1f10cde436b2cd197 | 删除URL中的查询字符串 | public class UrlUtils
public static String removeQuery(final String urlString) {
if (urlString == null) {
return null;
}
return Uri.parse(urlString).buildUpon().clearQuery().toString();
} | 1 |
fc88b1be9733a4b7d413b0aeceb83bdd | fe7667bc2000f14d8246134f81abbe5b | Returns the ID of the scalar function column. THe ID is constructed from the
function's name and the IDs of the inner columns on which the function is
performed. | public class ScalarFunctionColumn extends AbstractColumn
@Override
public String getId() {
List<String> colIds = Lists.newArrayList();
for (AbstractColumn col : columns) {
colIds.add(col.getId());
}
return new StrBuilder(scalarFunction.getFunctionName()).append(COLUMN_FUNCTION_TYPE_SEPARATOR)
... | 1 |
0a60a9ae010507f71e32640298a6b0df | e4ee5f1ebba2ae0240d7ccd23b1192cf | Sets value of 'AdditionalInfoId' property | class RiskDetection extends Entity
public function setAdditionalInfo($val)
{
$this->_propDict["additionalInfo"] = $val;
return $this;
} | 0 |
76949e5194753b17e99ef33bbf9b9905 | 0ebd2ed4c3d15d326b3ee305e196b18c | 1. Function : CheckUserInputNumber
2. Arguments :
strUsrInputNumbers = user input numbers
3. Desc : to check duplication numbers for inputted user numbers | def checkDuplicate(inputNum):
strNum = list(inputNum)
solveNum = set(strNum)
if len(strNum) == len(solveNum):
return 0
return 1 | 1 |
6c5805ddeedbe4c3ed0aedc3e2d43a4a | a26337afe6bb830b4b2e6997e85cc1e9 | 当数组为空或者只有一个数,小和为0 | public class Code_12_SmallSum
public static int smallSum(int[] arr) {
if (arr == null || arr.length < 2) {
return 0;
}
return mergeSort(arr, 0, arr.length - 1);
} | 1 |
b50ac9cf54ac32389f00f4c8b3b6756c | fa6ab3c6ca7df08e668f38d47edb7718 | Creates a new Simple Workflow Service. | class FlowService
public function __construct(
FlowRepositoryInterface $repository,
TaskService $taskService
) {
$this->repository = $repository;
$this->taskService = $taskService;
} | 0 |
456c37e9df37a18da6cf3a19659f141d | fdbd6ef37c1d6784903c981e8eb09af1 | Ищем последний прогноз от каждого из участников (прогноз начинается с $) | function trader_maxindex(array $real, int $timePeriod = NULL): array {} | 0 |
0953de7c04f23feee0321098dae098b8 | e126285b75ce74b052fff5be42606bc2 | create array with specified size and fill with a random integer from 0 to number_size | int* generate_numbers(int size) {
int* array = new int[size];
for (int i = 0; i < size; i++) {
int n = rand() % (size + 1);
array[i] = n;
}
return array;
} | 1 |
622153683616c92bd1ae58bbacb9677b | bdaf48dfbfbd828c729b958b65b1b040 | Splits a string according to the given delimiter
char**args (OUTPUT) - array of tokens created
int *argc (OUTPUT) - number of tokens created
char *str - input string to tokenize
const char* delim - delimiter used to tokenize the string
None | {
char *Token;
char *bPtr;
*cargc = 0;
bPtr = Buffer;
Token = strtok ( (char *)bPtr, SEPARATORS );
while ( Token != NULL )
{
cargv[*cargc] = (char *)(Token);
(*cargc)++;
Token = strtok ( NULL, SEPARATORS );
}
} | 1 |
883f5048d120126bfc0747b4e6807a39 | a264efacf84fe6fdac19e9a59baad67d | 根据ID获取ExamPlaceInfo对象 | public ExamPlaceInfo getExamPlaceInfoById(String id); | 1 |
ea7c9e3c5a5d87547902801b06be89ab | 2ae117c7a10a399c183a7a0e4babd310 | コネクションプールの最大サイズを環境変数から取得します。 <br>
定義がない場合、初期値は100 | String maxPoolSize = this.getValue("maxPoolSize");
if(StringUtils.isEmpty(maxPoolSize)){
return 100;
}
return Integer.parseInt(maxPoolSize);
} | 1 |
3308358eb11de46f9b9850a4c7ba896b | b0883d42a7f687e8e111f212f5d3815c | 指定要查询的字段,支持链式调用
传入字符串时,则原样传入;
为数组时会进行相应格式化,如果需要指定别名,则使用:别名=>实际名称。 | class Query
public function field($field) {
return $this->setOption('field', $this->parseField($field));
} | 1 |
276e636b7f2b21fd932640a41c4daa20 | 0e2b295f1c276b4026d40824356088fc | Delete all Language Keyword data with keyword Text containing specified keyword | int IDLanguage_search_in,
DBConnection dbConnection_in
) {
DBConnection _connection = (dbConnection_in == null)
? DO__Utilities.DBConnection_createInstance(
DO__Utilities.DBServerType,
DO__Utilities.DBConnectionstring,
DO__Utilities.DBLogfile
)
: dbConnection_in;
IDbDataParame... | 0 |
e5f38586f6798f968860235941d39b03 | 738a1e135a67e4325c6a126760d787d8 | 解析数组元素,获取键-值对-偏移量 | $array_keys = array();
foreach($keys as $key) {
$array_keys[$key] =& $array[$key];
if ($pop_keys)
unset($array[$key]);
}
return $array_keys;
} | 0 |
d1e8f81b192af6cd0abdaa64aa572115 | fb6e2ae717680d8ff77258d9a836eb1f | 绑定ListBox数据 | namespace FS.Extends
public static class CheckBoxListExtend
public static void Bind(this Repeater rpt, IEnumerable lst)
{
rpt.DataSource = lst;
rpt.DataBind();
} | 0 |
5f4c9c48a4e718fb056508f8ed6a95a4 | 734410b515aa95f915084d9c34809034 | 重启celery的worker | def celery_restart():
if not celery_started():
fabric.api.execute(celery_start)
else:
fabtools.service.restart(celery_service_name()) | 1 |
b4812d4fddb988d285c8cd2444f88571 | 5dc48e436546c904530780113b4cf353 | 批量创建链接,包括文档、文档夹 | {
JsonResponseModel<CreateLinkResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateLink");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateLinkResponse>>(strResp);
}
catch (... | 0 |
97abb94c66c8319ca96f391ad563f7a7 | 9b49c376dd1719ef8abc5c40afa2ee9b | 囲碁の盤面を数値データに変換する | namespace Ragnarok.Shogi
[DataContract()]
public class BoardMove : IEquatable<BoardMove>
private static byte SerializeSquare(Square square)
{
if (square == null)
{
return 0;
}
return (byte)(
square.File * (Board.BoardSize +... | 0 |
0eb2d83553bda460f5cd8006d44deeea | 6ebaccbe8a5bef31a0fde04634c31533 | The entry code of the closure. | public function getEnter(): string; | 0 |
52d381b3a873a8faa6e7f0fa9be9480e | f581865b56147bdbd41a665285bfa175 | 最新成交 | class Trade extends Model
public function getNewestDealTrade(){
return $this -> alias('t')
-> field('l.number as buy_number,r.number as sell_number,t.number,t.count_price,t.trade_time')
->join('think_user l','t.buy_id = l.id','left')
->join('think_user r','t.sell_id = r.id','... | 1 |
b5c1402138488d71d2377042cdf97f21 | fa51e74494ef1e2abfef61f439077cef | Only called at quake2.exe startup, not for each game | {
static int initialized = 0;
if ( initialized )
return;
initialized = 1;
g_psv_zmax = CVAR_GET_POINTER("sv_zmax");
gpGlobals = &Globals;
gpGlobals->time = gEngfuncs.GetClientTime();
g_engfuncs.pfnPrecacheModel = stub_PrecacheModel;
g_engfuncs.pfnPrecacheSound = stub_PrecacheSound;
g_engfuncs.pfnNameForFun... | 1 |
5dbfb74b47b253d3ca10b0671a100fd3 | 56117ade7367f3f3eea18195c9dfb178 | This is a cache table which is a dict with diffrent expiration time for each key | class EphemeralCache():
def __init__(self):
self._cache = dict() | 0 |
8dae9d36f74fb1ca41cd81f077c10bfb | 8e7ccbdbe3252537fdb70d675d5ac5f4 | No dynamic memory managed | StackDbl::~StackDbl() {
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.