query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
2a60a9c489e366179cdf1159b97fe633 | 9720f2b6f3782fc200ebb699ca7e06fb | Attempts to add a readv, preadv or preadv2 to the Submission Queue without it being submitted.
The actual submission can be deferred to avoid unnecessary memory barriers. | {
if (!TryPrepareReadV(fd, iov, count, bgid, offset, flags, userData, options, personality))
{
ThrowSubmissionQueueFullException();
}
} | 1 |
293ee5799abdad0844ff892b85478db5 | f4def44be56ebfa8a42e1d06f551027d | sets the current car and saves the player preference, which is used later in the game | public partial class GlobalData : SingletonGOB<GlobalData>
public void SaveCarIdx()
{
SecurityPlayerPrefs.SetInt("caridx", (int)_eCurCar);
SecurityPlayerPrefs.Save();
} | 1 |
b909370ebc9d5e1cb919b3eb3e9e3f1c | 3284a840f06db86d6f990038910dfd66 | 给日期设置一个新的月中的第几天。 | public class JsDate extends JavaScriptObject
public final native double setDate(int dayOfMonth) ; | 1 |
a2d6ad27c4f81ea97da660238158335e | 65a0a11be5334612ac7dab8945ce6644 | 获取 零售价 | @Table(name = "tbx_time_price_detail")
public class TimePriceDetail
public BigDecimal getRetailPrice() {
return retailPrice;
} | 1 |
d40b51d7b0413d1675479955c6bb45d2 | ab051db7dc9cb4effd706d592ec1780f | get a lw_visitor by condtion | class PurviewLiveModel extends PipiActiveRecord
public function getPurviewLiveByCondition(array $condition){
$criteria = $this->getDbCriteria();
$criteria->addColumnCondition($condition);
return $this->findAll($criteria);
} | 0 |
3177a5b354d25ebd795295705fee81cd | b2854af7dc685da0e910423cc888d3b4 | Logic which fires immediately prior to an item being added to cart. | namespace Avastone.Ecommerce public class AvastoneProductOptionSelector : ProductOptionSelector
public virtual void OnAddToWishListBefore()
{
return;
} | 0 |
df112664c846d6aad65cefa2e34da48b | ef3db9135385749f704c48ed1301acd2 | programmatically loop though employees and display each name as <li> element. | let ulEmployee = $('#addedEmployee')
for (let i = 0; i < employeeArray.length; i++) {
ulEmployee.append(`<li> ${employeeArray[i].firstName} ${employeeArray[i].lastName} ,
${employeeArray[i].title} , ${employeeArray[i].idNumber} , ${employeeArray[i].annualSalary}
<button class="deleteBtn"> DELETE</but... | 1 |
677d79f4216f11e8dbd2c3984ce85ef0 | 5e5461b06d21982b5c8d0f1f4df668e2 | Abilita la mostra delle risposte corrette per una sessione nel database | $query = sprintf(self::$UPDATE_RISPOSTA_MULTIPLA, $updatedRisposta->getPunteggio(), $updatedRisposta->getAlternativaId(), $elaboratoSessioneId, $elaboratoStudenteMatricola, $domandaMultiplaId);
Model::getDB()->query($query);
if(Model::getDB()->affected_rows==-1) {
throw new Applicati... | 0 |
03ebbd6eab2e9a0acf3738e47a2a7798 | 2c50dabbc1f1674ad163bc66eab838b3 | Try to migrate all active databases. This should not be called unless Django has
been initialized. | class S3Migration:
def migrate(self):
self.run_model()
current.s3db.load_all_models() | 0 |
438ffb1b41a98a17bf7cd8c3817e3a39 | d12c2c0598acfc7722b22c9a1cdf1984 | 處理所有SVN 與 Excel比對作業 :
1. 找出 SVN 與 Excel mapping data
2. 分別處理 Bug , Spec , Other 分類 | refs = db.ref_str.find({'host':{'$regex':'bugzilla','$options':'i'}})
for ref in refs:
host = ref['host']
print(host)
commit_result = db.commit.find({'gitcommit.message_t': {
'$regex': '(bugzilla)[\s]*#[\d]+|(bz)[\s]*#[\d]+|bz[\s]+|bugzilla', '$options': 'i'}})
text =... | 0 |
69cd4ba2babdcc52451007654653cb61 | 4fc895ba62d56f9a1e3c8ef27174152b | Parse the arguments from the http request. | class HTTPRequest(object):
def parse_post_attributes(self):
self.arguments = colony.legacy.str(self.received_message)
self.parse_arguments() | 1 |
e93365cca96793771ae34eace10e59f7 | d769f7ae7009f518401f367f37abe7d6 | Get le nombre d'étudiants du parcourt type | if (haveStudents()) {
int studentCounter = 0;
ArrayList<TreeNode> studentsNodes = CareerStudentsList.getTreeNodes();
for (TreeNode studentNode : studentsNodes) {
studentCounter++;
}
return studentCounter;
} else {
re... | 1 |
74be5c5e1e4d442c25de076d5012c74f | 7eb0ea19929a035f055932e3c7c43a12 | Ensure the size suffix converts to kilobytes with decimal string label as expected. | form = SelectForm()
form.helper = FormHelper()
form.helper.layout = Layout(
Field("method", context={"label_size": Size.for_label("l")})
)
assert parse_form(form) == parse_contents(RESULT_DIR, "label_size.html") | 0 |
903b23246b4ba946356daff00783e07e | c83742c89415f8c6a0f4223168758988 | 根据流程实例id和状态名称查询活动的执行实例 | public List<Map<String, Object>> queryProcessInstancesWithVariables(int state,String varName,String varValue) throws Exception; | 0 |
3582be53038fd16e9acfc322ed4244e3 | 8e7579cec025723bb24ba0bba33303a0 | Tests the binding of a Form with a single file attached. | form = DocumentForm()
self.assertTrue('name="myfile"' in unicode(form))
self.assertTrue('myfile-clear' not in unicode(form))
form = DocumentForm(files={'myfile': SimpleUploadedFile('something.txt', b'content')})
self.assertTrue(form.is_valid())
doc = form.save(commit=Fals... | 1 |
c7f2156eb6ac4c3252deb7553599f849 | 66b984a2060b3d3f3fac85125667a17c | 测试go中的字典map,以及其迭代方式 | var dict1 map[string]string = map[string]string{"name": "lnj", "age": "18"}
fmt.Println(dict1)
change(dict1)
fmt.Println(dict1)
} | 0 |
e1af3d7369f80fa8c08059d18adb0dd6 | 4f5c87ab9924e5309a5d73a637fc17e3 | Calculate subscription count based on subscription plan | class SubscriptionAbility
public function value($feature, $default = null)
{
foreach ($this->subscription->plan->features as $key => $value) {
if ($feature === $value->code) {
return $value->value;
}
}
return $default;
} | 0 |
0a72a795991aa78e545b9cb8b1284946 | 83b006633930ccb4b823c3dcf64b7882 | Helper functions to add and remove entries to the table
that maintains a list of all endpoints (vnd's) available on this device. | const newLength = state._epList.push(ep);
state._epDict[ep.addr] = newLength - 1;
} | 1 |
2f50ffdf3335d96addb3aa346a84be6f | 4d00e36221758be08d92401f100f6412 | 经验瓶是否满了 | local function fnCheckExpFull( addExp )
local pConch = mModel.getAfterAddExpConch(conchData,addExp)
return pConch.va_item_text.level >= mModel.getMaxLevel(conchData)
end | 1 |
17139dd9e81c7b160adf9801559dfd65 | 254d0a53b39ed9d6e55411b742a8f745 | Calcula la suma del total de aristas que cruzan por el corte | public class CiSEOnCircleNodeExt
public int calculateTotalCrossing()
{
Iterator iter = getIntraClusterEdges().iterator();
int count = 0;
ArrayList temp = new ArrayList();
temp.addAll(((CiSECircle) this.ciseNode.getOwner()).getIntraClusterEdges());
temp.removeAll(this.ciseNode.getEdges());
while (iter.hasNe... | 1 |
5f0814b59c13f9b36d32115f6787b833 | 16e85173bba5ee285c367f745017de22 | This function calculates the full generic CMAC on the input buffer with
the provided key. | {
static unsigned char T[16];
osal_memset( T, 0, 16 );
sm_CMAC( key, M, 0, T );
sm_CMAC( key, M, 16, T );
sm_CMAC( key, M, 40, T );
sm_CMAC( key, M, 64, T );
return;
} | 0 |
c59ca5b21e286fff1bef17858889d98e | 1674718be8769d4469958e66472cba50 | Evict tasks exceeding limits. | class Backend(BaseBackend):
def cleanup(self):
TaskMeta.objects.delete_expired() | 0 |
3f178124905d0045da24a53396915c6c | a2d560e51957dc7e32874e50a8b0e190 | @brief ファイルに書き込まれたcrontabフォーマットの文字列を解析してentry構造体を作成する。
作成された構造体は、不要になったときメモリの解放をする必要がある。 | char *pch, *curpos;
pch = &entry[1];
curpos = ++pch;
pch = strchr(pch+1, '|');
memcpy(p->cod, curpos, pch-curpos);
curpos = ++pch;
pch = strchr(pch+1, '|');
memcpy(p->title, curpos, pch-curpos);
curpos = ++pch;
pch = strchr(pch+1, '|');
memcpy(p->room, curpos, pch-curpos);
curpos = ++pch;
pch = strchr(pch... | 0 |
1c295c273cc46439dbeae844cbe0b922 | 864aa740f7d518219040a59f38477259 | Configura o painel principal. | void setPainelPrincipal(UIMovimento painelPrincipal); | 1 |
6384087f5624a5fa98a8ca894f637e3e | 1de2aae756ee4e403f5ad5fdef382b11 | @brief Read from the DMP memory.
This function prevents I2C reads past the bank boundaries. The DMP memory
is only accessible when the chip is awake. | int mpu_read_mem (unsigned short mem_addr,unsigned short length,unsigned char*data)
{
unsigned char tmp[2];
if (!data)
return -1;
if (!st.chip_cfg.sensors)
return -1;
tmp[0] = (unsigned char) (mem_addr >> 8);
tmp[1] = (unsigned char) (mem_addr & 0xFF);
if (tmp[1] + length > st.hw->bank_size)
... | 1 |
8b9910b863b6ee1707d51b6d6a834f7d | 206f13d2a255f0045637190d59d71bf8 | Test that vacant rooms are added to relevant list | class AmityTest(unittest.TestCase):
def test_get_available_room(self):
self.assertEqual(len(self.building.get_available_rooms('LIVING')), 0) | 0 |
2839ecb2af9f62fb47a170ac9238f744 | 711140186eb2073322678033377ee064 | Speichert die Angaben des Arbeitsgebers zu einem Kunden | public class FilePersistenceManager implements PersistenceManager
public boolean speichereMitarbeiter(Mitarbeiter m) throws IOException {
try {
oos.writeObject(m);
return true;
} catch (IOException e) {
return false;
}
} | 0 |
8b80db9579211f39926f41641d8a2ec8 | 623a1679c03f5ddb2f4b88e993b7c551 | 判断是否停牌
注意:早上开盘前和下午收盘后会有不同 | code = code.upper()
yesterday=self.getDailyHistory(code,1)['open'].values
today_open=self.getTodayOpen(code)
if not today_open:
return True
if len(yesterday)==0:
return False
l=self.ST_stock[self.ST_stock['DATE(date_time)']==self.current_time]['c... | 0 |
ec42a3d14adc17aab41c28d1e864c4e9 | e4465b50b27b3026449cc9bb59987a7c | 显示所有判断错误的方块 | function check(o) {
var id = o.attr('id'),
x = id.substr(2, 1),
y = id.substr(4, 1),
val = o.num(),
tx = Math.floor(x / 3),
ty = Math.floor(y / 3);
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
tn[i * 3 + j][0] = tx * 3 + i;
tn[i * 3 ... | 1 |
19cb4e42ac9d2b16eae20ba562ef876c | 8194c82e1752b69236cf9680dec8295b | 生成由四元组拼接成的字符串 | def tup_convert(tup):
str = ''.join(tup)
return str | 1 |
74f248ba26dc0940d7bb753fdcd108a4 | b9909c710d1989b6b0897ee1fe8b7907 | 移除所有为空,或已经销毁的Activity | for (Activity activity : activities) {
if (activity != null && !(activity instanceof MenuActivity))
destroyActivity(activity);
}
if (activities.size() == 1 && activities.get(0) instanceof MenuActivity)
destroyActivity(activities.get(0));
activities... | 0 |
1023fa45c3a7cfe0cde4ab46bc96cb21 | f308d17416bc3712322f03cb713c651d | Sets the default rule description. | @Fluent
public final class NsgSecurityRule
public NsgSecurityRule withDescription(String description) {
this.description = description;
return this;
} | 0 |
c0c2777573800706877101b367a5571e | 6c4c8d057b9fb4e6ba53c8a3e78c594c | Calculate capital recovery factor. | class Corp(object):
def fcf_revenue_r(self, startdate=None, todate=None, data=None, **kwargs):
data = self._get_states_data(startdate=startdate, todate=todate, data=data)
fcf = self.__state('fcf', data=data, **kwargs)
revenue = self.__state('bizinco', data=data, **kwargs)
return fcf / re... | 0 |
b8fa478aa30ce7915e2a731d4f0180b1 | bddf931357d9ff3deda9d6cd549776d9 | 获取_id为member_id的member对象。 | class voa_uda_uc_member extends voa_uda_uc_base
public function get_by_id($m_id = 0, &$member = array()) {
$member = $this->serv_member->fetch($m_id);
if (empty($member)) {
return $this->set_errmsg(voa_errcode_uc_system::LOGIN_ID_NOT_EXISTS);
}
return true;
} | 1 |
7c1523e051535c6546a8830d9a208fca | c1f354309420cc32fbdc548c11f65192 | function to simulate spread with temporal BFS | percentage = lambda x, n: np.sum(np.where(x >1, 1, x)) / (n*n) * 100
world = np.zeros(n*n).reshape(n, n)
world = start_points(n=n, world=world)
worldnotfull = True
while worldnotfull:
if percentage(world, n) <= threshold:
world += shifting(world, 1, 1, 0, 0)
else:
... | 0 |
7825df7eda33f6ad2bd20e3714421e9a | 88226c8fee22c91e07669acfd224e4f8 | 获取所有bgm | public class GameScreen implements Screen
public List<Sound> getBgms() {
return bgms;
} | 1 |
7ed7cc3b9bf52eb356a4c2e011e482d5 | 61b4bbe83f23f7a4b4d512770cf3d19a | 创建2个framebuffer作为每次渲染结果的叠加专用纹理 | fb = new int[1];
depthRb = new int[1];
renderTex = new int[1];
GLES20.glGenFramebuffers(1, fb, 0);
GLES20.glGenRenderbuffers(1, depthRb, 0);
GLES20.glGenTextures(1, renderTex, 0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTex[0]);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRA... | 0 |
c8f4398cd570e059a704c97a5f30f21a | 3418115a019e39e35c17566cc76b2b53 | Select who to attack next | {
List<Agent> villagers = AliveOthers.Where(a => !werewolves.Contains(a) && a != possessed).ToList();
List<Agent> candidates = villagers.Where(a => IsCo(a)).ToList();
if (candidates.Count() == 0)
{
candidates = villagers;
}
... | 1 |
70b7407ce9652a6058f9277b52d00aea | 3f0f8bc44f952ed94965321f5fba0d38 | Start the debug helix token flow. | class HueFlowHandler(config_entries.ConfigFlow):
async def async_step_user(self, user_input=None):
return await self.async_step_init(user_input) | 0 |
82c8482cfad7934bedc42b33960a6e6a | 65857ccdeba9762738f969aeb54d10a6 | https://github.com/glesys/API/wiki/API-Documentation#loadbalancerdetails | public final class ElbFunctions
public static CompletableFuture<GetLoadBalancerResult> getLoadBalancerPlain(GetLoadBalancerPlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("aws:elb/getLoadBalancer:getLoadBalancer", TypeShape.of(GetLoadBalancerResult.class), args, Utilities.wi... | 0 |
0c23bf4217f7f21cf48908358d296ccd | 4e2c983719e3db4eb83f3ab2ab1f16d9 | Iterates through the alphabet one letter at a time | def character_generator(text):
while True:
for i in range(len(text)):
yield text[i] | 0 |
3752f11bc773503028b49c73c9892577 | b7952ff496c7c9e76776fda1b739847b | This adds a property descriptor for the Elem Type feature.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_GeneratorEntityElement_type_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_GeneratorEntityElement_type_feature", "... | 1 |
d3689b3f09d35f3661cc9c1f649aa46a | d6a42b31e706cb6798d3200eae6ae9a3 | -----------------------------------------------------------------------
Bind Comments settings
----------------------------------------------------------------------- | namespace WebCounter.AdminPanel.UserControls.ActivityRibbon
public partial class CreatePublication : System.Web.UI.UserControl
private void BindPublicationAccessComment()
{
ddlAccessComment.Items.Clear();
foreach (var publicationAccessComment in EnumHelper.EnumToList<PublicationAcces... | 1 |
449e0c2e88fdff8db4436290a2f1db7b | f3608a4c12ac05b1e5211cc0a5aa9af0 | 当 doodle view 没有准备好时,将触摸事件处理为 cancel 事件 | public class GestureCropImageView extends CropImageView
@Override
public boolean onTouchEvent(MotionEvent event) {
if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
cancelAllAnimations();
}
if (event.getPointerCount() > 1) {
mMidPntX = (e... | 0 |
39b5b25f74973356849e93de983852d6 | ce680fd208af191908db9bc6580e925a | ******************************************************************
Autocomplete para las labores de sinv | function filtrarLab(e) {
var trId;
var trNombre, trCapacidad;
var itemValue = $(e).val();
$('#tbLab tbody tr').each(function (i, tr) {
trId = $(tr).attr('id');
if (itemValue != '') {
$('#' + trId).hide();
}
else {
$('#' + trId).show();
}
... | 0 |
52f936418e068755cd5b2b2966b5a213 | 7a57cdb691d2c8314f91fb6b6ae9baf2 | 指定字段进行默认升序排序 | namespace LeanCloud.Storage public class LCQuery<T> : LCQuery where T : LCObject
public LCQuery<T> OrderByAscending(string key) {
Condition.OrderByAscending(key);
return this;
} | 1 |
e610f120df11bfa445cad6f3b02e65f3 | 0d68ecdf97494708b0d9e38bbade8543 | 返回日期是所在月的第几周 | public class UIWorkSchedule extends BaseFragmentActivity implements GestureDetector.OnGestureListener, OnDateSetListener, TimePickerDialog.OnTimeSetListener, AdapterView.OnItemClickListener
public int getWeeksOfMonth(int year, int month) {
int preMonthRelax = 0;
int dayFirst = getWhichDayOfWeek(year, mo... | 0 |
1387a65dd033a4e79c7a4fe28a837a52 | 5b037032805e84ab035dfef1eb889b36 | Implements the JSON-LD Framing Algorithm. | class JsonLdProcessor(object):
def _frame(self, input_, frame, options):
state = {
'options': options,
'graph': '@default',
'graphMap': {'@default': {}},
'graphStack': [],
'subjectStack': [],
'link': {},
'bnodeMap': {}
}... | 1 |
ca220a579eaf1148e653462029058041 | 1b59715fe33f20fa9bbd5bf9e46e8837 | Callback message: export file epilog section. Progress 0-100. | uint16_t tmp =0;
if(octopi_choose_status)
{
int k=0;
char out_t[128];
send_to_curl("curl -s http://localhost/api/job");
parse_string(buffer,"\"size\":","}",out_t,&k);
unsigned int tlen=atol(out_t);
parse_string(buffer,"\"filepos\":",",",out_t,&k);
unsigned int plen=atol(out_t);
if(tlen<... | 1 |
6f2da76a1ba283c4e96933dc2dbc19c7 | fbdc3ff9143972acfb723ec82d5e8e7b | PriorityQueue's test suite | q = PriorityQueue()
for i in range(5):
q.push(i, -i)
assert len(q) == 5
assert q.pop() == 0
assert q.pop() == 1
assert q.pop_with_priority() == (2, -2)
assert len(q) == 2 | 1 |
b77e6f2cdb9d01e709e4e3c11cf4a2c4 | 88b77636c9a206e1a55d1da08205a1c6 | array of fields to ignore when updating | class Service
def ignorable_fields
["created_at", "updated_at", "approved", "discarded_at", "organisation", "notes_count"]
end | 1 |
ba184bec73052ab24cac7731ac67d657 | 669ac905ff8adf12e35dc5ab369d829c | Tests the correct cleaning of trailing spaces. | class LatexSourceSectionTest(unittest.TestCase):
def test_trailingSpace(self):
qns = [x for x in self.createSource("%ID camel \n%title I'm a camel\n%Explanation I \nGot 2 humps, see")]
self.assertEqual(qns, [{
'_type': 'tw_latexquestion',
'id': u'camel',
'tit... | 1 |
1d38750cbb18b71316d03c2637a7cc28 | 4eef7f650a77078a2fbc67563197072a | Unhooks the RTP events. | {
m_timer.Expired -= Timer_Expired;
if (m_toneController != null)
m_toneController.ToneReceived -= HandleDigitDetected;
AudioVideoCall.StateChanged -= HandleAudioVideoCallStateChanged;
if (AudioVideoCall.Flow != null)
AudioVideoCall... | 0 |
d0a4682c522419687d60645b45ff8d45 | 95666cea58ed60c9bdd86d0a0cad21fe | Generate the memory usage tree. | def default_memuse_analysis_fn(prefix=""):
import topo
print "%st%s: %s" % (prefix,topo.sim.timestr(),allsizes_mb()) | 0 |
0cd0b14789d1ddd6778ff59b62e3f345 | ae4c1631755023d9c0a5a13e9567b8de | Copies a source buffer to a destination buffer, and returns the destination buffer. | {
BL_ASSERT(sourceStartPosition >= 0 && length >= 0 && sourceStartPosition + length <= bufferLength+1);
memCopy(&destination[0], &buffer[sourceStartPosition], length);
} | 0 |
5d39c83138d54330ea941e5288708ac4 | 8c7b82339e8bfd8fe7b62d9042201481 | Keyboard interactive authentication sequence. | string username,
Func<string, CancellationToken, Task<string>> responseTask,
CancellationToken cancellationToken
)
{
if (_loginState != State.Initial)
{
throw new SshAuthenticationException("An authentication request was already... | 1 |
8fe9ce6903c67c76ffee866c98e44961 | 5ca7516de2e549f11e67ad21356d8153 | Updates an existing ActSactAsigna model.
If update is successful, the browser will be redirected to the 'view' page. | $model = $this->findModel($CODIGO_ASIG, $ID_PER, $CEDULA_DOC, $PARALELO, $ID_CAR, $ID_SEM);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'CODIGO_ASIG' => $model->CODIGO_ASIG, 'ID_PER' => $model->ID_PER, 'CEDULA_DOC' => $model->CEDULA_DOC, ... | 1 |
881e9b66b198c8a354a2bd06957983e0 | 26ca7ca6e3238ea27182997c5d9726a4 | 逻辑回归 | def logistic():
column = ['Sample code number','Clump Thickness','Uniformity of Cell Size','Uniformity of Cell Shape','Marginal Adhesion','Single Epithelial Cell Size','Bare Nuclei','Bland Chromatin','Normal Nucleoli','Mitoses','Class']
data = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databas... | 1 |
cbe7caaba53327cd01b9f91e28bc9d6d | 7f61448ad6da3ef0f9cb03f40c5be655 | https://www.grc.nasa.gov/WWW/K-12/airplane/atmosmet.html | cases like (1) | 0 |
70ab10ea2fab05d162c0e9d1ba743953 | 9e7956558dc97f9d058cf5ba290448f3 | Copies and converts the provided PyTorch GRU weights into this layer. | self.gru_1 = GRU(n_in, n_hidden, n_out, batch_size=batch_size)
self.gru_2 = GRU(n_in, n_hidden, n_out, batch_size=batch_size)
self.params = self.gru_1.params
self.params += self.gru_2.params | 0 |
c54d8110bf06b03ef824629e786af921 | 0af22fc1861f13c79a0d95c66e134350 | Проверяем кеширование результатов запроса score_request. | self.client.force_login(self.is_authenticated)
self.client.get(reverse('index'))
self.client.post('/new/', {'text': 'cache_test_2'})
test_post = Post.objects.create(
text="test_cache",
author=self.is_authenticated)
response_2 = self.client.get(reverse('ind... | 0 |
1866f0d271ed5c7074ba0969dd49fc5c | ce5fbe7706103404d79ce2701d7e6d04 | Subscribes the given method to the "OnHeartRateChange" event. This event will be fired when continuous
measurement is enabled and a new heart rate is received. | {
string hrm = GetStringValue(e.SensorReading);
bandServiceManager.bandTelemetry.HeartRate = hrm;
ApplicationData.Current.LocalSettings.Values["HeartRate"] = hrm;
IoTHubServiceManager.SendMicrosoftBandTelemetry(bandServiceManager.bandTelemetry);
} | 0 |
1cda1cefa63c97b5d212f60220a8a0f4 | 01e72462e52dcd2e0fce513a0c5757f9 | Добавление основной настройки SimpleInjector | {
services.AddSimpleInjector(container, options =>
{
options.AddAspNetCore()
.AddControllerActivation();
options.AddLogging();
options.AddLocalization();
});
return services;
} | 1 |
80727a859ad8b24559845f2452736e78 | 071037817cc273ca34d4bc4d6b4bd87c | 查询试读长度 | {
$TadDataCenter = new TadDataCenter('tad_book3');
$TadDataCenter->set_col($tbsn);
$data = $TadDataCenter->getData('length');
$lengths = [];
foreach ($data as $tbdsn => $value) {
$lengths[$tbdsn] = $value[0];
}
return $lengths;
} | 1 |
8bc4601eef8b0fd17d7fecbc171121b5 | a74ac24a8354730bae5db519fb2de9d9 | 更新退貨單主檔AdjustNo | {
if (is_array($orderDeliveryNoArr)) {
$arrDataDelivery['showcaseAdjustAfterNo'] = $showcaseAdjustNo;
$arrBindDelivery = $this->db->get_binding(DBTableField::tableOrderDelivery(), $arrDataDelivery, 'update', array_keys($arrDataDelivery), ['sno']);
$this->db->set_update_db... | 1 |
7057ca7aa42359b491c51d6fc82afbdc | 369245b5a8e60059b2f507e635ae211d | Reflect linedir in the plane spanned by planedirs | const CPlane3D& pl) const
{
double top = pl_n.DotProd( pl.pl_n);
double bot = sqrt( pl_n.Length2() * pl.pl_n.Length2());
return ( fabs(bot) > SMALL_NUM) ? top / bot : -2.0;
} | 0 |
c2fc4a6e8026963831c279b0fcfab640 | e1a5da181b7b2583bf8d65a3c2af1f4a | labrl文字被点击时,对应的表单获得焦点 | function focusLabels()
{
if(!document.getElementsByTagName){
return false;
}
var labels = document.getElementsByTagName("label");
for(var i=0;i<labels.length;i++){
if(!labels[i].getAttribute("for")){
continue;
}
labels[i].onclick = function(){
var ... | 1 |
d2d4c19d7f187683666f992f4955408a | ee36005838103049a997f6f706717fa6 | Called when the user changes the search type | export class SearchBox implements OnInit
searchTypeSelected(event: MatOptionSelectionChange, model: string) {
if (event.isUserInput) this.search(model);
} | 1 |
d16a3caaaaf0da893d8e89c145356551 | 66bd9e98dc0550bd3c0c4fcfae385111 | Open a file on the remote server. The arguments are the same as for
python's built-in C{file} (aka C{open}). A file-like object is
returned, which closely mimics the behavior of a normal python file
object.
The mode indicates how the file is to be opened: C{'r'} for reading,
C{'w'} for writing (truncating an existing... | class HttpFilesystem(object):
def open(self, path, mode='r'):
path = self.abspath(path)
if 'w' in mode or 'a' in mode or '+' in mode:
raise ReadOnlyError('read-only filesystem: ' + path)
_log.debug('open %s mode=%s', path, mode)
return closing(urlopen(path)) | 1 |
1a7843021693b425f3429b35dc7e1bca | 631cf19d19518a0a1920ea5987c65575 | Test if Post created properly | class ContactPostTest(TestCase):
def test_post(self):
self.assertEqual(302, self.resp.status_code) | 0 |
0359bca19c86a32ea1333ca4dc22d967 | 58f107a9d054f2051bf0f314239aaa8a | convert float hours to 12h format with no suffix | var hr = hours + 0.5/60
var h = Math.floor(hr);
var m = Math.floor((hr-h)*60).toString();
h = h.toString();
if (h.length < 2) {h = "0"+h;}
if (m.length < 2) {m = "0"+m;}
return h+":"+m;
} | 0 |
a896fb7c581f68e0bc917b5c49f195c6 | 2601052dfc94b724653b0a0bc4efdfa1 | Dadas duas posições calcula o rumo da primeira para a segunda | novo_estado = list(estado)
indice1 = novo_estado.index(cidade1)
indice2 = novo_estado.index(cidade2)
anterior = list(novo_estado[:indice1])
posteior = list(novo_estado[(indice2+1):])
trecho = list(novo_estado[indice1:(indice2+1)])
trecho.reverse()
return list(anterior + trecho + posteior... | 0 |
c6355e12c475a57bc814739ecf6ff8a3 | 09d337789e052a1f4cf319bf91d648b8 | 继承修复示例,virtual和override | namespace Types
class Program
static void InheritanceDemo()
{
} | 0 |
6d9b1bb3bb3dbb2f2122870bc1e753e4 | 65cde202fa355bf19881536fb37a9421 | 获取DataTable第一行,第一列的值 | {
object obj = 0;
if (dt.Rows.Count > 0)
{
obj = dt.Rows[0][comlums] == DBNull.Value ? 0 : dt.Rows[0][comlums];
}
return Convert.ToInt32(obj);
} | 1 |
d1303a826ec259989976fdbcca5364f1 | b2c59ba2f88cff0d6abf33e5e61c7513 | проверка принадлежит ли эта колода пользователю | class UserCardIndex(Index):
def CardCheckerLevel(self, tValue: dict, tCard: UserCard) -> bool:
if not isinstance(tCard, UserCard): raise TypeError("tCard needs to be a user.UserCard")
return super().CheckerNumber(tValue, tCard.mLevel) | 0 |
a212ab661f8740571eaa655d08108ef7 | 2646589a63a50f3e395ef771b40e94cd | 在PLSetting中插入内容。有可能会插入创建人、时间、修改人、时间 | public class EntityMsg
public static void setInsertInfo(Object object) throws Exception {
invokeSet(object, "recCreator", "System");
invokeSet(object, "recCreateTime", DateUtils.curDateTimeStr14());
invokeSet(object, "recRevistor", " ");
invokeSet(object, "recreviseTime", " ");
} | 1 |
00cf73588e9770e97f6da5c37c9539b7 | 498bbe090c24b2cd00c9165b0db46d11 | Poistaa yksittäisen muistiinpanon. | public class Kartta
public void poistaMonsteri(Monsteri m) {
m.getSijainti().monsteriPoistuu();
monsterit.remove(m);
} | 0 |
9652a90eb15b2abbc6c41868c8d3742f | 8d0389dbfe32c2df17e5cdafbf09f499 | 获取缓存的model实例 | namespace thesis.model
T GetModelByCache(int ID); | 1 |
f870d2eaeb4062c802f7017256ca02b8 | 8e2cf75c4afed76d31fc5e9acfa4451c | Bot tries to stale mate, or at least not give the player any opportunity | if (mod_id != CSTRIKE_DLL) return;
if (!hasJoinedTeam) {
rprint("Need to join team, doing that now");
JoinTeam();
return;
}
determineCurrentNode();
if (isDead()) {
if (!bInitialize) return;
rprint("Dead, need to re-initialize");
cBot *botPointerOfKil... | 0 |
bf0ef15ea725571c120a669a01ef33ab | 8a3fd7d65ba714049909758205dc0275 | 마이페이지 결제수단 | public class MyPageDTO
public String getPayment() {
return payment;
} | 1 |
cca2259be1d429b5f72c69f98ce5b9ec | aec31f61c6329594a9ebe4b3820a07df | Feature selection based on the scores given to the features by the
RandomForest algorithm. | X, y = shuffle(self._bunch.data, self._bunch.target)
X = X.astype(np.float32)
sfm = SelectFromModel(estimator=estimator,
threshold=None,
prefit=False
)
sfm.fit(X, y)
scores = self._get... | 1 |
98a40a5bdd04e38b9f64792762c0700e | c056394df4226b835bc5ffab52ab6fe8 | Accessor for retrieving the current size of the
available buffer space, in bytes. | protected
int get_buffer_size()
{
return buffer_size;
} | 1 |
8184fe47639e727a6a7ebddc864d270c | 5f34e90a959309081105c4f511bbc2d0 | 根据学校id获取流程计划
create by dale 20181127 | {
$that = $this;
return $this->fetchCached("school_id:{$school_id}", $school_id, function ($school_id) use ($that) {
$sql = "SELECT * FROM {$that->getTable()} WHERE school_id = ? AND status='published'";
return $that->getConnection()->fetchAll($sql, array($school_id)) ?: null;
}
);
} | 1 |
c6269ad97252af1f319c0d40980b24b3 | b3d5620349f42eb29bd3988538bc790c | 테이블 헤더에 툴팁 설정 | return new JTableHeader(columnModel) {
public String getToolTipText(MouseEvent e) {
String tip = null;
java.awt.Point p = e.getPoint();
int index = columnModel.getColumnIndexAtX(p.x);
int ... | 1 |
00c7529ed519eefae606fd750a5647ef | c9951f986deecafce8c98c888c617517 | Gets the edge between two vert indices.
If the two verts are not adjacent, the edge is technically known as a diagonal. | E getEdgeBetween(String srcVertexId, String dstVertexId); | 0 |
f6c23b0580aec7ca3525ea54f0acfd32 | c002ad733f453741db59e8313d0b7a9b | Add a new wiki site into this family. | public class SiteList extends DatabaseObject
public void addSite(Site newSite)
{
for(Site existingSite : siteVec)
{
if (newSite == existingSite)
return;
if (newSite.getId() != Constants.undefinedId
&& newSite.getId() == existingSite.getId())
{
siteVec.remove(existingSite);
break;
}
}
... | 1 |
5d43a6524ed58d12e993cadc52cebf83 | 5114692ac7c3518c2d6e6094ce1eaf33 | This Function checks for an ace, and asks the user
Whether they want to count the ace as 1 or not. | def hasUseableAce(hand):
if(1 in hand):
if(sum(hand) + 10 <= 21):
return True
return False | 0 |
8ff6483122aaabde8059a9a47bde2a26 | c7fe16811d9f23e3858341b9f69e046a | Called when the user touches the Popular Movies button | Intent movieDeatilIntent = new Intent(this, MovieDetailsActivity.class);
movieDeatilIntent.putExtra(MovieDetailsActivity.MOVIE_DATA, popular_movies.get(position));
startActivity(movieDeatilIntent);
} | 0 |
d0a8b827c5d160910328394aab3a8a91 | 59451f1ef66b512e858c7c53ff4d0ca5 | Creates linked list sequentially according to name of footballers | NodePtr curr = ll.head;
while (curr != NULL){
btfname->root = addbt(curr, btfname->root, btfname->type);
btlname->root = addbt(curr, btlname->root,btlname->type);
btphoneNum->root = addbt(curr,btphoneNum->root, btphoneNum->type);
curr = curr->next;
}
} | 0 |
48017c0d654ab1730c25e660482c9629 | 1f193e12509ddb17f71f69ddacc598bd | Sets the bottom right bounding box corner coordinates :math:`(x,y)`. | class GeoBoundingBox(GeoBoundingArea):
def setTopLeft(self, topLeft):
self._topLeft = topLeft | 0 |
41822346826cd41ae4793f8d9af20788 | 961019d6d97a83276d00b9f78c304314 | Copies the output arrays into the array that is displayed | int i = 0, j = 0;
for (i = 0; i<Output.TellWidth(); i++)
{
for (j = 0; j<Output.TellHeight(); j++)
{
RGBApixel NewPixel = Output.GetPixel(i, j);
ary[i*Output.TellHeight() + j].r = NewPixel.Red;
ary[i*Output.TellHeight() + j].g = NewPixel.Green;
ary[i*Output.TellHeight() + j].b = NewPixel.Blue;
}
}... | 1 |
2e6b10ebbb2073833dc7b26d0a812abe | e59236d9c19c999df88df279a1e39a75 | power function to find the biggest eigenvalues in magnitude | def BiggestRealEigPart(m):
eigs = np.linalg.eig(m)[0]
return np.max([np.real(e) for e in eigs]) | 0 |
5ff1f058ac49f90bf879fabc30fb9089 | c58fd8d1e05a8123cf0eae64336ba34c | Opens authentication page and prompts user for key. | def auth_handler():
key = input('Enter authentication code: ')
return key, True | 0 |
2144ed56ace50590df98249adcc763d5 | 41e8b46e14459bf4e4e06656dab482de | This method pops the backstack till the specified fragment | public class NavGraphUtils
public void popUntil(@IdRes int fragID) {
navController.popBackStack(fragID, false);
} | 1 |
14e0bcd3be09bd2eae2052312a331413 | 0ae2687ea9039f8d790528da87b5fc16 | stochastic gradient descent without mini-batch.(each sample updates parmeters ) | def sgd(params,lr,batch_size):
for param in params:
param[:]=param-lr*param.grad/batch_size | 0 |
b1315ea6145b2b778032618c94e57aa8 | cdc13737bc17fde40c99c92589c9dbe0 | This function closes a currently open message queue. | void close_queue(mqd_t id, char *name) {
if (mq_close(id) < 0) {
handle_queue_error("Failed to close", name);
}
} | 1 |
fc7d1072735a988df670c70b90e5ab1c | 2817e4d6837a14287fec1964fcbd04a0 | Store identity TaskIns and retrieve it. | @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.0" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TaskInstanceTable extends org.jooq.impl.TableImpl<io.github.ibuildthecloud.dstack.core.model.t... | 1 |
a584e381c4a5d7b0c8a66896b29ac3dd | b3b7b63e8809beecce2e929bb163ea78 | 把秀图设为顶部轮播图 | class Picture extends Init
function to_top(){
$id = input('post.id');
$data['id'] = $id;
$data['is_top'] = array('exp','1-is_top');
$result = $this->model->edit($data);
if($result){
return json(array('code'=>200,'msg'=>'操作成功'));
}else{
return json(array('code'=>0,'msg'=>'操作失败'));
}
} | 1 |
c84d2160cb6e799cfc5f821d9fd30bfd | 8ebed5803dc6b0dfafdcf07ac6b4b134 | See if the user is currently a driver | @SuppressWarnings({"unused", "serial"})
public class PlayerAccount
public boolean isDriver()
{
return !this.isPlayerBlade;
} | 1 |
1655f7ad28a26773fe395e1eadf692bd | d9331217ea0bfc8f5eb3191755e031b5 | Replace user code with dummy values | {
preg_match_all('@\{v:([^:]+):([0-9]+)\}@', $code, $matches);
if( empty($matches[0]) ) return;
foreach($matches[0] as $i=>$template){
$command = $matches[1][$i];
$model = self::find()->where(['command' => $command])->one();
$values = explode(',', $model->defaul... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.