query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
a1958335fe326bc995b7301cd4741856 | 1d3356606e9d3f804b3933f3e2d6275e | Формира податочно множество со tf-idf тежини и класи, соодветно за класификација со дрва на одлука. | def get_kw_features():
res = cluster_docs(dff, pre_process="tf-idf", cluster_type="em")
r = dict(res)
res_df = pd.DataFrame(r.values())
res_df.columns = ["class"]
res_df.index = r.keys()
print("Finished clustering")
res_label = pd.concat([res_df, dff], axis=1)
all_res_label=res_label.dro... | 0 |
e251056865f3deac614ba44505c03591 | 2336cdf0102ff670aaec9666b8801f0e | Returns the value of the '<em><b>Encrypted Admin Password</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Encrypted Admin Password</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc -->
annotation="http://openecomp.org type='configuration... | public String getCryptedPassword(); | 1 |
eb487690db68868c649a66ed9be4a33c | 2e401c8e499a278da3badd661856d84b | Set the compiled form of the formula. Note that this field is only valid
for account objects loaded from the database. | public class OBDMessage
public void setFormula(String formula) {
interpret = new FormulaInterpreter(formula);
} | 0 |
95dd63978ea45cc88a8aac2118c4df64 | 121d18f014753ae81f563d11dce70f00 | Called to indicate that the timer should start.
This is called right before {@link Command#initialize() initialize()} is, inside the
{@link Command#run() run()} method. | public class ShootBall extends CommandBase
@Override
public void initialize() {
timer.reset();
timer.start();
} | 0 |
fd55457b4b9320ae3fbaf988b1ae982a | f05d545d723752193efb302be2d1a921 | Checks if the recipient exists in the collection. | ArrayList<String> recipientArray = getSortedArrayOfRecipients(recipient);
DatabaseHandler dbHandler = dmApplication.getDatabaseHandler();
Cursor c = dbHandler.getAllRecipient();
if (c != null && c.getCount() >= 1) {
c.moveToFirst();
for (int index = 0; index < c.g... | 1 |
dabb42cab8c4b3c0f580038300e0cfd1 | 65e24fcfbdb48f58cc263aeff8b5fbcd | 用章申请-归还 | class GoodsController extends Controller{
public function return_pass($id){
$stu_id = session('stu_id');
$relation=M('relation')->where(array('stu_id'=>$stu_id))->find();
$role=M('role')->find($relation['role_id']);
if ($role['role_id']==1||$role['role_id']==2){
$lend_current =M('lend_goods')->find($id);
... | 1 |
0d0bcccb2a5fd7c254a232fbfd08a219 | 626f6cceb4315253ac7eb62744dd1c64 | Transforme à partir d'une "Tuile" un "Button" et l'ajoute à la liste de boutons | {
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(nombre + ".png", UriKind.Relative);
bi.EndInit();
var button = new KinectTileButton
{
Label = nombre.ToString(CultureInfo.CurrentCulture),
... | 1 |
cae2a4b90df9a727ba1baddf24a05334 | f3eb3700c36d7596ec162280f3f85afd | Sets the specified index to the specified value; used for placing bricks within the map. | public class Game extends Activity
private void setTile(int x, int y, int value)
{
puzzle[y * 3 + x] = value;
} | 1 |
312151c9264087b208ebb43db622fc01 | 7d5db66b7c95f51df0c7b19a203fe5ad | Limits the mouse position to within the window. | void LimitCursor(Point2D &mouse) {
if (mouse.x < 0)
mouse.x = 0;
if (mouse.x > MAX_COLS - 1)
mouse.x = MAX_COLS - 1;
if (mouse.y < 0)
mouse.y = 0;
if (mouse.y > MAX_ROWS - 1)
mouse.y = MAX_ROWS - 1;
} | 1 |
d91fbd34fbd0be905e714a73c62e5d6b | c01701b9494b611ccff50b23fc666dad | 主にデバッグに使用する、ログをLogcatに出力する関数
tagを指定しなければmyTagになる | String ltag=tag;
if(ltag==null){
ltag=TAG;
}else{
ltag=tag;
if(isDebug){
Log.v(ltag,msg);
}
}
} | 1 |
06c3ef66c08f20ca683a2031fe03344e | 437b6adc4cfa4e8c9fd6094c348e1b44 | 以分页的形式查找所有的维修车辆明细表列表 | public PageObject getCarRepairList(String strEnterpriseCode, String strWhId, String strProCode,
int... rowStartIdxAndCount) throws SQLException {
LogUtil.log("EJB:车辆维修明细查询开始", Level.INFO, null);
try {
String strSql = "";
String strSqlCount = "";
PageObject result = new PageObject();
strSql = "SELECT... | 1 |
eaad28cfae7df324602ff9f1348f8f7d | 0fa39116fc59cdd26497943b1117d627 | PKを指定して1件取得
ヒットしないときは例外 | class Model(dict, metaclass=ModelMetaclass):
async def find_pk(cls, pk, size=1):
rs = await select('%s where `%s`=?' % (cls.__select__,cls.__primary_key__), [pk], size)
if len(rs) == 0:
return None
print(cls(**rs[0]))
return cls(**rs[0]) | 0 |
918b8a397e01a78815a5faf927c39470 | df0540913bbd800226dc7b22b9914c8d | When a key is pressed in the email text field. | class EmailHint extends React.Component
handleInputKeyUp(event, index) {
let selectedIndex = this.state.selectedIndex;
let emailTypeLength = this.state.filterEmail.length - 1;
let indexNum = selectedIndex;
if (index !== undefined) {
this.setState({
selectedIndex: index
});
}
... | 1 |
dbc4d6ad67b089b653b7fbb556392328 | ed1207d61b65df45b7b30a908323b2b1 | Clears all the framgment back stack, the right panel can show only the
current selected contents. | class FragmentManager
@JvmOverloads fun clearBackstack(frManager: FragmentManager? = null) {
val fm = frManager ?: fragmentManager
try {
fm.executePendingTransactions()
for (i in 0..fm.getBackStackEntryCount() - 1) {
fm.popBackStackImmediate(null, FragmentManager.... | 1 |
8f879b5beabdbbd10ae0ec0d3c648f8d | d95141a4f535c3a9d0f10357c8f0d084 | Reset the Exposure array | {
wxCriticalSectionLocker lck(DarkFrameLock);
CurrentDarkFrame = 0;
for (ExposureImgMap::const_iterator it = Darks.begin(); it != Darks.end(); ++it)
{
CurrentDarkFrame = it->second;
if (it->first >= exposureDuration)
break;
}
} | 0 |
0e10f3cdf6a5c6a54c81e33f464c42f0 | fd72125bd331731390b468bad0a541d7 | Adapted from https://github.com/alexa/alexa-end-to-end-slu/blob/main/dataprep/prepare_snips.py.
Creates train, test, and validation splits using the provided ratios. | data_path: str = None, **kwargs
) -> Tuple[List[Tuple[List[str], str]], List[Tuple[List[str], str]]]:
train_ratio = kwargs.get("train_ratio", 0.7)
with open(data_path, "r") as file_p:
data = json.load(file_p)
tokenized = {"positive": [], "negative": []}
for label, sentences in data.items():
... | 0 |
6b8bcaefb98e46936bf445bbac5cd586 | afcd29a36700865bb1218814a338fac3 | Checks whether the given factors rearrange to form the input number | List<Integer> factors = getFactors(number);
int sum = 0;
for (int factor : factors) {
sum += factor;
}
return sum == number;
} | 0 |
b814deb5439874608e5dff19050a3501 | 86752cadf35968998bb8a845e59587db | destroys a scene light list via its name | def lzc_destroy(name):
ret = _lib.lzc_destroy(name)
errors.lzc_destroy_translate_error(ret, name) | 1 |
9791bdb4b508f813195364f45abc4578 | a0899c657d7a6b0b67323c77b8ef1ba9 | 根据考试批次ID 和题型ID 获取 答案 | Long grade1 = testService.findTestById(testId).getFkTestGradeId();
Long grade2 = userQClient.findUserQById(userQId).getData().getFkUserQGradeId();
if(grade1 != grade2){
return null;
}
Example example = new Example(TestTopic.class);
Example.Criteria criteria = ... | 0 |
56c6aaafd9dcabf8d41064ddbcc0ad9a | d86e114a9f52a40f0095c5e88c9ae335 | Updates a AutomationExecutionLog Provides an action to update a AutomationExecutionLog, when AutomationExecutionLog id and the new details of AutomationExecutionLog are given | namespace OpenBots.Server.SDK.Api
List<AutomationParameter> ApiVapiVersionAutomationsAutomationIdUpdateParametersPost (string automationId, string apiVersion, string organizationId, List<AutomationParameter> body = null); | 0 |
26f88ef13f13eea15d81fd76ce69de6e | e94bf90135b30ff270ab58f66a575787 | Set the starting time of the job passed in parameter to the current time | public function setTimeStarted() {
$this->taskRepository->setTimeStarted($this->task);
} | 0 |
38a3beeb865ea50f1c2ca339973500a5 | b270f412d0efe901d0b838da39e8ecfa | ! Set or clear the \c CE pin.
\sa pin_CSN() | void set_CSN()
{
GPIOPinWrite(nrf_gpio_base, nrf_csn, nrf_csn);
} | 1 |
8512c1803dd6f2deeb020d56add131a0 | d18836532e96cb894d20b71d6db5065e | 修改AdminLog | $module_list = array(
'Admin' => '管理员',
);
$action_list = array(
'add' => '添加',
'save' => '编辑',
'update' => '编辑',
'insert' => '添加',
'delete' => '删除',
'toggle' => '快捷修改',
'edit' => '编辑',
);
if(isset($module_list[MODULE_NAME]) && i... | 0 |
5d4e9ac8f6acedf0879d9283287bb6b9 | b3bd46dd132b41b3cc3fc0b5cf613c7b | Maps the grid to a $[0,2\pi]x[0,2\pi]$ domain and returns the mesh-grid. | def mesh_grid(kernel_size):
ax = np.arange(-kernel_size // 2 + 1., kernel_size // 2 + 1.)
xx, yy = np.meshgrid(ax, ax)
xy = np.hstack((xx.reshape((kernel_size * kernel_size, 1)), yy.reshape(kernel_size * kernel_size,
1))).reshape(ker... | 0 |
6180df27fde8db8b03418143f48b42ee | fd8741abaeb4c19c217cdbaec94b97e5 | compte le nombre de cases où il y a la place pour poser un scrabble | {
int i,count=0;
for(i=0;i<6;i++)
{
if(tabtuiles[i]!=0)
{count++;}
}
return count;
} | 1 |
cd11345fd5383e22a0c6c506a4e5c33c | b0d940d4190d3f675f61cc9810af0b48 | Set集合中的元素按照元素根据lambda拷贝后的值(拷贝后为Integer类型)进行分组后再拷贝 | public void groupingByTest() {
Map<String, List<Employee>> stringListMap = Employee.EMPLOYEE_LIST.parallelStream().collect(Collectors.groupingBy(Employee::getName));
System.out.println(Arrays.toString(stringListMap.entrySet().toArray()));
Map<String, Long> stringLongMap = Employee.EMPLOYEE_L... | 0 |
612155cd9d470fb0cc761c890d3cfe44 | fbefc8f55e1b8f12c2c3dc07487ca7dd | Calcule l'efficacite totale du systeme. | class PCS_Option:
def eff(self):
W_t1 = self.t1a.W+self.t1b.W+self.t1c.W
W_turb = W_t1 + self.t2a.W+self.t2b.W+self.t3.W+self.t4.W+self.t5.W
W_pump = self.p1.W+self.p2.W+self.p3.W+self.p4.W+self.p5.W
return (W_turb - W_pump) / (self.phx.Q_th/1000) | 1 |
f58444275c7c3a9efc071293355785ed | c4208d02ea987b12187b29b74b186b88 | Create a <div> element for the message and append it at the end of the
<body> element. The style rule associated with it makes it the proper
size and puts it in the proper location, except that its horizontal
positioning must be calculated, since it depends on the width of the
browser window. | function createMessageDialog(board_element , width){
return $("<div/>", {
"class": CLASS_MESSAGE_DIALOG ,
"style": "display:none;width:" + width * 2/3 + "px;left:" + width / 6 + "px;"
}).appendTo(board_element);
} | 0 |
0aefd2a2f4441bfd5370d1d7e3438751 | 5b6be71a960d5c6b17723b0de2af241d | 分用户统计待加入beidou账面的缓存金额
返回值描述如下:
Map的Key为用户ID
Map的Value为对应用户的缓存余额 | Map<Integer, Double> getBalanceByOrgIds(Set<Integer> orgIds); | 0 |
1d6dc8710e07109292e5c275a0502c9d | 641f35ab5ce54ad4db07ef2e611f7725 | This has the responsibility to validate whether the user has got admin rights to execute the api | {
if($this->segment(1) == 'api')
{
return true;
}
if(!Auth::check())
{
return false;
}
$user = Auth::user();
return $user->is('admin');
} | 1 |
02222af89368abe9ac6628a7007d4774 | fbf848b7e86b983e12c8d740bb891b11 | 將傳進來的資料藉由type1,type2分類並加總個數 | public partial class Category : System.Web.UI.Page
private DataTable GetJournalCount(string category,int type,string year) {
DataTable table = new DataTable();
table.Columns.Add(new DataColumn("count1", typeof(int)));
table.Columns.Add(new DataColumn("count2", typeof(int)));
table.Column... | 1 |
57dee780e6d700a223ca6d39aced450b | 715a465fa5b31bc6923b425247e90253 | Extract the token if present from the request args. | class CSRFProtection
protected function extractToken()
{
if ($this->request->input('token') === false) {
if (!$this->request->getHeader('X-JS-CLIENTS-TOKEN')) {
return 'token';
}
return $this->request->getHeader('X-JS-CLIENTS-TOKEN');
}
ret... | 1 |
a54d7d396a26a1d5a1af47de3e5153f3 | ae2f498d95436b487d2999e76b3c9f25 | 获取分类为linux的所有文章 | url = 'http://www.lylinux.org/api/get_recent_posts/'
res = self.UserAgent(url)
jsons = self.GetJsons(url)
posts = jsons['posts']
articles = self.parsepost(posts)
return articles | 0 |
c2c08b8048ad5549b3e15b5b70d3c6b6 | de07a6cd7e32ae6a625d940f5090c515 | 均方误差损失 | loss = 0.0
for i in range(len(Y)):
loss += pow((my_Y[i] - Y[i]), 2)
loss = 0.5 * loss * 1.0 / n
return loss | 1 |
d9d8ff814f3ab8135ff39cf82e014974 | f516f13700142e5706a1f20079027890 | 获取 当前 Logic 层名称 | class Lambda
public function getLogic()
{
return $this->logic;
} | 0 |
e53c3bd86ca814688892d97cf8b09f4d | ca2cb8aebe2f920d6b19f6a7585e68a1 | Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
this one). Args: x, y, z | {
float f = 0.0F;
BlockPos posTemp = pos;
for (int i = 0; i < 4 ; ++i)
{
posTemp = posTemp.down();
if (worldIn.getBlockState(posTemp).getBlock() == ModBlocks.CUCUMBER_STEM)
{
f = ((BlockCucumberStem) worldIn.getBlockState(posTemp).getBlock()).getGrowthChance(worldI... | 0 |
382fb0312040ffa6298c46a1bec8c21c | 2f9bae240cbc5b19ce5a28a4aa26c3d0 | Возврат размера стека. | size_t stack::size() const
{
return stack_size;
} | 1 |
c8c429d4781f29f677807c7322c0e861 | 45da30a2eea126e56806615c7d59f7ef | Apply an "in" constraint to the named property (Dapper.Net) | params object[] values)
{
return new MultiValueCondition(logicalOperator, isNot, propertyName, Operator.In, values);
} | 1 |
edd1ce0ce2c26a76d8825481e105d674 | baeb4ca631695cdb51c0af0d90414613 | 获取当前年的开始时间 yyyy-MM-dd hh:mm:ss | public class DateHelper
public static Timestamp getCurrentYearFirstDay() {
String year = getCurrentYearStr();
String time = year + "-01-01 00:00:00";
Timestamp ts = Timestamp.valueOf(time);
return ts;
} | 1 |
b85b36c3290c4e3887b59de336ec3928 | 584bc0ac2d2217991a8842ddac91ca37 | Delete Host vehicle which is out of range | {
if (h == null)
return;
LivedHost.Delete(h.HostSub.Ipv4Address.Address.ToString());
if (Config.EnableHostNotifyBroadcast && !Config.ForceOldContract)
{
Host[] list = LivedHost.Values.Where(s => s.HostSub.IPHeader != h.HostSub.IPHeader).Distinct(Helper.HostSubEqualityCompare.StaticObj).ToArray();
... | 0 |
8abedcc910a47497433927f287ff71d6 | e3b468ca4be629f4afeafff034cfebd1 | Filters [List] of [CheckboxStatus]
`checkboxStatus.isChecked()` as true. | if (this.scope) {
var hasChecked = false;
var hasUnchecked = false;
var items = (this.scope['items']);
if (items && items.length > 0) {
for (var i = 0, n = items.length; i < n; i++) {
if (!items[i].enabled) {
hasUnchecked = true;
} else {
... | 0 |
ca98da85e91fee4819be6ab656b96926 | f1831e78753b7c5b1e0b0ddc017778ff | Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information. | namespace Melanchall.DryWetMidi.Common
int IConvertible.ToInt32(IFormatProvider provider)
{
return ((IConvertible)_value).ToInt32(provider);
} | 0 |
dae3d8d33d7a0673752ffa5533e3e92a | 797cc22aca4650fb52a07fa795d6b95d | Pomožna funkcija za razveljavitev označitve objekta. | oznaka = str(oznaka)
if oznaka != self.oznakaModela:
self.oznakaModela = oznaka | 0 |
bfed6ec45703fae13b5f8ec027f050f9 | 7984782f0acab9853d132c935c36885c | orthographic
projection for a window with lower - left corner(\a left, \a bottom),
upper - right corner(\a right, \a top), and the specified \a nearPlane
and \a farPlane clipping planes. | Matrix44 OrthographicProjection(float left, float right, float bottom, float top, float nearClip, float farClip)
{
float h = right - left;
float v = top - bottom;
float e = farClip - nearClip;
float tx = -(right + left) / h;
float ty = -(top + bottom) / v;
float tz = -(farClip + nearClip) / e;
... | 1 |
6a8c268a8ce00b60c01f60a30c848704 | bca2e55993faab3e5c6eb902f9a82930 | 这个函数实现对于诗歌背景的初始化 | def writePoetry():
turtle.penup()
turtle.goto(400, -150)
turtle.pencolor((255, 255, 0))
potery = ["但\n愿\n人\n长\n久\n", "千\n里\n共\n婵\n娟\n"]
coordinates = [(300, -150), (200, -150), (100, -150)]
for i, p in enumerate(potery):
turtle.write(p, align="center", font=("STXingkai", 50, "bold"))
if (i + 1) != len(potery)... | 0 |
afdb7bd576a8a669895dc1dada99275f | f0e6c14a31d9631949997cfb88234a29 | 清空离线的criteria | function spEvaluateDoClear(){
$('#searchOnlineForm').form('reset');
} | 0 |
1ee1e68b8b0929f8ec1e814ceb74fbbb | de8ca3e4fccbaf6ca556ff9d9c778b4b | 根据spid查询详情 | return await new Promise((resolve, reject) => {
this.service.getspdataById(obj).then(
(obj:pageBean) =>{
resolve(obj);
}
).catch(
obj=>{
console.log(obj);
}
);
})
} | 1 |
fa5ab0c010c0d361d40689a210b19110 | f39aa1c2fb5d0d71649dce18d6557c86 | Does the event that is trying to be saved have an end date & time? | boolean hasEndTime(); | 1 |
bd9bee1f06f235cc805d39f2fa81e7b9 | 9397fac37de2d57a70d3fe18bde4447d | Wait for this future to be completed without {@link InterruptedException}.
This method catches an {@link InterruptedException} and discards it silently. | public void await() throws InterruptedException, TimeoutException; | 0 |
73697a90e8db47d1dd1cb5502f630646 | f55138b0b90ee321444b2de49faa28cf | Refolds a partially vectorised tensor into a full one | def _unvec(x, matrix_shape):
return tf.reshape(x, ps.concat([ps.shape(x)[:-1], matrix_shape], axis=0)) | 1 |
3d41d11602b18ac861c47a82576a8773 | 761e909414f698d5c7e0ab523ad2391e | Setup Traffic Class.
Fill in TC parameters in single MUSDK TC config entry. | unsigned char tfCls,
unsigned char handlingPrio,
UmtsQoSTrafficClass* trafficClass)
{
if (tfCls == 1)
{
*trafficClass = UMTS_QOS_CLASS_CONVERSATIONAL;
}
else if (tfCls == 2)
{
*trafficClass = UMTS_QOS_CLASS_STREAMING;
}
el... | 1 |
029bdaccc52cb7424438b0d75f4dfa0e | 6a0b61ad9fa438d51815ada01a6217fe | 加载用户链表 | {
user_head_t* head = (user_head_t*)calloc(1, sizeof(user_head_t));
if(NULL == head){
return NULL;
}
head->next = NULL;
return head;
} | 0 |
d21b5fbeb12a98f0edc560f3c48f85c8 | c96e979b599665e56b9385d33032ae91 | Tests for unit status reason. | def check_unit(serv_load, serv_active, serv_sub):
if serv_load == 'loaded':
if serv_active == 'failed' or serv_sub == 'failed':
return Problem.failed
if serv_sub == 'dead':
return Problem.dead
else:
if serv_active != 'inactive':
return Problem.not_load... | 1 |
6dd449bde221f62ef1ff6f72c14f53a6 | e342394bfa88ad9775adac4908ec06d8 | The snippet finder (a default is used if none provided). | public class SnippetConfigurer extends
AbstractNestedConfigurer<RestDocumentationMockMvcConfigurer>
public SnippetConfigurer withDefaults(Snippet... defaultSnippets) {
this.defaultSnippets = Arrays.asList(defaultSnippets);
return this;
} | 1 |
45d34202c3fdfaf854a00ad3cf4dc7ce | 57782ac11bb914c0c07fa7fdd93fe0a6 | Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.MoreOrEqualThan <em>More Or Equal Than</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getMoreThan_RightOperand(); | 0 |
25daeb5fcb648e4f15148f874c62f397 | ebe39be74e6ba7745b4501196935740c | My function to interpolate between two colors completely, returning an array | var ret = [0, 0, 0];
ret[0] = Math.floor((percent * c1[0]) + ((1 - percent) * c2[0]))%255;
ret[1] = Math.floor((percent * c1[1]) + ((1 - percent) * c2[1]))%255;
ret[2] = Math.floor((percent * c1[2]) + ((1 - percent) * c2[2]))%255;
return ret;
} | 1 |
0605ba12a92fd6adb66b714d470e046e | 30c97c54f3b6b1869c15116ae7c59bda | Handles the ExcelExportClick event of the Actions control. | namespace Kendo.Mvc.UI.Fluent
public class PivotGridEventBuilder: EventBuilder
public PivotGridEventBuilder ExcelExport(string handler)
{
Handler("excelExport", handler);
return this;
} | 0 |
ee966357b694709120948a8dfecd48fd | f1ebace24f3777e2f210dfe86d27a9db | returns true if value is not set yet, false otherwise | function issetnotval($variable, $value) {
return isset($variable) && $variable != $value;
} | 0 |
89d563b9319a214915d9a71b95671dca | 0e4a8a655689de31dbad6c998495edb5 | Function to perform an implicit finite
difference method on american options, using the
PSOR algorithm above. | d_eta = 1
d_xi = 1
m = M
n = N
for j in range(n-2, 0, -1):
for i in range(1, m-1):
x_eta = (X[i, j+1] - X[i, j-1]) / 2 / d_eta
y_eta = (Y[i, j+1] - Y[i, j-1]) / 2 / d_eta
x_xi = (X[i+1, j] - X[i-1, j]) / 2 / d_xi
y_xi = (Y[i+1, j] - Y[i-1, j]) ... | 0 |
8932d64c264baa4a03dfa339e03267f4 | 215ed6e3f6aafef085661aea1a5ec9c3 | Load HTML5 Blank styles | {
if (HTML5_DEBUG) {
wp_register_style('normalize', get_template_directory_uri() . '/bower_components/normalize.css/normalize.css', array(), '3.0.1');
wp_enqueue_style('normalize');
wp_register_style('slick-lightbox-style', get_template_directory_uri() . '/css/lib/slick-lightbox.css', array(... | 1 |
def3d8d120465ba957b3574133100e70 | f1d6c78101ed5bd66bf41527b965d3fd | Generate symbolic graph for adversarial examples and return. | LOGGER.debug(TAG, 'start to generate adv image.')
arr_x, arr_y = check_pair_numpy_param('inputs', inputs, 'labels', labels)
self._dtype = arr_x.dtype
adv_list = list()
for original_x, label_y in zip(arr_x, arr_y):
adv_list.append(self._optimize(
origin... | 0 |
7e7ba26d168b44dc94dfc8f37917f8e1 | 464a808a54c31e2f0ce0f2d398bea4e8 | 改正商品 | public class ProductMgr
private void fixBitch(ProductDetailBean data) {
if (data.skuInfo != null) {
String styleName = "";
if (data.skuInfo.style != null) {
if (data.skuInfo.style.name.length() > 0) {
int num = data.skuInfo.style.name.charAt(0);
... | 1 |
febef5dd0fad69740413dc7ad71d143d | 4410bc3dd6fc2a80a8dccd6b7c460ca5 | 帖子点赞列表查询 | class UserLikeController extends Controller
private function forum_like_list()
{
$object_id = I('post.object_id');
$map = [
'ul.object_id'=>$object_id,
'ul.other_id'=>0,
'ul.status'=>0,
];
$field = 'mu.id as user_id,mu.headpic,mu.nickname,mu.level,... | 1 |
004118f8fc847ecc95c5a7555f24581a | 0c9ea701a95fd8d9906566f5b2899e86 | retrieve the tags for this loc prod | public abstract class Invent_Data
protected void Get_ProdLoc_(Int32 Ctrl_Id, Int32 InstID, ref DataTable dtLoc)
{
SqlCommand com = null;
using (SqlConnection con = new SqlConnection(ReturnConString()))
{
con.Open();
com = new SqlCommand();
com.Connection ... | 0 |
72b18d33b7a8016bf2caed90e9ee92af | 67de4ca34c04dac3385a236f5acb6629 | 自动回复图文的模板 | {
$tpl = "<xml>
<ToUserName><![CDATA[%s]]></ToUserName>
<FromUserName><![CDATA[%s]]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><![CDATA[news]]></MsgType>
<ArticleCount>1</ArticleCount>
<Arti... | 1 |
43f176ff097ea6381a25669ac312ca25 | 8eaf746cb28e6de8a254190fa9733050 | You need to cook pancakes, but you are very hungry. As known, one needs to fry a pancake one minute on each side. What is the minimum time you need to cook n pancakes, if you can put on the frying pan only m pancakes at a time? n and m are positive integers between 1 and 1000. | if (m < n)
return 0;
int k = 1;
int j = 1;
for (int i = n; i >= 1; i--) {
k = k * m;
j = j * n;
m--;
n--;
}
return k / j;
} | 0 |
91adaf9374124827b5c7c8129bf26717 | feb58a4a599d468827b04436e545af94 | Start prompt and return value.
Returns:
int: The status of the prompt. | name = name.replace('_', ' ').title()
if description:
prompt = '{} ({}): '.format(name, description)
else:
prompt = '{}: '.format(name)
if default is _empty:
return input(prompt)
else:
return self._prompt_for_value(prompt, default) | 0 |
f1a1399f369377d67ee476d3d40b53b4 | 5fee8aed0f47be891adfd2883ee1f974 | Override this method to be notified when a Box2D contact begins | public void beginContact (Contact contact, Collidable other); | 1 |
5fa38667864f74511faf92ec4dcd8c80 | ac6075d25303584f25b3e1b5c2fd0f9c | Tests a duplicate add of a router interface. | l3_arg = L3IntfArg(lia_eth_port=0,
lia_l3_intf=self._pcfg.pc_l3_intfs[0])
self.assertEqual(self.warp17_call('ConfigureL3Intf', l3_arg).e_code, 0,
'Configure First L3 Intf')
self.assertEqual(self.warp17_call('ConfigureL3Intf', l3_arg).e_code,
... | 1 |
79e7071101cf141996545eb9236058f5 | 51f920241ec2139d839c0c3f03308aaf | Implementation of the link-state routing algorithm | {
Route *rtc;
Route *rtt;
unsigned int *cost;
int src_rid;
int dst_rid;
int rid;
cost = (int *) malloc(sizeof(int) * ort->numOfRouters);
memset(cost, 0, sizeof(int) * ort->numOfRouters);
cost[my_rid] = 0;
for (rid = 0; rid < ort->numOfRouters; rid++) {
if (my_rid != rid) cost[rid] = 0xffffffff;... | 1 |
ad4a4a5720690ec09a6f110e8ce472c4 | 38cd94203b4334b2e3161e4ed5490a87 | 現在のViewIdに対応するPageオブジェクトを返す. | {
View v = null;
if (null != mPageRoot)
{
v = mPageRoot.findViewById(id);
}
return v;
} | 0 |
427b8a02a9afbbaddbcbe9347b780704 | 3eb2b7860d9830edd59f459ec5d2932a | 比较两个矩阵是否相等,条件:行、列数相同,所有位置相同的对应元素值相同 | if(matrixA.length != matrixB.length || (matrixA.length != 0 && matrixA[0].length != matrixB[0].length))
return false;
for (int i = 0; i < matrixA.length; i++) {
for (int j = 0; j < matrixA[0].length; j++) {
if(!matrixA[i][j].equals(matrixB[i][j]))
... | 1 |
aec53e9be9e63e8b02f01fd51e196062 | d1e1b369e06df275b2191bcddd5460a1 | eliminate buses from the output
all buses are iteratively tracked back to the source
all components are then reconnected to their true source | r = False
for i in range(len(bus)):
if bus[i] == ['']:
bus.pop(i)
r = True
break
if r:
bus = recursive_remove(bus)
return bus | 0 |
fe898e2f7afaed530db5e1b6842b3138 | 0df02f42bdb8d4bffaa40567cc3ed414 | Удаляет из текста все слова, которые заканчиваются на заданный символ. | namespace ZimaHrm.Core.Infrastructure.Extensions
public static class StringExtensions
public static string RemoveCharacters(this string text, params char[] characters)
{
return ReplaceCharactersWithString(text, "", characters);
} | 0 |
a88cb009f1b456864daa234f3c3b0bc3 | e5590c43806d95dfec618787849361af | @brief 返回内参矩阵 | {
ori[0] = m_ori[0];
ori[1] = m_ori[1];
ori[2] = m_ori[2];
ori[3] = m_ori[3];
return true;
} | 0 |
95c05ba0d485958e164879d2a2d2780b | c3a2bc1ff505f39dff7e5b10366c4fda | Gets the selected annotation collection. | {
IEnumFeature pSelected;
IFeature pFeature;
IArray FeatureArray = new ArrayClass();
pSelected = (IEnumFeature)pMap.FeatureSelection;
pSelected.Reset();
pFeature = pSelected.Next();
FeatureArray.RemoveAll();
while (p... | 0 |
d75c4c81561265f97df86360de13d27e | ffa1e7a2c3e96b8eda6a3a0880900d9b | !
@brief device joystick initialization function.
This function initializes the device joystick with the composite device class information. | {
g_deviceComposite = deviceComposite;
for (uint8_t i = 0; i < USB_DEVICE_CONFIG_CDC_ACM; i++)
{
g_deviceComposite->cdcVcom[i].lineCoding = (uint8_t *)&s_lineCoding[i];
g_deviceComposite->cdcVcom[i].abstractState = (uint8_t *)&s_abstractState[i];
g_deviceComposite->cdcVcom[i].country... | 0 |
b454ed2b89cba78ae474dffb9365ec47 | 0bd99ff882ee45be7f8215b111f04dd7 | Answers the value stored for key, if there is one | char *kv_store_read(char *key){
} | 1 |
c0b70ca47053339d12ad73a118ec7ec4 | 993a908e09b6f9bb043fb7ef64858f9f | Get the {@code id} value.
Can be {@code null}. | @Nullable
public Long getId(); | 1 |
e02239beac62183eb259820218e9d752 | dd142315898f6f08ddf7478a4d6f86e4 | Following will avoid to add deuplicate Order # in database | namespace CS5
class OrderService
public void Insert(Order order)
{
foreach (Order o in orderList)
{
if (o.orderId.Equals(order.orderId))
{
throw new Exception($"order-{order.orderId} is already existed!");
}
... | 1 |
89e6ec03934b6df866eae00298ad14f5 | 6b4129325359cd8e87b83321da6abfce | 在标签闭合出创建父子关系 | function handleEnd(parse,index){
parse.tag = matchReg$().toLowerCase();
let isIfEnd = /endif|else|elseif/i.test(parse.tag)&&/elseif|if|else/i.test(parse.parent.tag);
let isEachEnd = /endeach|eachItem/i.test(parse.tag)&&/eachItem|each/i.test(parse.parent.tag);
if(parse.parent&&(parse.tag==parse.parent.ta... | 1 |
942627fb5dbb528f70df09894fc3ba0c | 56d8654dd4ea4209d18928616b204ff9 | 重写方法,注入指定的Dao对象. | public class Span42200 extends ModuleExecuterModule<BaseDaoEx>
@Override
protected void setModuleDao(BaseDao parent) {
this.moduleDAO = new BaseDaoEx(parent);
} | 1 |
c654630d51a49f183e9b671aa5955e48 | 36969de2f289762d4f6b26f77383ea08 | Add a new element to <oneofs> | class TDInputBuilder(object):
def add_oneof_rule(self, domain, type):
self.__oneof_rules.append((domain, type)) | 1 |
448baf9525debcf809f41298302568e5 | 6ce3d99544431230e050ff6ab4a4fbc6 | OpenStackProvidersCatalogService constructor. | BuildService $buildService, BlueprintService $blueprintService,
EnvironmentConfigurationService $environmentConfigurationService, DockerAccessService $dockerAccessService,
RancherService $rancherService) {
parent::__construct();
$this->rancherAccessService = $rancherAccessService;
$this->dockerService = ... | 0 |
c51a9bb1ac7f3257ce82d74e2ffb1fc4 | 26024089fa57b178eacf70c48115381a | This method waits until the aggregateRunningStatistics are loaded.
Uses a boolean that is set to true by the handleEvent method. | {
String loadedURL =
aggregationURL + "&CANCEL_QUERY=1&QUERY_ID=" + queryId;
String response = XmlUtils.requestString(loadedURL, null);
return response.equals("0");
} | 0 |
861f4a26658edf9f453b837cf9935269 | 1eabdc00fc716c79412b89d9f73a1309 | 实现功能:从文件中加载学生数据
输入参数:无
返回值 :学生链表 | {
ifstream ifs(filename_student);
if(!ifs)
{
cout<<"文件打开失败"<<endl;
exit(0);
}
Student *q=head;
while(ifs.peek()!=EOF)
{
Student *p=new Student;
ifs>>p->Name
>>ws
>>p->Number
>>ws
>>p->Sex
>>ws
>>p->Academy
>>ws
>>p->Class
>>ws;
ifs>>p->Less.n>>ws;
for(int i=0;i<p->Less.n;... | 1 |
d54710ef8ed2f5932ada1becd9cc0526 | 61c90764d1ff2490401b054ccb53a37c | Both processes should return False | class FullSyncPeriodicTimerTest(unittest.TestCase):
def test_full_sync_pt_multi_process_check_false(self) -> None:
mp_dict = spawn_multi_process(2, "gloo", self._full_sync_worker_without_timeout)
self.assertFalse(mp_dict[0])
self.assertFalse(mp_dict[1]) | 1 |
58021d2eb83c4d0c5d6bd4a506a78790 | 3a515a3b52741ae0d79cef129f8379e7 | Return the current version of the AdGuard Home instance. | class ADAPI:
def get_ad_version() -> str:
return utils.__version__ | 0 |
a62d0b2758e6910e5193deb1a246ef8f | 17b3cbc37c8adf420eb6adb42625d139 | getting transaction detail from database by no of transaction or date wise | class Transaction_model extends CI_Model{
public function get_transaction_detail($autoid)
{
$this->db->order_by('RecNo');
return $this->db->get_where('Inventory_Transaction_Detail', array('Transact_AutoID'=>$autoid))->result_array();
} | 0 |
eb7d2d650c57ae48675f04af97e2fcd5 | 509cfc0efd1483231599ebf81746befe | 固定资产期初余额 | @Bean(table = "F_CASE_MST", timeStampProperty = "modifyDate")
public class FCaseMstEntity implements BaseEntity
@Column("FINANCING_RATES_INIT")
public BigDecimal getFinancingRatesInit() {
return financingRatesInit;
} | 0 |
a6fcb83b3a11b76c579988a713121af9 | aa89e0eda659278dd28b4e9cbeee874b | 修复安卓手机软键盘遮挡的问题
在 iframe 内部点击输入框弹出软键盘后,浏览器不会自动聚焦到输入框,从而导致软键盘遮挡住输入框。输入一个字可以恢复。 | function useFixInputFocusScroll() {
useEffect(() => {
if (/iPhone|iPod|iPad/i.test(navigator.userAgent)) {
let timeoutId: ReturnType<typeof setTimeout>;
let previousScrollY = 0;
const onFocusOut = (event: FocusEvent) => {
if (isEventTargetTagNameSame(event, 'input')) {
timeoutI... | 0 |
c410dc14bfb1e8ffab6b01192e9ef2f4 | a94cc39183ceb1d50ae194d6268e58ad | <p>
Updates a hypervisor metadata, including its host, username, and password. Specify which hypervisor to update
using the Amazon Resource Name (ARN) of the hypervisor in your request.
</p>
target="_top">AWS API Documentation</a> | namespace Amazon.BackupGateway
IAsyncResult BeginImportHypervisorConfiguration(ImportHypervisorConfigurationRequest request, AsyncCallback callback, object state); | 0 |
c684bc25ed9cb1f5946251c23b63ce79 | 9158514ab7982ffcc93377d216dec844 | (Optional) Id of existing driver record. | public class DriverMessageParam extends BaseParam{
public void setDriverid(String driverid) {
this.driverid = driverid;
} | 1 |
3d59598a67c514d8d63b15f9d5220843 | 7923f1322f839176feb851700548ad3a | Displays Live Statistics from the unit. CPU, RAM, Packets/Sec | try:
net_stat = p.net_io_counters()
bytes_sent, bytes_recvd = bc.format_size(net_stat[0]), bc.format_size(net_stat[1])
packets_sent, packets_recvd = net_stat[2], net_stat[3]
err_pkt_in, err_pkt_out = net_stat[4], net_stat[5]
drpd_pkt_in, drpd_pkt_out = net_stat[6], net_stat[7]
pkt_data = {'bytes... | 0 |
5d0dd3ccbb12fa1ec87831cc9cb58fc7 | ed0438331fc25bf50536b9226e790411 | retorna el src del avatar de 50px. Se usa en el list del backend | class User extends Favoriteador
public function getAvatarPerfil()
{
return $this->getAvatar(self::AVATAR_SIZE_PERFIL);
} | 1 |
45654da0cdd7a2843df3e953f65e485f | 0061259db235358084aeadb2f24bb0a2 | Retrieves the stored purity reports. | public class WaterReportTracker implements Serializable
public void setPurityReports(Collection<WaterPurityReport> purityReports) {
this.purityReports = new ArrayList<>();
this.purityReports.addAll(purityReports);
} | 0 |
c547efd07a78b581d419d4a5f0d8f8be | 65dec77173476f07d1b07286ecfadeea | @brief Send all requests of the given type | void get_all_req(Request_TypeDef* all_request_copy,Direction_Enm_TypeDef direction)
{
if(direction==UP)
{
for (uint8_t i = 0; i < NUMBER_FLOOR; i++)
{
memcpy((Request_TypeDef*)all_request_copy, (Request_TypeDef*)&all_requestsUP[i].request, sizeof(Request_TypeDef));
}
}
else if(direction==DOWN)... | 0 |
2e5c18b4310ccf91af74f69cd05a91aa | a3c635a0de0d3ab49e6582630423f53e | 通过Thread 线程等待的方式来判断元素是否存在 | {
float fSec=0;
if (bWaitElementExistBeforeAction)
{
bool is_exist = z_is_exist_by_attribute(attr_name,attr_value,exactly,frame);
while(!is_exist)
{
Thread.Sleep(500);
is_exist = z_is_exis... | 1 |
c51c8b88f398567e64549fb3a4baa8b5 | f94f86e4682ffc23ed2c0df849a426c7 | 重新创建一个会话工厂 | public class HibernateUtil
public static void rebuildSesstionFactory() {
try {
Configuration configuration = new Configuration().configure();
sessionFactory = configuration.buildSessionFactory();
} catch (Exception e) {
System.err.println("Error Creating SessionF... | 1 |
ed404e4c16fee5c2fea579cd663eae9e | 4ca396471ce52fb4e5d20faaf85981c9 | 1) add security account information | @Insert({"INSERT INTO t_security (user_id,photo_album_id,question,answer) VALUES (#{userId},#{photoAlbumId},#{question},#{answer}) "})
void addSecurity(Long userId, Long photoAlbumId, String question, String answer) throws SQLException; | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.