query_id
string
corpus_id
string
query
string
code
string
label
int64
3fa2f2a4010ccfb03f9c5d7ff1718049
0fbb2a65bfbe31792c9118b84293b9d8
根据xml获取联系人列表
List<People> getAllByXml();
1
b3e190cc23e1579c6ef8b7a16795109a
838214974a0c327a472dea2212de9bda
retrouve le nom d'un prestataire par id
class Supplier extends aplStdAJAXMethod{ static function get_supplier_name($id){ global $mysqli; $name = ""; $query = "SELECT * FROM `".SUPPLIERS_TBL."` WHERE `id` = '".(int)$id."'"; $result = $mysqli->query($query) or die($mysqli->error); if($result->num_rows > 0){ while($row = $result->fetch_assoc()){ ...
1
83056193c1007788a94a0f8a011bb46f
520d0d7e08dc804ba606c752b519c059
Gets the height, it is preset to make sure the chest is the right size.
public int chestSize(){ return chestSize; }
0
b296fec71f3bd9a1baff5f86eabb2c55
c3315e7b1150c137f4532faba59a419a
更新套餐ID
class PackageController extends Controller public function update(PackageRequest $request, Package $package) { $package->fill($request->input())->save(); $package->modules()->sync($request->input('modules')); return ['message' => '套餐修改成功']; }
0
97599ac2b2273a9c7bdd4563a92ab098
71f51a7a5a97ac51b7e191c9f85cca2a
Returns the high-order nibble of a byte value.
func GetHighNibble(value uint8) uint8 { return uint8((value & 0xF0) >> 4) }
1
ff1cf95386d62a3d3b9d7831eefa6151
f85a0e14da31f2af0ba5e9f11552b5b8
Add access record
$db = $this->_dms->getDB(); $userOrGroup = ($isUser) ? "`userID`" : "`groupID`"; $queryStr = "INSERT INTO `tblACLs` (`target`, `targetType`, ".$userOrGroup.", `mode`) VALUES (".$this->_id.", ".T_DOCUMENT.", " . (int) $userOrGroupID . ", " .(int) $mode. ")"; if (!$db->getResult($queryStr)) return false; ...
1
7963d757ed3d05ca2050978ab2725fa0
fceee6c4f195b26ea86ec8abb80bd772
Turn a damping value (e.g. 0.97) into a value that's framerate independent. For example: carDamping = 0.97f; carSpeed = carSpeed * TimeX.Damping(carDamping); Scales according to an assumed 30 FPS.
namespace Cinemachine.Utility public static class Damper public static Vector3 Damp(Vector3 initial, Vector3 dampTime, float deltaTime) { for (var i = 0; i < 3; ++i) initial[i] = Damp(initial[i], dampTime[i], deltaTime); return initial; }
0
b08d19054df3158090217c0432503e92
a770ca9270a20754e29719be9efc02c1
Sucht einen Pfad durch die Spielfeldabstraktion von einer Batterie zu einer anderen
List<Submarine> submarines, GameField field, int length, int buff = 0) { var otherSubs = submarines.Where(x => x.Cell != from).ToList(); var path = field.getPath(from, to); if (path == null) { return null; } path...
1
43f465e0d71b9063f027c5bc42ef47eb
9f4d13ad49ae7300049ff23ba71ae46d
Adds a non-durable sink that sends log events using HTTP POST over the network. A non-durable sink will lose data after a system or process restart.
{ var uri = configuration.GetUri("uri"); var username = configuration.GetString("username"); var password = configuration.GetString("password"); var credentials = string.IsNullOrWhiteSpace(username) ? null ...
1
ba1cfdfe3bb302ae649892badb5f664d
e37e76df50131205fe2ce7ce5f221a5b
sort fog nodes by Least Loaded
self.state_table_without_offloading_fog = self.state_table.copy() if len(self.state_table): if len(offloaded_fog_ip) != 0: for fog_connection in self.state_table.keys(): fog_connection_ip = fog_connection.transport.getPeer().host if fog...
1
56d2f70dfe658dfe3731e26460d121ab
a798b2ed289079c05f3bd27c886abf7e
Returns a list of training data and labels
def get_training_dataset(): input_vecs = [[1, 1], [0, 0], [1, 0], [0, 1]] labels = [1, 0, 0, 0] return input_vecs, labels
1
daa50ba358d1d1a03958ad97ca747022
0d866003ad99e26f756471dc380cd901
订单发货信息更新到电商平台
namespace EOPComponent.ServiceInterface int UpdateSendOrderInfo(SendOrderInfo sendOrderInfo);
1
75464e5408882534c29f56246115898b
38dd8df27913e5e750a1274a87519249
Test whether ableToUndo and ableToRedo actually works, and whether it actually prevents the user from undoing when the board is solved, these are put together because how similar the two methods are.
playfield = [[0 for x in range(6)] for y in range(12)] playfield[11][0] = 1 playfield[11][1] = 1 playfield[11][3] = 1 moves = 1 status = solver.is_solvable(moves, playfield) self.assertTrue(status) playfield = [[0 for x in range(6)] for y in range(12)] ...
0
a94e1de2745ff3735750f2091f52cc9c
1094b0d89856b0a3b11ff3f64b318209
表格是否存在测试
public void test01() throws Exception { IndicesExistsResponse response = indicesAdminClient.prepareExists("books").get(); System.out.println(response.isExists()); }
1
c6f84c4dcd7d454943c2ecaaabc3ae13
83350741dfeeb5c5da01ca9725fa8bfc
Display log instead of the progress summary
{ if ($this->input->getOption('cron')) { return; } parent::displayRenderProgress($section, $message, $progression); }
0
c0bb0e928256f288059540b87f25f7fb
4878a6d4afc2e71bdb57887463a45ec8
https://gist.github.com/leonardo-m/6e9315a57fe9caa893472c2935e9d589
function permutations(iterable, r) { var pool = tools.toArray(tools.ensureIter(iterable)); var n = pool.length; r = r || n; if (r > n) { throw new Error( 'Parameter r cannot be greater than amount of elements in the iterable [' + n + ']' ); } var indices = tools.newAr...
1
6364d47d4bdc36d3c186c68ade68652e
7a65fd9c97168ca63051fc53e497aa02
Ball position on paddle when the paddle is sticky.
class PingPongBot(object): def target(self, ball, aim): HAT = 0.35 * config['paddleHeight'] x, y, dy = ball.paddle_hit_position() base = self.ball.paddle_hit_position()[1] if y < aim: return base + HAT else: return base - HAT
0
3d85596494cb0066cd098146724de78e
70cc508fc1a8c959de290cd963596ad9
The function initializes the IP Module in the NET Boot module. Not Applicable
void NetIP_Init(MEM_SEG *p_mem_seg, RTOS_ERR *p_err) { #ifdef NET_IPv4_MODULE_EN NetIPv4_Init(p_mem_seg, p_err); if (RTOS_ERR_CODE_GET(*p_err) != RTOS_ERR_NONE) { goto exit; } #endif #ifdef NET_IPv6_MODULE_EN NetIPv6_Init(p_mem_seg, p_err); if (RTOS_ERR_CODE_GET(*p_err) != RTOS_ERR_NONE...
1
9cdfb2ba06adcc418c53f47cce05edb9
ef2607cb0b4eca84205579e322b15920
Evento para compartir en redes sociales la nota disponible
public function shareSocials(string $url, string $title);
1
77df479688d683c2e2305688fdef4f83
f58ebae87a98ab27dfc876eb7ebe92f7
Can also pass options hash in at the end so you can specify :media => :print
if current.mime.start_with?('image') image current elsif current.mime.start_with?('text') formated current.read else link 'read', current, "Link to resource : #{current.basename} - #{current.size}" end end
0
fdfe8e5f4439a791a100f0ad2f5af717
6d7849bfc3e4ea08c1127a2c0e023f60
チェックマークのアイコン挿入
if(!markdown){return '';} if(!checkbox){return markdown;} var id = checkbox.tabIndex; var checked = checkbox.checked; var i = -1; markdown = markdown.replace(/\[(\s|x|\*|✓|✔|☑|×|X|✕|☓|✖|✗|✘|#)\]/g,function(total,inside){ i++; if(i!==id){return total;} var sign = checked ? '✔' : ' '; return '['+s...
1
13d278a8d1c08f8424e43407df2ff790
0b4768ecf806e6b4df0023206e5f4349
Run KDA on given data.
train, test, target_train, target_test = self._prepare_data( self.data_with_classes, self.kpi ) model = self._setup_model( train, target_train, algo=RandomForestClassifier, n_estimators=ranking_constants.N_ESTIMATORS, ...
0
e4efcb3ef65623be1d2c3b1aa7e0fdbd
93b7a1d9fb0b5c736783c13c14f28a21
Sets the threshold for the psm confidence.
public class PeptideShakerCLIInputBean public void setPsmFDR(double psmFDR) { this.psmFDR = psmFDR; }
1
162a83a108e38f041a78f2a49ba0137b
24336a00e22d51d489cbd56022dbcf64
Map messages to their originating time.
for message in messages if isinstance(messages, list) else [ messages ]: message['timestamp'] = int(time.time()) users = app.data.driver.db['users'] sender = users.find_one({'_id': message['sender_id']}) receiver = users.find_one({'_id': message['receiver_id']}) message['send...
1
4a2920dd928533e9176f3912385e7932
63a03cd09c66a42628fff64364f846a9
@brief UART在DMA模式下发送数据 \attention 具体的UART资源依芯片而不同,请参见相应的引脚复用说明
void USARTDMASendData(USART_TypeDef* USARTx,uint8_t data,uint8_t *buffAddr,uint16_t *buffPointer ,uint8_t *sendBufAddr,uint16_t bufferSize) { DMA_Stream_TypeDef* DMAy_Streamx; switch((uint32_t)USARTx) { case USART1_BASE: DMAy_Streamx = DMA2_Stream7; break; case USART2_BASE: DMAy_Streamx = DMA1_Stream6; ...
1
cb9bb64ed5d74ab5910aab227f4eb46e
44e480e68f36416195cf0480dbd3677c
Negative test case for getting user category list with no HTTP Header Authorization token
try: result = listMaker.getCategory("noSuchCategory") raise ValueError("no result expected for noSuchCategory") except ValueError as e: assert400Error(e)
0
55aded453e7a824326b1956eba3ded8e
81351de538235cfc6e053a827f06818d
Encodes url in uppercase.
namespace nsda.Utilities public class nsdaRequest public static string UrlEncode(string url, Encoding encoding, bool isUpper = false) { var result = HttpUtility.UrlEncode(url, encoding); if (!isUpper) return result; return GetUpperEncode(result); }
1
b2f5731a3041e0cb278efc1992f3ed78
ad2c492a1039312520f9eff06d842b90
@brief This function makes the Add Port Control message in SOAP.
const char* xml ) { parseHTTP(xml); if(strstr(xml, "u:AddPortMappingResponse xmlns:u=\"urn:schemas-upnp-org:service:WANIPConnection:1\"") == NULL){ return parseError(xml); } return 0; }
0
c957049fb0000938fa02ad3ab98de5bf
0441e3e72e864afeddda06c1428af095
将选择的物品添加到购物车中
$car=$this->car; for($i=0;$i<count($car);$i++){ if($car[$i] -> product_id.$car[$i] -> product_sno.$car[$i] -> product_color == $item -> product_id.$item -> product_sno.$item -> product_color){ $car[$i] = $item; } } $this->setCar($car); }
0
f65a555339438c1c68c55077952829d3
1d4c34815560e4db7bf056f97618bbcd
Handle requests to update an item in localstorage.
$('.js-shopping-list').on('click', '.js-update',function(event) { event.preventDefault(); console.log('`handleUpdate` ran'); const itemIndex = getItemIndexFromElement(this); console.log(itemIndex); const updateVal = $(this).siblings(".js-shopping-update").val(); console.log(updateVal); co...
0
6e2efff6caed0ee4aa007a8005aa2fc4
c24d4a52817f7f7a395a02fdf874f94c
Used to read and convert temperature from SHT21
class SHT20(object): def temperature(self): self.i2c.writeto(0x40, b'\xf3') time.sleep_ms(70) t = i2c.readfrom(0x40, 2) return -46.86 + 175.72 * (t[0] * 256 + t[1]) / 65535
0
b52702c7effd108de16b89cdd1d7050e
d6059a6bf9272064422e72db4fd7392e
Меняем технолога в задачах и пользовательских полях
global $db; $db->query("SELECT id FROM ticket WHERE tech = " . intval($id)); while ($ticket = $db->row_array()) { ticketactions_changeproperty($ticket, 'tech', $id); } $db->query(" UPDATE tech SET active = '0' WHERE id = " . intval($id) . " "); }
1
78fa3bbfa3891811ae48dfc6585f4daf
cc22009d60634d2b9a1a36f56b1e17ce
accept <nick> - Accepts a challenge from another player
{ Client c = FindObjectOfType<Client>(); c.isHost = false; c.Send("CRES~" + this.oponentName + "~ACCEPT"); ClosePopUp(popPup); }
1
a88d4a3f32073d1143496391344445ba
bf4ba85ca6ec84d610fab71bfbba0b05
Calculate PileUp reweighting
if (!is2016_) { static constexpr std::array<double, 10> ptBinEdges{20, 30, 50, 70, 100, 140, 200, 300, 600, 1000}; const auto ptBin{std::distance(ptBinEdges.begin(), std::upper_bound(ptBinEdges.begin(), ptBinEdges.end(), pt))}; const auto mujets_sf = [pt, type](const double p0) {return (0.9419...
0
011dd6c0ac7ed95ab25f18b78a6a2abc
c7e1218d66e6c248d3f7b7f31b496e1c
Opens f and prepares a WAVFILE struct with the WAV format info. On a successful return, the ALLEGRO_FILE is at the beginning of the sample data. returns the WAVFILE on success, or NULL on failure.
const char *filename, unsigned sampling_rate, unsigned channel_count, unsigned samples_per_frame, unsigned bits_per_sample, unsigned flags, pj_ssize_t buff_size, pjmedia_port **p_port ) { struct file_port *fport; pjmedia_wav...
0
ecd6b2d632575a199ee3bde31db2cc0f
b4d1a2ea1690a08f3c8684628dacdcb8
Returns the meta object for the containment reference list '{@link idm.tp1.StateMachine#getState <em>State</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getTrgTransition_StateMachine();
0
dfa16a22d5871ea245cda9ca900966ed
2fd275df2cb2bbeff2ee841706fc2ed5
https://www.codewars.com/kata/58b8db810f40ea7788000126
function box(n) { function boxTop(size) { let b = ''; while (size > 0) { b += '-'; size--; } return b; } function boxSide(size) { let num = size; let c = ''; while (num > 0) { c += '-'; num--; } const split = c.split(''); const map = split.map((s, i) => { if (i > 0 && i < split.len...
1
cf1f94e697b8448e0cb17d16719bea95
8dcb48ffa7470c28692a25613af187cb
Operation designFoldersGetWithHttpInfo Find all instances of the model matched by filter from the data source.
namespace TweakApi.Api ApiResponse<InlineResponse2002> DesignFoldersIdHeadWithHttpInfo (string id);
0
19998cd0cd37c5a285003fd6d3e9f8ef
9bc30e60cc4219820b22508aabddb138
! @brief キャラクターレイヤー取得 キャラクターレイヤーを取得する。
Layer* AKPlayingScene::getBackgroundLayer() { AKAssert(m_backgroundLayer, "レイヤーが作成されていない"); return m_backgroundLayer; }
0
5ee862f6a3fdaa067811ca7786f20512
1f8a492946070b1e4567a38ca6faff54
Fill array with human player's input.
for(int i = 0 ; i< 7 ; i++ ){ x[numberofplays][i] = userin[i]; }}
1
610d50e9a3d3cba759c75e4052e76dcf
4552b4df687816972c64c52683b5c234
ลบอักขระช่องว่างและอักขระเอ็นเตอร์
{ trimphrase = ""; for(int i = 0; i < textBox1.Text.Length; i++) { if(Convert.ToString(textBox1.Text[i]) != " ") { trimphrase += Convert.ToString(textBox1.Text[i]); } } label13.Text = ...
0
372e439a69770bf2112f736fb2daabd6
13e8b39b1d0974d6e39ee361c2b69c20
Sets up the cleaned-up array without adding the MO data yet. Just grabs the first four columns, which contain info on the AO function names and atoms
self.hainfo = {} self.probes = [] for res in self.solvent.residues: if res == 'WAT' or res == 'HOH': continue self.hainfo[res.name] = dict((a.name,a.id) for a in res.atoms if a.element != 1) self.probes.extend(['%s_%s'%(res.name, a.name) for a in res.atoms i...
0
83860c4942f1826ad445f19f4076a5da
5a6f9d24de23fbc3de551fec4ec180b4
To test an empty cat queue. Output a cat from an empty Cat queue, the result should be null.
class DogCatQueue: def isCatEmpty(self): return self.cat_queue.empty()
0
1ff1fb610acc1abd349e93ce64fe2f22
c392dda677f1450716435476032f16d4
To get the correct data regarding bugs that have been resolved and how long that has taken
function getDailyBugStatistics() { $this->loadModel('product'); $now = helper::today(); $products = $this->product->getPairs('noclosed'); $productIDs = implode(',', array_keys($products)); $createdPerDay = $this->dao->select("product, count(id) as createdPerDay")->from(TABLE_BUG) ->where('de...
0
d2118dea9a47875b2d55d0691b22abb9
5327fe1cfe31e59c9c65eaffbc9c2f1a
验证有效期,验证码的有效期为15分钟
{ if (UtilityHelper.ConstVar.testAccount.Contains(Mobile)) { return true; } DataBaseEntities db = new DataBaseEntities(); DateTime dt = UtilityHelper.getNow().AddMinutes(-15); if (db.cm_SMS_Verify.Any(u => (u.Mobile == Mob...
1
03be47959c4ee34c7fcaeb05afa5d818
92f9ff58bdf9dc6145b7c8df41b2767f
Renvoie un id de réunion en fonction de son nom et de son créateur
namespace Timeline.Services.Timeline Task<long> GetTimelineIdAsync(long ownerId, string timelineName);
1
20e0df206ac4298fff07e86882ec7e9c
4566cc9a1f5b07e8f443b6debe6af5ca
Test dead code elimination in ordinary switch statements
public class ResolveTests12To15 extends AbstractJavaModelTests public void test004() throws JavaModelException { this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" + " public static void foo(Num num) {\n" + " switch (num) {\n" + " case ONE, TWO, THREE:\n" + " System.out.println(num);\n" + ...
0
9eae86868d76d35403b341ae091e0c03
f928ab912e6fc520e70cf0a09ae8656a
随机返回minIp到maxIp之间的ip,包括minIp和maxIp
int[][] range = { {607649792, 608174079}, {1038614528, 1039007743}, {1783627776, 1784676351}, {2035023872, 2035154943}, {2078801920, 2079064063}, {-1950089216, -1948778497}, {-1425539072, -1425014785}...
1
96c82bf9ee421147fd152eb093033e38
605dd18d0b40d628c5db9bc4bb400bf3
Metodi hakee reseptejä vertaamalla hakusanaa näiden tietoihin.
namespace TacoHacker class DataAccessLayer public List<Recipe> RecipeSearch(string search) { try { List<Recipe> recipes = thDb.Recipe.Where(r => r.recipeName.Contains(search) || r.category.Contains(search)).ToList(); foreach (IngredientRecipe ir in Ing...
1
26bc3015228d3e9db3ba611708286197
d2e61191675a7a2ec61544b93cdd1fdd
Connection을 생성하는 것이 아니라 Connection을 DBCP로부터 빌려온다.
public class ConnectionPoolMgr public Connection getConnection() throws SQLException { Connection con=ds.getConnection(); System.out.println("db연결 여부 : con="+con); return con; }
0
fe9320ea1d556a100fbd53f25f8b5887
23d4ba2dae2b38896ef492f7121af0af
Generate a presigned URL S3 POST request to upload a file
try { java.util.Date expiration = new java.util.Date(); long expTimeMillis = expiration.getTime(); expTimeMillis += 1000 * 60 * 10; expiration.setTime(expTimeMillis); GeneratePresignedUrlRequest generatePresignedUrlRequest = new GeneratePresignedUrlReq...
0
23193b071e4e9ad04a064ae526140e91
cd360ab96389599064c21f00c8f36d46
Diseña un filtro pasabanda a partir de especificar las frecuencias de corte superior e inferior, la frecuencia de sampleo y el orden del filtro
def generate_filter(fs, lowF, highF, revfilt, auscultation_signal, graph): order, filter_generated = filter_design(fs, locutoff = lowF, hicutoff = highF, revfilt = revfilt) if (graph == 1): filter_behavior_graph(order, filter_generated, fs) return filter_generated
1
d6be932f344f9e457a57f70f0decf009
3782bf77be27014b2bd861ce5b179bbd
根据主键ID删除部门实体,并返回部门列表视图
{ ResultModel rm = new ResultModel(); if (dal.Delete(Id)) { rm.Result = true; rm.Message = "部门删除成功"; } else { rm.Result = false; rm.Message = "部门删除失败"; } ...
0
0c6f4f609c186b45a3af99d303c03c02
03adc51e3afbd9bc6612846beb1bf9de
A duplicate should not be saved but should not display an error.
class TestEditionMode: def test_duplicate_selected(self, app): app.ttable.duplicate_selected() assert app.ttable.edited is None
1
099da927b3d7c263c151dbd3f0ab8ad9
fe542cda596a2deb9e7a58e18b32e7bd
Clears the timer for the long loading warning snackbar.
if (ongoingLongPressTimer != null) { textView.removeCallbacks(ongoingLongPressTimer); ongoingLongPressTimer = null; } }
1
85fc268ee91bd9005348bd444d7485b7
8519e514f4fade78cda402b8e8b55322
计算 buff 消耗的金钱
local elapse_tick = now() - buff.start_time.sys_tick if elapse_tick < 0 then elapse_tick = 0 end elapse_tick = elapse_tick + buff.start_time.buff_tick return elapse_tick end
0
f2b3891e2caa835a1acbedcf8b9b2c3e
a8264bf47203e7a896515e542151aedd
東西所属コードを設定します。
public class ZaigaiSenkyoninMeiboResult public void set識別コード(ShikibetsuCode shikibetsuCode) { this.entity.setShikibetsuCode(shikibetsuCode); }
0
5044491a3ffa8302b8714e496eea5235
646970f38f8137c4d2ed002a623fb5b2
disable all 4 answer buttons
function hideAnswersHelp() { for(var j=1;j<=4;j++) $("#btn"+j).prop('disabled',true); var rightAns=rightAnsIndex(); $("#btn"+rightAns).prop('disabled',false); if(rightAns==4) $("#btn1").prop('disabled',false); else $("#btn"+(rightAns+1)).prop('disabled',false); }
1
8aa3b7ca0c6b213a16fb4657a0373a1d
92aea8ba3654e2b5708b3661202155ba
Starts the auto prefeeder
int pageClassification = mDataProvider.getPageClassification( false, true); postAutocompleteRequest(() -> { mAutocomplete.startPrefetch(mDataProvider.getCurrentGurl(), pageClassification); }, SCHEDULE_FOR_IMMEDIATE_EXECUTION); }
1
f338cae6f5c1a418411c92a28d0a3786
8a29afd7e43dadd648ee2c9c7be5e1f3
#6. exp(x) returns the exponential function (e^x) of the elements of x, when x is a REAL scalar, vector, matrix or array.
RespFun <- function(x, n) x^n
0
4ad3e00685562e5ece3153b123a67836
b13b4ee01d723c3d65117fa844af3517
Decrease height by 1
namespace SkipList public class SkipListNodeList<T> : NodeList<T> internal void DecrementHeight() { base.Items.RemoveAt(base.Items.Count - 1); }
1
bb70d23ef3abe806e2b40a8641aa356a
217615582575027055d023efea319f00
很据商品的user_id获取该用户的相关信息
class GoodsGame extends Model public function game_user_info() { return $this->hasOne('App\Http\Model\GameUserInfo', 'goods_id', 'id'); }
0
980edd5c9fdb6a582f59934d117e812d
debdd2dfae4acf26bf70b32fd51b8704
Sets the scroll pane to the list of shape identifiers in this view.
val limit = shapeIds.lowerBound(0, shapeIds.size, limitShapeId) repeat(limit) { shapeIds.removeAt(0)} shapeIds.addAll(0, savedIds); savedIds.clear() }
0
14ead9d78cb05e38186f4d1746f6270e
3aca94a045f892dab9bcb59ba89de3d1
CheckCollisionによって生じた変化を自分自身の状態に反映します。
namespace AniGifTest01 class ShotUnit : BaseImageUnit public override void BeforeCollisionCheck() { }
0
28d2a1e4c4aee88bdbbae3b9d8915339
23bf618d753737d606866bdc80d59fb0
テーブルの開始タグを作成します。
{ $class = ""; if ($classes !== null and count($classes) != 0) { $class = 'class="' . implode(" ", $classes) . '"'; } $title = ($title == null || $title == "") ? "" : "title='$title'"; $id = ($id == null || $id == "") ? "" : "id='$id'"; $this->beginTableMarkup = "<table $id " . ...
1
03751ea4227ddb14da654a55e4f6e96d
22cb33651724bc3b489aa71ce429833e
选项卡关闭按钮单击事件
namespace White public partial class MainForm : DevExpress.XtraBars.Ribbon.RibbonForm private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { ClosePageButtonEventArgs arg = e as ClosePageButtonEventArgs; XtraTabPage curPage = (XtraTabPage)arg.Page; openedTabPage.Remove(curPage.Tag.ToStri...
1
a2bc15d2473f061f8cd4ad15371619ec
67f3172ff9d2455e57a2656ba0743ec1
scrapes a section page of CNN Money returns a list of all article links
def get_href(soup): result = [] for ul in soup.find_all("ul", class_="type06_headline"): for a in ul.find_all("a"): result.append(a["href"]) return result
1
8edc04dfcbf19a8c79b5281d59905594
dc4dc78a75465fac2cf7592f8e3b5358
Returns true if number is divisible by 3 and false if not.
def multiple_of_three?(n) n % 3 == 0 end
1
2fcd08cc7ff4c113dcf27b0eddd7333a
d742ff783fe99ad340a319d4d50114da
セッションに正しく値が入ってるかのテスト 正常系
class SessionTest extends TestCase public function testSetGetFloat() { Session::set('test', 10.4); $this->assertTrue(is_float(Session::get('test'))); }
1
39365229f3bb26070a5caccbd48b6974
bbaa93ea203d724d76d9db04a134d62e
Liefert alle noch nicht gelieferten Bestellungen zurück.
let orders = [] return this.db.all( `SELECT * FROM bestellung WHERE user_fk = ? AND status <> 3 AND status <> 4`, [id], function (err, rows) { rows.forEach(function (row) { orders.push(row) }) callback(err, orders) }) }
1
5fe6a3472bb19d50809d7e056b89e707
7a287fbaa5ebe52e9dd93c6436ab4ee9
Specifies that this field has been flagged by an application to indicate that its current results are invalid (stale) due to other modifications made to the document, and these contents should be updated before they are displayed.
public invalid() { this._dataDirty = true; }
1
c4ac9daae94cb8d0e6cfdcbd6db98494
7b2f1314ea0fee0870c2ceebcc7c0826
把内容导出到Dxf文件中
bool topViewP, bool sideViewP) { #if DEBUG Log.Notice(this.GetType().Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name); #endif if (selectedProfile == null) { #if DEBUG Log.Error(this.GetType().Na...
1
4f31039bb4ff0f1ac9c133f928674686
19427a03bc3b269bc52e4ad314cecae8
Given a key, return a function that gets the values for that key, from an event passed to that function.
function mapEvent(event, map) { return (listener, thisArgs) => event(i => listener.call(thisArgs, map(i)), null); }
0
942740ac4ed0bc247548387f84dbfaa2
c47e115d8394a3eea023336ff744003b
Validate and save Camera IP Address
print(21 * " ", "SET IP OF TV", 21 * " ") print("") print("Please enter the IPv4 address of the\nSony Bravia Smart TV you wish to control.") print("") ip = input("Enter IP: ") print(ip) if len(ip) in range(7, 15): if re.match("[A-Za-z0-9.]*$", ip): f = open(ip_addr_file, ...
0
85d3a7236f2d9eb04aa4a9e54c9bd745
cdccfd8f0ef79bb7c2d334cc8868edf1
Get Resource for Menu Item
{ $menu_item_image = MenuItemImage::find($id); $menu_item_image->menu_item; if(isset($menu_item_image->id)){ $result = $status = 'Success'; $message = null; $result = $menu_item_image; $code = 200; }else{ $statu...
1
16484d3093e339b061a376cd3d52192c
424ba6606d5e1c65dd2fb72e5427965a
Private method. Returns empty list of variables because root variables have no parent variables.
class Negative(Number): def get_all_variables(self): return self.item.get_all_variables()
0
835bb5945bb2eef109aeaaf6556550d9
05aa983282a0c005d0705a4d9c5922d6
This method takes the string representation of a flattened JSON object and returns it to the conventional format. It will use the default delimiter.
class string_util(object): def flatten(clazz, s, delimiter = ' '): if clazz.is_string(s): return s if isinstance(s, list): return delimiter.join(s) raise TypeError('Not a string or list')
0
ddf076df996aca0d07a116027868ac86
eee858b73a49e62bb9bcb05bd953d0c2
Establish a handler for the SDIO card interrupt. Because the interrupt may be shared with different SDIO functions, multiple handlers can be established.
spi_register_irq(sdioh_info_t *sd, uint irq) { sd_trace(("Entering %s: irq == %d\n", __FUNCTION__, irq)); if (request_irq(irq, sdspi_isr, IRQF_SHARED, "bcmsdspi", sd) < 0) { sd_err(("%s: request_irq() failed\n", __FUNCTION__)); return ERROR; } return SUCCESS; }
1
46757d6dacff196c23c9567e27099014
589c82eabe0fa093af7b6c240c9629f6
This function is adapted from code of PQescapeLiteral() in fe-exec.c. Convert a string value to an SQL string literal and append it to the given StringInfo.
static int sessionValueSetStr( sqlite3_value *pVal, u8 *aData, int nData, u8 enc ){ u8 *aCopy = sqlite3_malloc64((sqlite3_int64)nData+1); if( aCopy==0 ) return SQLITE_NOMEM; memcpy(aCopy, aData, nData); sqlite3ValueSetStr(...
0
7c4a12433e540770ac1ffb31e280f56b
182c354dc62f1f6de7d8389bdfdafa8e
Returns the per year of this stat view tag.
class _Base(object): def annual(self): return self._annual
1
701b1f6e495db64e1e2d5c436040c9c9
f2e73212e71ce10d1945ad56cd2b2090
! 書式付きメッセージボックス 引数で与えられた情報をダイアログボックスで表示する. デバッグ目的以外でも使用できる.
void LogPop(const wchar_t *title, const wchar_t *msg, ...){ va_list args; va_start( args, msg ); vLogMsg(msg,args); wchar_t popmsg[2000]; if(msg){ wvsprintf(popmsg,msg,args); } MessageBox(NULL, popmsg, title, MB_OK|MB_ICONINFORMATION); ...
1
c1b6aad970b181323663e316ed921177
c6b74085588984c5addeeb7d593e1c5f
Список бланков с пагинацией и фильром
class CardBlockController extends Controller public function index(Request $request) { $query = CardBlock::query(); if ($request->has('sort')) { collect($request->sort)->flatMap(function ($item) use ($query) { $value = json_decode($item); $query->orderBy($...
1
85b43f4460e39f683616f2bce66ac40c
9497693f4116a57ccea6c04c83dcc360
穴タイルは描画しない
public class TileEntityPole extends ATileEntityBase<JSONPoleComponent> @Override public boolean disableRendering(float partialTicks) { return true; }
1
7d345596a215d028548dde20996c33a9
2973cb0c17245a07222f82bc6df294ba
Spot-checks structure constants of a matrix Lie algebra.
int full_sum_abs_x = 0; int full_sum_sq_x = 0; int full_sum_abs_y = 0; int full_sum_sq_y = 0; int full_sum_abs_z = 0; int full_sum_sq_z = 0; int M = 0; for ( int a = 0; a < L; a++ ){ int sum_of_products_x = 0; int sum_of_products_y = 0; int sum_of_products_z = 0; for ( int b = 0; b < ...
0
cbbc51010f9c485bf57c0827c245ed34
33ea62c1a6bf8db8e937474970754fef
Returns list of chairs on a specified faculty.
var result = []; if (facultyID === "1") { result = [ {id: 1, name: "BACHELOR PROGRAM (BA) 2017-2018"}, {id: 2, name: "Honours Major Program (Honours BA) 2017-2018"} ]; } else if (facultyID === "2") { result = [ {id: 3, name: "Accounting"}, ...
0
049fe35cb49d323733abc35b0544eb20
2fb891c9a615456ca6195853addc1c58
Find a hamilton path in a given graph from a given starting vertex. Search by traversing the nodes.
class Graph: def hamiltonianPathV2(self): self.PathV2result = [] self.SearchTree([],sorted(self.index.values())) return self.PathV2result
0
5142b851b0496d5c9b916810371a42b3
4fc9dcb2ae874289357a25f0aa90c00e
## Macro Average Geometric (geometric average of each class recall)
normBatchGeometricMean <- function(data.input, batch.vec){ batches <- unique(batch.vec) statistics.matrix <- matrix(0, nrow = nrow(data.input), ncol = length(batches)) for(i in 1:nrow(data.input)){ for(j in 1:length(batches)){ statistics.matrix[i, j] <- mean(data.input[i, batch.vec == batches[j]]) ...
0
472f613628204080e6159ef0d5dc58db
7fcf9b558d190371646148f32a15840a
Test if the asset history endpoint is accessable
res = app.get("/api/") assert res.status_code == 200 assert "Hypothesis-Media-Type" in res.headers assert ( res.headers["Hypothesis-Media-Type"] == "application/vnd.hypothesis.v1+json" )
0
21b87fbd2ba384d1556a41b011f07966
137954f1f89f68db27dd34c79e4f065a
校验是否加载了扩展,全部加载则返回true;未加载直接返回未加载的扩展
function isLoaded<T>(ext: Extension<T>): ext is LoadedExtension<T> { return ext.value !== undefined; }
0
a2caf92e015221eff8aed7d2ff72e241
a39c26c9de9a90c2b65a95fc2a892697
Applique un masque d'opacité sur la ressource courante.
interface ImageLoaderInterface fun mask(isOverlay: Boolean = true, @DrawableRes maskResId: Int, overlayMode: PorterDuff.Mode): ImageLoaderInterface
1
680bd030923a4c8dfdbc938eb239a9a2
bf8de7fea05244a77b655639455c8545
redisにあればredisから取得し、キャッシュになければブロック内の処理で取得しredisに保存するメソッド(Rails.cache.fetchと同様のメソッド)
define_method(name) do |arg = nil| if arg cached_associations[name] ||= {} cached_associations[name][arg.to_s] ||= instance_exec(arg, &block) else cached_associations[name] ||= instance_exec(&block) end end end
0
d3107594f3ceb482710385c2149aa8bd
3cd888ce03d8202dc6fd1e263bfa8e67
公共的禁止用户的方法
class User extends Model public function isForbid(){ return false; }
0
e416634f3eb8827f423451632238beaa
6c38da3ee4ac49a913e32d72c4e8619c
Borra todos los articulos del carrito.
class CarritoController extends Controller public function deleteAll() { try { $xCarrito = new cCarrito(); $xCarrito->iniciarCarrito(); $xCarrito->deleteAll(); return json_encode(array('estado' => true)); } catch (Exception $e) { Log::error($e); } }
1
5fa361b99a3a02fe43b9537a46124847
d92464abd4d6ecbd03ca5a2d1996e059
Sets the painter for painting the dragged dockables.
public class DisplacementScenario extends Scenario public void setPainter(Painter painter) { this.painter = painter; }
1
789410420336759db5e2e557e5e51efc
c0b8ee0e4de3e9950969ca34e1668a99
Purpose : This is function will set the debug control switches for hagt debug Input : Hsrv2AgtMsg_t* pst_hsrv_msg Output : N/A Return : HAGT_E_NONE Note : 2010.8 init version
_hagt_debugctrl_set (Hsrv2AgtMsg_t* pst_hsrv_msg) { #ifdef _GLB_DISTRIBUTE_SYSTEM_ uint32 lc_on; uint16 slot_num = 3; uint8 line_function_on; line_function_on = pst_hsrv_msg->opHsrv2Agt.hsrv2AgtMsgDebugCtrlSet.linefunon; ctclib_debug_line_function_on(line_function_on); lc_on = pst_hsrv_msg->opHs...
1
1b4b04db0b98220f184d47316c67d126
313ec3aa73c4642684e9c2a333063829
TCPClientJSON - send msg from VK to MC in JSON
msg = {} msg['action'] = 300 msg['data'] = get_data() msg["from"] = "3765C_21562167329C68E4" msg["mid"] = get_mid() msg["time"] = get_time() msg["to"] = "377900597703081984" msg_json = json.dumps(msg, separators=(',', ':')) return msg_json
1
d8e4274c5b3f328b69e86724bdc41a1e
9ddc38369986abccfe94a234ef45dc68
解析项目列表页面
project_item = response.css('#DataList1 tr[bgcolor="#F5F9FC"]') for sel in project_item: pre_sale_permit_number = sel.css( 'td:nth-child(2) a::text').extract_first() source_url = sel.css( 'td:nth-child(3) a::attr(href)').extract_first() ...
1
70bca7a217f89df837434eddfaa25c45
323f095af8a04b844632d9ee619eea8e
Returns two possible centers
def fuzzycenter(): x_wiggle = random.randint(-x_scale/5, x_scale/5) y_wiggle = random.randint(-y_scale/5, y_scale/5) y_center = y_scale / 2 x_center = x_scale / 2 return (y_center + y_wiggle, x_center + x_wiggle)
0
7176d976e34f27ec62105381c61a1ecc
466fc93d6b0e9dbdc5e5a4f76c150683
Helper function to generate encryption key for symmetric encryption.
void generateEncryptionKey(char *key, char *sessionID, char *username, char *password) { unsigned long sum = 0, i = 0, value = 0; char *bigString = malloc((getStringLength(sessionID) + getStringLength(username) + getStringLength(password)) * sizeof(char)); sprintf(bigString, "%s%s%s", sessionID, username, password)...
1
5c17d40863cab0e1d8635d5adcfd920d
e1d5a95b6c51eece1fc469a3a6ab2c97
Default number of bytes to read via I2C
class WildcardsFirmata(WildcardsFirmataBaseObject): async def i2c_config(self, read_delay_time=0): data = [read_delay_time & 0x7f, (read_delay_time >> 7) & 0x7f] await self._send_sysex(PrivateConstants.I2C_CONFIG, data)
0