query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
95465844a675387d578b40e9cfe5fc89 | 21475a1591bcbb2cefbbf0076d4f235b | This method is used to handle all the UI controls. In this case it only deals with the refresh button. | public class BBCXMLReader extends ListActivity
public void initControls(){
refreshFeed = (Button) findViewById(R.id.refresh);
refreshFeed.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v){
processThread();
... | 1 |
1e3f5f668073099051ff2116f3ee8af9 | 35a02141439ba1e6c3cf2228053e6494 | Computes the point normals for the geometry.
Raises:
hou.GeometryPermissionError
This exception is raised if the geometry is read-only.
Returns:
None
This is equivalent to using a Point sop, selecting 'Add Normal' and
leaving the default values. It will add the 'N' attribute if it does not
exist. | public class Geometry extends EventDispatcher
native public void computeFaceNormals(); | 0 |
e4c24db05a01eb91429c962d8fbd6656 | aeba4172a2b58308996a435d8e1402ab | Returns the meta object for class '{@link uml.classification.Slot <em>Slot</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getSlotAssignment(); | 0 |
39a3910e7f2ea9299a97a995e6f9f743 | d93665de2a4539c248c0ce97adb1fe38 | Returns the value of the '<em><b>Container Managed Authentication Alias</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Container Managed Authentication Alias</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc -->
extendedMetaData="kind='... | @SuppressWarnings("rawtypes")
public class OwMainAppContext extends OwAppContext implements OwHistoryManagerContext, OwNetworkContext, OwMandatorManagerContext, OwComboboxRendererFactory, OwAOContext
public boolean isContainerBasedAuthenticated() throws Exception
{
return (getNetwork().getCredentials() != ... | 0 |
da408ab846d18f504ec01e314c8febe1 | 4e9fea11d93cea04e58925b589ec01ff | 查询并打印某个部门的全部员工信息 | print("%s公司所有员工信息如下:" % self.com_name)
for k, v in department_dict.items():
print(k,":")
for i in range(0,len(v)):
if i % 2 == 0:
print("姓名:", v[i])
else:
print("入职时间:", v[i]) | 1 |
eafa292170e9288a06aa477a669b8ffb | 56f0eb9d695d9482326e8f2aafd881f9 | Increments the current ammunition of the agent. | public class Weapon_MachineGun : Weapon
public override void addAmmo(Stats stats)
{
if ((stats.machineGunAmmoCurrent + ammoToAdd) >= stats.machineGunAmmoMax)
{
stats.machineGunAmmoCurrent = stats.machineGunAmmoMax;
}
else
{
stats.machineGunAmmoCurrent ... | 1 |
d1072b8bdbc0ba9734cc842faf9a0a1e | 81cf5776fa718dd6b4bdf4f86664bfbb | Returns the meta object for the attribute '{@link io.deniffel.dsl.useCase.useCase.AllowedUserGroup#getName <em>Name</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EAttribute getElectiveCoursesGroup_Name(); | 0 |
d5877266633ef706239c2665006ddfbb | 2eb1ac0d3c16ea64131de1a5e789f911 | Draw a line. ALL lines will be drawn from the left to the right | if color is not None:
self._setcolor(color)
self.line(x, y, x, y + l -1) | 0 |
625ab89cbc6878b524cba661fe00c2d7 | 5ee1907924b0c6483f49d6e86a575365 | Metóda overuje dáta odosielané z formulára a vypisuje chybové hlášky pri nesprávnych vstupných dátach | String errorMessage = "";
if (hour.getText() == null || hour.getText().length() == 0) {
errorMessage += "No valid hour!\n";
}
if (pesel.getText() == null || pesel.getText().length() == 0) {
errorMessage += "No valid pesel!\n";
}
if (symptoms.getTex... | 1 |
f7c6035fd743173804a619b5b13ba730 | 35a72529fb614e33471b6a32693b0322 | #'@description Computes beta values for BS and OxBS-treated specimens
#'@source Christensen-Lab-Dartmouth/Normal-breast-5hmC
#'@source OxyBS R package | mdrihatcov = 0.05, frrhatcov = 0.2,
n_s_1 = 4000, n_s_2 = 4100,
n_t_1 = 1000, n_t_2 = 950,
n_pos_1 = 1000, n_pos_2 = 950,
n_r_1 = 70, n_r_2 = 45,
DE_prev_1 = 1, DE_RgivenTested_1 = 1,
... | 0 |
a5995e7d2ce8d62acb54d50efdcf702f | d471c70e6807f3daf590d11ab268892b | Returns the meta object for the reference '{@link Implementation.BookingComponent_BookingHandler#getAuthentication <em>Authentication</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | {
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(AUTHENTICATIONRESULT$0, 0);
return target;
}
} | 0 |
1fdc1c3ba9578d78c5374b87f12dcc5c | 9a792ebe87a5afc0c631bce0b2e85606 | Method that sets total number of dimes in ChangeJar | public class ChangeJar
public void setDimes(int dimes) {
this.dimes = dimes;
} | 1 |
787a6699f36bdff1c0845edadd3ddb6a | 7ce3c289d03cc6c604ee9cd1b3b45aa8 | Check that $\rho \simeq 1$ case is smoothly connected with a general case, i.e.,
comparing the approximated computation and full computation around the cutoff, which is currently $\rho = 1.0 - 1.0e-5$ | halo = myname.get_name(0, True)
savefile = "boxhi_grid_cutoff_H2.hdf5"
ahalo = dp.PrettyBox(halo, 3, nslice=10, savefile=savefile)
cutoff0 = ahalo.column_density_function()
ahalo = dp.PrettyBox(halo, 3, nslice=10)
normal0 = ahalo.column_density_function()
halo = myname.get_name(1, True)
... | 1 |
ece11dc2730cd94702bc12dd8fd88647 | 20bf9555800ddd6190484205a61ec19d | Expands long header values by removing new lines and tabs | while '\n\n\n' in multi_line:
multi_line = multi_line.replace('\n\n\n', '\n\n')
return multi_line | 0 |
84f56a4dde42e2947a4538c40c83104f | 1e6c6d97fccb11460a0b3f7a81136249 | Returns a subarray starting at specified index and ending at the last index of the original array. | fun Array<Byte>.mid(startIndex: Int): Array<Byte> = this.toByteArray().mid(startIndex).toTypedArray() | 1 |
322cf0cf23899323259dc4bb4cfe02a4 | 08f1ba274fab721f1e986ac97c076caf | DefaultHTTPConf returns a HTTP configuration with some defaults | cfg := &Config{
Common: Common{
Listen: ":9090",
KeepDuplicates: false,
MaxCPU: 1,
},
ClickHouse: ClickHouse{
Url: "http://localhost:8123",
DataTable: "graphite",
DataTimeout: &Duration{
Duration: time.Minute,
},
TreeTable: "graphite_tree",
TreeTimeout: &Duration{
Duration: tim... | 0 |
6487db197b5b633f3f21932d19907c56 | b7a5e6745c8b12f206c35c9cfb091bbc | 移除内容中的忽略词 | def content_filter(content):
words=['我是']
for w in words:
if content.__contains__(w):
if content.__contains__(','):
content_arr = content.split(',')
arr = [x for x in content_arr if not str(x).__contains__(w)]
content=",".join(arr)
... | 1 |
db59603f1fdc31c7b976deb5eff6fb04 | c0d3650b2c2d3826690e4bf7b8e97337 | Handles changes to the ActiveContent property. | namespace DevelopmentInProgress.TradeView.Wpf.Host.Controller.RegionAdapters
public class DockingManagerBehavior : RegionBehavior, IHostAwareRegionBehavior
private void DockingManagerActiveContentChanged(object sender, EventArgs e)
{
var documentViewHost = dockingManager.ActiveContent as Documen... | 1 |
29cd30d7a956cd8e120c66b8725b2437 | 76116ea92d7d6337e5db34168f3d0dbc | 调用RetinaNet损失函数实例, 计算RetinaNet损失函数值;
损失函数值是FocalLoss(分类损失)和SmoothL1Loss(框回归损失)的和. | def fastrcnn_loss(class_logits, box_regression, labels, regression_targets):
labels = torch.cat(labels, dim=0)
regression_targets = torch.cat(regression_targets, dim=0)
classification_loss = F.cross_entropy(class_logits, labels)
sampled_pos_inds_subset = torch.where(torch.gt(labels, 0))[0]
labels_po... | 0 |
4f6dafbdb48f154ec3066643efde958f | b0553b63b4f3127c3fe126949ee3b766 | This handles hiding and showing various views depending on the privacy
settings of the app and the current state of the phone (keyguard on or off) | final boolean respectKeyguard) {
if (respectKeyguard) {
if (isKeyguardShowingAndNotOccluded()) {
return;
}
if (!mKeyguardOccluded && mKeyguardDelegate.isInputRestricted()) {
mKeyguardDelegate.verifyUnlock(new OnKeyguardExitResult() ... | 1 |
904b5513da3e6a85578e9843bac0b1c4 | c7777d4056f22fbde3fc99f10dd9a5f7 | returns whether pd was added to buffer (1=OK, 0=NO) | {
if(Q->data_count < Q->buf_size)
{
Q->pBuffer[Q->in_index++]=dat;
if(Q->in_index >= Q->buf_size)
Q->in_index= 0;
cli();
Q->data_count++;
sei();
return 0;
}
return 1;
} | 1 |
ff556cf9da6ffbc16d0555848bfa3514 | ed6d7cf94ccd924e25a811627e6df429 | Send sms when order is placed | {
if (!Mage::helper('twilio')->isEnabled() || !Mage::helper('twilio')->sendSmsForNewOrders()) {
Mage::log("Magento Twilio module is not enabled or should not send SMS for new orders.");
return;
}
try {
$sms = $this->account->messages->create(
... | 1 |
a24a9c41685c666344004393c6cffd00 | 09c32fa5dcff3306be82b664d9c7c82a | Returns an enumerable containing all
elements contained in one list but not the other
after both collections have had transform called on them | {
var transformedA = a.Select(with);
var transformedB = b.Select(with);
var hashSet = new HashSet<TResult>(transformedA);
var unioned = hashSet.ToList();
unioned.AddRange(transformedB.Where(item => !hashSet.Contains(item)));
return unioned;
} | 0 |
7e2bfda2b39bd08ed4ac80d0ff1e80f9 | 3ddebfdfe08b132a6f41ed8cfe7feebb | Returns whether the video is scheduled to be published.
private and is scheduled to become public in the future. | class Article
def published?
self._published? && !self.future?
end | 0 |
4ad388defa806f358d2d588a5533181a | b5f0ee24b00910585e879644f2da8f8c | configure pin 3 in port d as external interrupt | __interrupt void EXTI_PORTD_IRQHandler(void)
{
PD_ODR_ODR3 = !PD_ODR_ODR3;
} | 0 |
c2cc94e12b21e5d6d0037fd6e7314ef4 | 9f2f54e680ac3b3bd6ab6490c5c4477f | Handles the Click event of the categorySearchButton control. | namespace KTCERP.Shipping
public partial class ShippingCategory : MetroForm
private void btnSearch_Click(object sender, EventArgs e)
{
string sql = "SELECT sc.ShipCategoryId,sc.CategoryName,sc.CategoryNameEng FROM dbo.ShippingCategory sc "
+ "WHERE sc.CategoryName LIKE '%"... | 1 |
2ae4c0c268c522aacf1bf1d6cf0fbf85 | 7beaa323fae54e70d3fcbb031327b709 | 根据渠道id显示关服公告 | function QStaticDatabase:getChannelCloseDisc(channelid)
for _,v in pairs(self._staticDatabase.channel_closure) do
if v.id == tonumber(channelid) then
return v.content
end
end
end | 1 |
6ee9aa931b4e83b5cc671408cdf04087 | 04607b626e06ff5d519608dd99180129 | Evento del checkbox del primer procesador - habilita el boton de aceptar | if (this.procList.getSelectedIndex() == -1) {
this.modificarProcButton.setEnabled(false);
this.eliminarProcButton.setEnabled(false);
this.subirProcButton.setEnabled(false);
this.bajarProcButton.setEnabled(false);
} else {
this.modificarProcButton.setEnabled(true);
... | 0 |
02a4ed7e2045bb1b6678a26e75d4f12b | d8ee374af2ff9962ef0f3215d4b99b0e | Get TransactionDetail value | class Transactions extends AbstractStructBase
public function getTransaction()
{
return $this->Transaction;
} | 0 |
d59288d3456155a4fa4f735507e6669e | 83cde674b5bcc59096a9a30cc7501217 | Exceptions in python on an MPI rank are not enough to end a job. Strange behavior results when an unhandled
Exception occurs on an MPI rank while running a neuron.h.ParallelContext.runworker() loop. This method will
hard exit python. | logger.critical('Fatal error. This is probably a node-specific error; '
' killing worker to force a retry.', exc_info=exc)
sys.exit(-1) | 1 |
3942a0dd56fde369c23b38211edc53cb | db9a6cf1ea3975b7823e062bf662e624 | Disables the Canvas GameObject | {
canvasGroup.alpha = 0;
canvasGroup.interactable = false;
canvasGroup.blocksRaycasts = false;
} | 1 |
0ea47d026219caeea4c1c2afb0ad190d | 00078e1699ec6d59fb4834388ea8e9a6 | Set the min number of lines per split | $count = (int) $count;
if ($count <= 0) {
throw new Forms_Exception();
}
$this->_linesOnPage = $count;
} | 0 |
6c05c5b107ee2b45f50ad922cc66c914 | 4ca902a7d95a59bec059f02898c3823d | Get the cos(angle)and distance between a bond and a charge | li = ei - si
lj = ej - sj
cos_t = np.dot(li, lj) / (self.cal_mo(li) * self.cal_mo(lj) + np.spacing(1))
if li[0] == lj[0] and li[1] == lj[1]:
return 0
if cos_t > 0:
sin_t = np.sqrt(1 - cos_t ** 2 + np.spacing(1))
return self.cal_mo(lj) * sin_t
... | 0 |
719f44140c5d5fcd862a479db2fb454e | b79d3abef7d83e2c4aad3f58adaf4b03 | Vrati cestu k suboru, kde je ulozeny obsah stranky pred kompilaciou | class zajCompileBlock{
public function get_cache_file_path($source = false){
if($source === false) $source = $this->source;
return '__block/'.$source->get_requested_path().'-'.$this->name.'.html';
} | 1 |
72ceef25c52304741f55c22552d88c5e | 7583c1adfac9ea634578c8a9b7430f89 | POST /a/ws/crm/crmCustomerSale/batchSaveOwnerId 批量转让客户 | String hql="update Lead lead set lead.owner.id=? where lead.id in (:list)";
Query q = createQuery(hql);
q.setParameter(0, ownerId);
q.setParameterList("list", ids);
return q.executeUpdate();
} | 1 |
a0313d6885c6d3061cccc1db84026541 | d32cd5a0257afe1216ef3142689ac1c6 | Check whether the divisor is zero | namespace SampleProject.Functions
public class DivisionFunction : IBinaryFunction
public bool CanPerform(decimal x, decimal y)
{
return y != 0;
} | 1 |
340e4cacf73dee71c82ca1c657971221 | 8973a085981df07e08d9ceb49e973893 | Get in-sync replica list the given topic and partition. | version=LATEST_MICROVERSION):
uri = "share-replicas"
uri += ("?share_id=%s" % share_id) if share_id is not None else ''
resp, body = self.get(uri, headers=EXPERIMENTAL,
extra_headers=True, version=version)
self.expected_su... | 0 |
7becff1721e9890d2b135ea9adec8ca6 | e48df5626a41e623258396147e6635cb | Balance tree. | static void Balance (PtABP ptree, PtFraction plist[], int pbegin, int pend)
{
unsigned int Median; PtFraction Fraction;
if (pbegin <= pend)
{
Median = (pbegin + pend) >> 1;
Fraction = FractionCopy (plist[Median]);
if (Fraction == NULL) { Error = NO_MEM; return ; }
ABPInsertRec (ptree, Fraction);
if (Erro... | 1 |
2307935490def3d166299319018b01c3 | 320bebaa67377d2259190b0956c2519f | Extend diagrams to the right:
a0 > a1 > ... > ad
>= >= >=
b0 > b1 > ... > bd | public class WellFlattenerX
private void accumulateForward(int b, float[][] e, float[][] d) {
int ni = e.length;
int nl = e[0].length;
int nlm1 = nl-1;
int nim1 = ni-1;
int ib = kminNotNull(e);
int ie = kmaxNotNull(e);
for (int il=0; il<nl; ++il)
d[ib][il] = 0f;
for (int ii=ib; ii!... | 0 |
40ebf2fcc3d176fc1cb847c81a4db16b | 34498a7b76e127180ff3201a5c58e716 | パーツ数値をコントロールに設定 | switch(Part7_PatchGroup_select->currentIndex()) {
case 0:
Part7_PatchNumber_select->setMaximum(128);
break;
case 1:
Part7_PatchNumber_select->setMaximum(255);
break;
case 2:
Part7_PatchNumber_select->setMaximum(128);
break;
case 3:
Part7_PatchNumber_select... | 1 |
a98c94ec31f707f82e6a4747b162f6b3 | 6e6b2793b5546dc58e224de1bc7b2c98 | 设置用户话费券 | class Couponput extends Api
public function set($shop_id, $card_id, $card_describe, $start_time, $end_time)
{
$params = [
'shop_id' => $shop_id,
'card_id' => $card_id,
'card_describe' => $card_describe,
'start_time' => $start_time,
'end_time' => $e... | 1 |
99b7693e1d1682104c012228f208ee2b | d35e4b942fe871636b5f20a54f400d61 | Traitement des factures reçus en banque (marquer comme encaissées) | class Shop
public static function ValidationCommandeBanque($autoNum, $transNum, $comNum) {
DatabaseHandler::SetBeginTransaction();
try {
$sql = "CALL upd_comdeEtat(:comNum,:etat)";
$params = array(":comNum" => $comNum, ":etat" => 1);
DatabaseHandler::Execute($sql, $params);
$sql = "call aud_commande(:co... | 1 |
3ec171c019eadf11ad27f87a532e0ac0 | d01e6a786b4ff9c4ac4b8f37916a2d81 | Funtion that returns the index of active set based on current time | int SemilinearSystem::CurrentTimeIndex()
{
return I_Current_T_Index;
} | 0 |
25f8e74fa9d94c59ee01b7867bb9b1fb | 0154277b55c9fad6da21f2688de56249 | From https://stackoverflow.com/a/47171600 | def zip(*iterables):
sentinel = object()
iterators = [iter(it) for it in iterables]
while iterators:
result = []
for it in iterators:
elem = next(it, sentinel)
if elem is sentinel:
return
result.append(elem)
yield tuple(result) | 1 |
a2ca3be5fea40be59c6decc1fa42181c | eff41d69fa8881ceb5b4bff9103977d6 | Returns an amortized measurement of percentage CPU usage
for a single CPU over the given time period, deriving the
the measurement from the given accumulated idle tick counts. | static long long
get_consumed_cputime (void)
{
static long long prev_cpu = 0;
static long long prev_time = 0;
long long curr_cpu;
long long curr_time;
long long result;
curr_time = get_time();
curr_cpu = get_cputime();
result = (curr_cpu - prev_cpu);... | 0 |
1e9a2ad7ab26cea0e4b9f5c5acbe04e7 | 6f22c78fdf9c26fe1d016d2895e02c29 | Update existing gui with new data, rather than create from scratch. | class OWTextableVariety(OWWidget):
def updateGUI(self):
self.unitSegmentationCombo.clear()
self.unitAnnotationCombo.clear()
self.unitAnnotationCombo.addItem('(none)')
self.categoryAnnotationCombo.clear()
self.categoryAnnotationCombo.addItem('(none)')
if self.mode == 'No c... | 1 |
1d6ea20fa987a749dd562f05bd2b8fea | 6a895d284438ca73554b8e082f10ddeb | 为空判断 | function tomxin_IsEmpty(str) {
if(str == "" || str == null || str == undefined || str == "null" ){
return true;
}
return false;
} | 1 |
a7f3ff054e8f9e1e505794d24b239c8e | ff3809fb278dabae8d1ec5e921aa660a | Get the connection to the source and destination databases | public class DatabaseManager
private DatabaseConnection getDatabaseConnection() throws SQLException {
return connectionSource.getReadWriteConnection(null);
} | 0 |
8cf0f5c135469bb23e141498ebf2f6de | 44a5113ab15a7e334bf1b6cb5613138e | Get AWS secret key | class MyAmazon
public function getSecretAccessKey() {
return $this->secret_access_key;
} | 1 |
e02cafbaae56a8d0930ee598f8bdac4c | 12169e8b49ac1630b7ada12ddd0e7321 | @brief Timer 3 Interrupt handler for Input Capture | void Timer3A_Handler(void){
TIMER3_ICR_R = TIMER_ICR_CAECINT;
int32_t status = StartCritical();
uint32_t endTime = TIMER3_TAR_R;
PulseTime3 = OS_TimeDifference(StartTime3,endTime)/8000;
GPIO_PORTB_PDR_R |= 0x04;
EndCritical(... | 1 |
a3cd2d3044d6b6ae82d790df4a654bad | 7583c1909fa601b7b3783a6c86062fa8 | This will run the match with random chosen events | num = random.uniform(0, 1)
if num > 0.15 : return
possible_random_events = [
"oxen_dies",
"thief_attacks",
"wagon_breaks",
"bad_weather"
]
random_event = random.choice(possible_random_events)
globals()[random_event](game) | 1 |
66f620690c38df277a513d30ef15b1a2 | da274fc7fd6791c1cfa353e3a4701419 | Add the given filter as a join in the query builder, bound
to its dependency. Assumes that dependency has already been added. | public void joinFilter(String operator, AbstractQuery newQuery); | 1 |
835ac40c1009196dbaa057eac6cf8ca8 | 46c7dbfef6990de2a2bb66b9cc4241c7 | Tạo mã giảm giá | namespace Gym
public partial class Form1 : Form
string createMaLH()
{
int MaLH = 0;
foreach (DataGridViewRow row in dtgdsloaihang.Rows)
{
if (!row.IsNewRow)
{
string b = row.Cells[0].Value.ToString().Substring(2);
... | 0 |
1078237f6fba90fdb9cabc5764b86ab8 | ea6a5f14d59beae681d5d2585094850b | r"""Compute Hardy Weinberg p-value
Tests whether the number of observed heterozygous vs.
homozygous individuals is different than expected
under Hardy Weinberg Equilibrium given the observed
allele frequencies, based on a binomial test. | compare='diff', alpha=0.05, correction=True):
method_default = {'diff': 'newcomb',
'ratio': 'log-adjusted',
'odds-ratio': 'logit-adjusted'}
if compare.lower() == 'or':
compare = 'odds-ratio'
if method is None:
method ... | 0 |
1c5d9a5651122b3c4eb39bcfbc58f4f8 | 949bd770881bfca82cbd5aa7c88053b8 | Expect that a zero duration project should not give a divide by zero error in various places where calculations occur | class DeveloperModelTests(TestCase):
def test_total_work_estimate_for_no_tasks(self):
dev1 = create_developer('Tommy')
self.assertEqual(dev1.total_work_estimate, 0) | 0 |
c8419ef66c4a787e4bc9b48a5975d457 | 51faa87de5c1e636a33f74ad28b3c4cb | Setter for the scaling function. This is applied to the result of
the normalised distance | class DataGenerator():
def set_scaler(self, scaler):
self.scaler = scaler | 1 |
b81193a9fac7b6d552de3880198ce7b5 | de8a27ce6b94a397f41294fd1e2b8f7e | Sorts action by floor number and eventType. | {
if (other == null)
{
return 1;
}
return this.EventId.CompareTo(other.EventId);
} | 0 |
be0411d441c157f8888cfad5f8d93ff5 | bd2ef619d191bff160c14a53db68165c | u''' 保存风险评价内容 | public void saveRiskEvent(String records) throws ParseException{
JSONObject jsobj = JSONObject.fromObject(records);
String kpiName = jsobj.getString("kpiName");
Kpi kpi = o_kpiBO.findKpiByName(kpiName);
Risk risk = null;
Set<KpiRelaRisk> kpiRelaRisks = kpi.getKpiRelaRisks();... | 1 |
2a956d93b32ebe1b0045b47e73049a81 | 1096a16469dad5642ee8f6fb6bd7a603 | This test performs a right outer join between a empty table (left) and a non-empty table. | @Test
public class TestSimpleJoins extends SqlTestCase
public void testROJEmptyLeft() throws Throwable {
TupleLiteral[] expected = {
new TupleLiteral(null, null, 1, 100),
new TupleLiteral(null, null, 2, 200),
new TupleLiteral(null, null, 3, 300),
n... | 1 |
dcfa6bf726f8b30d588b61ef9173d18a | 221d12cc957a245bce729ebbc3b05d08 | Shows desktop alert. | namespace codestuffers.MvvmCross.Plugins.UserInteraction
void Alert(string message); | 0 |
852f30d96ded4b8def1dde6993d605c9 | 223e726a2ec2b5ae738e17884b8c1a8b | Function that processes the list of quadruples according to the operator in each quad | {
var curr = new AstNode(node);
switch (node.Operator)
{
case QuTLOperator.PROCESS_EVENT:
{
worklist.Push(curr);
}
break;
case QuTLOperator.TMP_F:
... | 1 |
a986764fd843995d35adeaabccd2287a | 91e4d65196b2b61b9bdb4fd604867668 | Bounds of the part of the visualization (all of the Nodes together) that
is currently visible in the view (in the view coordinate system). | class GeometryPlotter:
def viewbox(self):
return self._viewbox | 1 |
2cfc02f497e0614631979a41efb98bac | 3ce478398a1873b44eec90cd1a679c98 | 摇头动画,左右各摇摆一次,然后回到原来位置 | function upDwon_Shake(node, time, range, func): void {
Laya.Tween.to(node, { y: node.y + range }, time, null, Laya.Handler.create(this, function () {
Laya.Tween.to(node, { y: node.y - range * 2 }, time, null, Laya.Handler.create(this, function () {
Laya.Tween.to(node, { y... | 0 |
8e9995b5cf3b7c457361f93e64bc604b | af671f45de7289b703a48738f1f0f020 | 取到所处的大格子的小格子的坐标范围,传入的是小格子坐标 | fun getFarmInfoByGridId(gridId: Int, smallLen: Int): (HashMap<Int, GridCellInfo>) {
val xNum = pcs.basicProtoCache.allArea / smallLen
val row = gridId / xNum
val col = gridId % xNum
val xyMap = hashMapOf<Int, GridCellInfo>()
var index = 0
for (x in col * smallLen..((col + 1) * smallLen - 1)) ... | 0 |
a613ffbff596cff2d0d41b506becf9dc | e5b066836f28e4be95ccb0efc04c2530 | botões das letras | var letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
for (var i = 0; i < letters.length; i++) {
var letterBtn = $("<button>");
letterBtn.addClass("letter-button letter letter-button-color")
lette... | 1 |
2377d304c84e9c02b54c5616c522c123 | 6633474c87e544565eb1126c59187bbb | Checks if client has set Recommendation credentials. | {
return this._recommendations != null && this._recommendations.Count > 0;
} | 0 |
02eec43d95c3037cafb3f287fa25d876 | 1142a7e01664090d8f3966feb9fd2353 | 根据参数查新品牌信息 | public class BINOLMQCOM01_Service extends BaseService
public Map<String, Object> selBrandInfo (Map<String, Object> map){
map.put(CherryConstants.IBATIS_SQL_ID, "BINOLMQCOM01.searchBrandInfo");
return (Map<String, Object>)baseServiceImpl.get(map);
} | 1 |
904fbfd210b32f3e0e0f15f6170244d4 | 7265375390d5013642493f6cab531a0a | Returns the dictonary of the videos. | videos = {}
for path, dirs, filenames in os.walk(self.src):
for filename in filenames:
video_path = os.path.join(path, filename)
relpath = ppath(os.path.relpath(video_path, self.src))
_, _, relpath = relpath.partition('/')
name,... | 1 |
c83df3a8f09f2f78b9c430c1867f4d95 | e04b1151894b35830b6ee7d9756d1327 | @brief doing some tests to SD card, like mount, create file, open a text etc. | void simple_test(void)
{
stest_mount_umount();
stest_create_delete();
stest_open_close();
stest_read_write_stat();
stest_lseek();
} | 1 |
b7268652b695cb4ee7d18a6bcf7614c6 | fd3cd823fda4ebf6b527bd0ee1ab99e8 | Update a Notification Client # noqa: E501
Update a Notification Client. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | class NotificationApi
def update_notification_client_using_put_with_http_info(notification_client, notification_client_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: NotificationApi.update_notification_client_using_put ...'
end
if @api_client.confi... | 1 |
76e25ed5f7f4c2894ece7a7fe5057a85 | c458b46414e443c3d3b0364c10184767 | Obtiene tarjetas por su place_id | class UserTarjetasController extends Controller
public function index(Request $request)
{
$user = $request->user();
$tarjetas = $user->tarjetas;
if ($tarjetas->count() == 0) {
return response()->json(['message'=>"no hay registro"], 404);
} else {
return respon... | 0 |
26ca492e29af323aaaa3a8cd0e08bf38 | dd0698b0309f00f7e22ab92b65b0036d | Change campaign state action to active or inactive.
name="Change Campaign state",
section="Campaign"
) | class CampaignCommand extends Command
public function setCampaignStatus($campaignList, $status) {
if(!empty($campaignList)) {
$campaignId = array();
foreach ($campaignList as $campaign) {
array_push($campaignId, $campaign->Id);
}
CampaignModel::setCampaignStatus($campaignId, $status);
}
} | 1 |
989ec8d871243ce4a28a1eac2781ced8 | 2695b951b9811ae9dfc8efbf0d2a7860 | 设置普通按钮的文本不可用颜色。 | mDisabledBgColor = XHelper.getColorRes(color);
hasSetDisabledBgColor = true;
isBackgroundColor = true;
return this;
} | 0 |
2e86399ccbe7b5aee290ab8859c3fd4a | 08bb83ac02bb495d67e9511447b4e669 | action for route: / | class ActionController extends Controller
public function index()
{
return \View::make('actions.index',['actions'=>Action::all()]);
} | 1 |
21bf07e6e8364c1850f5c4c6250b1f79 | 69f5f40b1655350b76d87745fc56a1de | What happens when the setup chapter instance is loaded (checking for completeness etc) | {
if (loadM.LoadComplete)
{
gameState = LOADING_COMPLETE;
Setup();
startThisState = StartSystem;
}
} | 1 |
486b5a32e2613025d09025e50322e8b9 | 3cd47e5ab5276cff5cadb927d70a88e8 | Monta o GridView | foreach ($values as $offset => $value) {
foreach ($value as $key => $val) {
if(!isset($count[$key])){
$count[$key] = ['count' => count($val), 'campos' => $val];
}
if(count($val) > $count[$key]['count']){
count($val);
$count[$key] = ['count' => count($val), 'campos' => $val];
}
}
... | 1 |
64a80091a2f7c1a9bd2c224fbfbde972 | c1d2110188f575fc32c8d112acad44b3 | 获取每天的项目成本 | double d=0d;
Map<String, Object> filter=new HashMap<>();
filter.put("userid", userid);
filter.put("queryProid", proid);
filter.put("queryTime", yearmon);
List<ProjectTaskHour> queryProHour = projectTaskHourDao.queryProHour(filter);
if(queryProHour!=null && queryProHour.size()>0){
ProjectTaskHour projec... | 0 |
5967b687061111ca3adf56fe33178ae7 | 585b9aa52c2fabc3515786ace225dd0b | カウンターキャッシュが定義されているモデル一覧を標準出力に書き出す | class CounterCacheShell extends AppShell
public function _outputModel() {
if (empty($this->_counterCacheModels)) {
$this->err('カウンターキャッシュが設定されているモデルが存在しません。');
$this->_stop();
}
$modelNameMaxLength = Hash::apply($this->_counterCacheModels, '{n}.model', function($s){
$ary = [];
foreach ($s as $model) {... | 1 |
b37864a4882a478db049d163ef4a89d5 | dc5ac758ea63cccfc1705be7304e209e | 通过提单号获取运单数量 | public Long getCountByAirWaybillNo(AirUnshippedGoodsDto airUnshippedGoodsDto) {
return (Long)this.getSqlSession().selectOne(nameSpace + "getCountByAirWaybillNo", airUnshippedGoodsDto);
} | 1 |
88e2f53fb3e19d4d2b803f31c0bb3fbe | 22258c940c28ad21b67848656f70a656 | Erhoeht den Index der Textur | void incrementGlTextures()
{
NUM_GL_TEXTURES++;
} | 0 |
4118ebdb8edcb2093f836e87ca012215 | 472a10619ea7d02e698b20ab7467e22b | Defines the Shape Borders. | _borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = Excel.XlLineStyle.xlContinuous;
_borders[Excel.XlBordersIndex.xlEdgeRight].LineStyle = Excel.XlLineStyle.xlContinuous;
_borders[Excel.XlBordersIndex.xlEdgeTop].LineStyle = Excel.XlLineStyle.xlContinuous;
_borders[Excel... | 1 |
70a8e0c010ab9c7e844051ec2ad5ed3d | 8dddac0f37e3dd300eab96682fc0a435 | 处理页面输出的JS标签 | {
Yii::app()->getClientScript()->render($output);
if($this->_dynamicOutput)
{
$output=preg_replace_callback('/<###dynamic-(\d+)###>/',array($this,'replaceDynamicOutput'),$output);
$this->_dynamicOutput=null;
}
if($this->_pageStates!==null || isset($_POST[self::STATE_INPUT_NAME]))
{
$states=$this->... | 1 |
a5eb451d19d20aa3452f4b7c681043db | 9a869aad7c13626e48a371d36c68eac9 | 保存产品数据到本地 | class ProductsDampDown(object):
def save_product_info(self, info: list):
new_info = [item if item else " " for item in info]
with open("product.txt", 'a', encoding='utf8') as f:
f.write("\t".join(new_info) + "\n") | 1 |
8174119271dd162f49feb29f68ab20cf | aa4f95c2c22a5b3adf14c7abd710f258 | This is called when parsing of incoming http msg done | basic_parser::do_message_complete ()
{
complete_ = true;
on_complete();
return 0;
} | 1 |
23bf41b60406f5a1cec9bdacfd4b26b7 | eb2f1bc048c34a53fa607bd0889a148b | This function must be used by drivers as their &file_operations.release
method. It frees any resources associated with the open file, and calls the
&drm_driver.postclose driver callback. If this is the last open file for the
DRM device also proceeds to call the &drm_driver.lastclose driver callback.
Always succeeds and... | int HRTDriver_release(struct inode *inode, struct file *file)
{
struct HRT_dev *hrt_devp = file->private_data;
printk("\n%s is closing\n", hrt_devp->name);
return 0;
} | 0 |
15af6ed72d59d1ec36624e7f5b1a6374 | fa314a9b001ec7e2c9e71192ef55916f | Esta funcion la llamo via AJAX para que me devuelva los posibles estados que puede tomar un vale en base al estado en el que se encuentra. | {
int indentificadorEstado = -1;
double disponibilidad = Referencias.ConsultarDisponibilidad(codI, codAlm, ano.ToString(), 0);
int minimoDisponible = Referencias.CalcularMinimoDisponible(codI, mes, ano);
if (disponibilidad == 0)
{
try
... | 1 |
c21e8f7538d4e13e674cec26a64f9f07 | 9c6eda42d59cea53ac935b11193b4b2e | Test case for customers_id_teams_nk_members_rel_fk_delete
Remove the members relation to an item by id. | class TeamApiTest extends \PHPUnit_Framework_TestCase
public function testTeamsIdTemplatesNkTagsRelFkDelete()
{
} | 0 |
5ebf6adfa97bfbf33a94264cde9afc14 | 0a55675b45262c53a4e38127f0ec407d | Mouvement raquette | function love.update(dt)
if love.mouse.getX() + pad.largeur > largeur + pad.largeur/2
then pad.x = largeur - pad.largeur - 3
else pad.x = love.mouse.getX() - pad.largeur/ 2
end
if love.mouse.getX() < pad.largeur/2 then
pad.x = 3
end
pad.y = 5*hauteur/6
if ball.x + ball. radius ... | 1 |
f7c3523540cd64b174489c35efb3b6e5 | 669937a3cc6dc83a9409ae04858ef5b1 | Get All Categories with Pagination and Sorting | try{
if (user.role === 'Admin' || user.role === 'Manager') {
let query={}
if(user.role === 'Manager'){
query["location"]= user.locationId
}
const category = await this.categoryModel.find(query).populate('location','l... | 1 |
5238b73650d44f6f7ba25108cc1a6ddb | 1e57f2fa087ddc6e20a0abb8e7ee8f0e | check if a string is True, allowing for None | def _truth(str):
return str == 'True' | 0 |
1b4a549802f0fecd49d0bc0285a8db3f | c958ee4e39f18afa2df2bb5bd6e0d3ea | 根据链接,统计文章 URL 数量 | def getUrl(reponse):
html = reponse.text
pattern = re.compile('/articles/\d+\.html')
urls = re.findall(pattern, html)
urls = list(set(urls))
num = []
for url in urls:
pattern_num = re.compile('\d+')
number = re.findall(pattern_num, url)[0]
num.append(int(number))
numb... | 0 |
3d2f304d5fcc3e20d29d5ccfb858a12b | 1c9739d9add47d7cb8483a3c6fbb07da | Update the inherited attributes based on root tasks values. | class ProvenanceTree:
def update_root_information(self):
files_read = []
files_written = []
dirs = []
symlink_to_target = {}
execve_env = {}
for id in self.__nodes:
if id != 0:
files_read += self.__nodes[id].files_read
... | 1 |
28e49dba5b46a896fdd9ed305358ab50 | 58ee50b809e319dc0b5d58b2e323748b | 添加链接分类 | {
if (isset($_POST['name'])) {
$data['type'] = "add";
$data['name'] = $_POST['name'];
$data['code'] = $_POST['code'];
$data['showorder'] = $_POST['showorder'];
$result = $this->model->Action($data);
if ($result !== true) {
... | 1 |
2afa2c21c4918c8c36644a4ba6f9d7f2 | d00859c9648a80b30e8f1dc6bb6822d0 | Set focus to dialog iff focus is outside of dialog itself | LRESULT CViewDialog::OnMouseActivate(UINT msg, WPARAM wparam, LPARAM lparam)
{
if (!IsChild(::GetFocus()))
SetFocus();
return FinalWindowProc(msg, wparam, lparam);
} | 1 |
bc30ea18cf4163ed888305bb25cba870 | 9d4b9c0c9b507082f7b273b06f54540a | Init returns a new instance of the Static module wit default values | func NewStatic() *Static {
return &Static{
Home: views.NewView("bootstrap", "static/home"),
Contact: views.NewView("bootstrap", "static/contact"),
}
} | 1 |
38da0b7371ff79398bc40cbd33fa062b | 915355dd709936cf3583c9390e158d74 | Disable all characters except chosen character based on index value of button | keyButtons.forEach(button => {
if (userLetter === button.textContent) {
button.disabled = true;
button.className = `key chosen`;
}
});
} | 0 |
7044f13605d9adbce451bde5803d6f6d | b11b4cb41afe086527f74f01cf0d5c1e | Creates the path stack. The stack should reflect the path the search tree took from start to finish | def _buildPath(node):
global ptg
while node != None and node.parent != None:
ptg.append(node.step)
node = node.parent
ptg.reverse() | 1 |
d9147aef047544b415252a31befaba21 | 07950973def5aa3c3e36a84b510d3d76 | 创建文本文件,并写入内容,如果目录不存在,则创建 | public static class IOUtil
public static void CreateTextFile(string filePath,string content)
{
DeleteFile(filePath);
using (FileStream fs = new FileStream(filePath,FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs))
{
sw.Write(content);
... | 0 |
3f0bcca440d7b4ca28c3384cbb8a1584 | cd577826701b63290484c00887b7d622 | Release a message to LITM
This function should *ONLY* be used by client's
as a result of finishing the processing of an
envelope/message retrieved through ``litm_receive_nb''. | ER snd_mbx(ID mbxid, T_MSG *pk_msg)
{
int id = mbxid - 1;
struct li_mbx_t *mbx = NULL;
int result = 0;
if ( (id < 0) || (id >= LI_MAX_MBX_NR) )
{
return E_ID;
}
pthread_mutex_lock(&li_mbx_mtx);
mbx = &li_mbx[id];
if (!mbx->used)
{
pthread_mutex_unlock(&li_mbx_mtx);
return E_NOEXS;
}
pthread_mut... | 0 |
fddf211d5320497a2748707bff0c3dc7 | e8320e4adc4ac43b5c5556b49084f891 | 8. Show the topic(s) posted by a given producer | Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
topicCountMap.put(topic, new Integer(1));
Map<String, List<KafkaStream<Message>>> consumerMap = consumerConnector.createMessageStreams(topicCountMap);
KafkaStream<Message> stream = consumerMap.get(topic).get(0);
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.