query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
e840500aae8441da8265e676c4770c68 | dc7e29a34cca838bb48c9adf4bd4ca0d | Sorts an array of integers using a bubble sort algorithm.
Takes in one argument: an array of integers. | class BasicSort
public static int[] bubble(int[] input) {
return new int[0];
} | 0 |
55d3dd0bd283b078ccd422ef71c60d5e | ab93f2149d501a4b9094e5c0b388434d | 显示每一行的关键词 | function showWord() {
document.getElementById('result').classList.add('hidden');
var tableList = document.getElementById("table");
var str = "";
var html = '<div>';
var ke = 1;
var shu = 1;
for (var i = 1; i < tableList.rows.length; i++) {
if (i == 1) {
continue;
... | 1 |
b1684b303fa065e23f342db3f555183f | 87c3fe19d86597caf8c9e9054efefa2a | 存入发送队列(0成功 -1失败 1已满) | {
CanTxMsg TxMessage;
CanSendCount=0;
if(QueueEmpty(can_queue))
flag.CanSendqueueEMPTY=1;
else
{
if(can_queue->Can_DataSend[can_queue->Front].ID<0x800)
{
TxMessage.IDE=CAN_ID_STD;
TxMessage.StdId=can_queue->Can_DataSend[can_queue->Front].ID;
}
else
{
if((can_queue->Can_DataSend[can_queue->... | 0 |
2a85ec3e222c8e36386e0b05edaa9723 | 0005c5b4a11d788cf6f4625b20ece369 | Tests to check whether Fortran array slices are correctly translates to DaCe views. This case necessitates multiple views per array in the same context. | class TestSharedMemory(CUDATestCase):
def _test_dynshared_slice(self, func, arr, expected):
nshared = arr.size * arr.dtype.itemsize
func[1, 1, 0, nshared](arr)
np.testing.assert_array_equal(expected, arr) | 0 |
5b49e4cf3eb97e2e61755bf3cbbba80e | 48f69fb47603dbacb26844546516420a | Add a line to a text view. | public class MainActivity extends AppCompatActivity implements TextToSpeech.OnInitListener
public void appendText(final String s) {
runOnUiThread(new Runnable() {
@Override
public void run() {
textView.append("\n" + s);
}
});
} | 1 |
0090a15e763a200a0134deb3a3650e79 | f4afdb92d2e3db61c40713783da68622 | Retourne l'identifiant du joueur dont c'est le tour de jouer.
Si le joueur n'est pas trouve, retourne None. | class Jeu:
def _get_tour(self):
if self.joueurs:
return self.joueurs[self.no_tour]
else:
return None | 1 |
768415dffaa87d81e5f18b18c860d022 | a730a67dfe498d3cc0e03aa2d7211093 | !
@brief Sends over-the-air a GoToLiftValue/GoToTiltValue request from the WindowCovering Cluster Client. | {
ZCL_Step_t *req = (ZCL_Step_t *)payload;
int16_t level;
ZCL_Status_t status;
uint8_t type;
uint8_t onOffState;
status = ZCL_ReadAttributeValue(APP_ENDPOINT_LIGHT, ONOFF_CLUSTER_ID, ZCL_CLUSTER_SIDE_SERVER,
ZCL_ONOFF_CLUSTER_ONOFF_SERVER_ATTRIBUTE_ID, &type, &onOffState);
... | 0 |
292d0c7db2357e9bbcbeb55d6baf3cae | 13545b998a6ef20454c0b0aa7497fd1f | Определение ТИЦ | def TI(df):
df = TAlib(df)
df = pd.concat([df, pd.DataFrame(BIAS(df['close'], 20), columns=['bias']).set_index(df.index),
pd.DataFrame(AMA(df), columns=['ama']),
pd.DataFrame(PSY(df['close'], 24), columns=['psy']).set_index(df.index),
pd.DataFrame(DPO(... | 0 |
def6b25b2ef42f5b6857733bb8de367e | 26cad14e2fa120c08f09e72504bafe66 | 验证多个group portal多次开启,关闭,wifi连接和portal功能正常--执行2次 | log.debug("050")
tmp = CPBusiness(self.driver)
portal_title,redirect_title,again_title,expiration_title = tmp.\
check_radius_portal(data_wireless['all_ssid'],
data_wireless["short_wpa"],data_basic['wlan_pc'],
data_basic['lan_pc'],1,"testabc",
data_... | 0 |
6b87f91c44c1faab9a1688360a2d1b68 | 80746167c1213b3f99dfb8496f023d16 | A sign does not change its direction. | def test_resistance_sign_and_symmetry():
force = hrrla.force(boatspeed=2.)
force1 = hrrla.force(boatspeed=-2.)
assert force.x == -force1.x
assert force.x < 0 | 0 |
4bd3700d2ceea17d1e6296e1385da4ff | 2cafd771690258a89f4c4537c297b520 | 测试通过对象构造封闭委托。 | {
var delType = Type.GetType("InvokeByReflection.MyDelegate");
var mi = typeof(Program).GetTypeInfo().GetDeclaredMethod("Method");
var deleg = mi.CreateDelegate(delType);
deleg.DynamicInvoke(64);
} | 1 |
a9439b6f9422dce46dded3a54fb9c252 | 9c3870c425095d9e6b5020e50d0dc377 | Chuyển từ chuỗi sang KeyCode | {
try
{
return (KeyCode)Enum.Parse(typeof(KeyCode), inputVal, true);
}
catch (ArgumentException)
{
return KeyCode.None;
}
} | 1 |
68bbebeea9003a9d6db29cfc5b211d7a | e0962e46c098db36baa6855f3a126c5d | End callback thread | {
StopDelay();
{
CriticalSectionAuto AutoCS(m_ThreadCS);
m_ThreadRunning=false;
m_ThreadEnabled=false;
}
if (m_ThreadHandle) _endthreadex(ExitCode);
} | 1 |
bbcbc414d1d2aad546bc99127a3fa9ef | cd38384b302e9696409253991dcd6397 | Given a URL, and a dictionary of data to post to the URL, this function will send the requested data to that
URL, download the resulting page, convert it into a beautiful soup object, and return it | def get_response_object(url):
source = requests.get(url).text
soup = BeautifulSoup(source, 'lxml')
return soup | 0 |
d9a5e6b1d7cf0bd1665d4f466c8209e9 | a6b2cac11f0072a567262973eb0c5fd8 | Remove an instance listener | public class PredictionAppender extends JPanel implements DataSource,
TrainingSetProducer, TestSetProducer, Visible, BeanCommon, EventConstraints,
BatchClassifierListener, IncrementalClassifierListener,
BatchClustererListener, Serializable
@Override
public synchronized void removeInstanceListener(InstanceListen... | 1 |
70fc9d246aba636f5b1fd4900a797995 | e43d72a9bc75e7dc7b3ff2eaaa657fde | Append a command to the script. | class SudoScript:
def add_cmd(self, cmd, skip_if=False, comment=None):
if skip_if:
c = ScriptCommand(cmd, skip_if=True, comment=comment)
common.debug(f" [skip] {c.cmd!r}")
else:
c = ScriptCommand(cmd, skip_if=False, comment=comment)
common.debug(f" [... | 1 |
4049bbb6aadcf7d5d1f71cd676f49d8c | 858e9cab5c3403317937af152053b3f6 | Currently just checks if plotting sets with different dimensions
causes an exception, if does test fails. | def test_plot_pd_ax(explanation):
_, ax = plt.subplots(nrows=2, ncols=2)
with pytest.raises(ValueError) as err:
plot_pd(exp=explanation, features='all', ax=ax)
assert "Expected ax to have" in str(err.value) | 1 |
41dcf8b57787e38a0517b438919c1a8b | 22bc2581e1abb03278877621473faa2c | function for filtering names with all alphabets in lower case | function allLetter1()
{
var uname1 = document.registration.lname;
var letters1 = /^[A-Za-z]+$/;
if(uname1.value.match(letters1))
{
document.registration.email.focus();
document.getElementById('lnameError').innerHTML = " ";
return true;
}
else
{
document.getElementById('lname... | 0 |
7406a6ea9fc91e422e8b2d7327a0859a | a83159d204783e95da4c1753d28d6513 | Fetch the drift time quantity of the scan
Returns | resp = yield self.query('SWET?')
sweep_time = float(resp) * units.s
returnValue(sweep_time) | 0 |
956d14d0b4f57ba47b0cad68ab9f5656 | ecd2f30f3045955670e0b1d9ecdcf1ac | Gets policy general info by policy number | @Query(value = "select p from PrpCmain p where p.policyNo=:policyNo")
public PrpCmain findByPolicyNo(@Param("policyNo") String policyNo); | 1 |
d391d4b339288de1e1f5fdc9eb491445 | 174007c2ac5f1f242baf8f5a6f06de8f | 跳转帮主竞选页面 | public String mimaxiugei(HttpServletRequest request){
String cookie = CookieUtils.getCookieValue(request, COOKIE_NAME,true);
if(StringUtils.isEmpty(cookie)){
request.setAttribute("msg","你还没有登陆,请去登陆");
return "index";
}
Invetor invetor1 = JsonUtils.jsonToPojo(c... | 0 |
e5b3f3e930dfcf4c109c2475504ef20f | 4622243d8f57be08103289f5b175e582 | 根据店铺Id查询客户信息 | List<MemberInfoDto> selectMemberByStoreId(Integer storeId); | 1 |
a86b29573e7f782d7670bd746a7b6a18 | beb0f0c7fccf06b2e390024fd02a0993 | Returns the number of troopers in the slot | namespace RivieraStudio.Magic.Logic.GameObject.Component
public class LogicUnitStorageComponent : LogicComponent
public int GetUnitCount(int idx)
{
return this._slots[idx].GetCount();
} | 1 |
19f76dfa452e0e06162465680d2c20ae | 5e0e1014517e37e68af1a97e9d1275cb | 修改例题节点 基于点击修改事件 | function clickCTTC(){
let TL = document.querySelectorAll(".task_list");
let TN = document.querySelectorAll(".task_name");
let taskDelete = document.querySelectorAll(".task_content_d");
for(let i = 0; i<TL.length ; i++){
TL[i].onclick = function(){
let promptValue = prompt("你想改成啥");
if(promptValue &&... | 1 |
6bbeceadc88edcebc980fb4f8e9aee5c | 3d601f4d6571322862b48658c321a41c | Converts datetime.date object to string
output: '1978-05-14 | def datetime_obj_to_str(dt_obj):
return dt_obj.strftime('%d%b%Y') | 0 |
4fcfbd71bd7ab118294ecbbe2aecb771 | d1ffc5aa343442f3481189274f3e198a | importVocab token manager is read-only if output would be same as input | {
return ((OutputType == InputType) ||
(OutputType != EMaterialValueType::MaterialAttributes && InputType != EMaterialValueType::MaterialAttributes));
} | 1 |
702347efd70652cfa6e1cffcf7244d59 | 08f1a38bcaf72c9eebb85ab4f7c6a824 | Generate binding for the external OCaml API. | let generics = generics(db.upcast(), def.into());
let substs = generics.bound_vars_subst(db, DebruijnIndex::INNERMOST);
make_binders(
db,
&generics,
TyKind::FnDef(CallableDefId::FunctionId(def).to_chalk(db), substs).intern(Interner),
)
} | 0 |
e750157934443ec198461e97a227c3ba | 669e0ecfb2361bd44693a1e23603c7e8 | Called when the hitbox first collides with an object. Handles collision with enemies. | public class EnemyScript : MonoBehaviour
void OnCollisionEnter2D(Collision2D hit){
print ("I have been hit by " + hit.gameObject.name + "!");
if (hit.gameObject.name == "HitBox") {
hit.gameObject.GetComponent <PolygonCollider2D>().enabled = false;
canBeHit = false;
if ((stats.DEF < girlStats.ATK) && canBeH... | 1 |
f826530407efec791fbf7d87cd7f1fff | 2b0087bfcc7a57f80b299dcf80f74416 | Check that the user can perform the action. Die otherwise. | clearance_level = current_clearance_level
action = self.action_name
not_authorized! unless keeper.lets? clearance_level, action, self.class
end | 1 |
a20b9ebb9d75c2d1fdb51903259de267 | 0ffd3db3fa660f9a8d4f504801bc59ee | 根据用户id查询状态为2已支付的订单 | @Service
public class UserService
public List<Order> findAllByUserIdENo(int id){
OrderExample example=new OrderExample();
example.createCriteria().andUIdEqualTo(id).andOrderStateEqualTo(0);
return orderMapper.selectByExampleWithUser(example);
} | 0 |
6d83575616ead16cc2a118ff33bbab5b | bdb15b92cf4b290e29dddb52930c8c28 | 由檢視模式,轉為編輯模式 | {
try
{
ChangeFormMSTMode(FormViewMode.ReadOnly);
}
catch (Exception ex)
{
ErrorMsgLabel.Text = ex.Message;
}
finally { }
} | 0 |
e8ce91cd5d2132c3672055a84639e521 | d4111fb7a249909d1c8de4d504069f81 | Return the places within the bounding box that are "featured". Unlike featured_in_bounds,
this method uses a quick DB GIS query, then loads the actual results from the search engine. | with OfflineGeocoderCached(server, REDIS_CLIENT) as geoencoder:
result = geoencoder.query_by_anything_include_if_place(location)
return result | 0 |
faf73e0ae535cd86155d2fe8bfb54499 | 8492845c686ca0e37721fa0dee2857d6 | Get array of options accepted by this command.
An option may also accept a value, e.g. '-f some-file', '-f"some-file"' or
'--file some-file'.
'help' or 'h', and the value is either true (option accepts a value) or
false (option does not accept a value). | public String[] getCommandOptions(); | 1 |
f06326e11f3cf782a39b7b9eba6f8771 | e9d20af2d699b8c1943bedd048a002b3 | configure the RFM69 module | rfm69_init(VSPI, PCA301_PIN_SPI_CLK, PCA301_PIN_SPI_MISO, PCA301_PIN_SPI_MOSI, PCA301_PIN_SPI_SS, RFM69_IS_HW);
rfm69_opmode_set(RFM69_OPMODE_STANDBY);
rfm69_freq_carrier_khz(PCA301_FREQ_CARRIER_KHZ);
rfm69_bitrate_bs(PCA301_BITRATE_BS);
rfm69_dio_mapping_rx(0, RFM69_DIO0_RX_PAYLOADREADY_TX_TXREADY)... | 1 |
4347b78e7f77342986c2b1632719f265 | 6171a816f13a77425faa2a1c2b144af3 | 定義された変数のSetを返す | const VarSet* VariableFileParser::getVariables() const {
return &variables_;
} | 1 |
46aeab2aaca8afc9c29d8c1c318ef4fe | 4f5731cd86f7683395b00802776c6573 | Check permissions of a folder whether it should be writable - all of
its contents and subfolders should be writable. | Parameters.notNull("sourceGroup", sourceGroup);
Parameters.notNull("packageName", packageName);
FileObject fo = getFolderForPackage(sourceGroup, packageName, false);
while ((fo == null) && (packageName.lastIndexOf('.') != -1)) {
packageName = packageName.substring(0, packag... | 0 |
999136f8ea8719d580cd01f6982548e9 | de16605e6066cfa62517d6038b896b1f | Entry speed metric: Entry speed is calculated by dividing the length of the transcribed text by the
entry time (in seconds), multiplying by sixty (seconds in a minute), and dividing by five (the accepted
word length, including spaces (Yamada 1980)). Thus, the result is reported in words-per-minute (wpm).
currently the ... | def proc_to_seconds(val, entry):
return 60 * int(val) | 0 |
66a2ee720a861dc93bf7e7fc327fc0e1 | 645a4478162322e5e5aefc9bdc0d66c5 | 激励视频是否加载完毕 | play() {
this.judgeFreeVideo(this.data.src, this.data.free);
} | 0 |
548501ccd1685e5cd2c2085ff59ad53a | 32cdeb2c0cfe3dd080baa22aca3c221e | Processes product by setting link type and in case list type is search adds search parameters to details link | {
if($this->fullActionName === 'catalog_product_view'
&& $_product = $this->_coreRegistry->registry('current_product')
) {
$this->addVariable('list', 'detail');
$product = [
'id' => $_product->getId(),
'sku' => $_product->getSku(),
... | 0 |
8bec1f958883178d1c4e6001d8c01957 | 75abf29cadf81f4cee86ade87d36bf98 | 更新返航路径信息的动作 | try{
routeService.update(route);
setState(UPDATE_SUCCESS);
}catch(RuntimeException e){
setState(UPDATE_FAIL);
e.printStackTrace();
}
return list();
} | 1 |
2b28b27c4fba295a58fb952d9afbb516 | 4231910f301cb13b15fb068711552589 | 返回服务器对话框 | {
lock (syncRoot)
{
if (dlg == null || dlg.IsDisposed)
{
dlg = new FrmSerTCP();
dlg.TcpLog.Log("服务器开始启动监听数据...", udcRunLog.ELog.Content);
}
}
return dlg;
... | 1 |
fccf2dd737a1434e2f04be1dd7cd9d0b | 150af84f6e90d1cd2471993d95ae3b0a | detab | size_t detab(const char *s, char *t, unsigned w, size_t lim)
{
unsigned i, j;
for (i=j=0; s[i]!='\0' && j<lim; t[j++] = s[i++]) {
if (s[i] == '\t') {
do {
t[j++] = ' ';
} while (j%w);
i++;
}
}
t[j] = '\0';
return j;
} | 1 |
ce2c7b801bdcfb49b32292d2b6ba2f40 | 63e4c3d60a67be044c3f4be2014d4c86 | Register middlewares that intercept API requests and serialize it as JSON. | function initMiddlewares(app: Application): void {
app.use(express.json({ limit: '10mb' }));
const client = new DiscordClient().starts();
app.use('*', (req, res, next) => {
req['client'] = client;
next();
});
} | 1 |
cae043c1bb44f1c82a22b7e632145ab6 | 9e5e0a0a5ec067130e131a0f469c7652 | 返回QQ点歌XML | {
$itemTpl = "<Music>
<Title><![CDATA[%s]]></Title>
<Description><![CDATA[%s]]></Description>
<MusicUrl><![CDATA[%s]]></MusicUrl>
<HQMusicUrl><![CDATA[%s]]></HQMusicUrl>
</Music>";
$item_str = sprintf($itemTpl,$musicArrary['Title'],$musicArrary['Description'],$musicArrary['MusicUrl'],$musicArrary['HQMusicUrl']);... | 1 |
2322b8d0447246c9f321c4c4e5e9de82 | c3c2d0517b9b14010bbcaf38403bdec9 | Zmena mapy pomocou oznacenia riadku v tabulke - pohlad pre Join | void Game::placementToMap(int mapToBePlaced,int mapToPlace)
{
if (mapToBePlaced == 1 && mapToPlace == 2)
m_map1=m_map2;
else
m_map2=m_map2;
int numOfRobot = Robot::getNumOfCreatedRobots();
for (int i = 0; i < numOfRobot;i++)
{
int mapNumberOfRobot = m_robotArray[i]->getMapNum... | 0 |
5aece23d7604f10343255fcc1f5fc082 | de1ed3537112e5695e9767104ffb2729 | Calculates Term Frequency Value multiply by Inverse Document Frequency Value | class TFIDF(Feature):
def calcTFIDF(self, word, text):
return self.calcTF(word, text) * self.calcIDF(word) | 1 |
0e05ed777d91fbe2f24a3dae6b9d50dd | c8a875965600e6aca3bffa4763428a43 | Вычислить поэлементную операцию (ленивое) И со всеми элементами перечисления.
Перебор элементов перечисления производится до появления первого значения <see langword="false"/> | {
return At<T, bool>( array1, array2, λ => λ );
} | 0 |
590fb1c80917ad77f51040b5c49a5d09 | 46a997c5a9cb36d113940c23fb1d32a5 | mergeNamespaceManagement merges the default namespace management settings with the release specific settings | reservedNamespaces := map[string]bool{
"onepanel": true,
"application-system": true,
"cert-manager": true,
"istio-system": true,
"knative-serving": true,
"kube-public": true,
"kube-system": true,
"default": true,
}
defaultNamespace := manifest.GetValu... | 0 |
22a46e7011d873a7b85b5f173f915c00 | 2a40cd16c54c72bd2b8a0f014a048954 | 各ステージが星何個までクリアしているか表示する関数 | {
if(PlayerInformation.stageData.eClearState != EClearState.none)
{
PlayerInformation.stageData.InitData();
}
for (int i = 0; i < PlayerInformation.stageData.stagesStarCount.Length; i++)
{
exploreStages[i].SetStarCount(PlayerInformation.stageData.s... | 1 |
debd83c9a872d6ee265fa81627113ada | 3d022f86561f9b400de98efb099127dc | 水面の描画する関数 | bool CsiDrawDem::drawSea()
{
return drawData( m_vSea );
} | 1 |
63d2b693ba07d08997318be9b60121e9 | 80c4866876cd06d2d7a17463ef42d46d | 通过GET数据加载控制器以及控制器的方法,
如果未传入数据,则使用default控制器中的index方法 | $ctrlname = "Controller\HomeController";
$method = "index";
if(isset($get['ctrl'])){
$ctrlname = "Controller\\".ucfirst($get['ctrl'])."Controller";
}
$ctrl = new $ctrlname();
if(isset($get['method']) && method_exists($ctrl, $get['method'])){
$metho... | 1 |
e8f5f3665307768d305a168734d3bf93 | ac148118aeebec6a7ad67d3fdc1c7980 | ===========================================================================
DESCRIPTION
Initialize RTRE in CM and NV.
DEPENDENCIES
None
RETURNS
None
SIDE EFFECTS
None
=========================================================================== | void ui_init_rtre(void)
{
nv_item_type nvi;
nv_stat_enum_type result;
result = ui_get_nv (NV_RTRE_CONFIG_I, &nvi);
if(result != NV_DONE_S) {
#ifdef FEATURE_RTRE_DEFAULT_IS_NV
nvi.rtre_config = NV_RTRE_CONFIG_NV_ONLY;
#else
nvi.rtre_config = NV_RTRE_CONFIG_RUIM_ONLY;
#endif
(void) ui_put_nv (NV_RTR... | 1 |
cf11948e23973e903726f59e607e2279 | ab9f4d404871835ff6df4219c64b91c7 | Gets the right bin specifier from the SVL plot. | def _get_suffix(bin, VoronoiSN):
if VoronoiSN is not None:
suffix = "SN{0:03d}".format(VoronoiSN)
else:
suffix = "bin{0:02d}".format(bin)
return suffix | 0 |
b47323fb30e71f4e4ffcf509b638b364 | 73608c9ca71658e283153d73a15093ca | Generate bounding box deltas using proposls and matched ground truth bounding boxes. | box = tf.cast(box, tf.float32)
gt_box = tf.cast(gt_box, tf.float32)
height = box[:, 2] - box[:, 0]
width = box[:, 3] - box[:, 1]
center_y = box[:, 0] + 0.5 * height
center_x = box[:, 1] + 0.5 * width
gt_height = gt_box[:, 2] - gt_box[:, 0]
gt_width = gt_box[:, 3] - gt_box[:, 1]
gt_ce... | 1 |
6cc9d53645ff6d2719eae762182eae6b | 0da180c4d5604077c63f67e29729b4ac | Returns product that is currently edited | class Mage_Adminhtml_Block_Catalog_Product_Edit extends Mage_Adminhtml_Block_Widget
public function getProduct()
{
return Mage::registry('current_product');
} | 1 |
d45dc171ba12a11870e06ee324745a6a | 5edb2e44062ac81dcf7fccdc6c4ec1f9 | Check if a template name has been specified and if it doesn't exceed the maximum length (50 characters). | def check_name(name):
return len(name) >= 1 and len(name) <= 50 | 1 |
a27bd91a7ac3f36a645ae078e0a83480 | 145e8ab9fb32f428e1b2c0506b71317d | save the state before entering the loop, for calculation later of the merge at the loop top | void msagraph::RememberState()
{
vars->prevMSAMode=vars->msaMode;
vars->prevFreqMode=vars->freqBand;
vars->prevPath=vars->path;
gGetXAxisRange(vars->prevStartF, vars->prevEndF);
vars->prevBaseF=vars->baseFrequency;
gGetIsLinear(vars->prevXIsLinear, vars->prevY1IsLinear, vars->prevY2IsLinear);
vars->prevSt... | 1 |
a58eb52fcf9b4ed8133ee19f27fe9924 | 0f0303c36e69d7dbf2e7dfaf8a6a152b | Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it.
A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". | class AutomaticScaling extends \DrSlump\Protobuf\Message
public function getMinPendingLatency(){
return $this->_get(9);
} | 1 |
6aea2b164182910d4f572f69424502a7 | 984c21369d36ffe37a1046f1111143c2 | Plots direction names. | if self.plot_type[ax_nr-1] == 'b':
angle = np.deg2rad(np.array(bearing))
ax = self.ax[ax_nr][side]
ax.set_theta_zero_location('N')
ax.set_theta_direction(-1)
ax.plot(angle, magnitude, *args, **kwargs)
self.fig.show() | 0 |
7e3751f1b3f9d7752d1e09474100d163 | 694e62a31a49eed2a403a272d2f6e975 | GET: Nutritionist | {
ApplicationUser user = UserManager.FindById(User.Identity.GetUserId());
List<MenuModels> menu = db.MenuModels.Where(x => x.FoodVendorName == user.FoodVendorName).ToList();
return View(menu);
} | 0 |
57c469674029bc664763296d382bb593 | c413f634775fb734c4baac25e056128c | Returns the meta object for the attribute '{@link org.talend.designer.core.model.utils.emf.talendfile.RoutinesParameterType#getId <em>Id</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EList<Parameter> getIdParams(); | 0 |
110693b38c0192d2041296dc567de315 | 4aa601453eb6c5e65aac2ee375ed011f | Gets a random date-time value between the given minimum and maximum. | {
if (min < 0)
{
throw new ArgumentOutOfRangeException(nameof(min), "min cannot be less than 0.");
}
if (twentyfourHours && max > 23)
{
throw new ArgumentOutOfRangeException(nameof(max), "max cannot be greater than 23 fo... | 0 |
2e7de0a8cce198c7c38122ad9fea6fff | 8d634e27c9f21ed40e32c4fefbf7ebc5 | Get the staged stats of the pokemon. | public class Pokemon{
public Stats.IdentifyStats getIdentStats() { return IS; } | 0 |
568f5dbc9e43cd1e3b708fc265c3762c | a722ac8f1f248b404ed9d07eea88fe2f | True if has "PrecedingMessageID" element | boolean isSetPrecedingMessageID(); | 1 |
a92c9be7ff3cf0d5937b28a79350cf64 | cb96ecd16c3501834708b4c383581598 | 双指针,A走完走B路,B走完走A路 | int lenA=getLen(headA), lenB=getLen(headB);
if(lenA>lenB){
for(int i=0;i<lenA-lenB;++i) headA=headA->next;
}else{
for(int i=0;i<lenB-lenA;++i) headB=headB->next;
}
while(headA!=NULL && headB!=NULL && headA!=headB){
headA=headA->next;
... | 0 |
9939fd38e68210cdf1843f4f91a3bb7d | 4b442719d2fbe63b95b33ad0aeb2f3eb | Convert the current time into the format of [HH:mm:ss] | public class DateTimeUtil
public String getTime()
{
String hours , minutes , seconds;
if (this.getHour() < 10)
{
hours = "0" + this.getHour();
}
else
{
hours = String.valueOf(this.getHour());
}
if (this.getMinute() < 10)
{
minutes = "0" + this.getMinute();
}
else
{
minutes = String.... | 1 |
057c1056f4e176ec42fc8a966897d381 | 7b2f5435aecf98d5e34a988f09478dd4 | fetching saved article from local database | class SavedNewsFragment : Fragment(R.layout.fragment_saved_news)
private fun observeNewsFromDB(){
viewModel.getSavedNews().observe(viewLifecycleOwner, Observer { articles ->
newsAdapter.differ.submitList(articles)
})
} | 1 |
c3b012dc72303a575f4b68aa65d6b10f | e5fe408bc81e7dd168bc2fa8ba042f8b | 自动装配(通过类型) | def autowired(type):
return Autowired.get(type) | 1 |
1ab84372a7911ea4e9a64fba6628abb7 | 4e85227eb0531ec40f75f0e354f2758a | 可视化预测结果,支持中文标签 | converter = utils.strLabelConverter(alphabet)
image = cropped_image.convert('L')
w = int(image.size[0] / (280 * 1.0 / params.imgW))
transformer = dataset.resizeNormalize((w, 32))
image = transformer(image)
image = image.view(1, *image.size())
model.eval()
preds = model(image)
print("... | 0 |
ce7d56fdad6b9a2017ce665725cfcd64 | 75ba45d2f03d55148350d557abb0c166 | printf wrapper for debugging | void debugPointer(void *ptr, size_t size) {
fprintf(stderr, "(ptr=%p, size=%zu)\n", ptr, size);
} | 1 |
f531f9c8725c70d6110940616cd3661a | 8aa665c309cac84e5b5cc07cf10e6a3c | When a request is made for the page this method initialize the state for the page.==> same as onGet while onPost handles form submissions | class Pegawai extends Component
public function mount(Request $r)
{
$this->resetPage();
} | 1 |
80720f36191bb413cd94575778fd2071 | b3fef26184f273451276781c4901d10d | Отправить сообщение в Твиттере. | namespace Solar.Models
public class Client : NotifyObject, IDisposable
public Task<bool> Post(AccountToken account, string text)
{
return Post(account, text, (_, s) => _.Statuses.Update(ShortenUrls(Settings.Default.Post.AutoShortenUrl, s)));
} | 1 |
d1dac5170d3dda001561d9d8326eec80 | 2a9ff40e4b503511db8ecf843e3f4f7b | 得到当前帐户上传的未挂接的电子全文 | String status = "0";
int pageIndex = 1;
int pageSize = 1;
if(CommonUtil.stringIsNULL(userId)){
return "noUserId";
}
userId = userId.replace("'", "").replace("\"", "").replace("\r\n", "");
Employee dep_c = employeeService.findEmployeeById(userId);
if(null == dep_c){
return "noDepId";
}
String d... | 1 |
c1b892c2e9b8d9c8b2a5345d232f8679 | 28f9bc5f314260b1e2188796f3f771a9 | 컨텐츠 권한 목록을 가져온다. | @Service
@Transactional(readOnly = true)
public class ContentServiceImpl implements ContentService
@Override
public List<ContentAuth> getContentAuthList(Map<String, Object> map) {
return contentMapper.selectContentAuthList(map);
} | 1 |
064de179b0c8b702147e9d157a584936 | 96769550f97a95da41370bd91da4457a | 6.实时的改变数量,并保存到cookie中 | @Controller
@RequestMapping("/cart")
public class CartController
@RequestMapping("/updateItemNum")
public void updateItemNum(Integer id,Integer num,HttpServletRequest request,HttpSession session,HttpServletResponse response)
{
System.out.println("id"+id+"num"+num);
User user = (User)session.getAttri... | 1 |
081b1c2b73cb548c78440a43edde385e | 4f708bb15ae5428c566d7bd71b640e0a | Gets the value of the headline property.
possible object is
{@link String } | class StandardSingleImageSpecsDetailModule implements ModelInterface, \ArrayAccess
public function setHeadline($headline)
{
$this->container['headline'] = $headline;
return $this;
} | 0 |
67c2c49b786b3b2e31fa0c6188e21d77 | 1075b5226e2539dab866b9cc0901c20a | Set a speed coefficient for particles.\n
This value is multiplied by the direction of the particle to get the final velocity | [RequireComponent(typeof(Rigidbody2D))]
public class LG_Movable : MonoBehaviour
public void AddSpeedCoef(float _coef)
{
if (_coef != 0)
speedCoef *= _coef;
} | 1 |
2dd91c33a7295e4a49d528e3857aa3bf | 83a541a0ab3915f7515f739c21779848 | 根据用户appId获取用户supplierId | Long getSupplierId(Long userId); | 0 |
85ef47631bbac09e140595bd3fc08e7d | 895cd0ed8d0da4ddc69d5f743cd557b3 | Get header name for specific LOB. | @AutoEscape
public String getLob(); | 0 |
03f9496766d01fc22ddeae46315352d1 | 6d250822c9ed340a57c46eeef7f45517 | #https://stackoverflow.com/questions/1185408/converting-from-longitude-latitude-to-cartesian-coordinates | if (hem %in% c("N","S","E","W")) {
x <- lapply(strsplit(x,sep), as.numeric)
x <- unlist(lapply(x, function(y) (y[1]+y[2]/60+y[3]/3600)))
ifelse(hem %in% c("N","E"),
ifelse(x>0,mult <- 1, mult <- -1),
ifelse(x<0,mult <- 1, mult <- -1))
x <- x*mult
x
} else {
print("Error... | 0 |
d757fecba42521812eccac96d0cd31b7 | dca3071147b358fa483aeea227db1706 | 显示时间,到当前时间的倒计时 | function displayTime(){
var last = Player.timer.time;
var hours = Math.floor(last / 3600);
if(hours < 10){
hours = "0" + hours;
}
var minutes = Math.floor((last - hours * 3600) / 60);
if(minutes < 10){
minutes = "0" + minutes;
}
var seconds = last % 60;
if(seconds < 10){
seconds ... | 0 |
3c333f455dfbdde1fbd6bf8e1dea0060 | 25c76bf70787c54657a1e8224edca99c | Gets the last index of the visible. | export class LiveRepeatDirective<T = any, E = {}> extends EventEmitter<LiveRepeatEvents<T> & E> implements Directive, RepetitiveTemplateSource<T>
getLastVisibleIndex() {
return Math.max(0, locateLastVisibleIndex(this.scroller, this.sliderChildren.getChildren()))
} | 1 |
b4e291c275c2efe10fe6c3b6a9320966 | 11ee83cd63dd226a3d5fecf75051b1b3 | Search for a video - e.g. UFC 01 and verify output. | async function searchForVideos() {
let youtubeService = new YoutubeService(process.env.MICRO_API_TOKEN);
let rsp = await youtubeService.search({
query: "donuts",
});
console.log(rsp);
} | 0 |
0da5f49f3bff0fc48cd05ab306365df1 | b8a00e798bd7a3df04160e28f6b5ac40 | GET: LogGroupings | {
var model = new PanelView()
{
Groups = unitOfWork.Repository<Group>().GetAll(),
};
return View(model);
} | 1 |
80c9d34870617da73b6fd45dd0f7bb4b | 28cf5823708f46fe780548716c316afe | Adds a point to the end of the list relative to the last point. | [RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
public class FlexibleLine : MonoBehaviour
protected void AddPointToEnd(Vector3 position, bool connected)
{
AddPointToEnd(position, GetNewPointWidth(pointCount), GetNewPointDirection(pointCount, connected), connected);
} | 1 |
9afdba0bdb660cbe9feeddb9516e34ac | b543797a42cf3b947680fd4416f6b196 | CopyArchive downloads files and directories as a tarball and saves it to a specified path. | if _, err := archiver.ByExtension(src); err == nil {
return archiver.Unarchive(src, dest)
}
in, err := os.Open(src)
if err != nil {
return err
}
defer in.Close()
out, err := os.Create(filepath.Join(dest, filepath.Base(urlPath)))
if err != nil {
return fmt.Errorf("Creating out: %v", err)
}
defer out.Clos... | 0 |
e319994a7b63287e049a3385f1beb24b | 3bc5d837059ef477a91e50130e8e7c01 | tighten view around data limits | class ImagePlot(pg.PlotWidget) :
def fix_viewrange(self) :
logger.debug('<{}>fix_viewrange().'.format(self.name))
[[x_min, x_max], [y_min, y_max]] = self.get_limits()
self.setLimits(xMin=x_min, xMax=x_max, yMin=y_min, yMax=y_max,
maxXRange=x_max-x_min, maxYRange=y_max-y_min... | 1 |
ad9a8c5a60fa1a5db0b7e0324fa4c97f | 0d402b6e95ecbcfc109076f9ab65f830 | Attribute for ordering by mailing type | export class MailItem
public get mailType(): any {
return this._mailType;
} | 0 |
1334ec1f1220ab6f5cc326ecb0caf2b9 | 83868ecce065c9024c898b992b4f0638 | Retrieve all the reservations for a certain car type | const post_type = type === 'car' ? 'vehicle_order/' : 'camp_order/';
const url = `${this.api.uri}${post_type}?type=order`;
return this.http.get(url).map(res => res as OrderCarRes[]);
} | 1 |
261408d1d2fa2e4df040de6170a28b9a | 0ed84b2d0c7875f6e4976fe67cc86a00 | Ritorna l'url del glmarket.xml | class Marketplace extends \app\models\base\MarketplaceBase
public function getLink($scheme = false)
{
return Url::to([
'/marketplace/index',
'subSubSubDomain' => $this->domain_alias,
'subSubDomain' => $this->country->domain_alias
], $scheme);
} | 0 |
fa02ba03f02272af9fb0912ed9c76701 | c8d535128c37165d3bb2dd844d0a0c11 | Get the button attributes. | {
$arr = array_copy_default($this->data['buttons'][$name], $this->get_button_fields());
$arr['name'] = $name;
return $arr;
} | 1 |
30197342dd5e0112ec85648beb8f1dfc | 89f35edf966bbcae1f5c4e84263db623 | Clear the replay queue. | class ClientPlayback:
def stop_replay(self) -> None:
self.flows = []
ctx.master.addons.trigger("update", []) | 1 |
1660bdc0c7e67df952a2ac0a5f133d58 | 79f4922e6c32f9d21ad35b199f0b2d3b | Manually sets the requirements that are LEFT in order for the quest to complete. | class DestinyRecordDefinition implements \Bungie\D1\Model\ModelInterface, ArrayAccess
public function setRequirements($requirements)
{
$this->container['requirements'] = $requirements;
return $this;
} | 1 |
37a4bac188ba90bdd7311d3e6604a343 | 168dcca0452380cde44496eaaa00215d | Gets the trainings of this Project. | public class TrainingsImpl implements Trainings
public List<Iteration> getIterations(UUID projectId) {
return getIterationsWithServiceResponseAsync(projectId).toBlocking().single().body();
} | 0 |
3ca714f366ff1d330186a3bb47e7648a | 17ff0dde8f40574c41e9532b84c53941 | 移除长按标识符 | class DeveloperLayout(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : FrameLayout(context, attrs, defStyleAttr){
private fun removeLongClickCallback(){
removeCallbacks(longClickAction)
longClickAction=null
touchView=null
} | 1 |
144cab938d13574ec0de3885830d2340 | 76bf3b57cb4a49ea83d6f6a6559db4bc | será responsável por retornar o HTML preenchido com os dados de um pedido | {
$pedido = $this->repository->find($id);
$itenspedido = $this->itenspedidorepository->findWhere(['pedido_id'=>$id]);
return view('pedidos.show', compact('pedido', 'itenspedido'));
} | 1 |
13861e61d46071750bc99957b57b2332 | 24fccfb1459829021644928ed396ad91 | Gets categories and dispatches actions | function initApplication(){
return function(dispatch){
dispatch(getCatPage(0, 'gifs'))
dispatch(getCatPage(0, 'images'))
dispatch(getCatFavourites())
dispatch(getRandomCategoriesPage())
}
} | 1 |
606eab3d11a51daf6e1a9b411a58da3a | 2be903c550d3bafe5af422c898abcb4e | 查询当前货币符号,并缓存在文件中(每天跟新一次) | url = "https://api.bitfinex.com/v1/symbols_details"
response = requests.request("GET", url)
symbol_info = json.loads(response.text)
_save_data('bitfinex_symbol_info.pk', symbol_info)
pass | 1 |
156b87f5738fc94fb230775ba4b0755d | b737673e46dea4157208f3a2390a8184 | Visar text som innehåller information om liv, poäng samt topp-poäng. | {
showText("Red Lives Left: " + redlives, 100, 50);
showText("Blue Lives Left: " + bluelives, 1100, 50);
} | 0 |
4d0d671f7617f3296cd1ecf2d12651c8 | 72b3ef82dbf318687fe5f446cdca0d7c | Verifies that the actual QueueEntry's filename is equal to the given one. | {
var fileEntry = other as ProcessingEntry;
if (fileEntry == null)
return false;
return string.Equals(other.Path, Path, StringComparison.OrdinalIgnoreCase);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.