query_id
string
corpus_id
string
query
string
code
string
label
int64
0a4d436bacacc6e34ff1a6b083ec5382
fac4fc054d52a9b6e8735f9fe1ecf1b9
计算多个止损策略结合回测的结果
class Strategy(object): def backtest_result(self): pl = self._broker.get_equity_curve() dbal = self._broker.get_daily_balance() tpl = self._broker.get_trade_pl() tlog = self._broker.get_trade_record() return pl, dbal, tpl, tlog
0
81535d996c8bb9c36959e4fb3cd1c5b9
d1d24ea5a9ae04d80dba98e97442b38b
Fill the array with the integers from 0 to a.length - 1.
int fillArray(int* arr, unsigned n) { for (unsigned i = 0; i < n; i++) { arr[i] = i; } return 0; }
1
400d156b261343ea3ac021d7cce3222f
8a9939704751a23518e7a5d41c717d62
Increments the amount of games the player has played.
public class GameStats public void gamesPlayed() { gamesPlayed++; }
1
6596e29bf95fd2d2e90f1bbfd3ddb2c6
fd4ce933c18dc25ed57e872d1e420c29
get optional parameter (e.g. article title)
public class OptionalParamsController : ApiController public string Get(int id, DateTime optionalDateTime = DateTime.UtcNow.Date) {...}
0
266951698801fa00d4c0783308be3b3e
90043c415f2ac3de0a3e900ffdc35517
Get htMoteur2.
class Appareil public function getHtMoteur2() { return $this->ht_moteur2; }
1
8653f15be9b1301156d80f3720f83a1e
24df0c6b6c25e76885e1d417b4b4594a
Returns the value of the '<em><b>Colour</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Colour</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
Colour getColour();
1
330b62aa885a2d5e3bbd277dc43850e1
d1e443a3257c9e6654bcf4273395c76a
complex 1x1 convolution
cmatrix returnVal; returnVal.rows = input.size; returnVal.cols = 1; returnVal.entries = malloc(sizeof(double complex*)); for (int i=0; i<input.size; i++){ returnVal.entries[i] = malloc(sizeof(double complex)); returnVal.entries[i][0] = input.entries[i]; } return returnVal; }
0
bd897c8e8565d00e4e36e3fdacacdf83
7109a4d23debab92e4ec932aeeb59ade
查询放款数据,不做分页
getLoanList(params) { return postParams(DATA_URL + "init/loan/queryLoan", params); }
1
a96d8c39094ef5968e93cc859777118b
03d7cf4586c8696d67b8cbaa0d48b452
Sets the return address for the block
class Message public function returnPath( $address ) { $this->swift->setReturnPath( $address ); return $this; }
1
20769d36cab9756ff071ef01f1270184
598ac5914ca6f1f6a49291a68e7afc26
Save full model in self.sess by tf.train.Saver, all vars must have been initialized. Default save path = self.config.out_path/self.config.model_file_name
class SAC(object): def save(self, path): self.saver.save(self.sess, path)
1
9996f5fd3bb34c7b71aaa00f97e4e1f4
6c5be1e305e69b61dbf384c8a7ef5e65
@brief 查询城市是否存在
Response<String> checkCityExists(AreaDTO areaDTO);
1
3db47170c7d85fa5a6f32efe3bfa3eff
621bcbb04965cbdf54b5e98258852a2a
Determines whether or not the supplied SQL exception was caused by a duplicate row being inserted into a table with a unique key.
public final class Util public static boolean isConstraintViolationException(Exception e) { if (e instanceof RollbackException) { final Throwable cause = e.getCause(); String message = cause.getMessage().toLowerCase(); if (message.contains("unique") || message.contains("duplicate")) return...
1
4233a08734b5552711eae933478563f0
c4dc7d03c9857a1fc47b23aec309fd02
Метод знаходження факультету з найбільшим числом студентів
namespace KursBD public partial class InfoList : Form private void Facult(ComboBox sender) { SqlCommand fnCom = MyData.con.CreateCommand(); fnCom.CommandText = "fcNames"; fnCom.CommandType = CommandType.StoredProcedure; SqlDataAdapter fAdapter = new SqlDataAda...
0
5a2daed9a05a164322768614283a6f67
69a5b3413812b900ab100554060380ab
Notify about changed property count.
namespace Multiplayer.Client.Persistent public class CaravanSplittingSession : IExposable, ISessionWithTransferables, IPausingWithDialog public void Notify_CountChanged(Transferable tr) { uiDirty = true; }
1
5a6231822f06eaec57c40de186d001da
0dba644d211d0c0f493a5acc8326e059
Take a character and turn it into an id for storage
if char == "W": return 1 elif char == "U": return 2 elif char == "B": return 3 elif char == "R": return 4 elif char == "G": return 5 elif char == "M": return 6 elif char == "0": return 7 else: return 8
1
44d799f40a3add008dc5a9ff60048fa2
9f4160ac45a30427ba93b9157a5bf55f
导出-会员层级
class MemberController extends CommonController public function downloadexcel() { $status=array('1'=>'正常','2'=>'删除','3'=>'冻结'); $relust=$this->rewardset(); $level=explode(',',$relust['level']); $member_table=M('member'); $xlsName = "用户列表"; $xlsCell = array( array('id','会员id'), array('username','...
1
5fc7a47047a5d6daefa2bc092e52dc9d
a5a4125b61f25c7b09f88770db54f673
We rotate the character to have the same rotation of the camera
public class ScreenCapture : MonoBehaviour void RotateCharacter() { if (rotation_count == 0) current_character.transform.rotation = new Quaternion(0,0,0,1); rotation_count = (rotation_count + 1) % rotation_step; current_character.transform.Rotate(Vector3.up, 360/rotation_step); if (rotation_count == 0...
0
0b9c971079b4cdb6a4364fb7155012e6
cf21f2f1e6745326aed5088f83b708b1
Pass the turn to the white pebble
public class Selection : MonoBehaviour public void P2White() { P2currentColor = 5; select.Play(); }
0
bc68db8dbccc018d1aa4452274cd104d
cf6ccb6d089ca98dbf272bd3dd7bf332
Kiểm tra xem TimePeriod này có "giao" với một TimePeriod khác hay không
public class TimePeriod public boolean contains(TimePeriod tp){ return this.periodStart <= tp.periodStart && this.periodEnd >= tp.periodEnd; }
0
94b67c674540ba9293d9031ce32859e1
9df462af65b26c2a1cb05b1c1e920c7c
Retorna lista de artigos por veiculo
for (ArtigoVeiculoComunicacao artigo : listaArtigos) { if(artigo.getVeiculoComunicacaoId().contentEquals(id)){ listaArtigosPorVeiculo.add(artigo); } } return listaArtigosPorVeiculo; }
1
5df880d75d1174b0c639f50ad1706476
f5ffec723cd9481f08272d81a7f0721b
Sort list categories by order field
class CategoryController extends Controller public function sort(Request $request) { $categories = Category::where('id_parent', 0)->orderBy('sort')->get(); return view('admin.categories.sort', ['categories' => $categories]); }
1
265be90ba53cac26d14435f702ba76f0
b4013f6a1a580f9a14d812407512fa5d
make a copy of all the vm_entrys. Needed to Duplicate Process (fork).
void vm_map_dup(vm_map_t *new_vm_map, vm_map_t *old_vm_map) { vm_map_init(new_vm_map); list_head_t *it; list_for_each(it, &old_vm_map->vm_map_list) { vm_map_t *old_vm_map = list_entry(it, vm_map_t, vm_map_list); vm_map_entry_t *old_entry = old_vm_map->map_entry; assert(old_entry != NULL); vm_map_entry_t *ne...
1
61ef0c8589dc39c3b20139dcbff34fd2
d5209f18e5b33064b01fe96aa2024619
Rolls a specified number of dice with the specified number of faces
def rollDice(dice_num : int, face_count : int) -> int: if dice_num > MAX_DICE_COUNT or face_count > MAX_DICE_FACE_COUNT or dice_num < MIN_DICE_COUNT or face_count < MIN_DICE_FACE_COUNT: return None total = 0 for die in range(0, dice_num): result = randint(1, face_count) total += resu...
1
b4e2a1b211da7ffb2d272d989182ea98
4d1a471d640ae7ff4021e482c5c23c7c
求N个数字的最大公约数
func NGCD(numbers ...int) int { l := len(numbers) if l == 1 { return numbers[0] } return Stein(numbers[0], NGCD(numbers[1:]...)) }
1
892014ecb807c628acfdcb7de02551f4
15bf4536c92f1a2d3763b8ef9a6e2a9f
GET: Timetables/Create
namespace test2MVC.Controllers public class TimingsController : Controller public ActionResult Create() { return View(); }
1
25882599e3424da77e82b1d0c8f5434a
309287db2b724e25c2f0078a094fb268
Utilizando Linq obtengo el total de la venta sumando el producto de las cantidades por el precio de cada producto
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "/totalizarVenta")] public ResponseBussiness<TotalizarVentaResponse> TotalizarVenta(TotalizarVentaRequest totalizarVentaRequest) { ...
0
ccf70ca95c3eab7e2189e1240e86ea6d
b296a4ef312bd5b4dcb828f8eaf1aec6
非惠商户布局组件并注册事件
var html = createMMVeLUm("hna_moveReg"); var $mmv = $(".p-mmv"); if($mmv.length > 0){ $mmv.parent().replaceWith(html); HNAmoveReg.eventInit({ "id": "hna_moveReg", "successMsg": _i18n("B13"), "callback": function (data) { $(".user-info-form"...
1
171bee0ecb965395ea6bff5aa9f434c6
be88ab1d2658602acdd27c7233bd9b9a
用户列表调用(发送获取userList的请求)
*fetchUserList({ payload, callback }, { call }) { const result = yield call(fetchUserListI, payload); console.log("use res: ca: ", result) if (typeof callback === 'function') { callback(result); } }
1
0a0667b8947da74c56c92b1f8425a796
688bd8e3f403dc6ca87f1ea1145d141e
Takes an arbitrary string `serialized_call` and attempts to find a cached value in Redis for it based on an md5 hash of the value as the keyname. Failing that, passes `serialized_call` call onto the function passed as `external resource`, takes the result and caches it in Redis with an expiration of `ttl` which default...
&self, runtime_blob: RuntimeBlob, ext: &mut dyn Externalities, allow_missing_host_functions: bool, export_name: &str, call_data: &[u8], ) -> (std::result::Result<Vec<u8>, Error>, Option<AllocationStats>) { let mut allocation_stats = None; let result = self.uncached_call_impl( runtime_blob, ext, ...
0
5f95395f64037eba79ef4f6807818414
6b18ad9c2a2d2621464d47996a57e881
Display a listing of the ProductSubCategory.
{ if ($request->ajax()) { $hotel_id = $request->session()->get('hotel_id'); $subCategories = ProductSubcategory::withCount('products')->where('product_category_id', $request->product_category_id); if ($request->active != '') { $subCategories->where('active...
1
8a779a6d8e16a1092ce4f7a8aff98b3b
c28d3487bdce515d60941298d5166212
Transport address that will be attached to transmitted data that are input to serial port 2.
void serial_enter_ptx() { SYSCFG3 |= USCIARMP_1; SERIAL_DIO_DIR |= SERIAL_DIO1_PTX; SERIAL_DIO_OUT |= SERIAL_DIO1_PTX; SERIAL_DIO_DIR &= ~SERIAL_DIO2_PRX; SERIAL_DIO_REN |= SERIAL_DIO2_PRX; SERIAL_DIO_OUT &= ~SERIAL_DIO2_PRX; serial_phy_mode_ptx=1; serial_ll_timeout_ms = PTX_TIME_MS; }
0
689df1209f0ff30cc991bd607e9fdc5a
10c4c7490cae1f7190f9bcc6a7dbd43f
指定this为void类型,表明在该函数中this不可用/不可访问
public class ThisTest void show(){ System.out.println("成员方法中:this = "+this); }
0
b1ce7690888798cb347058d6f443b66b
0aa721747df5d567d70311725771f6e2
Funkcia vytvarajuca novy list stromu s danou hodnotou
elemofTree* newElem = new elemofTree(); (*newElem).value = value; newElem->left = NULL; newElem->right = NULL; return newElem; }
1
f90076b4df87059d729fbcfb655693d2
967d0cbcfb8fe772ec8332e27eb6f7bd
Sets the free parameters of stochastic oscillator.
self.index = index if index else self.index self.open = open if open else self.open self.close = close if close else self.close self.max = max if max else self.max self.min = min if min else self.min self.vol = vol if vol else self.vol...
0
46d879f453d34fbccd4daa86b470ce8d
c287380a3011592253faa5b693bc07f7
运营活动优先级查询
{ DataTable table = null; using (SQLHelper conn = new SQLHelper()) { conn.OpenConnection(); try { table = conn.OpenDataTable("select td_pid,td_pname from lrpriority (nolock) order by td_pid", CommandType.Text); conn.CloseCon...
1
0519e61513f4a8f3a8eaf55351a92388
d9e1cb1332d930de9fada1e1a90549d4
지도 상에 추가되어 있는 대여소 리스트 초기화
mapView.removeAllPOIItems() mapView.setCalloutBalloonAdapter(null) val parking_lat1 = 37.585268 val parking_long1 = 127.056157 val locate_parking1 = MapPoint.mapPointWithGeoCoord(parking_lat1, parking_long1) val parking_marker1 = MapPOIItem() parking_marker1.itemN...
1
d98185bb039afa9181e98676ebb00b09
2016c0d655a373ec29e084ea53724bab
Answers a Challenge Response type challenge. This is a BankSolutions challenge that generates a response based on an inputed value
(_, o, _, _, _, hs) = params w0 = o.random() w1 = o.random() W = w0 * hs[0] + w1 * hs[1] c = _challenge([hs[0], hs[1], C, W]) r0 = (w0 - c * r) % o r1 = (w1 - c * m) % o return (c, (r0, r1))
1
d5902ac8f88f3fd75f39c18eef4b55ba
61b7e6e49f462666e863cba1420ce1f2
calculate the average unit vector which is perpendicular to the bp planes
self.u_gtg = self.gtg.find_u_gtg() self.u_gtg = self.u_gtg / np.linalg.norm(self.u_gtg + self.epsilon) self.u_oa = self.oa.find_u_oa() self.u_oa = self.u_oa / np.linalg.norm(self.u_oa + self.epsilon)
0
f0616d954d607b3b201be02ddf5861ac
0f5d3f5720c2eed541c31e2bb3091425
Make a minimal PolicyVersion
class Policy public function __construct($version = self::VERSION) { $this->setVersion($version); }
0
47c0d377e443962b4ce2a95cb8a0c06d
997c85abc620131b29b4ffb78dbf2b6f
Gets the root node in the merkle tree.
{ var node = GetTop(); return _tncGetter(node).IsRoot ? node : null; }
1
adfa359314cb7302c2a0d5b969aacb8b
9b39c049bbab526bef08066b0aaace27
NAME DAdestroy_array - Destroy a dynarray DESCRIPTION Destroy an existing dynarray from use. This routine de-allocates the dynarray structure and deletes the current dynarray. RETURNS Returns SUCCEED if successful and FAIL otherwise
ddr_vll_drom_quadmsh_delete(object, data) DtObject object; ddt_vll_drom_quadmsh *data; { if (data != (ddt_vll_drom_quadmsh *)0) { if (data->uvvertexlist != (DtInt *)0) { DDspace_Deallocate(data->uvvertexlist); } if (data->bboxuv != (ddt_vll_drom_bboxuv *)0) { DDspace_Deallocate(data->bboxuv); } if (d...
0
9675012e0fd4b3e437678539acd8c164
195143e75d7ee71ee67b5d7e1c89253f
Find all gates that have been saved for a qubit or None if the qubit doesn't exist.
class GateHelper: def quregs(self) -> Dict[str, NDArray[cirq.Qid]]: return self.r.get_named_qubits()
0
ce2723f0f4d203ac90264d56c2cb771e
9d04b451346b67d7a86b8b5e8eba210f
初始化最高分
function initHighScore() { var highScore=localStorage.getItem("highScore")||0; $("#high-score").html("历史最高分:"+highScore); }
1
cb695a3d889a002dd3377bb4a2f56ef4
5744793a687f630a66e2d93f2014a8b8
获取编辑帮助 <p>只有<b>{@link RewardTypeEnum#ITEM_STACK_SINGLE}</b> <b>{@link RewardTypeEnum#ITEM_STACK_MULTIPLE}</b>、 <b>{@link RewardTypeEnum#CHAT_SINGLE}</b>、 <b>{@link RewardTypeEnum#CHAT_MULTIPLE}</b>会调用此方法</p>
if (dataType instanceof Enum) { return new HelpLocation("DataTypeEditors", "EnumEditor"); } if ((dataType instanceof Union) || (dataType instanceof Structure)) { return new HelpLocation("DataTypeEditors", "Structure_Editor"); } return new HelpLocation("DataTypeEditors", "Structure_Editor"); }
0
d127d613bdb6f9fdb9a1fee9aedac70d
cf5cf2e328e569942c2a1cefb24dac9c
Returns the variable representing the current amount if energy of this battery in the given energy unit.
if (!getEnergyPresence()) { return -1; } if (getStaticCoeffPresence()) { return getBaseSize(); } else { return 0; } }
0
015ffc8a765194454fcf82f6c8e93caf
31722bf22c29dc64dda35e8a49e9ab07
待支付金额变化
class MainWin(GUI.MyFrame): # 新建数据 def pay_money_changed(self, event): paid_money = 0 for n in range(1, 10): n_checkbox = eval(f'self.pay_no{n}_checkbox.GetValue') n_money = eval(f'self.pay_no{n}_money_text_ctrl.GetValue') n_paid = eval(f'self.is_paid_no{n}_checkb...
1
91896742123423f9b9daf082f1af25ca
6601f0380b157b249e7639ed80f91b0a
A module indicates that it wants to discover all concrete instances of a given IKnownPluginType by declaring an enumerable property of that know-type. The property will be populated with instances that are derived for the specified known type.
namespace Catel.Test.Runtime.Serialization.XmlSerialization [KnownType("KnownTypes")] public class ParamsBase : SavableModelBase<ParamsBase>, IParams static Type[] KnownTypes() { return new [] { typeof(PluginA.Params), typeof(PluginB.Params) }; }
0
b7ac7f37c57b5d3faf3b0919a63a2a08
b7415107409566e4b954434c1c550885
Concat RFM quartile values to create RFM Segments
maxes = agg_sum.max(1) mins = agg_sum.min(1) for pair in val_pairs: value = pair[0] idx = pair[1] val_min = pair[2] val_max = pair[3] should_scale_and_normalize = pair[4] if should_scale_and_normalize: value = (1 - 0)/(val_max - val_min)*(value - v...
0
d382d501bcbd93ee60286b56e33537d6
341cb4bb301364a136a32e909b89ce80
Toggles the project detail view
class JsonEditor: def toggle_detail_view(self): if self.show_detail.get(): childrens = self.tree.get_children() for child in childrens: self.expand_item(child) else: childrens = self.tree.get_children() for child in childrens: ...
1
9735ec540ecdb5a9aff1ec9cfb846d46
d3607aaa09ea1bd437c148c705b8aa9a
set which buildings are drawn
if (!enabled) foreach (Transform building in transform) building.gameObject.layer = 2; else foreach (Transform building in transform) building.gameObject.layer = 0; }
1
fa3b5d3853331addb5b3c8456a591093
f61e6435cee892282098427f6c4065ac
Stop the recognizer before the application is closed
function RecognizerStop(SDK, recognizer) { recognizer.AudioSource.TurnOff(); }
1
46c0f2e6c3bc3a4d5711165cb2b819a1
4a87c2d9a5fc39e60abbb7ceccd887a4
删除物业
if (IS_POST) { $token = I('post.access_token'); if (!check_token($token)){ $output = array('data' => array('redirect_url' => urlencode($_SERVER['HTTP_HOST'] . __APP__ . '/Public/login'), 'sec' => 3),'info' => urlencode('ACCESS_TOKEN超时,请重新登录!'),'code' => -208); exit(urlde...
1
63b10867d88093d4fcd2f86d50281fe7
e540906e9aa78f60c1c40dd19fe2fa35
Returns the numeric value associated with a base64 character
public class Base64Map public static char getBase64(int index) { return chars[index]; }
0
b5536370395f3b3faa628af1d21e905d
8ef4127f895a339901495a84fed96c75
初始化界面 首页加载时第一个的豆豆为红色
function CreateRedDragonRoomCtrl:InitPanel(userInfo) roomRed = roomRedDragonVo:New() roomRed.id = 1 roomRed.total = 8 roomRed.modeType = 1 roomRed.isSelf = 1 roomRed.isFeng = 1 roomRed.isRed = 1 roomRed.isFishNum = 0 roomRed.isPlayNum = 4 roomRed.isRobot = 2 roomRed.isBihu = 2 CreateRoomPanel.redTogRobot:Se...
0
e71bd8e7a28f60bba9077a93b0886b67
7386d420499462d862f66eec71f92b59
{@code GET /region-zip-lists} : get all the regionZipLists.
@Service @Transactional public class C_zip_codeServiceImpl implements C_zip_codeService{ @Transactional(readOnly = true) public Page<C_zip_code> findAll(Pageable pageable) { log.debug("Request to get all C_zip_codes"); Page<C_zip_code> result = c_zip_codeRepository.findAll(pageable); return ...
1
30a4ebbea691982585c6542d3772b9bd
792c7180224b801d734ff3140737dca2
Return true if word is in the dictionary, and false otherwise
bool check(const char* word) { return findWord(hashDict, word); }
1
8a63a48143d2dd01f4747d3446994f84
d48790f0df5e3876f5faee1523741af6
Refresh the number of diamonds left to collect
public abstract class mobileElements extends Entity{ public void incrementDiamondsCounter() { this.diamondsTimer++; }
0
358020384cf05ebc7cb7e58c8bca3760
1af43f89aff57c3d6fbfada6ccd9650e
这里使用inherits()函数判断父部件是否是菜单或工具栏 如果是,则创建该父部件的子部件,并返回子部件 如果不是,则直接返回0
class QtToolButton(QtAbstractButton, ProxyToolButton): def create_widget(self): parent = self.parent_widget() widget = QToolButton(parent) if not isinstance(parent, QToolBar): sp = widget.sizePolicy() sp.setHorizontalPolicy(QSizePolicy.Minimum) widget.setSizeP...
0
83d01d52dc72dd5a00e2adcca018782c
e4eef9dd4dd80f52b37bf6d53dc48de2
Generate a PyTorch Tensor of uniform random noise. Input: - batch_size: Integer giving the batch size of noise to generate. - noise_dim: Integer giving the dimension of noise to generate. Output: - A PyTorch Tensor of shape (batch_size, noise_dim) containing uniform random noise in the range (-1, 1).
def get_noise(batch_size, n_noise): return np.random.uniform(-1., 1., size=(batch_size, n_noise))
0
f92776f7cf4c7c9b7a8158dfca066a3d
ee2a400cbb58ce64685786ea4f975a16
Naive implementation of algorithm to find nth Fibonacci number.
int getNthFib1(int n) { std::map<int, int> memoize({{1, 0}, {2, 1}}); return helper(n, memoize); }
0
364526ce280ad79c7b51442bab43f491
00e6bff1662a1b75aa8ba3b5f252a751
Generate player decks containing 26 integers representing cards
{ playerCards = new HashMap<String, List<Integer>>(); List<Integer> listForGreen = new ArrayList<>(); List<Integer> listForBrown = new ArrayList<>(); String Green = "Green"; String Brown = "Brown"; for(int i=1; i<=48; i++) { listForGreen.add(i); } for(int i=1; i<=53; i++) { listForBrown.add(i...
0
775059cde3c888cb56b6611c3c87090e
5df83950e3cee9d9bf55839e6fe0fbe5
Return amount value. Specific for Paypal
class GeelPayPal_Response_DoAuthorization extends GeelPayPal_Response_Abstract public function getAmount() { return $this->_amount; }
1
b1552d4e1201703a66cb12543b470d11
628f594f9335305f52a4080d6ae7fcbe
Test that if the running application dies then the agent and debugger will also shut down.
public void Cleanup() { try { TestEnvironment.testProcess.Kill(); } catch (System.InvalidOperationException e) { Console.Error.WriteLine(e.ToString()); } }
0
1e8e5f7b14f63a3ab838dd9e4836a8a1
5f459faf2167e0c24273597998a516cd
@brief Set advertising interval, this belongs to advertising parameters
uint8_t direct_address_typ, bd_addr_t direct_address, uint8_t channel_map, uint8_t filter_policy){ hci_le_advertisements_set_params(adv_int_min, adv_int_max, adv_type, gap_random_adress_type, direct_address_typ, direct_address, channel_map, filter_policy); }
1
36f93239b85a2587898a978df57ed269
be6f40037f0f92615b6f3ba9fc716ca5
Построение компонент для матрицы с отбрасыванием малых контуров
{ byte[][] lMatrix = new byte[pMatrix.Length][]; for (int i = 0; i < pMatrix.Length; i++) { lMatrix[i] = new byte[pMatrix[i].Length]; for (int j = 0; j < pMatrix[i].Length; j++) lMatrix[i][j] = pMatrix[i][j]; } ...
1
74eb669f4b9da5cff36f4c674cef113f
5e13af0686d4a77d23f42e8b9a192860
Método getNotes(): retorna a lista notes (principal)
class Client public function getNotes() { return $this->notes; }
1
7beea872ee7a46b109508bb7a4579ff1
d7beb80fddbf1529bf55a880f508713d
Switches the renderer mode.
if (rendering_mode == this->rendering_mode) { return; } this->rendering_mode = rendering_mode; rebuild(); }
1
4c4058a115603d9fa483981bbc7e571e
9f47b13d243c439159abfa231307cf30
This method enters text in Email field on Registration Form
public class registrationPage extends BasePage public void firstNameEnter(String text) { WaitTillElementIsClicable(txtFirstName); txtFirstName.clear(); txtFirstName.sendKeys(text); }
0
0403ad187a5602378e586060300a94ff
5a0f8baab1fc9a50b2df74654f16be08
기업 프로필 수정
public String updatePro(HttpServletRequest req, @ModelAttribute MemberDTO dto, RedirectAttributes rttr) { int res = memberMapper.updatePro(dto); if(res>0) { rttr.addFlashAttribute("msg", "updateSuccess"); return "redirect:managerList.admin"; } rttr.addFlashAttribu...
1
a9f02788ad6e3849d930f18865411cf5
973be651eda954b4f245aa39943cda7a
Function to update main tree parameter "isPruned" to 1 to avoid selecting same attribute again.
if tree.attribute == None: return tree else: for i in tree.children: if tree.children[i].attribute != None: subjects2 = [] for j in subjects: if j[index[tree.attribute]] == i: subjects2.append(j) ...
0
4ee6a7523ed3554ac97d24929951002c
1310905c01b7e5683ea5c9bd82a17a1b
validate whether the score user entered is assignable or not in the array
if(val > 80 || val < 1){ return false; } if(userInput.size() == spotsToPlay){ return false; } if(userInput.contains(new Integer(val))){ System.out.println("Error: " + val + " has already been inputted"); return false; } ...
1
a4531aeb616c231d223bf728185fc153
ffcfebf41e6e9a91a4521247bc8c67e7
删除不在sis数据库中的图片
public class ArchiveService extends Service private void deleteImagesFromDb(List<String> messageIdList) { if (messageIdList != null && messageIdList.size() > 0) { Uri uri = SmartPagerContentProvider.CONTENT_IMAGE_URL_URI; String where = getWhereStatement(messageIdList); getContentResolver().delete(uri, where...
0
9389d406e088e683dc2ec71a1449ee85
4cf2180e9be3f64747ff01b2348614c9
Método que establece el numero de anotaciones visibles en la vista
public class MainController extends Controller<BorderPane> private void setAnnotationButtonsActionListener() { highlightButton.setOnAction(e -> { if (isAnnotationsLoaded()) { String input = annotationTextField.getText(); if (!input.isEmpty()) { if ...
0
0ed9899da71742eb34a201053336c259
c49d5f5bafd15306216125429d5c3b8f
check authenticated status and toggle state based on that
if (!AuthManager.isLoggedIn()) { this.setState({authenticated: true}) } else { this.setState({authenticated: false}) } }
1
4a279dcbb4200bc5aeb7a6bb6c0c48a6
10e8ae4a8b6339942ec1f72448e717f3
https://leetcode.com/problems/parallel-courses/
public class CourseSchedule public static int scheduleCourse(int[][] courses) { if (courses == null) { return -1; } if(courses.length == 1) { return 1; } Arrays.sort(courses, (a, b) -> { return a[1] - b[1]; }); Queue<int[]> maxH...
1
f58968685a4b190975027e262be04ea9
36470ba9bf8a0a748d94074f3582a947
This error handler logs exception and then makes response with most appropriate error message and error code
public ResponseEntity<ErrorMessage> orderExceptionHandling(OrderException exception) { HttpStatus httpStatus = HttpStatus.valueOf(exception.getError().getHttpCode()); ErrorMessage error = new ErrorMessage(); error.setError("OrderException"); error.setErrorDescription(exception.getMessage()); LOG.e...
1
7e76b893166c9b47efc192e72fd9b93d
c0c10643640d1a531f6b103741c3a5b5
Debug an array of values, print to a log file
static void log_qrs_step(char* step, uint16_t* array, size_t size) { #if ENABLE_LOGGING == 1 size_t idx; printf(step); printf("\n"); for (idx = 0; idx < size; idx++) { printf("%u\n", array[idx]); } #endif }
0
3e1ed5b6d1d9f4374ae7e61abb6329f6
99d0afb1f20261235dee5ce502377775
Appends the given parameter to the given parameter array.
if (parameters == null) { parameters = new ArrayList(); } for (int i = parameters.size(); i < index; ++i) { parameters.add(null); } Object old = parameters.set(index - 1, ob); if (old != null) { } }
0
8e45b2b58dca339be57c31285c0d82a2
ea24e0f7c3f2cd8d4da3e6a90a9c9faa
Ensure metrics related to kerberos login is updated.
time.sleep(1) assert wait_on_element(driver, 7, '//mat-card[contains(.,"Kerberos Keytab")]//div[contains(text(),"keytab_test")]') assert wait_on_element(driver, 10, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]')...
0
d40de2d5992ed1ef61cbc34f6e1194d7
61cdb54ad685da210cc2617b681cf03e
GET: JobAppointment
{ var applicationDbContext = _context.JobDuty.Include(j => j.Job); return View(await applicationDbContext.ToListAsync()); }
0
2c4971c2262d61593adf4f7155460cff
57afab065312bb9184b549022989477f
Internal callback function used by the UIP web client. Called when connection is closed (finished reading a page)
class ApricotClient(object): def on_eof(self): pass
1
67eb43b7ba7d64155a3b9c7dae79b0da
5ab4da219e6a9de0068cfa677fbc0b39
Muestra la lista de profesores de un departamento
class ProfessorController extends Controller public function index() { $professors = Professor::join('departments', 'professors.dept_id', '=', 'departments.dept_id') ->select('professors.*','departments.depart_short_name as depart_short_name') ->get(); return view('AdminPa...
1
a98843571ebbc679fc7315511403743b
0d1a379f832409f44457695323ef04ca
Get list of ordered tickets by order id
$qb = $this->addAllowedNameQuery() ->leftJoin("u.orders", "to") ->leftJoin("to.event", "e") ->andWhere("e.id = :eventId")->setParameter("eventId", $eventId) ->andWhere("to.ticketorderstatus = :status")->setParameter(...
0
891d3be1358386a9cfe33294ed092fce
2ae84fd1bf2500e95abf321dbedadc3d
Como una especie de malloc para las tareas.
void * a = malloc(tam); if(!a){ printf("ERRO: SEM MEMORIA!\n"); exit(1); } return a; }
1
6398c3dcd70923fd6394da389e3dbb73
ae2920ac3dc4fffe3cffa9478da7036d
the new data will be located at the front of database array
class Datastore implements Iterator, ArrayAccess, Countable, JsonSerializable public function Unshift(mixed $Val): static { array_unshift($this->Data,$Val); return $this; }
1
4e5fc25560a9f19279414bcdd2ed872c
9e933d752a193af01b4fe64c985c9af8
只渲染显示列
public class JsonUtil public static JsonConfig formatShowProperty(final Map<String, String> showColumns) { JsonConfig config = new JsonConfig(); config.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor()); config.setJsonPropertyFilter(new PropertyFilter() { public boo...
1
d6ff65984367dd8bee69d2f0066bdad8
067858076089e8235687035bd7396196
If n is a starting term, this function returns how many terms are in the sequence.
if n == 0: return 2 elif n == 1: return 1 else: return (n - 2) + (n - 1)
0
ffdf1fbc65608744a468ad0be0f1a624
541cf6cb794bbda0f7dfe69a44129e76
Returns the digestion preferences.
namespace Microsoft.Teams.Apps.SubmitIdea.Common.Interfaces Task<IEnumerable<TeamPreferenceEntity>> GetTeamPreferencesAsync(DigestFrequency digestFrequency);
1
b8267142150423c20e527657ea642fb1
9519be4a841f06a60b308f2a61bc2844
从json字符串中获取avro的schema
String jsonStr = IOUtils.resourceToString(resource, Charset.defaultCharset()); JSONObject schemaObject = new JSONObject(jsonStr); Schema jsonSchema = SchemaLoader.load(schemaObject); return jsonSchema; }
1
0c888d34c1228bd72d2dda32bca86efb
d5274fa3017b9296c28c49c195730931
Detailed representation: scope (varset) + table memory location
class TableVariable: def __repr__(self): return "TableVariable(name:{} vtype:{})".format(self.name, self.vtype)
0
0b4a52a03a528ac4b6fcc514893a13c4
4814263a2758f80f96d08e7afda12b3f
ConnectionオブジェクトをもとにconnectionIdを設定する
saveConnectionId(state, action) { return { ...state, connectionId: action.payload.connectionId, }; }
1
5ab769c65ac39a1ad83a6c29ab4c4141
cbea3f764f91a29f96ecffa1b5f00b26
Configures the service locator (Microsoft Common Service Locator) if used.
namespace Cedar.Core.IoC void Configure(IServiceLocator serviceLocator);
1
88298e7a2e67219a850c4eb47a4e38f7
869488cacaed490038f085d0e05a908e
Closes all stores in the list. This is safe to call in all circumstances. Implementations can not trust that OpenAllL has been called before.
void CVPbkContactStoreListStub::CloseAll(MVPbkContactStoreListObserver& ) { }
1
863c99fc6aed3480e90f425a64ff561f
2b11c37fb192cf771ea9e15cda00345b
Obtener listado de archivos relacionados a una radicación
{ $data = Radicado::with([ 'usuario', 'estadoRadicado', 'tipo' ])->get(); return $data; }
0
4cf69fed9172cc52721818364e9fd9f3
bf11ee25e45aad0e3e92e4e079f6ab44
Geeft het mutatieobject terug.
public abstract IMutator<G> getMutator();
1
7dbc22e7cb948b90e8fcf99b49a53fe2
e0b5c6a38dc5d2f2e5575d5c6abc7a4c
Method to handle open the selected poll
{ $extra = ""; $sql = ""; $check = 0; if ( ! $this->settings['poll_poll_url'] ) { return; } if( $this->settings['use_friendly_urls'] ) { preg_match( "#/topic/(\d+)(.*?)/#", $this->settings['poll_poll_url'], $match ); $tid = intval( trim( $match[1] ) ); } else { preg_match( "/(\...
1
a82841f7911aa3e47ee9c763e51be601
3e5ad66baac6c9ec89def404f6cce1b2
Test case for update_agent Update agent # noqa: E501
class TestDevicesApi(unittest.TestCase): def test_update_device(self): pass
0
6a22bd232e39145b1763222b18033b73
765055a8cca2458e645e447d7543aa5e
kéo
{ if (HookClone) { HookCollection = Physics.OverlapSphere(HookClone.position, 1.5f, 1 << LayerMask.NameToLayer("Player")); } if (HookCollection.Length > 0) { foreach (Collider item in HookCollection) { if (item.gameObject.ta...
1
d42c095ff9bbc466472c0a882eba1dcf
27b93f1e8fecdb43e12b22a31ae24187
删除条目的同时,减去缺课老师缺课时长,减去代课老师代课时长
class MakeupArrange extends Base public function delOne() { $data = $this->getData(); if(empty($data)) return $this->user_error('补课数据错误'); if($data['catt_id'] > 0 || $data['satt_id'] > 0) return $this->user_error('已经考勤删除不了'); $this->startTrans(); try { $sa_id = $t...
0
1793c01b0fc825b7641d6db7a58c4366
bf0febfb97f7a7c28f351281aa95eb6e
Ok, look backward and find a loop/switch statement
alloc: &'arena Bump, token_iter: &mut Lexer<'_>, ) -> Result<hhbc::Instruct<'arena>> { let mut cases = Vec::new(); let mut targets = Vec::new(); token_iter.expect_is_str(Token::into_identifier, "SSwitch")?; token_iter.expect(Token::into_lt)?; while !token_iter.peek_if(Token::is_gt) { ...
0