query_id
string
corpus_id
string
query
string
code
string
label
int64
9cc5bc7bce118291520afc3aca8c9683
a3834dcd56955886496ffbc728edc260
Sets the number of words found in the file.
public class OnlineArticle extends OnlineTextItem public void setWordCount(int wordCountIn) { wordCount = wordCountIn; }
1
d19715fb63e01d160ff32e67a9800efe
dbde51db11b4a7ae9064d785575694ab
根据有向边集合构建图
function createDirectGraph(edges) { let G = new Array(); for(let i = 0; i < edges.length + 1; ++i) G.push(new Array()); for(let i = 0; i < edges.length; ++i) { G[edges[i].source].push({pos: edges[i].target, originLen: edges[i].originLen, len: edges[i].length}); } return G; }
1
7c1da9668a14ad62397e992a868f1e05
2b2dbeded457b2534f0ede21f22ffc0e
Initilize all the Button names for the specific state.
{ m_up.SetName("UP"); m_down.SetName("DOWN"); m_left.SetName("LEFT"); m_right.SetName("RIGHT"); m_square.SetName("SQUARE"); m_circle.SetName("CIRCLE"); m_triangle.SetName("TRIANGLE"); m_x.SetName("X"); m_L1.SetName("L1"); m_L2.SetName("L2"); m_L3.SetName("L3"); m_R1.SetName("R1"); m_R2.SetName("R2"); m_R3...
1
c850ffa8ee45f24ae673bf59f71edec4
ebba621e485b248f4b8d9865fcf7bd1f
实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。 如果不存在,则返回 -1。 示例 1: 输入: haystack = "hello", needle = "ll" 输出: 2 示例 2: 输入: haystack = "aaaaa", needle = "bba" 输出: -1 说明: 当 needle 是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。 对于本题而言,当 needle 是空字符串时我们应当返回 0 。这与C语言的 strstr() 以及 Java的 indexOf...
func strStr(haystack string, needle string) int { if len(haystack) < len(needle) { return -1 } if len(needle) == 0 { return 0 } p := 0 for i := 0; i < len(haystack); { if len(haystack[i:]) < len(needle[p:]) { return -1 } if haystack[i] == needle[p] { if p == len(needle)-1 { return i - len(need...
1
9b46dfe923c337069711e21e7dff6111
0599c2586f137cf1d63bc7ce787b6935
checkbox的事件,達到上限就不能再選
var checked = $(obj).attr("checked"); limitImportMaxnum($(obj), checked); if($(docObj).find("#cbxSelectAll").attr("checked")=="checked" && !checked){ $(docObj).find("#cbxSelectAll").attr("checked",false); } else { var flag = true; chkItems = $(docObj).find(":checkbox[name='iris_i...
1
1a72f64336a363c60811a52f474ae560
f0a5981ee53d14baf725aa938cbf4556
根据原始asm annotationNode构造注解实体
AnnotationInfo annotationInfo = new AnnotationInfo(); annotationInfo.setType(annotation.getTypeName()); annotationInfo.setParamMap(getParamMap(annotation)); return annotationInfo; }
1
fbdcaef3e3038d988f3077f422d36e7b
f5a577fb8c9289cbf293e00410de3c0d
Returns the number of related J808tProducto objects.
{ if ($criteria === null) { $criteria = new Criteria(ProdutoPeer::DATABASE_NAME); } else { $criteria = clone $criteria; } if ($distinct) { $criteria->setDistinct(); } $count = null; if ($this->collCertificados === null) { if ($this->isNew()) { $count = 0; } else { $criteria->add(Ce...
0
c3da7b113525dd886e5a1fad781e72ae
ee6d97b754bcd557d916186cb1ef53f8
Find pos of id to delete return -1 if no ID founded
{ for(int i = 0; i < records.size(); i++) { if(records.at(i).id == id) { return i; } } return -1; }
1
418614712d789d586f0f2be47f5187c6
9ac553f28806f65dbe8cd9cf65f502c0
文本块生成器:把纯文本分成一个个文本块
start = 0 while start < len(text): chunk = text[start:start+size] yield chunk start +=size return
1
64cee2da974bc0a49c54f724f66e5e5d
7f61448ad6da3ef0f9cb03f40c5be655
Expexted format: hh:mm
cases like (1)
0
41cf0090d783c698442e16fc44daed1b
d86acba0b7adadd84fe47d0371b675f6
Disposes the Eyes object, turning off all LEDs and disposing the correspoding I2C devices.
{ _bodyDriver?.Dispose(); _bodyDriver = null; _colorDriver?.Dispose(); _colorDriver = null; _infraredDriver?.Dispose(); _infraredDriver = null; kinectSensor?.Close(); kinectSensor = null; }
0
d159c1a4c62bd99c03070d85f21b2ae2
31425163732a287b1444aaf11b0c7778
Finds field (input, textarea, select) with specified locator.
public function findElement(WebDriverBy $locator);
1
b6777f00f4b0f0bf86faea3aaf04dc8f
4bb256c6b0d74a4623b596b0a523062d
Find atomic parameters recursively.
{ if (!is_array($value)) { return $param->filter($value); } $result = []; $type = $param->getType(); if ($type == 'array') { $items = $param->getItems(); foreach ($value as $val) { $result[] = $this->recurse($items, $val); ...
1
c9fc4f3ac12470692458574646cfcd94
93445c1a0f84fba40a8a8548bd81de5b
Sets JWT as the default token format for access tokens.
public class JwtDecodeDemo implements EntryPoint private void setDefaultToken() { inputArea.setValue( "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJlbHZpZS53YXJkQGdtYWlsLmNvbSIsImZ0biI6IkxlYSIsImx0biI6" + "IkhlYXRoY290ZSIsImxjbCI6ImVuIiwiZXhwIjoxNDkzMzM0MDU4fQ.i3nVmGTskToNIiXgzAbGVEOu-62y" + "S5H2P4RQQJl...
0
662916f35e34bfaaf02ab1e16ee57131
4de4e7e996865019de598f824db25677
Wait for the codec bus to be free
static u32 cbus_wait () { u32 timeout = 0xF000; while ( !(ldrh ( CBUS_CTRL ) & CBUS_CTRL_READY) && (timeout-- > 0) ); if ( !timeout ) { buffer[0] = 0xEEEE; return 0; } return 1; }
1
09066e2cdb1074e7059b3088852ef72b
c61de838530ef5558b129375a53db3b2
向服务器发送统计数据,用户分享了该活动
if (APPUtils.judgeTimeDev(getActivity(), devcode, timestamp)) { String sign = Md5Utils.createMD5("bid=" + bid + "devcode=" + devcode + "timestamp=" + timestamp + "uid=" + userId + URLUtils.WK_APP_KEY); RequestBody params = new FormBody.Builder() .add("bid", bid) ...
1
f7994093773af3bb935a972a2205d2b0
0fd0fe40a91eae56bb3a3ac42ae23339
Test updating another users answer
class AnswerControllerTest extends TestCase public function testUpdateAsGuest() { $answer = Answer::factory() ->for(Question::factory()->for(Survey::factory())) ->for(User::create(), 'votable') ->create(); $updated = Answer::factory()->raw([ 'value' =>...
1
d4d8a91c718d2023755ecb5b548bb747
6ed1da1099730d580caf72e5b2f2d94c
创建新的空文件夹,创建.和..文件
{ fat[block_number] = USED; strcpy(fcb->name, "."); fcb->is_directory = 1; setCurrentTime(&fcb->datetime); fcb->block_number = block_number; fcb->size = 2 * sizeof(Fcb); fcb->is_existed = 1; Fcb* p = fcb + 1; memcpy(p, fcb, sizeof(Fcb)); strcpy(p->name, ".."); p->block_number...
1
935346949b1354c0c1f44f1cbdd3b984
445b2b8bd22c4743f56df9c2071ba569
对象序列为json字符串
namespace TinyFx.Data.ORM public static class OrmUtil public static string SerializeIDS(Dictionary<string, object> ids) => SerializerUtil.SerializeJson(ids);
1
4a9e6a6acf0c460cb2c13279eddb4ebc
b071ece1a6892b30b4c1b51a612f90a0
Specify the concrete implementation for the contract interface.
namespace LightCore IFluentRegistration Register<TContract, TImplementation>() where TImplementation : TContract;
1
95e3381f2d1710a595422fc95dbe8172
62f50b35f63a655d4cddcc1654bd8cb4
compute the indices of the start and end anchors for a given curve segment can be helpful when building the basis matrix
mask = np.concatenate([[False],mask,[False]]).astype(np.int8) dmask = mask[1:]-mask[:-1] start = np.where(dmask>0)[0] stop = np.where(dmask<0)[0] return np.array([start,stop]).T
1
67f85a514e891babfc09c0969be108bf
09a9a7f8ca8c898a7c328607c50097ef
convert position in map(has bounds) to position in graphic
public class TileManager : MonoBehaviour public static Vector3Int PosToTileMap(Vector2Int pos) { Vector3Int output = new Vector3Int(pos.x + widthStart, pos.y + heightStart, 0); return output; }
0
24af2b26f5d7918a3a1e9faa65433b3d
eb6a616accd45fd57c8a8e90d0e588dc
Retrieves a flag which indicates if summary rows inherit criteria from non-summary rows.
public Boolean getSummary() throws DataAccessException, IllegalPropertyException { logger.trace(DEFAULT, "Retrieving the default '{}' configuration option: '{}'", "summary", SUMMARY); return SUMMARY; }
0
49fa11720fa59a2c7971821a0fde0ab0
a4558a629472374e47e9b49fa96839da
回调方法很简单,就是遍历成功或者失败回调函数容器,然后依次执行内部的方法
function _exec(arr){ var i = 0, len = arr.length; for (;i<len; i++){ try { arr[i] && arr[i](); }catch(e){} } }
1
d90a5e0db09c41a1f5aedc1c1ed1e6c1
17733df6fd24be3fc8416a7e2513b679
Named provides a more concise way to create NamedArg values. Example usage: db.ExecContext(ctx, ` delete from Invoice where TimeCreated < @end and TimeCreated >= @start;`, sql.Named("start", startTime), sql.Named("end", endTime), )
var b = &RawBuilder{} b.builder = newBuilder() b.query = &query{b: b} b.exec = &exec{b: b} b.scan = &scan{b: b} b.sql = &bytes.Buffer{} b.Append(sql, args...) return b }
0
ac8e07623b29e16855e103e80f22d3eb
fa5cdf94027e250995eeb80ec3dc55fd
Command handler for the MKD command. <pre>MKD %SP% %pathname% %CRLF%</pre>
{ if ( !IsConnected || path.IsEmpty() ) return; try { OutCtrlStream.PushLine( "MKD " + path.Replace( '\\', '/' ) ); FtpResponse response = GetResponse(); if ( response.KnownCode != FtpControlCode.Succ_Created ) ...
1
d27fc6826427fede01bd08c1f8611f4f
0d2846da56db6bacd552c1801278c60f
Solve the equation a x = b for x, assuming a is banded matrix. The matrix a is stored in `ab` using the matrix diagonal ordered form:: ab[u + i - j, j] == a[i,j]
int solve_Ax_eq_b(band_mat *bmat, double *x, double *b) { int i,bandno; for(i=0;i<bmat->ncol;i++) { for (bandno=0;bandno<bmat->nbrows;bandno++) { bmat->array_inv[bmat->nbrows_inv*i+(bandno+bmat->nbands_low)] = bmat->array[bmat->nbrows*i+bandno]; } x[i] = b[i]; } long...
1
88fc653faa53ee416a25c7007efe3cdc
45819732e6b3a222248b9cca3659fc66
获取集中器和控制器详细信息
ctrls = {} @controller_info.each do |controller, parameters| ctrls[controller] = { 'product_name' => parameters.fetch('Product Name'), 'serial_number' => parameters.fetch('Serial Number'), 'fw_package_build' => parameters.fetch('FW Package Build'), 'fw_version' => pa...
1
47164023ec6ae103e3c0f280678cb504
e33e1a557b834d0129de8a1606056513
inizializza listener del bottone
for (int i = 0; i < ListaButtonUtente.size(); i++) { final int index = i; ListaButtonUtente.get(i).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(entity.getEffetti()==true)...
1
ed195b3dd95b0ab6e7cecf72a6d5ca0e
d43bdc735c44c234d1ac4ea7b780eaa9
Sets GameObject's rotation to match that of specified GameObject with the same parent transform.
if (script.transform.parent == null) return script.defaultLocalRotation * v; return script.transform.parent.rotation * (script.defaultLocalRotation * v); }
0
54555ebfdb5bfcb8c42e46ffb5e83a0a
378493f009659f1f61c7e4ff2363fc08
Creates a request validation entry.
namespace Amazon.APIGateway public partial class AmazonAPIGatewayClient : AmazonServiceClient, IAmazonAPIGateway public virtual CreateRequestValidatorResponse CreateRequestValidator(CreateRequestValidatorRequest request) { var options = new InvokeOptions(); options.RequestMarshaller ...
1
8f9c5797b1fb9d7b9c03a6e0fd20b375
0f2f6a69098138a5617365165e277ec7
Map temperature to one of TEMPERATURE_CHOICES intervals.
class HotTub(ClimateEntity): def map_int_to_operation_mode(config_int): if config_int is not None: if AWAY <= config_int < COMFORT: return STATE_AWAY elif COMFORT <= config_int < SAVING: return STATE_COMFORT elif SAVING <= config_int < BOOST: ...
0
28461fc3ae53ba7ef9ab38aea0073b83
5a07e1c857abb8e6bee4f1b4da482592
检测英雄飞机是否击中敌机,检测碰撞
class PlaneGame(object): def __check_collide(self): pygame.sprite.groupcollide(self.hero.bullets,self.enemy_group,True,True) enemies = pygame.sprite.spritecollide(self.hero,self.enemy_group,True) if len(enemies) >0: self.hero.kill() PlaneGame.__game_over()
0
78028e5a72cd6db51558854a5f2ec840
7399d431795312faf0ca846fd181421b
Determines whether the current admin page is an MASHSB admin page. Only works after the `wp_loaded` hook, & most effective starting on `admin_menu` hook.
class Wirby static function is_a(){ return c::get("is_admin"); }
0
6e8332f62c146c2f6865ed3c23134dfb
99bdb2cfb2a1d6a951a8f658466006dc
Creates the data for bulk insert
class group_request extends \phpbb\notification\type\base public function create_insert_array($group, $pre_create_data = array()) { $this->set_data('group_name', $group['group_name']); return parent::create_insert_array($group, $pre_create_data); }
1
a289b8becc35365290c9624e9b3b9141
74ec1a6ad8ee89d812dfd6b5c915fb1a
Returns the value of the '<em><b>List Source</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>List Source</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc --> extendedMetaData="kind='attribute' name='list-source' namespace='##targetNames...
Parameter getValueSource();
0
8c82eef87b7b6bda04f9bf6ef9d62c43
944ebde417ba76857a7d1dbc458ac69f
Converts all windows-style slashes to unix-style slashes
{ char *rawStr = (char *)Path.data(); for (char *ptr = rawStr; *ptr; ptr++) { if (*ptr == '/') *ptr = '\\'; } char *out = rawStr; for (char *ptr = out;;) { *out = *ptr; if (*ptr == '\0') break; out++; ptr++; if (*ptr == '\\') { while (*ptr == '\\') ptr++; *out++ ...
0
461c1cf9e9b255fd7122aef1e2a483fe
d4de499cb7a2b8eee9cc31e1ccd661a8
@brief Determines if the 2 features are already in the vector cf.
{ return (vector_greater(cpvec_first, cpvec_second) || vector_equal(cpvec_first, cpvec_second)) ? true : false; }
0
8ebcc3ab22f40c46f49088fd144a7710
a0e0cc5a10249c92727af2424cdbb885
@brief Clear Rx FIFO.
{ u8_t data = NOP; NRF24_ll_write_registers( FLUSH_RX, ADDRESS_NOP, &data, 1u ); return ( PASS ); }
1
325536331418e11433df6479b8cb92c2
e834984c28430b81f61fd31b93a59b23
Set up projectile to be thrown. (script called in: Player_Movement)
public class ProjectileScript : BaseProjectileScript void Start () { }
0
fa90e7fdd1b0740cb048eeb880cca2fc
98dd2a399a551d565c1b25ff42b1f6fb
演示在路由中使用默认参数
func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { fmt.Fprintf(w, "Hello, %s!\n", ps.ByName("name")) }
0
503399b4b14777157725b19160ce2065
e1a2e2330fe6171a6ff6f05808ded531
Relaciona al vertice con otro vertice y asigna el costo de dicha arista
Vertex<T> vertexFrom = getVertex(vertexValueFrom); Vertex<T> vertexTo = getVertex(vertexValueTo); vertexFrom.addEdgeTo(vertexTo.getValue()); }
0
c77f6fc12cb1b0b87a59d1e96d7f7eb0
642d0ce1742465d9d2a666ed3a0030bf
Given the app never pulled before, but consent was given to pull EU keys.
mock_enterprise_enabled.return_value = True mock_consent_necessary.return_value = True consent_url = '/abc/def' mock_get_consent_url.return_value = consent_url self.check_data_sharing_consent(consent_required=True, consent_url=consent_url) mock_get_consent_url.assert_call...
0
1d6b56885040af3d579f65c0d4252546
b2f88376327fc4d116ff50bd1afd01da
解析buff数据(按打击帧分, 一个打击帧一个列表)
{ if (null == BuffConfigFile) { TraceUtil.Log(SystemModel.Common,TraceLevel.Error,"BuffConfigFile没有指定Buff的配置文件!"); } else { foreach (BuffConfigData element in BuffConfigFile._dataTable) { m_buffConfigList.Add(element._buffID...
0
1e7cdc8fe2b0805605214b58cc0783ca
78546ab86de06e4cf208f8e6c0f7ee92
Passes if object is not a kind of class. assert_not_kind_of(Object, 'foo')
def assert_kind(expected_class, actual_object) expected_class = expected_class.to_s.camelize actual_object = actual_object.first if actual_object.respond_to? "each" assert_equal expected_class, actual_object.class.to_s, "expected object to be class '#{expected_class}' but was '#{actual_object.class}'" e...
0
4159c556703eddc604b9883e5189a10e
4aa86c93e066fc8b159ef8bb174c2c70
Liefert die orthogonale Beschreibung zu den Erweiterungen zurück.
public class Konzept implements Serializable public List<Konzept> getSpezialisierungen() { return this.lnkSpezialisierungen; }
0
a52e9cf05be623aceed29cbb14cedf15
c0d0707134f90ecefde039c78a24a462
Revises the emergency indicator.
{ if (_emergency_active == value) return; _emergency_active = value; if (_emergency_active) { cancel(); find_emergency_plan(); } else { find_plan(); } }
1
2fa2466fb501394eeb43e3c7c0fc8a2b
a97e5051535337429e060bfc392f8ab3
Perform a linear search for the given element. Return the index of the element's node if found, -1 otherwise.
for(int i=0; i<size-1; i++){ if(elementData[i].equals(element)){ return i; } } return -1; }
1
6288d020e34f76b4547138e1ad9a55b6
5264071f03f8a87cb46f1ad1d1275e19
根据前序和中序遍历,反向构造树
if(middle.length() == 0){ return null; } TreeNode root = new TreeNode(-1); for(int i=0 ;i<before.length();i++){ if(middle.contains(String.valueOf(before.charAt(i)))){ int index = middle.indexOf(before.charAt(i)); String leftMiddle =...
1
784b7d674f088604429dd41756307dd9
22488e57207fca65e20ae265f32b9705
Write the pointer to an undo header. Instead of writing the pointer itself we use the sequence number of the header. This is converted back to pointers when reading.
static void put_header_ptr(bufinfo_T *bi, u_header_T *uhp) { undo_write_bytes(bi, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4); }
1
b483092aca00bdcf60232f375ede94b2
c05f36e1265b5bed3a796a6d6775b38c
Path to client's public key (PEM) used for authentication.
String getPublicKeyPath();
1
686b3666ab5e7917a1439be3e4130ed4
eb28c0835143e9ce7c6b7abebe9a374a
Busca mensagem de sucesso armazenada em sessão
SessionContext session = SessionContext.getInstance(); String message = (String) session.getAttribute("message"); return message; }
1
825308c20309fb0379fb6d873dcd88ea
5dc7b8e2b106da1560166563a15ceb32
获取一天的毫秒数
public class DateUtil public static Long getDayMillis(int i) { return 24L * 60 * 60L * 1000 * i; }
1
6895361055c5f9d6c1c8f618c5e8e1e6
9d183f40a265307c08ff3b8ae76a1028
Загружает данные о количестве ресурсов у игрока
if(resources['gold'] != 'undefined') $('.rating .resurses .gold').text(resources['gold']); if(resources['silver'] != 'undefined') $('.rating .resurses .silver').text(resources['silver']); if(resources['energy'] != 'undefined') $('.rating .resurses .lighting').text(resources['energy']); }
1
73710e5bac5f566da4ce1d263ef34a67
ce40e30113b680759bbb22a8918ea803
Makes a private copy of the proxy for the specified interface.
namespace RemoteLibrary.InterfaceProviders T GetProxy<T>() where T : class;
0
966e26cab2aba87199b87f417e4b1ade
22a517ac51b06624ec4c0f48d35a7c84
ペット購入
{ $item = Item::findOrFail($id); $inputs= request()->validate([ 'purchase_number' => 'required|max:'.$item->stock, ]); $request->user()->purchase($id, $request->purchase_number); $item->stock = $item->stock - $request->purchase_number; $item->save(); ...
0
678416046eb32b49e20adb0b415c3464
d2c913d67e29b6ee74d83434cc067389
Hide overlay panel, used for avoiding user inputs while async function is running
public class SignatureWriter : MonoBehaviour public void HidePanel() { EventSystem.current.currentSelectedGameObject.transform.parent.gameObject.SetActive(false); }
1
f55a245ce8019305725152332119fa2a
029c7dd960e04a43f1692027fdcb0509
Returns the resolved PrivacyPreferences entity.
class User extends \Application\Entity\User implements \Doctrine\ORM\Proxy\Proxy public function getPreferences() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPreferences', []); return parent::getPreferences(); }
0
78416ded9231d4634220780ce222ee1f
7d0b49e9c1cb6d3998cda45a7a5e37db
funkcija za otkazivanje rezervacije
$conn = require "conf/connection.php"; $id = $this->getId(); $sql = "DELETE FROM reserve WHERE id='" . $id . "'"; if ($conn->query($sql) == true) { echo "Reserve deleted"; } else { echo "Error deleting reserve"; } }
1
57ca011e9ec52a5ded8b654dca9b6902
94e9622672e4586c3686fb2074b48cd4
Gets the total of static pages. If static pages are not loaded, this function will load them.
interface IPaginationAdapter fun getStaticItemCount(): Int
0
c4d2b73a808ab6f6f2dab98e2484619c
b541ecfaa74790814d96c71e5b737742
Two-line element set
class Data_Line def set_elements element(:tag_field) {b.text_field(:id => "dataField_tag_id_line#{line_id}_control")} element(:ind1_field) {b.text_field(:id => "dataField_ind1_id_line#{line_id}_control")} element(:ind2_field) {b.text_field(:id => "dataField_ind2...
0
69dc1bff134c44ffc665a34efeb13609
1e7f547330a39606a2851a7fa1e886af
获得生活类文章数目
func GetCountArticle() (count int,err error){ var article []LiteArticle return count,db.Where("status = ?",1).Find(&article).Count(&count).Error }
0
e1fdd6908465adea36e4655931cb2d3f
d1308ee1822cffc1185301d368c6cfde
Probability of crossover.
class GP(Optimizer): def p_reproduction(self) -> float: return self._p_reproduction
0
0818640267c6027bb37a0a51ef620804
c5f1d6dd6a9b826f69e31b7aedb8921a
========================================= USER =========================================
function userReducer(state = initialState, action = {}) { const { error, payload, response, type } = action switch (type) { case USER_FETCH_REQUEST: return { ...state, isFetching: true, error: null, } case USER_FETCH_SUCCESS: return { ...state, isFet...
1
3556529d26e66d90cfb5345fd8e7925a
c0fc1c68de8ffa7afb95f7b9c354a055
Функция возвращает список брендов отсортированый по алфавиту из конкретной категории
class BrandController extends Controller public function getBrandForCategoryFrontend() { $brands = Brand::orderBy('created_at', 'desc')->Where('active', 1)->paginate(10); return BrandResource::collection($brands); }
0
81f86068cc0d910164bb5a6fb85142a6
2b6d31ee12fe4c8428ba8cbdbd179bcc
Apply filter to dictionary keys maintaining correspondence.
def apply(dct: dict, key=lambda key: key, value=lambda val: val, item=None) -> dict: if item: return dict( item(_item) for _item in dct.items() ) return { key(k): value(v) for k, v in dct.items() }
1
8626cf13184a774673dbb566a6a51cbe
0fed8d69d94f6b8c45adb2a1ea24f3b9
Generate the set of HTML options tag for the select list containing the set of selected dimensions.
public final class EMSFunctions public static String htmlOptions(String name, Map<String, String> options, String selected) { StringBuilder builder = new StringBuilder(); builder.append("<select name=\"").append(name).append("\">") .append(System.getProperty("line.separator")); ...
1
4ac856722cad6c231f983c93f2b51ffd
d62680fcb7c56ba18b776752f1a1098c
根据uid 获得在线session
Session getUserSession(String uid);
1
2f28bc73db67eab7910bb56f8d2bbdd9
2cb25f615492d84fa963eeed57331505
去激活Active Directory用户
namespace Core.Systems sealed class AdHelper public static void DisableUser(string sAMacc) { DisableUser(GetDirectoryEntryByAccount(sAMacc)); }
1
7850aace435244c1c6cc177a51f61037
3ff0422e7c0dd6f921516597c88ed6ee
当页面加载完毕时 给H5的加入购物车按钮添加点击事件
function init() { var add_btn=document.getElementById("add-btn"); add_btn.onclick=addBtnHandle; }
1
5a9243a11c511c1fb8fc51a94e2a57b2
5aedbe6a16fbc361d037394a57662acb
Convert all span labels to uppercase to normalize
function normalizeWords(words) { return words.map((x) => x.toUpperCase()); }
1
9cc93de308076bcf0ec8d8f78fda2cfe
deef2b0116d5b528cf7cf370d5dc0e87
棋譜ファイルの読み込みを行います。
pub fn read_file() -> Result<(Vec<Move>, Vec<Move>), Box<dyn std::error::Error>> { let mut undo_list: Vec<Move> = Vec::new(); let mut redo_list: Vec<Move> = Vec::new(); let mut reader = BufReader::new(File::open(GAMESTATE_FILENAME)?); let mut buf = String::new(); reader.read_line(&mut buf)?; let...
1
d3f7c5e2f9c50f83ed8ac43b0feeca8a
a9e43c560a9fbf5d79a7746979a57263
重置RadioButton的图片的大小
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_rate_solid); int startHeight = bmp.getHeight(); if (startHeight != 0) { ViewGroup.LayoutParams lp = mGradeRb.getLayoutParams(); lp.height = startHeight; mGradeRb.setLayoutParams(lp); ...
1
c92a40602b6e6baace6bb79aef4630cd
bfddf8bd842c5cd44166b73426b5c609
Returns the meta object for the attribute '{@link org.abchip.mimo.context.MessageDescription#getSeverity <em>Severity</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EAttribute getVulnerability_Severity();
0
9db9e2597b1a7d369a2c96085c85deae
dea726546caf3f4848fa121ad612025f
second pass,返回频繁2项集
fp_tree, head_table = self.__create_fp_tree(self.data_set, self.min_sup) freq_items_list = [] self.__recursive_fp_tree(head_table, 2, set([]), freq_items_list) return freq_items_list
1
b08455fc2e7206ecfebbb6a4767e74bd
099abae7bfb7ba1d3261ebda0dda1b1a
获取患者签名
{ Node nodeTemp = new Node(); string sql = "select a.tid," + "a.pid," + "a.textkind_id," + "a.belongtosys_id," + "a.sickkind_id," + "...
1
9182d637ea113c92bd861b95fa598478
917e7490055ef6783c9ef1add151df7c
Render an OpenId response to my response, or bail and render an HTML error message if we can't.
Identifier verifyResponse(HttpServletRequest httpReq) throws OpenIDException;
0
3a202fa11867c83ae7bcb6517bfd021d
4e748f057ab6191ecab5bd82be1e3169
Realiza la búsqueda avanzada de personas mediante varios campos.
Ciudadanos ciudadanos = new Ciudadanos(); try { ciudadanos = this.busquedaPorNombre(apellidoUnoBusq, apellidoDosBusq, nombreUnoBusq, nombreDosBusq, null, null, "2", JsfUtil.USER_ACCWSNOMBRES_MADRE, JsfUtil.PASS_ACCWSNOMBRES_MADRE); personas = ciudadanos.getPer...
1
117436b1b3421056200773b44d110f59
e6e01c884961ecf4a71c5018db7df108
5.문자열을 숫자로 변환하기
public class MainClass{ public static void main(String[] args){ String str = "20"; int a = 10; int x = Integer.parseInt(str); int ret = a + x; System.out.println("ret = " + ret); }
1
c7e428cc699cacd1898a9e5c3ee46e04
5bb44aea8d8816126f50b8829d09fb12
页面刷新代码
function pageRefresh(){ $.mobile.pageContainer.trigger("create"); }
1
9262fcae73b946a14606dfe1f670a065
062cdad12917ab9bc568f4c77985021a
The method here takes the dictionary produced in the other method "search_query" and adds each entry to a priority queue.
def addSolutionToQueue(solution, priorityQueue): heapq.heappush(priorityQueue, (solution["inferiorHeight"], solution))
1
66fc47ea7f72994f18bab3963cd2da48
754ffb0a6c51952a841d8b1abd136fd4
<p> Este método contatena o protocolo e o host do webservice do controle de acesso. <br/> </p>
public class ProdepaGlobalSystemProperties public static String getNucleoPaWsFullUrl(){ return getNuclePaWsProtocol().concat("://").concat(getNuclePaWsHost()); }
1
7267c08032093204bd81e95d63f51b11
189495330f832607866ba36d70580517
Get the maximum value that can be passed to setPlaybackSpeed
public class SimulationManager : MonoBehaviour //-------------------------------------------------- public int PlaybackSpeed() { return m_playbackSpeeds[m_playbackSpeedIndex]; }
0
9a7de9ec262e456fdd1546d72870c59a
abc90e78ec60497e0c3c7cd568228ae5
根据表达式数组 获取列名数组
{ var result = new List<string>(); if (expression == null) return result; var arrayExpression = expression.Body as NewArrayExpression; if (arrayExpression == null) return result; foreach (var each in arrayExpression.Expr...
1
ac35920a8a55786edbddeef6a33f58af
3510590e69ed74edef7617f0361f0e4b
Function to perform IP function and return pointer to the result.
void IP(uint64_t plaintext, uint32_t &left, uint32_t &right) { for (int i = 0; i < 32; i++) { set_bit(left, 31 - i, get_bit(plaintext, 64 - MAP_IP[i])); } for (int i = 32; i < 64; i++) { set_bit(right, 63 - i, get_bit(plaintext, 64 - MAP_IP[i])); } }
0
170de58ebbe6c182212d7e161ac1a1af
5e5e92fd27b9b6d23310be79dafdaa3b
主管部门区域列表
class ApiotherController extends BaseApiController function areaList(){ $area = new AreaModel(); $return = $area->areaList(); $this->jsonOutput($return); }
1
0fd4e3065826aa3cb718c60a17365064
eeba1c0d35b6204553dcfe92d36cae61
https://leetcode-cn.com/problems/uncommon-words-from-two-sentences
if len(x) != len(y) { return false } diff := make(map[string]int, len(x)) for _, _x := range x { diff[_x]++ } for _, _y := range y { if _, ok := diff[_y]; !ok { return false } diff[_y] -= 1 if diff[_y] == 0 { delete(diff, _y) } } if len(diff) == 0 { return true } return false }
0
b4b8ceaf9bf5e565fd87058d7c5f2939
06cae77ee050d37fddeb71e8008dcaad
Returns vcards that match the criteria (key/value pairs) sent in JSON format.
{ try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(buildRequestUrl(criteria)); return process(doc); } catch(ParserConfigurationException e) { throw new RuntimeException(e); } catch(SAXException e...
0
d34c1cc32d9b815ad4996ed8b2d52389
b86bc65073abc695e6b303a298d0667b
simulate a time-consuming messaging operation
function processMessages(): Promise<void> { return new Promise<void>((resolve) => { setTimeout(() => { resolve(); }, 0); }); }
0
31a09ffac2e69f1ef0fe1aaaf419ebab
6114000c025b51c4ea64bd3c1bc5e9b4
Set Prefetch progress in percentage
public function setPercent($percent = 0);
1
3533007d1e9a02e331f276a2e13b88c7
9429ad3717f326b9b14c945fd014c778
Sets the sensor_id of this Sensor.
itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_sensor_id_feature"), getString("_UI_PropertyDescriptor_description", "_UI_sensor_id_feature", "_UI_sensor_type"), Automatizaci...
0
2a512b1876388f8a15315df6967bf42b
8d484532729b7f411d03bafb81874a04
实现离线缓存 (离线可以缓存,在线就获取最新数据)
class CacheLogic extends MemberInterlayer public function onlineSave($data, $name='') { $this->onlineInit(); return $this->_cache->save($data, "online{$name}"); }
0
16e44591449c38435c95695d4c115261
665b5b72f108631f2c8cd88b18b8e8bc
called internally to update info about the stream from the server
class PulseAudio(Module): def server_info_cb(self, context, server_info_p, userdata): server_info = server_info_p.contents self.sink = server_info.default_sink_name self.request_update(context)
1
bbfea84558077448acd5670412fe6dd9
6a1704f0073d4b5c947eacd1ec4455aa
Calculate amplitude of jonswap spectrum for specific angular velocity
def get_vdc_amf(uavg, javg, ntot, l): alpha = -uavg/2.+(uavg+2*l*javg)/(2*l+1)/4. vdc = alpha*2*ntot return vdc
0
3fbfe6919b200d6071bc1d0f72a5468e
e86e37162257d0444376c3ae11835f0a
如果没有传入goods_id,只有sku_id,要先查询出来goods_id
def get_sku_id(sku_code, product_code=''): result = get_sku_info(sku_code, product_code) sku_id_list = [] for info in result["data"]["Items"]: sku_id_list.append(int(info["Id"])) return sku_id_list
0
beece291e9d65015079a86dc0ee0bec3
1252857f34b56a2995eb46a73c77283a
网点供氧模板列表
@Controller @RequestMapping("/tjcx") public class TjcxController extends BaseController @RequestMapping(value = "/wzjjjllist") @ResponseBody public Object wzjjjllist(Page page) throws Exception { Map<String, Object> map = new HashMap<String, Object>(16); String errInfo = "success"; PageD...
0
c46d4682e406e651ab19999a2c7c8d02
5105a4ad6556231d3e3486ffef3e6ec3
Compute encryption key when AES is negotiated
{ using (AesManaged symmetricAlgorithm = new()) { symmetricAlgorithm.KeySize = 256; symmetricAlgorithm.GenerateKey(); symmetricAlgorithm.GenerateIV(); if (m_keyIVs is null) { m_keyIVs = ne...
1
a871bf637dbe39343ec24cd0626231ba
a1dbf38f67860cf89e94d425cff4dd84
合并类型声明的分发函数
{ bool thisFunctions = (flags_ & FUNCTION_TYPE) != 0; bool otherFunctions = (st.flags_ & FUNCTION_TYPE) != 0; flags_ |= st.flags_; min_ = (min_ < st.min_) ? min_ : st.min_; max_ = (max_ > st.max_) ? max_ : st.max_; if(st.returnType_) { if(returnType_) { minArgs_ = (minArgs_ < st.minArgs_) ? minArg...
1
218bb9889dee40bb92dead0ec43c8966
1cb6c3b22c0b437b7cc14c6da3bcb524
Empty Shopping Cart and reset session.
{ $basketService = $this->get('kac_admin.basket_service'); $basketService->resetBasketSession(); return new Response(htmlspecialchars(json_encode(array('response' => 'success')), ENT_NOQUOTES)); }
1
e316fca351460e43050aa8d30415dda1
d85e7a6830b847e4e83855ba9419387d
Returns the actual value (a copy) as bytes.
final byte[] out = new byte[this.rawDerValue.length]; System.arraycopy(this.rawDerValue, 0, out, 0, this.rawDerValue.length); return out; }
1