query_id
string
corpus_id
string
query
string
code
string
label
int64
1d6dc8710e07109292e5c275a0502c9d
8b036040d220def03532d3be7a0f7d24
This has the responsibility to validate whether the user has got admin rights to execute the api
export class AdminUserListService isAdmin() { return this.httpClient.get(`${this.API_URL}/sessioncheckeradmin`) }
1
02222af89368abe9ac6628a7007d4774
0cb8e25be830c4029539055fc942caf4
將傳進來的資料藉由type1,type2分類並加總個數
function typeDataBack(typeArray){ var dataArray=[]; for(var x=0;x<typeArray.length;x++){ dataArray[x] = {}; dataArray[x].name = typeArray[x]; var number = 0; for(var i=0;i<mainData.data.length;i++){ if(mainData.data[i].type === typeArray[x]){ number +=...
1
57dee780e6d700a223ca6d39aced450b
e757903eb1c39cb5c474f29b78ca04d2
Extract the token if present from the request args.
return unless authorization_request = authorization?(env) return unless authorization_request[TOKEN_REGEX] params = token_params_from(authorization_request) [params.shift[1], RocketIO.indifferent_params(Hash[params])] end
1
a54d7d396a26a1d5a1af47de3e5153f3
1d11820a0a65b489893532354ea17755
获取分类为linux的所有文章
$res_pid = db('category')->where('mark','gongcheng')->field('id')->find(); $res = db('article')->alias('a') ->join('pics b','b.aid=a.id') ->where('a.cid',$res_pid['id']) ->field('a.id,a.title,a.desc,a.content,b.pic') ->select(); return $res; }
0
c2c08b8048ad5549b3e15b5b70d3c6b6
9776439bec946a6254dc187dce0b75fa
均方误差损失
def Loss(y_pred, y): y_pred = y_pred.reshape(-1,1) y = np.array(y).reshape(-1,1) return 0.5 * np.mean((y_pred - y) ** 2)
1
9a501f0e001c98223ac80ad0640736e0
c6cbaa742eb5fa9f2945cdaaec836b95
检查语音提醒的线程
new Thread(){ public void run(){ recordList = dbManager.queryOldClock1(); if(recordList.size()>=1){ playMusic(); } for(int i = 0; i< recordList.size(); i++){ Log.e("TAG", "Notificationservice nsta...
1
e53c3bd86ca814688892d97cf8b09f4d
4d545b085db0344b70284bd1ff289580
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
double getCropGrowthMultiplier();
0
382fb0312040ffa6298c46a1bec8c21c
c98f4b5e910e10f4bd1617e66d55e119
Возврат размера стека.
class Stack(): def size(self): return len(self.stek)
1
c8c429d4781f29f677807c7322c0e861
a25cc7e6333ac9baea786c27c14806e5
Apply an "in" constraint to the named property (Dapper.Net)
public static partial class Extensions public static ISqlBuilder In<TEntity>(this ISqlBuilder source, Expression<Func<TEntity, object>> expression, Action<ISqlBuilder> action) where TEntity : class { if (source == null) throw new ArgumentNullException(nameof(source)); if (source ...
1
edd1ce0ce2c26a76d8825481e105d674
46f007f3f4f00629807e89b445b12082
获取当前年的开始时间 yyyy-MM-dd hh:mm:ss
public class DateUtils public static Date getCurrentYearStart() { return DateTime.now().withDayOfYear(1).withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0).toDate(); }
1
b85b36c3290c4e3887b59de336ec3928
d06247472605c779cd0bfddb3319d8ec
Delete Host vehicle which is out of range
{ List<int> result = await VehicleRepository.GetDisconnectedVehicle(GetRequestInterval()) ; new SharedMethods().ChangeVehicleStatus(result, fireBaseSettings.DbURL, fireBaseSettings.DisconnectedUrl); _response.HandlePresenter(new ListResultDto<int>(result, result.Count)); ...
0
8abedcc910a47497433927f287ff71d6
ef78716633f8a3a5a73d556e1b07fc8d
Filters [List] of [CheckboxStatus] `checkboxStatus.isChecked()` as true.
for (i = 0; i < data.length; i++) { $('#data-tables').find('tr[aria-label="'+data[i].key+'"]').find('.slds-checkbox-button').addClass('slds-checkbox-button_is-checked'); $('#data-tables').find('tr[aria-label="'+data[i].key+'"]').find('.slds-checkbox-button').find('use').attr('xlink:href','/assets/icons/utilit...
0
ca98da85e91fee4819be6ab656b96926
17d46e4dd9cb7d8b470e3530b8d7475c
Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information.
namespace Unify.Framework public int ToInt32(IFormatProvider provider) { return Convert.ToInt32(_Value); }
0
dae3d8d33d7a0673752ffa5533e3e92a
1ca175a43e92152c157853c3c2b841e8
Pomožna funkcija za razveljavitev označitve objekta.
char pronadjiZnak(char rijec[]) { char c; for (int i = 0; i < strlen(rijec); i++) { if (rijec[i] == '+') { c = rijec[i + 1]; } else if (rijec[i] == '-') { c = ' '; } } return c; }
0
bfed6ec45703fae13b5f8ec027f050f9
30f68f4e34ce32223b1ca8807fa693e1
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.
class Matrix4(BaseMatrix4): def orthogonal_projection(cls, left, right, top, bottom, near, far, dtype=None): rml = right - left tmb = top - bottom fmn = far - near A = 2. / rml B = 2. / tmb C = -2. / fmn Tx = -(right + left) / rml ...
1
6a8c268a8ce00b60c01f60a30c848704
67b32fd47837347e31d58fcb0b1dac64
这个函数实现对于诗歌背景的初始化
public class Sample protected void initializeBackground(){ perBaseBack=new BackgroundCollection(); perBaseBack.addBackgroundModel(new PoissonBackgroundModel(-1, config.getPerBaseLogConf(), getHitCount(), config.getGenome().getGenomeLength(), config.getMappableGenomeProp(), 1, '.', 1, true)); }
0
d9c17e6ebc43057cd19d444d62ee019f
037d2dad24747d2fa742333edc415ce3
Timer callback, schedule advertisement event here.
{ push_button_cfg_t *cfg = (push_button_cfg_t *)os_timer_get_context(&handle); if (cfg) { pb_enqueue(cfg, 0); os_timer_reset(&cfg->adv_timer); } }
1
1ee1e68b8b0929f8ec1e814ceb74fbbb
d626a0dbb05d9298d71fb15f5e46203f
根据spid查询详情
@Controller //请求映射路径 @RequestMapping("/SpinfoOrder") @SuppressWarnings("all") public class zyqController @RequestMapping("/querySpinfoOrderById") public @ResponseBody List<Map> querySpinfoOrderById(Integer soid) { return zs.querySpinfoOrderById(soid); }
0
fa5ab0c010c0d361d40689a210b19110
1ab4c82618aa2c00ea1d9089296801e8
Does the event that is trying to be saved have an end date & time?
public function hasEndDate(): bool;
1
bd9bee1f06f235cc805d39f2fa81e7b9
4aaae848305637c6b9fb492e12bc68f6
Wait for this future to be completed without {@link InterruptedException}. This method catches an {@link InterruptedException} and discards it silently.
Future<V> await() throws InterruptedException;
0
73697a90e8db47d1dd1cb5502f630646
1a4fafd5556d22769b71b0196712d2c4
Refolds a partially vectorised tensor into a full one
class Evolver: def unflatten_tensors(vector, variables): unflattened = [] initial = 0 for var in variables: shape_list = var.get_shape().as_list() slice = 1 for i in range(len(shape_list)): slice *= shape_list[i] new_shape = tuple(...
1
3d41d11602b18ac861c47a82576a8773
1384aacf3b0eee97076b5ea99d148acb
Setup Traffic Class. Fill in TC parameters in single MUSDK TC config entry.
{ PRV_TGF_NOT_SUPPORTED_DEV_CHECK_MAC( prvTgfDevNum, UTF_CH1_E | UTF_CH1_DIAMOND_E | UTF_CH2_E | UTF_CH3_E | UTF_PUMA_E); prvTgfPclIpv4UdpQosConfigSet(); prvTgfPclIpv4UdpQosTrafficGenerate(); prvTgfPclIpv4UdpQosAdditionalConfigSet(); prvTgfPclIpv4UdpQosAdditionalTrafficGenerate(); ...
0
5d3d3bc5969ec5c4b063b295999c725a
655c02f7da1430bac7272a025b19e2f6
Gets the apex of super jump trajectory.
public class Parabola public Point2D.Double getApex() { TheVector normal = direct.getNormal(); Point2D secP = normal.getOtherPoint(focus, true); Line ortogonal = Line.approximate(focus, secP); Point2D intersection = Line.lineSystem(direct, ortogonal); Point2D.Double apex = new Po...
1
d21b5fbeb12a98f0edc560f3c48f85c8
29f3f45632ab4f22374fb981e7fc12c6
Tests for unit status reason.
namespace HPHP namespace UnitChange changeReason( const CachedFilePtr& cachedUnit, const struct stat& s, const RepoOptions& options, Stream::Wrapper* wrapper, bool forAutoloadHit ) { auto const checkStat = [&] { if (forAutoloadHit) { return cachedUnit->dirty.load(std::memory_order_acquire); } ...
1
6dd449bde221f62ef1ff6f72c14f53a6
587a0f0610f70b04df30a96f65bc05a8
The snippet finder (a default is used if none provided).
class CompositeTool(BaseTool, Folder): def findSnippets(self, **kwargs): st = getToolByName(self, 'portal_skins') ct = getToolByName(self, 'portal_catalog') f_params = {'search_sub':1} c_params = {'portal_type':'CompositePack Viewlet'} mt = kwargs.get('meta_type') if mt i...
1
45d34202c3fdfaf854a00ad3cf4dc7ce
8a3355335b5744bfe4d1cde26650441f
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 -->
EClass getSuperiorOrEqual();
0
25daeb5fcb648e4f15148f874c62f397
5fc750c678ea215c38ac88f0aa4f4b5e
My function to interpolate between two colors completely, returning an array
color = [] for i in range(3): color.append( round((1-t) * from_color[i] + t * to_color[i]) ) return color
1
0605ba12a92fd6adb66b714d470e046e
e6a879333ed7e0c9fa02752ffe1dddd1
Handles the ExcelExportClick event of the Actions control.
namespace AutotaskCorporation.Autotask.Web.UI.PopulatedWebControls.Reporting public class ReportViewerBase : Page protected void ExportButton_Click(object sender, EventArgs e) { this.ReportLayout.Report.ExportToExcel = true; this.GenerateReportButton_Click(sender, e); }
0
4f4a72a508ceb2acfae26cc52099d3c2
72844c27d5f9017c3b497701dc6dee6e
記事のHTMLソースが取得された際に呼び出されます。
{ string contentType = client.ResponseHeaders[HttpResponseHeader.ContentType]; Regex reCharset = new Regex(@"charset=([0-9a-zA-Z-]+)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); Encoding responseEncoding = null; string charset = null; if...
1
89d563b9319a214915d9a71b95671dca
13e310078b2330d7a9ee87b844f43bbc
Function to perform an implicit finite difference method on american options, using the PSOR algorithm above.
void ImplicitFDM(double *V, double xmax, int M, int N, double K, double r, double sigma, double T) { double *u0, *u; double k, alpha, beta, a, dt, dx, tau; double *e, *f, *g, *x, *y; int i, j, iopt; u0=(double *)malloc(sizeof(double)*(2*N+1)); u =(double *)malloc(sizeof(double)*(2*N+1)); e =(double *)mall...
0
8932d64c264baa4a03dfa339e03267f4
159a62162cd461499403d3b603c2145a
Load HTML5 Blank styles
function html5blank_styles() { wp_register_style('html5blank', get_template_directory_uri() . '/style.css', array(), '1.0'); wp_enqueue_style('html5blank'); }
1
abdcc2255f634147e7f0c3dc06194e8e
50fea97d8c650eccd75218a83d510195
Creates array of shortest words.
def shortest(list): p = 100 s = [] for item in list: if len(item) < p: s = [item] p = len(item) elif len(item) == p: s.append(item) return s
1
7e7ba26d168b44dc94dfc8f37917f8e1
ace4fbf92b59604aeb60cb6a4fbfbcc6
改正商品
@RequestMapping("/fix/sku/{productId}") public ResponseObject<Boolean> fixSku(@PathVariable String productId) { log.debug("----"); System.out.print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); productService.fixSku(productId); return new ResponseObject<Boolean>(Boolean.TRUE); }
1
febef5dd0fad69740413dc7ad71d143d
faa5ccfe2373303d2b4e41dab4e3fa39
帖子点赞列表查询
Map map = new HashedMap(); map.put("userid", userid); map.put("type", 1); return sharesService.querySharePostList(map, pager); }
0
6be545be019655182dcb8f4ed2da9e50
01792fead5d8996107e8a457b36aa06f
Adds a property editor layer to the end of the layout.
namespace NanoByte.Common.StructureEditor public partial class ContainerDescription<TContainer> [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Generics used as type-safe reflection replacement.")] public ContainerDescription<TContainer> AddProperty<T...
1
72b18d33b7a8016bf2caed90e9ee92af
f5cda63bcd8c670bc9e01681ca60301b
自动回复图文的模板
{ $textTpl = ' <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[image]]></MsgType> <Image> ...
0
43f176ff097ea6381a25669ac312ca25
d988550af5dca02bc8de82d032fc5c51
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 (n <= 0) { return -1; } if (n == 1) { return 1; } vector<int> u(n); u[0] = 1; int t2 = 0, t3 = 0, t5 = 0; for (int i = 1; i < n; i++) { int cur = min(min(u[t2] * 2, u[t3] * 3), u[t5]*5); u[i] = cur; if (cur == u[t2] * 2) { t2++; ...
0
91adaf9374124827b5c7c8129bf26717
331b7069bce67160758c1a08b6067c99
Start prompt and return value. Returns: int: The status of the prompt.
prompt_pattern = get_prompt_pattern("", self.comms_prompt_pattern) self.transport.set_timeout(1000) self.transport.write(self.comms_return_char) LOG.debug(f"Write (sending return character): {repr(self.comms_return_char)}") output = b"" while True: output += s...
0
f1a1399f369377d67ee476d3d40b53b4
4095dc21d628bf7bcf9d66fc1e07ca19
Override this method to be notified when a Box2D contact begins
class CPhysics2DProxy: public b2ContactListener, public b2Draw void BeginContact(b2Contact* contact) { m_System->BeginContact(contact); }
1
5fa38667864f74511faf92ec4dcd8c80
c9a33027c8d11d6cfee53bd5aa4b3970
Tests a duplicate add of a router interface.
class InterfaceConfigTest(unittest.TestCase): def test_duplicate_ip_failure(self): interface_cfg = NetworkInterfaceConfig('dummy0') interface_cfg.add_v4_ip(ip_address='10.0.241.123', prefix_length=24) with self.assertRaises(DuplicateIPError): interface...
1
79e7071101cf141996545eb9236058f5
5a28a0f872893b76680732284e7e99a7
Implementation of the link-state routing algorithm
for { if nodes[0].Active { m :=<- r myRound, _ := strconv.Atoi(nodes[0].Round) if m != "e\n"{ a := strings.Split(m, ":") recv_ID := a[0] init_ID := a[1] recv_dist, _ := strconv.Atoi(a[2]) recv...
1
ad4a4a5720690ec09a6f110e8ce472c4
f5b640b20bd8eef06aef4ed8e4f95c6a
現在のViewIdに対応するPageオブジェクトを返す.
@MainActivityScope public class AppView private PageView getPageView(PageKind pageKind) { return pageKind.isToday() ? mTodayPageView : mTomorowPageView; }
0
427b8a02a9afbbaddbcbe9347b780704
4c624b5a1c3e43a3735bacbbc369296a
比较两个矩阵是否相等,条件:行、列数相同,所有位置相同的对应元素值相同
function Application() function isEqualMatrix(matrix, secondMatrix) {}
1
aec53e9be9e63e8b02f01fd51e196062
1d7d0c3792f693a4525b4758888310f1
eliminate buses from the output all buses are iteratively tracked back to the source all components are then reconnected to their true source
int main (void){ simulate_one_bus(); return EXIT_SUCCESS; }
0
fe898e2f7afaed530db5e1b6842b3138
8f4b07de3035da9e808b3169cd934d08
Удаляет из текста все слова, которые заканчиваются на заданный символ.
{ $string = ""; for ($i = 0; $this->string[$i]; $i++) { if ($this->string[$i] !== $char) { $string .= $this->string[$i]; } } $this->string = $string; }
0
6850fb7db37885bcf5de692467ac63ff
4fecab723b20993216cf350cc6d31c72
时间转换为字符串格式(附带时区)
DateTime dateTime = new DateTime(date); dateTime = dateTime.withZone(DateTimeZone.forTimeZone(TimeZone.getTimeZone("GMT+8"))); return dateTime.toString(standard); }
1
bd83c723ead4f30144fc6e8d996c26b2
6212a0f4162b599dd137c513c3b67572
Given a String the method will sanitize the string, and convert '-' to '0' (zero)
public class BasePage protected String convertDashToZero(String s) { return sanitize(s).replace("-", "0"); }
1
d75c4c81561265f97df86360de13d27e
7a202b0a86c239cfbf7b8e9a46b15f24
! @brief device joystick initialization function. This function initializes the device joystick with the composite device class information.
{ g_deviceComposite = deviceComposite; g_deviceComposite->hidMouse.buffer = s_MouseBuffer; return kStatus_USB_Success; }
0
b454ed2b89cba78ae474dffb9365ec47
9590f8be2a425741577cea55a3eda7a2
Answers the value stored for key, if there is one
public class BST <Key extends Comparable<Key>, Value> public boolean lookup(Key key){ if(key == null) throw new NullPointerException("Argument to lookup() is null"); return getVal(key) != null; }
0
c0b70ca47053339d12ad73a118ec7ec4
8a8f1f3fb2d1d63df33de70364cde0b9
Get the {@code id} value. Can be {@code null}.
@JsonProperty @JsonInclude(Include.NON_NULL) default String getId() { return null; }
1
e02239beac62183eb259820218e9d752
bb2d6992e4e054868b0672fda197b77a
Following will avoid to add deuplicate Order # in database
class Order(models.Model): def save(self,*args,**kwargs): if not self.order_id: self.order_id = id_generator() while Order.objects.filter(order_id=self.order_id).exists(): self.order_id = id_generator() super(Order, self).save(*args, **kwargs)
1
89e6ec03934b6df866eae00298ad14f5
d7d16720d22e21cb2e216b8c8ef9e504
在标签闭合出创建父子关系
export function parseHTML(html) function end(tagName) { let element = stack.pop(); currentParent = stack[stack.length - 1]; if(currentParent) { element.parent = currentParent currentParent.children.push(element) } }
1
942627fb5dbb528f70df09894fc3ba0c
d100b20962c3a805fe324e2118f83b7f
重写方法,注入指定的Dao对象.
public class Span40050 extends Module<Span40050Dao> @Override protected void setModuleDao(BaseDao parent) { this.moduleDAO = new Span40050Dao(parent); moduleDAO.setUserId(userId); }
1
c654630d51a49f183e9b671aa5955e48
3f0b0131776eb8be131e081cc42775a6
Add a new element to <oneofs>
class ShExDocBaseListener implements ShExDocListener public function exitMultiElementOneOf(Context\MultiElementOneOfContext $context) : void {}
0
4c234be10423a458214851f1cf675423
badcdea1ad97b2c85ab93dddb9ef9062
is true if application is ready and shows the ContactTab
class immotool_functions function can_show_expose_contact(&$object, &$setup) { $tabEnabled = array_search('contact', $setup->ViewOrder) !== false; $hasContactPerson = isset($object['contact']) && is_array($object['contact']) && count($object['contact']) > 0; $hasContactMail = isset($object['mail']) && is_st...
1
c51a9bb1ac7f3257ce82d74e2ffb1fc4
84fb6b70ff833e8566c41c09ce3805fd
This method waits until the aggregateRunningStatistics are loaded. Uses a boolean that is set to true by the handleEvent method.
long startTime = System.currentTimeMillis(); while (true) { synchronized (this) { if ((System.currentTimeMillis() - startTime) > msecWait) { throw new RuntimeException("No events or less then the number of expected events received, expected " + numberOfNew...
0
861f4a26658edf9f453b837cf9935269
8ee1dc3bd562f715cee3e119aadb791c
实现功能:从文件中加载学生数据 输入参数:无 返回值 :学生链表
student *head = (student*)malloc(sizeof(student)); char fid[20], fname[20], fstuclass[20], fstuid[20]; student *p; student *q; p = q = head; FILE *r = fopen("F:\\codespace\\c&c++\\C Design homework\\project(divided)\\student.txt", "r"); if (r == NULL) { printf("Open input file failed"); return NULL; } whi...
1
d54710ef8ed2f5932ada1becd9cc0526
1fd11caddbf6a76548c46c4a61f5d6f5
Both processes should return False
class TestGenerator(TestCase): def test_process_text(self): ls1 = self.gn.process_text("bbbbb") ls2 = self.gn.process_text("bbbbb") self.assertFalse(ls1 == ls2)
0
58021d2eb83c4d0c5d6bd4a506a78790
dcc269488d9cf72ba73e6eff5220b021
Return the current version of the AdGuard Home instance.
class Admin(BaseAGOLClass): def currentVersion(self): if self._currentVersion is None: self.__init() return self._currentVersion
0
7b482105abd43bff15bebaa38da26431
ff2c27677d57e42a70c69faa69e7f603
检查更新对话框
checkUpdateDialog = new MaterialDialog(this) .setTitle("更新") .setMessage("发现新版本,是否更新?") .setPositiveButton("现在下载", new View.OnClickListener() { @Override public void onClick(View v) { downloadApk(); ...
1
eb7d2d650c57ae48675f04af97e2fcd5
64f8df53c379ed3a06775afcb881aa45
固定资产期初余额
$mrObj = app::get('finance')->model('monthly_report'); $billObj = app::get('finance')->model('bill'); $arObj = app::get('finance')->model('ar'); $time = $this->get_init_time(); $time = $time['time']; $data = array( 'monthly_date'=>'期初', 'begin_time...
0
9b747d364fed9d3da47f269d85b5edf8
823570085631c3a79eda5d35cc667795
鯖のIPをランダムに返します。
def rand_ip(ip_file=IP_FILE): ips = all_ip(ip_file) logger.debug(ips) if ips: return random.choice(ips)
1
c410dc14bfb1e8ffab6b01192e9ef2f4
05fb362503a315544025c40113bfefa8
<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>
java.util.concurrent.Future<UpdateMethodResult> updateMethodAsync(UpdateMethodRequest updateMethodRequest, com.amazonaws.handlers.AsyncHandler<UpdateMethodRequest, UpdateMethodResult> asyncHandler);
0
c684bc25ed9cb1f5946251c23b63ce79
647368255fd8258e9d39744de507a247
(Optional) Id of existing driver record.
public class OrderListParam extends BaseParam public void setDriverid(String driverid) { this.driverid = driverid; }
1
3d59598a67c514d8d63b15f9d5220843
e930d937b27d76a771b57406ab34fdc2
Displays Live Statistics from the unit. CPU, RAM, Packets/Sec
namespace KcptunGUI.Class class LocalFunction public static String[] GetStatus_Network(PerformanceCounter[] _pcs){ Single Sent_Bytes = _pcs[0].NextValue(); Single Sent_HumanBytes; String Sent_Unit; BytesCountUnitScaler_Single(Sent_Bytes,out Sent_HumanBytes,out Sent_Un...
0
5d0dd3ccbb12fa1ec87831cc9cb58fc7
994cbe57702423f978a5ae952e412434
retorna el src del avatar de 50px. Se usa en el list del backend
class Renderer(base.Renderer): ##_template = ViewPageTemplateFile('intereses_portlet.pt') def getBgImg(self): ppUrl=self.getDestacado().absolute_url() ppo =ppUrl+"/@@images/bgCabezalHome" return ppo
0
45654da0cdd7a2843df3e953f65e485f
9b0f07465ac2dc4bdc1a6c932f831616
Retrieves the stored purity reports.
class RedisStorageReader(interface.StorageReader): def GetAnalysisReports(self): return self._store.GetAnalysisReports()
0
c547efd07a78b581d419d4a5f0d8f8be
d5154f7eca77c2e0c8f225decca78bd9
@brief Send all requests of the given type
int send_request_list(int sockfd){ if(global_info->list->tail==NULL){ printf("List empty\n"); }else{ RequestNode* node; node = global_info->list->head; while(node!=NULL){ write_to_socket(sockfd,node->request); node = node->next; } } return ...
0
2e5c18b4310ccf91af74f69cd05a91aa
e718a2c94e67ee20ebe1672d4888a8d5
通过Thread 线程等待的方式来判断元素是否存在
for (int i = 0;; i++) { try { if (t.isFindElement()) { break; } } catch (NoSuchElementException e) { if (i > timeoutCnt) { throw e; } } try { Thread.sleep(waitTime); } catch (InterruptedException e) { e.printStackTrace(); } } }
1
c51c8b88f398567e64549fb3a4baa8b5
1fe078a4211179204d835ad4f50b78e8
重新创建一个会话工厂
namespace Hibernation public sealed class Hibernator public static ISession RestartSession(string factoryName) { CloseSession(factoryName); return OpenSession(factoryName); }
0
ed404e4c16fee5c2fea579cd663eae9e
0b9c8dd74313bc9b9c1bfb56904a43f6
1) add security account information
class UserController extends Controller function createSecurityDetails(Request $request) { $validator = Validator::make($request->all(), [ 'bankName' => 'bail|required', 'ddNo' => 'bail|required', 'accNo' => 'bail|required', 'receiptNo' => 'bail|required', ...
1
cc0e76abb457d851c3311524968f8602
eba1e189502f4357e81817a46393e846
POST: Home/AddNews
{ if (HttpContext.Session.GetString("Name") == null) return RedirectToAction("Create", "News"); var model = new AdminModel(); model.NewsCategories = await GetNewsCategories(); return View(model); }
0
efda61328b65813efd5e815b5c952acd
a9a036ac4bba88f98b6cfc8aefcefb13
Creates a chain of jobs, each reading and writing files using the toil.fileStores.abstractFileStore.AbstractFileStore interface. Verifies the files written are always what we expect.
if len(messages) > 0: open(outFile, 'w').close() randInt = random.randint(1, sys.maxsize) service = ToyService(messages[0] + randInt) child = job.addChildJobFn(serviceAccessor, job.addService(service), outFile, randInt) for i in range(1, len(messages)): randInt = ...
0
e243ac57b5891825b1b8fb47bd062e76
874c8cc03b40bb08a74bfae146c6ec1b
统计输入内容中的元音字母
def getCount(inputStr): num_vowels = 0 for letter in inputStr: if 'aeio'.find(letter) != -1: num_vowels+=1 print(letter) return num_vowels
1
229282bacc45e58181fa3e8994dda4e9
5f63eadf52107a31705f0d9cc4ee0fdd
从Mysql模型工厂中获取一个生成的模型。
class CsvSeeder extends Seeder public static function newModel() { $model = static::$model; return new $model; }
0
3a3d44baee99ae6c015b7fdd72590e18
cfd2724ff7f6cdff5d009d00d09ed849
Testing the extraction of text from PDF files.
public void processFile_shouldReturnExtractedTextPDF() throws FileTypeNotSupportedException { String fileUri = "dummyUri"; String fileRef = RES_PATH + "Pasta.pdf"; File file = new File(fileRef); try { InputStream inputStream = new FileInputStream(file); Extrac...
1
a5df18bbc0f9cbec8e7d8952384000db
33878e27f77ff95a27fed72733c2d7f2
Finishes the asynchronous execution of the DeleteUserSettings operation.
{ var options = new InvokeOptions(); options.RequestMarshaller = CreateUserSettingsRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateUserSettingsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); }
0
88120d0a138fd9b5649ec3c590b58bb2
9e1ad2ba79135b8a3a177afe392457ff
id序列转换为对应的token序列
tokens = [] for i in ids: tokens.append(self.ids_to_tokens[i]) return tokens
1
e96738fb8f9a143e104e40cae776f83e
cb57ac0df1a71dda593e1210ed230ca9
Create the file if it does not exist
class FilePath(PathAbstract): def create(self): if self.exists(): return with self.asFile("wb"): pass
1
34f8745cec212ae2e9fbb272b60075cf
2897385bca57c680f99cad392a133574
Removes any custom JGroups bindings.
public class Tio public static void unbindGroup(ChannelContext channelContext) { channelContext.tioConfig.groups.unbind(channelContext); }
1
7eed106b8da93b2bb871fc0829d38e06
a433b45bcef984c612f4e8778e8ed3cf
''' Draws the settings menu to the screen. '''
def draw_game_controls():
0
2fc14b99fbd9ee17ece532300d7bc294
e822093ba059d592f7305eb484416e86
Extracts locally unique identifier fragment from the specified URI.
separator_idx = uri.rfind('#') if separator_idx == -1: raise ValueError return uri[separator_idx + 1:]
1
63b5d12e416044d19633223e429916ea
76568c568901b975c7809ca7750aa9b2
apk批量上线
for pkg in pkgs: get_path_cmd = 'adb shell pm path {}'.format(pkg) pkgPath = subprocess.Popen(get_path_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if py_ver_info == 3: path = str(pkgPath.stdout.readline(), ...
0
d0f1207d315b6532cf6017a7d33f2b08
2cbbb5885b6bbc1f0e54bbb034fb6868
根据父菜单查询其下的子菜单(不递归,单级)
@Service("pmsMenuService") public class PmsMenuServiceImpl implements PmsMenuService @SuppressWarnings("rawtypes") public List getListByParent(Long parentId) { return pmsMenuDao.listByParent(parentId); }
1
c8297844f0bbdd36459cb9920d3a8d8e
06c6588eefd5aaa103ee58a0638fc4a3
입력된 line만큼 엔터를 친다.
fun main() { val n: Int = 10 val line: String = readLine()!! repeat(n) { println(line) } }
0
db8b037ee10bf35508ea28bcf8d19ff4
94c4dd0e7b59a7e88e84893f325a367f
@brief : 读取闹钟是否启用
boolean alarmClock::isSet() { return set; }
1
ebdd32c20ec4b419da1a35448aa57b00
ce30d64b37a3371338d1cbec920ae786
Iterates through a list of raw data of a specific type and yields a seed data spec for each object in the list
cursor = self.get_mongo_collection().find(spec=spec, sort=sort, fields=fields) for doc in cursor: obj = self.construct_child_from_mongo_doc(doc) yield obj
0
b93bf51452c0f9afdd6751812daf4bc5
6bd17e9ae3435dc4308ca8fd161d747b
Get the details of requested master account
{ $wallet = $this->findMasterWallet($request->input('account')); $statusCode = array_get($wallet, 'status_code'); if ($statusCode !== '0') { $responseData = [ 'code' => $statusCode, 'data' => [ 'errorMessage' => array_get($walle...
1
96e24394f70c38c7258f0d657640c581
35ab8e01bec6fa0b5967a58af7462c9f
{@inheritdoc} Link the activities to the permissions. checkAccess is called with the $operation as defined in the routing.yml file.
{ switch ($operation) { case 'view': return AccessResult::allowedIfHasPermission($account, 'view sorteo entity'); case 'update': return AccessResult::allowedIfHasPermission($account, 'edit sorteo entity'); case 'delete': ret...
1
e5bd620043eb9632625686ebf4c11572
e31946e6fbd792c3fe5c2028b6f53cd0
Returns the exploration statistics object associated with the current GTS.
if (this.explorationStats == null) { this.explorationStats = new StatisticsReporter(); } return this.explorationStats; }
1
165af3c2d7eb6b35667beb6a18b380bd
000fc76d87cbdcf67962b9f472700960
Check if the box gets an valid EDID from the Sink (getHDMIEDIDReady() in Casablanca)
bool otm_hdmi_is_monitor_hdmi(void *context) { hdmi_context_t *ctx = (hdmi_context_t *)context; if (ctx == NULL) return true; return ctx->edid_int.hdmi; }
0
43da099c3aad1645126b14d108bc60d4
da1ab97296843c982f18ce970f53bd38
Squared Euclidean distance between u and v.
def euclid(v, u): return np.linalg.norm(v - u)
0
0e63ac4b09de64b73995e17f76812f3d
f631a0a95f629aa773934e9670e550de
Reopen the connection with the instrument with the same parameters as previously
class LANSCPI(object): def Reopen(self): self.Close() time.sleep(1) self._Connect()
1
1818d46178f6df3b2952abe968c4636b
0d27273008f87553dbbe99a2400ac8a3
Returnerar receptets alla ingredienser som en sträng.
namespace CoffeeMachine public class CoffeePortion public string[] GetAllIngredients() { return _ingredients.ToArray(); }
0
fc616b717ce02150c7736700a351a445
c547baa4fe832a62899fca6554bfb20c
Returns the meta object for class '{@link oepc.OrganisationUnit <em>Organisation Unit</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getCourseInstance_Organisation();
0
65aa46ba1bfd5142e0fc3decd7f50489
f13577b52f793fa073ebae2aa3d9ddd2
Click event handler for Dakota Double Burger Button
{ BtnBrontowurst.IsEnabled = true; BtnDinoNuggets.IsEnabled = true; BtnPBJ.IsEnabled = true; BtnPterodactylWings.IsEnabled = true; BtnSteakosaurus.IsEnabled = true; BtnTRexKingburger.IsEnabled = true; BtnVelociWrap.IsEnabled = t...
0
2d407294a2331ef89e69d69bece9dd66
0cae5ad4f2ae525f882db083795666ac
Gets the stage start date and time of the brew batch
public class BatchInfo implements Serializable, Comparable<BatchInfo> public String getStartDate() { return startDate; }
1
fb8cbfe6df65ea2d0f67cf1dc7490484
1712f3dd2f3d25db806ff9e2cb060d84
Test SatelliteImageFiles.get_sat_image
preprocessor_file = GPROFPreprocessorFile(test_data["preprocessor_file"]) assert preprocessor_file.satellite == "GPM" assert preprocessor_file.sensor == "GMI" start_date = preprocessor_file.start_date end_date = preprocessor_file.end_date assert start_date.year == 2019 assert start_date.mont...
0
bfffd550bcbf435fc4ce11fbb8721a68
53d2f0836b5b46ba634fc5317b7f1344
the Atbash cipher is the same as the substitution cipher using a reversed alphabet
class Atbash(Cipher): def encrypt(self,text): output = [] text = text.upper() for char in text: try: index = self.alphabetList.index(char) except ValueError: output.append(char) else: output.append(self.alphabetL...
1
32bc6502cf93b5ef8fd318739564209e
efd9924028896d25bd72cbee8b7537c9
Display time, file, and line number in log messages.
func init() { log.SetPrefix("TRACE: ") log.SetFlags(log.Ldate | log.Lmicroseconds | log.Lshortfile) }
1