query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
88d0c6d9d15f9312cc50a5700d375717 | 1aed2f3abd26a7c36aa491f9d6a15edd | 插入新注册的数据节点到链表最后 | void insertNode(ArcNode *node, ArcNode *newNode)
{
ArcNode *p = node;
while (p->nextarc != NULL) {
p = p->nextarc;
}
p->nextarc = newNode;
} | 1 |
29021bc14674aae1c355320320580ead | 4eff28ec8e91217104d1d5b76f1630c7 | metodo que actualiza el estado de la particula | function actualizar() {
posicion.add(velocidad);
} | 1 |
47ce9abfabf256fecbdcddce15ba333f | 62f1856184c7413a6b3f8e257cfdd3aa | Reset all state of given component to its initial value, by type. | function resetComponentState() {
isParent = false;
previousOrParentTNode = null !;
elementDepthCount = 0;
bindingsEnabled = true;
} | 1 |
530a56db1d05946119d85928998757b1 | d57fd3876cb55c5b3d4894e9d1127b2b | Perform an azimuth correction on a trace object. | beam.total_drift = 0.0
try:
optics_system.transform(beam)
except:
traceback.print_exc()
pass
return optics_trace(beam.marks) | 0 |
55ca8d48a5c941a6c39ff319b4ed316b | 5f2fd86440465dd106b294c7ca799617 | cette methode retourne une forme en 2D apres une reduction dimensionnnelle | ImageGrise img2 = new ImageTab(largeur,hauteur);
for(int i=0 ; i<hauteur ; i++){
for(int j=0 ; j<largeur ; j++){
img2.definirPoint(i,j,tab[i][j].ajouter(img.pointEn(i,j)));
}
}
return img2;
} | 0 |
f5185c5998aa239cba47da3408c02dfb | a2f469b155fa6b39f242fc37496a39be | | ----------------
|
| Description:
| ------------
| This is the CVP server's request handler.
| It checks the connection parameter and determines
| the server's handling scheme accordingly.
|
| Parameters:
| -----------
| session - Pointer to an OpsecSession object.
| info - A pointer to an OpsecInfo data... | swcr_process(device_t dev, struct cryptop *crp, int hint)
{
struct swcr_req *req = NULL;
u_int32_t lid;
dprintk("%s()\n", __FUNCTION__);
if (crp == NULL) {
dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
return EINVAL;
}
crp->crp_etype = 0;
if (crp->crp_desc == NULL || crp->crp_buf == NULL) {
dprintk("%s,%... | 0 |
8a1c702590db2417bef3b49d8eac69ba | 05d622f904d09f5dc5175f04de5f56b4 | 初始化国籍遮罩层点击事件 | $(aclick).on('click', function(e) {
setTimeout(function(){
$(zhid).show();
},200)
if($(this).attr("id")!='shut-province'&&$(this).attr("id")!='shut-license-region'){
$(hide).hide();
}
$(asideid).css('transform', "translate3d(0,0,0)");
$(shut_aside).css('transform',"translate3d(100%,... | 0 |
9d604fc1b9130425600740f6fa6a83b7 | bc59e5d5afa0809f09abd639f40a7d32 | If a point is in any bounding box, it is a foreground point. | {
for (size_t i = 0; i < b.size(); i++) {
if (cv::pointPolygonTest(contour, b[i], false) > 0) { return true; }
}
return false;
} | 0 |
4fe88c60618b51bf5b9d291b83709751 | 7ce731d3a61b6e9c19413113e108e0c9 | Activa o desactiva els botons de selecció de rei.
<p>
Desactiva el botó de cada rei si ja existeix al tauler, per tal d'evitar duplicitats.
</p> | if (hasReiBlanc) {
bgPeces.clearSelection();
buttonReiB.setEnabled(false);
actual = '-';
} else buttonReiB.setEnabled(true);
if (hasReiNegre) {
bgPeces.clearSelection();
buttonReiN.setEnabled(false);
actual = '-';
} ... | 1 |
f4512772fc7e057f27aa0b7764259866 | 85680f923507e5d2d02784435b344e69 | 设置当前可领取奖励的副本id列表 | function ShopData:setTreasureIdList( tData )
if tData then
self.tTreasureIdList = tData
local nTargetIndex = nil
for i=1,#self.tTreasureIdList do
local nIndex = self.tTreasureIdList[i]
local tTreasure = getShopTreasure(nIndex)
if tTreasure then
if tTreasure.area == 1 then
nTargetIndex = i
... | 1 |
2657fe9248db6cad8e6e38b039d8043a | f4820edf3086081ef8c73864046651cf | Checks whether or not the current text in the IPv4_textBox is legal. | try {
InetAddress.getByName(addressTextField.getText());
return true;
} catch (UnknownHostException ex) {
return false;
} catch (SecurityException ex) {
validateLbl.setText("Security exception raised!");
return false;
}
} | 1 |
7cd959838d73b4aac547536d94ee0ba1 | 47d7162b8b6d8585c30e5ad434c5228d | 执行每一行用例 | pass_list = []
fail_list = []
rows_count = self.data.get_case_num()
for i in range(1, rows_count):
is_run = self.data.is_run(i)
if is_run:
url = self.data.get_request_url(i)
method = self.data.get_method(i)
data = se... | 1 |
0a0b40f7ea9bafe5ad47f6eac30bf428 | d5cc977d8570d6ddc99c4cba7bade401 | Fonction du cours (équivalente à Montée) pour récupérer le max de façon parallele | winner = Victoire()
if winner == 2:
return 1
elif winner == 1:
return -1
if MatchNul():
return 0
cases_disp = getCaseDisp()
result = []
for couple in cases_disp:
Play(couple[0],couple[1],2)
value = simulaPLY()
if type(value) is not int:
... | 1 |
0bf2de130595d47f153c582d1ddcc6ae | 147f1115e6777f8036de090d32c08d37 | \
|* *|
|* Description: *|
|* Parses the array_spec for declarations *|
|* array_spec is explicit-shape-spec-list *|
|* is [lower-bound :]upper-bound *|
|* ... | auto begLoc = tryConsume(TokenKind::LSquare).getBeginLoc();
if (!begLoc)
return Result<Expr*>::NotFound();
auto elist = parseExprList();
SourceLoc endLoc = tryConsume(TokenKind::RSquare).getBeginLoc();
if (!endLoc) {
if (elist.isNotFound()) {
reportErrorExpected(DiagID::expected_rbracket);
... | 0 |
ccca6af6302f240c5ed8c13e945ee3c5 | 49680dc132be31211ffc172e068bc78b | Restaura una lista de unidades oraganizacionales eliminados en base al arreglo de identificadores recibidos | p_ids: string,
) {
let _path = '/institutions/department/restore';
let _body = '';
let _params = {
headers: new Headers(),
search: new URLSearchParams(),
}
_params.headers.append('X-Requested-With', 'XMLHttpRequest');
_params.search.ap... | 0 |
3f919d512e3aee7b756b152d589fcda1 | cc7b0772af7b93bfe28c216fab7444ec | Hardware interrupt for limit switch | uint8_t limitSwitchActivated(){
uint8_t limitSwitch = digitalRead(LIMIT_SWITCH_PIN);
return limitSwitch;
} | 0 |
0f85fd28854bc448fe561a1daa1fc04a | d0e31c0463c22621e9534ecec414d543 | Takes a spark dataframe input and explodes the array columns to multiple rows, returns a dataframe | def explode_features(df):
features = df.schema['features'].metadata['features']
def extract_feature(features, idx):
return float(features[idx])
extract_feature_udf = F.udf(extract_feature, pyspark.sql.types.FloatType())
cols = [extract_feature_udf('features', F.lit(idx)).alias(name) for idx, nam... | 0 |
39cf7f006e50f77c1760297e5916fec6 | 12522bac4efb62675bba0a52dc673b18 | 生成说明书文档目录,忽略section | class TwPreprocessor(Preprocessor):
def compile_section(self, project, section, level):
if 'link' in section:
link = section['link']
else:
return ''
title = self.get_title(project, section['title'])
markdown = ''
if 'link' in section:
level_inc... | 0 |
f21872667cfd9d5e4c60b45829b2da32 | 6f18b5f207b598cad86982a0f0e32275 | Takes in a username and gets their corresponsing ID from the database.
Returns the users ID if successful and -1 if not. | try {
Statement statement = connection.createStatement();
String query = "SELECT * FROM "+ userTable + " WHERE username = '"+ username+"'";
ResultSet rs = statement.executeQuery(query);
if(!rs.next()){
return -1;
}
int id = rs.getInt("ID");
return id;
} catch (SQLException e) {
e.printS... | 1 |
d29021f9ccd7feff5d2ecbe0a42c905e | eb4f708f5ac0accebf113cf85df9d762 | Saves the force power. | {
SetForcePowerFields(tvForcePowerList.SelectedNode.Tag.ToString());
bool blnAllButton;
if (this.tvSelectedForcePowers.Nodes.Count > 0) blnAllButton = true; else blnAllButton = false;
SetFPSelectButtons(true, false, blnAllButton);
} | 0 |
b84b79ecb28caf89164f3b3decaf9694 | ff000fc0a7ddb8266b0faac147681e7d | A test for ChangePermissions | class EditVirtTest(TestCase):
def test_incorrect_perms(self):
logged_in = self.client.login(username='admin', password='dtofaam123')
self.assertTrue(logged_in)
self._make_change("Test12313","New Test")
self.client.logout()
logged_in = self.client.login(username='bo... | 0 |
1d2825060bbc51e6248197c580029b3e | c4757f6d3c732e090ba7dd521b006789 | minimum of three integers | int myMin(int a, int b, int c) {
return min(min(a, b), c);
} | 1 |
59fbb7b490f52c8a0fa389039eafb6e1 | 44636bc8876bc148f4d53866854cb32a | Update ULs using global variable arrays | for k in _UL_RES:
if _UL_RES[k][0] is None:
continue
_ul_add_action(actions, k, res_type, stderr) | 0 |
8121801e66db0b6f021b057f028a4dff | 47337a450453e3731160a96fbf7608d1 | Sets rules for organisation name. | class OrganizationPosition extends \yii\db\ActiveRecord
public function rules()
{
return [
[['position_name'], 'required'],
[['position_name'], 'string', 'max' => 255],
[['user_create'], 'string', 'max' => 3],
];
} | 0 |
0044c1d013eead5d9362bd8a17b404c7 | 49b9cea53dcaf9e6fd0d135956edb364 | function decorator for game actions, ensures cleanup | @functools.wraps(func)
def wrapper(self, chore):
chore_old = self.get(chore.name)
if chore_old.active:
self.deactivate(chore.name)
try:
response = func(self, chore)
except Exception as e:
raise e
finally:
if chore.active:
... | 1 |
80acf72a2e8732904cd73d5ab841c803 | e73f9639c44d91eae95d75c5de0a8c06 | Enables / disables bookmark CBs. | if self.__browser.url().scheme() in ["eric", "about"]:
self.__bookmarkButton.setVisible(False)
else:
self.__checkBookmark()
self.__bookmarkButton.setVisible(True)
self.__browserUrlChanged(self.__browser.url())
self.__safeBrowsingLabel.setVisible(
... | 1 |
cca9b23803cfb3a57710a833c3ecb792 | 0ba96d79217b30312bd3b5fbef53edd4 | Parsing the json data obtained from the resource file. | JSONParser parser = new JSONParser();
JSONObject obj = null;
try {
obj = (JSONObject) parser.parse(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8));
} catch (Exception e) {
e.printStackTrace();
}
return obj;
} | 1 |
a360e80ce03e9a311e6f26cb2666a9e1 | 091535a35d666857011fb346734142b9 | 指定された年月に日記を書いている日のリストを返す
書いていれば 日記の数
書いていなければ 0
を入れる | $existCheck = "select good_1, good_2, good_3, other from myDiary where userId = :id and date = :date";
$stmt = $this->db->prepare($existCheck);
$stmt->execute([
':id' => $id,
':date' => $date
]);
$check = $stmt->fetch(\PDO::FETCH_ASSOC);
if($check === false){
return '';
}el... | 0 |
32c9e5401519af95fe40d7d68a590155 | e36e4735b4132568537ac76773abb949 | Loads the Win Screen | public class UIManager
public void CallWinScreen() {
UI = GameObject.Instantiate(Resources.Load<GameObject>(PrefabsDir.uiVictDir));
PlayerManager.Instance.player.gameObject.SetActive(false);
} | 1 |
749c56e26ca53ea18aaf8cdeff7a0f84 | 9052a0fb7675c05866a46bcfc2cd91e9 | Setter for <code>privdoc.DoctorGift.orderNo</code>. 订单号。 | @Table(name = "CHAJA_DT_SHIPMENTDETAIL")
public class ChajaDtShipmentdetail
public void setOrder_no(String order_no) {
this.order_no = order_no;
} | 0 |
896ebeeb1f749d9d36afa6857be05767 | c658653da3d47fe51a7e0352fc143573 | 添加作家信息(校验是否已存在该作家) | namespace BLL
public class CSinger
public bool AddSinger(Model.CSinger model)
{
if (singer.SelectSinger(model))
{
return singer.AddSinger(model);
}
else
{
return false;
}
} | 1 |
510db5a5e8a76e8155449055f03b3f58 | 2a35039109e0cb9c533677a22c69aa0c | Assert that layout block is not rendered | result = fr_helpers.analyze_layout(
self.region,
"abcd",
self.file_content,
self.filename)
assert result == None | 1 |
acf26655e89e3f44e0a94a2a0506fce6 | d003a3ff1ae10d6dbdc0ee44395cf297 | Returns Text Shadow presets. | return array(
'' => esc_html__( 'Default', 'oceanwp' ),
'normal' => esc_html__( 'Normal', 'oceanwp' ),
'italic' => esc_html__( 'Italic', 'oceanwp' ),
);
} | 0 |
03cb7837add76af4c9c5c9a995d2b9be | bf50bcd8895b2bc3a493bc6dfb240dd2 | 将文件写入到输出流中 | fun File.writeToFile(inputStream: InputStream) {
this.outputStream().use {
it.write(inputStream.readBytes())
}
inputStream.close()
} | 1 |
c17dcd00ca8a57ebf2b36251391e30fe | 4a73e26801b55e2eb11597e16cab48c1 | 根据父编码查询字典信息列表 | public List<SysDictionary> findByParentCode(String parentCode); | 1 |
5fc3a7108ecd270ca172605d56fad597 | c08b1e50a7be276dd0f47ccd3ac436b1 | Input: regression model fit object
Output: dictionary of coefficients and their p-values | class LogitOutcomeModel(BaseOutcomeModel, BaseLogit):
def coeff_summary(self):
return super().coeff_summary() | 0 |
2c6f5d34b711b2f33067c7e8eaeb0ce6 | 6d97c6f22536899df23b89c647dcb6ef | 分配样本到聚类中心 | def divide_Sample(train_Data,category,dataDimension,K):
for i in range(K):
category[i].clusteringData = []
for i in range(len(train_Data)):
min_dis = 1024
min_dis_label = -1
for j in range(K):
dis = calcu_Eucli_Dis(train_Data[i][:dataDimension],category[j].clusteringC... | 1 |
b67ae1e2255ee99480b8c676fb5bc024 | 2130b9f566ef8219b7f929440d09d069 | Get whether the perplexity is converged or not | @SuppressWarnings("DuplicatedCode")
public abstract class BaseSlamCalibrator<D extends BaseCalibrationData>
public boolean isConverged() {
return mConverged;
} | 0 |
3961d9bae52734a232dc424d2b02afed | 2673fdfcf7ff059f772fe18c9b6fefcf | Compares two ChatMessagesADT. | {
if (((msg1->message_p1 && msg2->message_p1 && streq(msg1->message_p1, msg2->message_p1)) ||
(!msg1->message_p1 && !msg2->message_p1)) &&
((msg1->message_p2 && msg2->message_p2 && streq(msg1->message_p2, msg2->message_p2)) ||
(!msg1->message_p2 && !msg2->message_p2)) &&
((msg1->... | 1 |
dd0e49f15182ed094f49be08da9c5dc7 | f27c9f0b7f43e5a2e05bf01c120aedfa | 渡された日付が無料体験期限以内であればtrueを返す | {
$booking_date = $params['booking_date'];
$start_time = $params['start_time'];
$start_time = $params['end_time'];
$start_date = Carbon::parse($booking_date.''.$start_time);
$today_date = Carbon::parse(Carbon::now());
... | 0 |
b1c2b8fb6a53211078f6b5954c2aea18 | 302089aec2a4d1c1283bab82dbdec8f6 | Find non-numerical features index list of data | indices = []
i = 0
for att in dataset[0]:
try:
float(att)
except ValueError:
indices.append(i)
i += 1
return indices | 1 |
d44aa8edaf4426f34a6d5a087875832b | 83c4aa17abeaacfc56a5f1f931b6d96f | Called just after new page is inserted. | namespace Xamvvm
public class BasePageModel : BaseNotifyPropertyChanged, INotifyPropertyChanged, IBasePageModel, INavigationInterceptors, IPageVisibilityChange
public virtual void NavigationInserted()
{
} | 1 |
299d1fc8d2b17dfc1ed81d39aa92d218 | e836102ad2a614e14fec153da2dadead | Call the Ruby initialize method with the supplied arguments and block. | def the_method(&the_block)
the_helper(the_block)
end | 0 |
f85f52fff17f053f14c5bc22a8e59776 | 626cb7de30f78b4ffc18775d13ff4519 | Sends a command to the pulse generator RTL via FIFO | void flpydsk_send_command (uint8_t cmd) {
for (int i = 0; i < 500; i++ )
if ( flpydsk_read_status () & FLPYDSK_MSR_MASK_DATAREG )
return outportb (FLPYDSK_FIFO, cmd);
} | 1 |
ae68669a2052b379704c9ff41245b86d | df9eedcc628fa6d7d83609e29d2f4250 | \brief Returns "The element requested to be deleted does not exist." error message. | static const char* empty_getError (deStreamData* stream)
{
DE_ASSERT(stream);
DE_UNREF(stream);
return DE_NULL;
} | 0 |
7837779c91bf8d31f315b4084cecd46f | 1e84c6558f11a9b55b3d59f1c7802afd | 获取用于存储的pidsj index值 | setting = '/%s/pids/%d/p' % (self.dev_ID, pid_index-1)
dic = yield self.daq.get(setting,True)
p = float(dic[setting])
returnValue(p) | 0 |
8b863a183bfb10a5b7a7fa64cd9185de | a9d9cc620a3ad30fc9eed43ea0f97a33 | Order lines count. | $orderLines = $this->getLines();
$count = 0;
foreach ( $orderLines as $orderLine ) {
$count += $orderLine->quantity;
}
return $count;
} | 1 |
b1a7078ad64a8a6c2bdb3ad0f835d064 | 5ef98bd14c490d5490b117a3aaa36c2e | https://leetcode.com/problems/single-number-iii/ | class Solution:
def singleNumber(self, nums: List[int]) -> int:
return self.bit_manipulation(nums) | 0 |
ff8f6b76f664b7abc259e3b00c192c46 | 95f155c700575a7fbcbf2cb2486cdd12 | 最大公約数を求める(ユークリッドの互除法) | {
int temp = 0;
while ((y != 0) && (x % y == 0)) {
x = x % y;
temp = x;
x = y;
y = temp;
printf("デバック最大公約数%d %d \n", x, y);
}
return x;
} | 0 |
73af6661bf36b3842c29b82bb3142042 | c5794316c9516e75cc174ddd85b255eb | 左侧菜单解除点击事件 | function leftMenuDetachMouseout() {
$('.left-menu>dl').off('mouseout');
} | 0 |
6be9d862a18f159feb35769bf9d0bee9 | a977545fc71564b452cae584acd50169 | Constructs the list tag | class Extruct_NativeToStream_Convertor extends Extruct_NativeToNative_Convertor
public function _List($oNode, $DATA)
{
$this->Stream[] = '<List>';
parent::_List($oNode, $DATA);
$this->Stream[] = '</List>';
} | 1 |
5863ecc4b27af26cbf807443d373d723 | d132506c92bbddac10f5cc0576807385 | Compares pizzas by calories | public class PizzaManager
private void sortByCalories() {
if(pizzas.isEmpty())
return;
for(int i = 0; i < pizzas.size() - 1; i++){
int index = findSmallestClrs(i, pizzas.size());
for (int j = i + 1; j < pizzas.size(); j++)
if(((Pizza) pizzas.get(j)).getCalories() < ((Pizza) p... | 1 |
d33b77f318be37ecac748b5a563e5798 | e2518c9980c941a55803d8af8b0bd5df | Turn it into a NationStates ref name | if (typeof name === "string") {
name = splitName(name);
}
if (name.length === 1) {
name.unshift(name[0]);
}
if (name.length === 2) {
name.unshift(name[0]);
}
return levelArrayToRef(name);
} | 1 |
f586abd2344a42cb24bc7c01d5e9007f | d8ac011ab1952da1a4cb5d8e162de750 | Generate a sequential sequence to fill a buffer. | size_t i;
char value;
for (i = 0; i < buffer_size; i++) {
value = (char)((i + 1) * (rank + 1) + i);
sbuffer[i] = value;
}
} | 1 |
952c47ba274149493029c515677e139c | a59ead756258cf6dda82b0c10af96ecd | Adds intro related session tests. | class SessionTest extends \OxidTestCase
protected function setUp()
{
parent::setUp();
$this->oSession = oxNew(\OxidEsales\EshopCommunity\Tests\Unit\Core\testSession::class);
} | 0 |
d24f057749a4c42d54fde2e8c95a7ead | 406e9cd75b3054fd84f8f78c63bcd868 | Gets one specific IP, with it's note matching your input | String text = ipField.getText();
String info = matches(text);
JOptionPane.showMessageDialog(null, info);
} | 0 |
a613266895f301118f3d8b5ccb7b71a6 | 0b370b74e926e270407e98308b05be7d | 改变玩家角色 | export default class BaseLevel extends cc.Component
changePlayerEvent(){
if(this.playerEvent){
this.playerEvent = false;
}else{
this.playerEvent = true;
}
} | 0 |
5e259c8a9a9d2992535745ed0bc492f9 | adc4664ae678c34ac96053e367f62322 | Test case for get_destination | url = "/v1/bookings/{}/".format(self.test_flight.id)
resp = self.make_flight_request(
operation="get",
url=url,
content_type="application/json",
headers=self.headers
)
self.assertEqual(resp.status_code, 200)
self.assertEqual(resp.js... | 1 |
e1a20b0eb8213b385d45aeb229c1baf9 | 43845665c53578adf533d1639399e815 | 获取发送验证码的URL | validateSMSCode(params) {
return () => `${baseUrlMobile}validateSMSCode?${queryString.stringify(params)}`;
} | 0 |
2d4b4be6f4e939788f1d0fe1860b951d | 218c8a40d39b17e83da8b1282ca7b543 | Return a reference to a MS parameters data structure for a specified
parameter set. | _In_ const MI_ParameterSet *self,
_Out_ MI_Type *returnType,
_Out_ MI_QualifierSet *qualifierSet)
{
const MI_Char *name = NULL;
MI_Char *referenceClassName = NULL;
return _ParameterSet_GetParameterAt(self, 0, &name, returnType, &referenceClassName, qualifierSet);
} | 0 |
e14ae7f16dfed53bb65e9cb485726a6f | 67751af6afc14355cd7bab6ad10d84d8 | set scale to the current matrix | namespace M3D
void Matrix4::SetScale(float scale)
{
m_m00 = scale;
m_m11 = scale;
m_m22 = scale;
} | 1 |
43143964c2e56c47f2d204f716a5b158 | 9c4ff6bb7975028ea84c23c3bf3a1389 | This command allows a policy to be bound to a specific creation
template. This is most useful for an object creation command such as
TPM2_Create(), TPM2_CreatePrimary(), or TPM2_CreateLoaded(). | void* auth2 = NULL;
RETURN_ON_FAILURE(TtlRunCommand(TPM_ORD_Seal,
2085, 2115, in_parameters, out_parameters,
auth1, auth2, buffer, buffer_size));
return TPM_SUCCESS;
} | 0 |
860e647aaa569093b93200e86b1317cd | ad529be42c18ff73148cf7aab4f6f28a | Execute the selection SQL and handle the result set.
changed. | public class Rdb extends ARdb<ResultSet>
@Override
public final IRecSet<ResultSet> retRs(final String pSel) throws Exception {
try {
boolean dbgSh = getLog().getDbgSh(this.getClass(), 8006);
if (dbgSh) {
getLog().debug(null, getClass(), "Thread ID=" + Thread.currentThread()
.getId() ... | 1 |
f3302134eac672a80a85e1f82f53050b | 3c32cd1e7393924bcf2349a0fbb523b7 | 统计用户的课程学习时间 | courses_data = Hash.new
users.each do |user|
if user.course_id.present?
course = Course.find(user.course_id)
if !user.last_login_time.nil? && date_check(amount_time, time_period, from_date, user.last_login_time)
if courses_data.key?(course)
courses_data[course] += 1
else
courses_dat... | 0 |
c43eaa83b95221382aa58d1ae0413e2e | 9cac53bd802f2d71cbc682b8cd8959e8 | Parse list of comments of pojo @Comment to list String | if (list.isEmpty()) {
return null;
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
Property property = list.get(i);
if (i > 0) {
sb.append(", ");
}
sb.append(property.toStringFormat());
}
return sb.toString();
} | 0 |
6ebfb3081659eece49c287d10da0e96d | a9744948045f0878b42323511c0e64d4 | 异步修改列表页 内容 | class Lists
public function updateListsAsync(int $slId, array $data, UidDTO $user = null)
{
return EellyClient::request('service/lists', __FUNCTION__, false, $slId, $data, $user);
} | 1 |
7b9fd18b363b8cce1bb8befdc3ca788a | 211eb9443a033e7c5074fdbe77fd9f8d | 打开挂件-边框宽度选择框 | fun Context.paintWidthPickerDialog(config: PaintWidthPickerDialogConfig.() -> Unit): Dialog {
return PaintWidthPickerDialogConfig().run {
configBottomDialog(this@paintWidthPickerDialog)
config()
show()
}
} | 1 |
a3de620d7a3019a2271c3111326ee7ef | 64ba3540c665c892994ec31336a4af60 | 从文件中获取action名称 | ArrayList<String> aNames = new ArrayList<String>();
String path = "src/main/resources/Actions.json";
String s = readJsonFile(path);
JSONObject j = JSON.parseObject(s);
JSONArray ja = j.getJSONArray("actions");
for(int i = 0; i<ja.size(); i++){
JSONObject key1 ... | 1 |
508f881a3e002d7d1b4c05ba1aba75e0 | 1f2a1a47472323056ca2d60eb0fa7759 | Set up the spirograph's parameters. | myCircle = circle;
rotateRadius = myCircle.m_Radius - pHalfWidth;
pathway = Pathway.inPath;
rotateSpeed = rotateDis / rotateRadius;
} | 1 |
6eecb9fda3c5015fb150fba6fabfa98d | 568775c4807d6ca061800b7c77e67b7d | adds a player to the banned players list | public class BattleListenServer extends Thread
public void addPlayer (BattleServerPlayer sp)
{
this.serverPlayers.addElement (sp);
} | 0 |
d81c07233b5bcd31e002922f08332458 | e18976e90f7654dc040a6d1d7d1b8081 | Expand a dataframe with a list into multiple rows. | class Series(SingleColumnFrame, IndexedFrame, Serializable):
def explode(self, ignore_index=False):
return super()._explode(self.name, ignore_index) | 1 |
ad341269e2a7d9b4b0bbcc448fedf4df | f541886e9ccca768beaf9d56f9afeefe | Add a default exit menu | void Archiver::BuildDefaultMenu()
{
} | 0 |
c5872378f853207f17a7f2eec9b26588 | 92aa76703fa3d56a50131a870456009e | Convert date string into integer after removing name from it | int DateClass::changeDateOnIntWithoutDashes(string dateStr){
int date = 0;
dateStr.erase(4,1);
dateStr.erase(6,1);
date = atoi(dateStr.c_str());
return date;
} | 0 |
38debcb45c314c0b95dd4e5825fc88cf | 9cc4df52b673285a366677399f746857 | aggiungo l'utente ai gruppi degli insegnamenti dell'anno del corso di studio scelto | public boolean addUsergroupToCourse(long usergroup_id, long course_id); | 0 |
faa5ec079c0633d7d9de6df6a9eb4b6d | 84f8c69c97516e1573ee8a5b4748f2e2 | Called when property on button label is changed. | {
IndexedPropertyChangeEvent e=(IndexedPropertyChangeEvent)evt;
FieldButton b=buttons[e.getIndex()];
if(! e.getNewValue().equals(b.getValue()))
{
b.setValue((Character) e.getNewValue());
}
} | 1 |
94ec972fe2d93c790e51fc00123396d6 | 27d75490a28fc169b18bf28105f47a97 | Класс для шифрования/дешифрования текста в изображение. | class Draw_it:
def __init__(self, original_image, fill, font):
self.draw = ImageDraw.Draw(original_image)
self.fill = fill
self.font = font | 0 |
eec18c4b4c33f7fdc1909556dcf0740a | 4134a155749468ec157c7dc71ef6a844 | Tells if an index table for a given table exists | public class IndexAdmin{
public boolean hasIndex(String tableName) throws IOException{
return hasIndex(Bytes.toBytes(tableName));
} | 1 |
3c4205a602d3df9ba2c637a61653f563 | 0908da61b6881120c108f30030e24808 | 初始化涉密等级下拉列表 | {
string[] SecrecyLevels = new string[] { "四级", "三级", "二级", "一级", "管理员" };
for (int i = 0; i < Convert.ToInt32(Session["SecrecyLevel"]); i++)
{
DroSecrecyLevel.Items.Add(SecrecyLevels[i].ToString(), i.ToString());
}
List<BasicCode> list... | 1 |
f3609708115312addbf3159f987717f3 | 7982819e09e163b31ee1c37f7cdae05a | @brief Met le timer en mode Fast-Pulse Width Modulation (Fast-PWM).
ATTENTION : les broches PD4 et PD5 seront gérées par le compteur.
Pour éviter cela, mettre com1a et/ou com1b en mode DISCONNECTED. | {
PWM.TCON = (PWM.TCON & (~(0xf<<0))) | (1<<3 | 1<<0);
} | 1 |
4dbcf5946fc72d3a323fd147e5dbe541 | 1958cdff359a23ab3d0df7938a286573 | 빠른 매치 요청 답변 패킷 처리. | {
var msgAskBattleResponseData = (byte[]) headData.body.Clone();
msgAskBattleResponseData = ReadMsg(msgAskBattleResponseData);
var msgAskBattleResponse =
SocketManager.DeSerialize<MsgAskBattleResponse>(msgAskBattleResponseData);
MsgFactory.UniqueIdStart = msgAskBattleResp... | 1 |
81ba605f93d3e1825b0136ab2bdebdfb | bd302daa652a4f917099d584088ed08d | IssueCert issues a certificate, either a self-signed CA or from a CA in a keystore. | err = req.Validate()
if err != nil {
err = errors.WithMessage(err, "invalid request")
return
}
err = cfg.Validate()
if err != nil {
err = errors.WithMessage(err, "invalid configuration")
return
}
var (
gkey crypto.PrivateKey
keyID string
c = csr.NewProvider(provider)
)
csrPEM, gkey, keyID, e... | 1 |
b0f5307be70546c6a1d7a5c44dc44985 | c892105c85b71048863c6d724f77c58f | this method shows the employees list in a ascending order based on IDs | {
employeeCLASS temp;
for (int M = 0; M < EU - 1; M++)
{
int Min = M;
for (int N = EU - 1; N > M; N--){
if (EmpList[N].GetEmployeeData().Id < EmpList[Min].GetEmployeeData().Id){
Min = N;
}
}
temp = EmpList[M];
EmpList[M] = EmpList[Min];
EmpList[Min] = temp;
}
} | 1 |
c1a4fb6b1a65da462d15cee22f8174d4 | d52f4da51dafd7bc289989d41826855f | Snippet for DeleteReferenceImageAsync | export class DeleteImageCommand extends $Command<
DeleteImageCommandInput,
DeleteImageCommandOutput,
ImagebuilderClientResolvedConfig
>
constructor(readonly input: DeleteImageCommandInput) {
super();
} | 0 |
dbfe1b47c37f1b94cee5707369a91abe | 4858e50c47fcf1b3c78babe7bc4298ad | print one argument per line, ending with a new line. | def print_line(txt):
print(txt), | 0 |
a3733773c4753d9f2b2229fb0635a8a7 | 7c5e1680693d7c7515b709f5bce8043e | Create visit log mock file. | String date = DateUtils.getTodayDate();
List<Row> rows = new LinkedList<>();
BufferedWriter bw = new BufferedWriter(new FileWriter("date/date.log"));
for (int i = 0; i < 100; i++) {
long userId = random.nextInt(100);
for (int j = 0; j < 10; j++) {
... | 1 |
9c9c4c5a3dc5f55e912d12dcaa8386ed | b7fc60f486e995b6555f3336e805b39d | Checks, whether player pointer is on the last player who played this turn | int index = players.indexOf(currentPlayer) + 1;
return index >= players.size();
} | 1 |
238b6380087824b1e7b99dbcb79d987a | 7ce79bcd4f3085727b69d91547bad044 | Run `status` command. | class StatusCommand extends BaseCommand
public function main()
{
$server = \Mix\Http\Server::newInstance();
$pidFile = $server->settings['pid_file'];
$pid = $this->getServicePid($pidFile);
if (!$pid) {
println(self::NOT_RUNNING);
return;
}
... | 1 |
c7314169f1cef20296e06a0b260d1222 | 6b93bd4a08e7f9385fa93119bd8efb29 | Sets the number of training epochs. | class CIFAR10DataProvider(object):
def set_epochs(self, num_epochs):
if num_epochs < 1:
raise ValueError('num_epochs must be >= 1')
self.dataset = self.dataset.repeat(num_epochs) | 1 |
291cd1df019345cbecc980fc02bff233 | 4572c78f97c56dfdf83bafa00157285d | 展示日韩电影 | {
import('ORG.Pinyin');
$py = new PinYin();
$t = I("id");
if( empty($t)){$t=1;}
if($t == 1 ){
$allpage = intval(2668/100)+1 ;
$topID = "movie" ;
$cid = 1969 ;
}elseif($t == 2 ){
$allpage = intval(732/100)+1 ;
... | 0 |
63e6107e63d3e49888402c21ecfdd036 | a21496ae9eb33676b2d31cbca5ff4f9a | == Définition des fonctions de rappel des types de champ == | class FonctionType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('typeFonction');
} | 0 |
327649dfac588142b358c9adf8f7849c | 4241b629bec0a2a7b1a3afcf225fdb5d | Возвращает заголовок документа в HTML формате | {
String attribs = getConfig().getAttributeString( "doc.header.title" );
return EOL + "<fo:block" + attribs + ">" + title + "</fo:block>" + EOL;
} | 0 |
81215195529812a7d64cdda43dffb9f2 | ef842dd7aa2c3dcecaf02bbcd74c26ae | Converts our Shading enum to the D3D ShadingMode equivalent. | static void nv30ShadeModel(GLcontext *ctx, GLenum mode)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SHADE_MODEL, 1);
OUT_RING_CACHE(mode);
} | 0 |
570b6cc50fd980e7c5f4189a3f5a90d9 | 3ee4f96355d0aa7a334d16eca5b833d1 | Afficher le formulaire de création d'un room | class RoomController extends Controller
public function create() {
return $this->output();
} | 0 |
05c16110e09f73da3872664705522976 | f1efeb22c85b9387f063bd8ddb729b86 | 发送带附件及图片的邮件 | public class JavaMailKn
public void sendAttachmentMail() throws Exception {
Properties pro = System.getProperties();
pro.put("mail.smtp.host", host);
pro.put("mail.smtp.port", port);
pro.put("mail.smtp.auth", "true");
Session sendMailSession = Session.getDefaultInstance(pro,
... | 1 |
39be99ccf960262232b9f10f83893564 | 043b48752d348c5b57294c0b406b09f5 | 按钮材质初始化 | console.warn(`resetButtonMaterials`);
btnOpenVideo.material = new THREE.MeshBasicMaterial({ map: mat_btnWater });
btnOpenVideo.name = 'OpenWater';
btnOpenRightDoor.material = new THREE.MeshBasicMaterial({ map: mat_btnMagicDoor });
btnOpenRightDoor.name = 'OpenMagicDoor';
btnKnockOn.material = ne... | 1 |
9b3e163c55af62de668dd6c80a6f548e | 0f0f990f9ecf3b76907cde76e50834df | 商务租赁充值 | class Wx_carpoolModuleSite extends WeModuleSite
public function doMobileRecharge() {
require_once(dirname(__FILE__)."/inc/mobile/doMobileRecharge.php");
} | 0 |
9be7293bfd10b5f4f8e662d554345d60 | c7bc0e1bff42c72e60b83c8acbc0f353 | Test that the header, data, and footer methods are called. | static void test_header_buckets(CuTest *tc)
{
test_baton_t *tb = tc->testBaton;
serf_bucket_alloc_t *alloc = serf_bucket_allocator_create(tb->pool, NULL,
NULL);
const char *cur;
serf_bucket_t *hdrs = serf_bucket_headers_create(alloc);
CuA... | 0 |
8f8f991c9f8576fe80ec4854ab34a650 | 1d53cfa25a4bcb46fe76f58ea7fc4ccd | Spawn threads to read the scoreboard file and to get the player details concurrently | public class OrderManager : MonoBehaviour
void Start()
{
ReadInOrders(@"Assets\Scripts\OrderTextFiles\order_inputs.txt");
scoreRef = scoreObj.GetComponent<ScoreSystem>();
SpawnOrder();
} | 0 |
47d04a617bf22a1f1f2394cc77ee1f43 | 4e3262716bf3a1e548f661362f557e2c | handle Click event to save send to list | namespace Exile_Payment_Reminder
public partial class frmMain : MetroFramework.Forms.MetroForm
private void onSaveListMenuClick(object sender, EventArgs e)
{
SaveXML();
} | 1 |
816e577ae7175eed4c68e8bc43b441f2 | 84f0902e02a4974e8d7305a8a2edbd21 | M�todo est�tico para obtener la referencia al singleton. | namespace NewAge.Cliente.GUI.WinApp.Clases
public class BaseController : CommonReportDataSupplier
public static BaseController GetInstance()
{
try
{
if (_instance == null)
_instance = new BaseController();
_numOfReference++;
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.