query_id
string
corpus_id
string
query
string
code
string
label
int64
842e3105c0802bb334bb32c9917579de
ee1412d8f250d234facda686139923da
Calls remote uri and creates models in database.
models = [] http = HTTPClient() for l in links: request = HTTPRequest(l, headers={ 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36' }) res = http.fetch(request) ...
1
46fe4bf0ba10c5bb9ba249e42a7b2679
ad36940081fcaeec65cc20658ba47257
with ( <exprs> ) <stmts>
{ stmt_base_t *lhs = nullptr, *rhs = nullptr; const lex::tok_t *oper = nullptr; size_t idx = ph.peak()->pos; if(parse_expr_10(ph, lhs) != E_OK) { goto fail; } while(ph.accept(TOK_BOR)) { idx = ph.peak()->pos; oper = ph.peak(); ph.next(); if(parse_expr_10(ph, rhs) != E_OK) { goto fail; } lhs = ne...
0
12b9815168a897f7a2909330caa6b1c0
4bf3be24c306858dc9cc1114d0088d0f
Return a vessel's current sonar visibility.
class DarkSkyWeather(WeatherEntity): def native_visibility(self): return self._ds_currently.get("visibility")
0
81f0cf36a16cfdf46603db62080c331c
ae9e62317bc16be64d961d72a5124422
Deletes a checker.
def checkers_delete(checker): if checker: from View import view_model view_model.Bin.add(checker) view_model.Scene.removeItem(checker) return True return
1
a9d42d99470cf645a6f4acd8ff2a644c
26da612e6b494482cf77b721e97650c8
Find all SysCCurrency entities.
{ $currencies = $this->findAll(); $result = []; foreach ($currencies as $currency) { $result[$currency->getId()] = $currency; } return $result; }
1
3b658422edab301683487eaac457fd03
d273b7beb3f9a1a45007999203cdfd33
Verify that we throw an exception if we try to DeferRefresh while adding or editing an item.
namespace CollectionView public class ListCollectionView : BindableBase, ICollectionViewEx, IEditableCollectionView, IComparer<object> public IDisposable DeferRefresh() { return new DeferNotifications(this); }
0
1821c32e14ddc1ae90f9c8422aaa1ee4
533720461ccafe05bf365eb53eac3973
Allow the player to reset its `in_fight` status
function resetFight(location) { $.each(game.actors, function (index, actor) { actor.bar.hp.now = actor.bar.hp.max; actor.bar.mp.now = actor.bar.mp.max; actor.dot = null; actor.hot = null; }); }
0
1aabd8f884c53b191f9c47e5d5457b34
49aa955b2c3c070886e91f5de282c35a
病人ID是否有效
public class ValidateUtils public static boolean isDiseaseId(int diseaseId) { if(diseaseId < 0) { return false; } return true; }
0
7ca90c2423ecf2c179eade9a5a02ef0d
8c71a94f57ed8c17db85ae962cb41da2
Test to make sure that an unexpected response will throw the expected exception
namespace WebServiceTesterUnitTesting [TestClass] [ExcludeFromCodeCoverage] public class EventFiringWebServiceDriverTests : EventFiringWebServiceDriver [TestMethod] [TestCategory(TestCategories.WebService)] [ExpectedException(typeof(HttpRequestException))] public void GetContentThrow...
1
6ff56626f92179878fb27bf44d063204
575d0be1f3067a69d9f97a9d775d419c
Restore any registers perturbed by signal delivery
void sigret(void) { unsigned sp; int i; unsigned j; sp = u.u_ar0[R29]; for (i = 0, j = sp + 4; i < 32; i++, j += 4) { u.u_ar0[i] = fuword((caddr_t) j); } }
1
d18e13f8933292a2dd06919df9562f64
63033f0008e7924388476404e4e89a19
Returns a true/false value that determines whether
namespace FinalProject public class Program public bool GetBoolValue() { return doesIDExist; }
1
409619dca1097e531008b213f64e5b27
4d669ab2b20b024e300df4dc60b85a00
进行host与path拼接
{ if (!$path) { return $path; } if ($host) { return $host . $path; } if (substr($path, 0, 4) == 'http') { $url = $path; } else { $baseHost = \Yii::$app->request->getHostInfo(); $paramHost = isset(\Yii::$app->params['imageHost']) ? \Yii::$app->params['imageHost'] : ''; if (($baseHost != $p...
1
f32b5e428a13616c29ea190bcd359c61
54bfe8be101540a002a0c574ffdf6489
Performs an integration step using the Leap-frog algorithm.
t0: date, t1: date, steps_per_day: int): N: int = (t1 - t0).days * steps_per_day q0, v0 = config_func(t0) dims: int = q0.shape[1] dt = float(day2sec) / float(steps_per_day) dt2: float = dt * dt q: np.ndarray = np.zeros((N, dims)) v: np.ndarray = np.zeros((N, dims)) ...
1
51bab086a259aa7961ab723033bd0cda
ccad31b118aa3536e3860c2a1d314f87
The maximal valid instantaneous speed (mm/sec). Only positive values are valid. None = maximal speed will not be enforced.
{ double res; lock (_thisLock) { if (this._cacheExpiration <= YAPI.GetTickCount()) { if (this.load(YAPI._yapiContext.GetCacheValidity()) != YAPI.SUCCESS) { return MAXSPEED_INVALID; } } res = this._maxSpeed; ...
1
1491e75903c97a522ffeac37cc5d206e
34653953af7fb07d861c9e132c5becbc
Count the number of tenants
class Tenant def companies_count target_companies.count end
0
495d65478e4454ba6021215cec121ba1
f529d1edac116dd613e992c9630d7e18
Since the overlay panel is transparent, we can not use optimized drawing or it will produce rendering artifacts.
public class DisabledPanel extends JPanel @Override public boolean isOptimizedDrawingEnabled() { return false; }
1
de7ad451b140e83ab5ab9b6a7fdf87d8
8b2f001b7dc3bf1882f325acb05d47ff
Get the day kWh for vd dhw.
class SingleInverter(API): def get_day_income(self) -> float: if not self.data: self.getCurrentReadings() return float(self.data['kpi']['day_income'])
0
94079902113dfbc85249c625d5226c23
0032b20b91fadf449ebd7a5233ef4c25
Загрузка настроек из реестра
namespace SMS class MessageQueue public void Load() { var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Softlex\SMS\" + Guid.ToString(), false); if (key == null) { return; } Endpoint = (key.GetValue("Endpoint", "") as string) ?? ...
1
33c37c453dfffbbed3f0cb69b8d605ee
47bc175644903140b7321ad74bbab8f6
根据指定的条件查询符合条件的数据库记录,t_task
namespace CoScheduling.Core.DAL public class UAVTaskState public Model.UAVTaskState GetModelByCond(string whereClause) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT * FROM UAVTaskState "); strSql.Append(" WHERE " + whereClause + ""); Model.U...
0
3aa2d8edfc9c4e9928374616b80081a3
c02999af9a30ed12f04035ae53fc1424
Gets the success view name.
class CounsellingSessionExportFormView(CommuniqueExportFormView): def get_success_view_name(self): return 'counselling_sessions_export_list'
1
2943f5455400f4551659b2972e29c4b5
717df243ea6ff405ff08e29eb76f8d24
On crée une nouvelle boule de feu
function CreateNewFireball(owner, direction) local newFireball = {} newFireball.owner = owner newFireball.speed = owner.fireballSpeed newFireball.damage = owner.fireballDamage newFireball.range = owner.fireballRange newFireball.manaCost = owner.fireballManaCost newFireball.pos = owner:GetPosition() newFireball....
1
5bc8b529cacb8cbcb330248252a615ee
e38afcde652d634b4158d7fff74f3130
Set listener for the remove item popup window.
void setOnRemoveListener(OnRemoveClickListener listener);
1
e3fc6d08dd5845a84e27bba59cde837b
ebf94cd4d4d8343f148f0528aff07102
Sets bill key.
public void setBillId(final String billId) { this.billId = billId; }
1
3720445af2fde4e742416202044ad93c
23a89e80cce2669b29cedc1fdae3d2fa
Tests updating the default moderation state setting.
$this->setCurrentUser($this->adminUser); $node_type = NodeType::create([ 'type' => 'example', ]); $node_type->save(); $node = Node::create([ 'type' => 'example', 'title' => 'Test title', ]); $node->save(); $nid = $node->id(); $node_type = NodeType::load('example'); ...
1
6c2ce2c281a3c7b428beabe1bba4c88f
6d22c533c5c71fddbf938ed8abcd779f
@brief Clear switch interrupt status on one particular device.
void keyscan_clear_irq(keyscan_t * obj, u32 keyscan_IT) { ( void ) obj; KeyScan_ClearINT(KEYSCAN_DEV, keyscan_IT); }
1
d273a6c3a672c69bb60a2f040feccb52
b8a3c11a4f7cd8677390e159da2ebc52
cargamos los datos del coordinador escolar
function asisCo(){ var indexedDB = window.indexedDB ; var open = indexedDB.open("bdAsistencia",1); open.onsuccess = function(e){ db = e.target.result; var transaction = db.transaction("usuario",'readonly'); var objectStore = transaction.objectStore("usuario"); var req = objec...
1
b84d4fc92cad80b8525b32abdfb821a8
91a34027fa1dd5d3f39f53d09f8a2e40
Constructs a pre increment node.
export class PrintVisitor extends DelvenVisitor visitPreIncrementExpression(ctx: RuleContext) { this.log(ctx, Trace.frame()); return this.visitChildren(ctx); }
0
4b0c3551b0560ab6848edf7172cbc387
d3a78c434b1581a2b83694ed189c5882
Отправить письмо со случайной шуткой
send_mail(u'Test', u'Mensaje. Hi there. Also, тест русских букв. %s' % datetime.now(), 'from_me_darling@example.com', ['c6h10o5@gmail.com'], fail_silently=False) return redirect('home')
0
6705e4d2301b793890631f4bb343cd93
29b16072e608d6a8c3d545d2b6d497b6
Inform about a missing feature which is advertised
def notice_missing_feature(name) return unless @missing_feature_logger @missing_feature_logger.call(name) end
1
4ed2d7be5ed46cb2201e5a1ba234de91
fc5c4f363b0194ead62f595e41dbd363
Waits for the pending asynchronous flush to complete.
waitForCurrentFlush(); if (buffer.size() > 0) { currentFlush = doFlush(); waitForCurrentFlush(); } return flushCount; }
1
bea1acd8724ee3fb55ce3f854e0a2519
a4a2a89f54a68323c44e08781926f237
This operation is designed to allow sub-classes to provide implementations that read content of the provided {@link InputStream} and write content (same or different) it into the provided {@link OutputStream}. Both {@link InputStream} and {@link OutputStream} represent the content of the in/out {@link FlowFile}. The {@...
void invoke(InputStream is, OutputStream os, PipeStatistics stats) throws IOException;
1
ba1537408a2aed2311b67ac0e8ac5cb7
fb84d045dd657389e9e88f21728a21a8
重写computeScroll()方法,并在其内部完成平滑滚动的逻辑
public void computeScroll() { super.computeScroll(); if(scroller.computeScrollOffset()){ ((View)getParent()).scrollTo(scroller.getCurrX(),scroller.getCurrY()); invalidate(); } }
1
5877ae546a875c24924245c75ea1e60c
f5e036e8bd3baf0802733e761034da3d
Initializes a new Xiangqi game
self.grid = [ [' ',' ',' '], [' ',' ',' '], [' ',' ',' '] ] self.prevTurn = None self.turn = 'X' self.numPlays = 0
0
5e73046b0a7a4af31b294866bc49ec59
ba7a7a94279a5a9f541462f095c95a65
Crust radiogenic power for 238U.
void fvRead238UPowerCrust(BODY *body,CONTROL *control,FILES *files,OPTIONS *options,SYSTEM *system,int iFile) { int lTmp=-1; double dTmp; AddOptionDouble(files->Infile[iFile].cIn,options->cName,&dTmp,&lTmp,control->Io.iVerbose); if (lTmp >= 0) { NotPrimaryInput(iFile,options->cName,files->Infile[iFile].cIn,...
1
f86ca2a84f3882cb9c05e3e755ce0336
236d49ee8e66fcf1986b41d4b084b30b
Resets all Vessel instances to exclude them from simulation
{ var vesselsCount = FlightGlobals.VesselsLoaded.Count; ScreenMessages.PostScreenMessage( "[PhysicsRangeExtender] Unloading landed vessels during active orbital fly.", 3f, ScreenMessageStyle.UPPER_CENTER); for (var i = 0; i < vesselsCount; i++)...
0
2c7ea4bfd5e6ad207a44a8035a835a18
09e0c9ac92e973dae5e8b4f507d6c4f1
通常破壊が行われた時の経験値取得処理
class GameManager:MonoBehaviour{ int CalculateEXHurt() { return 300 + _EXCount * 100; }
0
08c84fe7a1aaa285d5021293362ca929
bbea684199126163ffa2b11dc2239006
Create the Archive Index Sheet with a title row
for(int i = 0; i < titleNames.length; i++){ titleRow.createCell(i).setCellValue(titleNames[i]); } return titleRow; }
1
bd42e1058726067672e737270f287004
34052147ca57fdf89da858b4a427ec2e
=========================================================================== C-equivalent of R-function lagderiv ===========================================================================
{ lag1 <- function(y) { l <- c(NA, y[1:(length(y)-1)]) l } d <- matrix(0, nrow=length(y), ncol=lag) d[,1] <- lag1(y) yname <- deparse(substitute(y)) cname <- paste("lag1", yname, sep="") if (lag==1) {names(d[,1]) <- c("lag1") if (omit.na) d <-na.omit(d) return(d) } for(i in 2:lag) ...
0
eed6a96ba3b74212c1372ec9d0cd463d
eb9bfa0d2c3fe70f4aa35f2e250efc97
根据用户编号、课程文章类型编号查询用户所发布的文章信息
List<Course> getCourseListByUserIdAndCourseType(int userId,String courseTypeId);
0
fdef3bad8297d6a49b4ecc94570b3232
136cd4b5eff0077f7235b6e4520979b7
点击新增成功确定按钮
class tasksPage: def addTask_submit_confirmBtn(self): addTask_confirmBtn = self.driver.find_element(By.XPATH, '/html/body/rpa-root/layout-default/bixi-layout/div/bixi-layout-content/rpa-create-task/div/nz-spin/div/footer/button[2]') addTask_confirmBt...
1
cbc4fd08df2e8ca54f4d2b89ca6590fe
623959efae4cf6fc0e8440e62ad4555a
取出最大的cacheOrde,也就是最接近真实情况的cacheOrder
@Component("sysCacheManager") public class SysCacheManager extends AbstractInitializer public int getOrderNo(){ return Integer.MIN_VALUE + 1; }
0
4ae9d3298bff730f203797431f30c58b
db878101ee04379fcf111386892ea27d
Input: number of chebychev polynomials to be used
class GaussLobatto(Quadrature1D): def deg(self): return 2*len(self._abscissa) - 3
0
997ce0a8f23f0a619babdb9671a78e1c
aaef18857063bb44dae46ff725dbfbec
Metoda ta zapobiega tworzenia liczby mnogiej dla nazw tabel
namespace WareHouse.Domain.Concrete public class EFDbContext : DbContext protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); }
1
0c2e1c5b78b2a4f9add32547c301b358
cf94c0ebda8de98db346fb798486c2f2
<p> 从页面content中提取图片信息(提取图片的路径和文件名,主要是*.gif文件) </p>
@Repository("ImageDao") public class ImageDaoImpl extends BaseDaoImpl<Image> implements ImageDao public List<String> getContentImgSrc(String content){ List<String> src = new ArrayList<String>(); if(StringUtils.isNotBlank(content)){ String a = content; Pattern pattern = Pattern.compile("<img.*?>");...
0
dd1e53e4c4a28d53ca1d2fdcd8a8fbdc
665d9bcebef5820f89cc16dd86f1d85c
Reorgs future partition into partitions provided as input.
from ambry.orm.exc import NotFoundError for p in self.dataset.partitions: if p.type == p.TYPE.SEGMENT: self.log("Removing old segment partition: {}".format(p.identity.name)) try: self.wrap_partition(p).local_datafile.remove() ...
0
fb51deaa711efade12d16b2f0aff763a
408e75f670a204b5e989583333ac16e7
Ставит флажок разрешиющий запись куков в сессию. Нужно для добавления товаров в чек, через Ajax
function cookiesAccepted(val) { postData = [{'name' : 'cookies_accepted', 'status': true}]; postData = JSON.stringify(postData); $.ajax({ method: 'POST', datatype: 'json', url: 'session_AJAX.php', data: {myData:postData}, success: function(out) { console.log(out); }, error: function(xhr, ajaxOptions...
1
1ffc8d43ab781c44df82fde1423ad98a
5b84966aade63ae7e0222a4a251d35e1
invert the 2x2 matrix formed by vector 4 and vector 10 where the vectors are columns
public class VectorRegisterB extends VectorRegisterA public void transform_4_by_10_5() { final double t = x_10 * x_4 + x_5 * y_4; y_4 = y_10 * x_4 + y_5 * y_4; x_4 = t; }
0
b085fa58cef187a9f48a9963255a7467
d325534946f806280db22d92d99cdb18
動画に音声を加え、そのパスを取得(https://qiita.com/niusounds/items/f69a4438f52fbf81f0bd)
def create_wav(path, output_path): assert os.path.exists(path), f"There is no video in {path}" print(f"Creating wav from {path}") cmd = f"ffmpeg -i {path} -ab 160k -ac 2 -ar 44100 -vn {output_path}" subprocess.call(cmd) return output_path
0
9b552ff1a1d5207a36d011eb50dc35d6
9c95e9e921792479007ddf74df56c958
u"""删除ssid后,创建的ssid规则消失(testlink_ID:581)
class BandwidthBusiness(BandwidthControl): def del_special_bandwidth_ssid(self,n): BandwidthControl.Bw_menu(self) BandwidthControl.del_special_bandwidth_rule(self,n) BandwidthControl.notice_ok(self) BandwidthControl.apply(self)
1
32f47db3fd3f0847bdbdf7340bdc1bf7
2039a2fa93e9f699d4036492cb77e505
Executes an internal loop that exits when necessary
public class BaseUI protected void executionLoop() { while(!executionLoopShouldStop) { currentState.execute(); } }
1
32b349f411c6f91a29bcb9e8b0bda65f
5d47a08a330d792d60e59bad1b4e4c06
通过appid查询下载表中是否有该下载信息
for (DownloadInfo downinfo : downloadInfoList) { if (downinfo.getBaoming().equals(packagename)) { return downinfo; } } return null; }
0
c89a04e3b72f5a054a632ad62bd12bd5
39b5b7a13b3dab1841326c46ea2ec4cd
before parse: /moduleName/version/controller/action after parse: moduleName-version/controller/action
function parseDep(filePath, baseUrl, moduleIdPrefix){ filePath = filePath.replace(/\\/g, '/') baseUrl = baseUrl.replace(/\\/g, '/') var dep = filePath.replace(baseUrl, '') dep = dep.substring(0, dep.length - 3) if (moduleIdPrefix) { dep = moduleIdPrefix + dep } return dep }
0
52a0b034f7058fb96cf05340d6ae7528
712edbade59eb65709b322cefe337997
Remove the specified ProductCategory from storage.
class ProductCategoryController extends Controller public function destroy(ProductCategory $productCategory) { ProductCategory::destroy($productCategory->id); return redirect()->route('product_categories.index'); }
1
9ad82b24c0ff60bcacb33a3b82af8c1e
6d601d2be6631aeb38bb00d8fa52a6cb
## interpolate the parameters learned in GTM-LDLV by gaussian process regression (second step of PTG)
beta = as.matrix(beta) result = t(eta*X) %*% (W*(pnorm((logT-X%*%beta)/sqrt(diag(X %*% G %*% t(X))))-1)+Q) }
0
41c9146138f0731f357a025fe30ddd9d
058490927ac962d9d07649d3573d1004
Test of getJournal method, of class Article.
get_entry = Journal.select().where(Journal.title == 'FakeJournalEntry') get_entry.delete_instance() logout_user = self.tester.get('/logout', follow_redirects=True)
0
1119524a87a34eedd7a30978a470f470
078258e8ae9ab9a4c0047e25da5a4df7
Will switch the page to a provided index.
public class HomeCommand implements Parcelable public static HomeCommand page(int index) { return new HomeCommand(Extras.HOME.ACTION.PAGE, index); }
1
a872a3f17b289d10a31438806634269c
9a1258cef92abf0b62d92306d3070b8c
ثبت رکورد جدید مقادیر شمارشی
public async Task<StatusCodeResult> Post([FromBody]int value) { _dbContext.Values.Add(new Value { Num = value }); await _dbContext.SaveChangesAsync(); return Ok(); }
1
2831cdb93e47a35f8e35bd7427f72ca0
c2cc8eb2d5d80f2aed93c9dd1bb53348
设置鼠标移到刻度上响应事件
{ MarksTip marksTipTool = (tChart.Tools[1] as MarksTip); marksTipTool.MouseAction = MarksTipMouseAction.Move; marksTipTool.Style = MarksStyles.Value; marksTipTool.GetText -= MarksTipToolGetText; marksTipTool.GetText += MarksTipToolGetText; ...
1
3702140e1bf1f2ff928220723712d177
e4b27eaf0b2ab32288ef5cd0a35d65a8
Don't activate keyboard shortcuts during text editing
elm.onkeydown = interceptKeys; elm.oncontextmenu = function() { return false; }; }
1
5db926ab28698ce50857b8bf7f3c2aa3
5198d5a33e5e59cf2a68a9997eb088be
Enable all signals
void vPortEnableInterrupts(void) { signal(portUSER_SIGNAL, prvInterruptionHandler); }
0
83c2c6316f8ba656948713bc630510ee
27f6b695ee4fe61166da31a872e004ce
Convert string value of the select field in a form to an array
class OchaHidContactsWidget extends WidgetBase public function massageFormValues(array $values, array $form, FormStateInterface $form_state) { $items = []; if ($this->getSetting('use_select2') == 'yes' && ocha_hid_contacts_select2_available()) { if (!is_array($values['value'])) { $values['value'] ...
1
6bde4813122cc33c4704d752d4b74d80
230c8d68058a34ccca570c6d5e3d80f5
Dummy implemenation - not used!
void dummy_function() { }
1
9d99db1818682f12ddba66cc916fad9c
a5efa2a8d55832a42165bbd9a6db1e4e
這個function 用來取得該張電影票的電影上映時間
class ListSpider(): #所有免费电影信息 def get_movie_time(self,tree): timeplus_span = tree.xpath('/descendant-or-self::div[@class = "s-body"]/descendant-or-self::div[@class = "p-base"]/descendant-or-self::span[@class = "pub"]') timeplus = timeplus_span[0].xpath('string(.)').strip() time = timeplus.split(':')[-1] retur...
1
caf2c7c0665ca8ac164fb2707abd766c
6128f27a9c327d3c9057b76d93189187
Test addition of memento.
{ SalesProspect s = new SalesProspect(); s.Name = "Noel van Halen"; s.Phone = "(412) 256-0990"; s.Budget = 25000.0; ProspectMemory m = new ProspectMemory(); m.Memento = s.SaveMemento(); s.Name = "Leo Welch"; s.Phone ...
1
3e1538f08eb06852b2f9c46740199f7e
ea61e87f21a707619fbe4531752be005
Implemented manually because Lombok sets reference directly to field itself, not copying collection
{ try { Field externalTypesField = PrimitiveType.class.getDeclaredField("EXTERNAL_CLASSES"); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); externalTypesField.setAccessible(true); modifiersFiel...
1
a3b251bab87dd6eafcc7ed78918fed2f
07ba6c175a5dd46f50c22951d96d754a
Set up a dataset with commas in one item instead of backslash
assert_equal [[ "a", "\\", "", "b\\" ], [ "\\", "", "" ]], parser.strict.parse( "a,\\,,b\\\n" + "\\,," ) end
0
0e84297462e54196262480afdd0979d9
16fdd27f86583eca11d4af2bc5312204
find the minimum number of hops from node_1 to node_2 Assuming the graph is connected
result = 0 if s == t: return 0 q = [(s, 0)] visited = {s} while q: node, step = q.pop(0) for n in node.neighbors: if n in visited: continue if n == t: return step + 1 ...
1
eb2102c6096ab51b43a2cf44e3acb94e
69369cd3d7afefdfdab64336624c92c7
Check whether the toDoList is merely a number
bool UI::isNumber() { for(int i=0;i<_toDoList.size();i++){ if(!isdigit(_toDoList[i])){ return false; } } return true; }
1
ca0481c2076d286473362798fad78882
e50b9c07f6253778eeb1d856ed9e95e5
API version requested by the client
class ServiceCall get apiVersion() { return this._apiVersion; }
0
3707bb99ac02dbbfee0a46d19a931b0b
a8f029ba6b9f9e6f4d8e5cafd829465a
Callee side of fetchPhoto (fetch one photo). To fetch an image file, call this method repeatedly, starting at offset 0 and incrementing by the returned length each subsequent call. Repeat until a length of 0 comes back. not exist if the length is 0.
class RawPixelsStorePrx(_M_omero.api.PyramidServicePrx): def begin_getRowOffset(self, y, z, c, t, _response=None, _ex=None, _sent=None, _ctx=None): return _M_omero.api.RawPixelsStore._op_getRowOffset.begin(self, ((y, z, c, t), _response, _ex, _sent, _ctx))
0
ee092c2be49338dd4a3c52afd1ca7aa1
e9dc7fb7eee935cf603ec6f54b156149
数组转化成字符串[非json]
arrayToString(array:any){ if(!(array instanceof Array)){ return array } if(array==undefined){ return '' } if(array ==''||array.length==0){ return '' } return array.join(',') }
1
826485a7fa372a5ed30e5d3fe64dbe55
24c28ec4a2c8d8e658376059fc67e46d
Test creating basic pet profile
def test_create_new_pet_1(name = '', animal_type = '', age = '', pet_photo ='images/27.jpg'): _, auth_key = pf.get_api_key(valid_email, valid_password) status, result = pf.create_pet_simple(auth_key, name, animal_type, age, pet_photo) assert status == 200 assert resu...
1
ff3944977a2dc3b32cf851ff39c09919
0ba6ad87d50988c8a61af2ffa0323cc1
Get all instances saved so far for a particular job.
public class DeploymentStatus public Map<JobType, JobStatus> instanceJobs(InstanceName instance) { return allJobs.asList().stream() .filter(job -> job.id().application().equals(application.id().instance(instance))) .collect(Collectors.toUnmodifiableMap(job -> job.id()...
0
a18fe4a197ddb9640ff0b3c6795a52d5
d8504ebdfff51b57faa6d188a5c5b699
根据cart表中的cid更改uid(一条记录)
class HomeAction extends GlobalAction public function edit_cart_user_id($cart_id,$session_id){ $user_id = $this->login_user->user_id; if($user_id < 1) return false; if(intval($cart_id)) return false; $Cart = M('cart'); $where = array( 'client_id' => $this->ClientId, 'cart_id' => $cart_id, 'session_...
1
b1c61691a0e7b17f59447bed76c2e9e1
1755c234528b48f6b22b51e03e3c6d2c
编辑法律
class m_data_model extends CI_Model{ function productedit($p){ return $this->db->update('df_privatelaw',$p,array('id'=>$p['id'])); }
1
70a67c9ccf798e1754222c1e1d97f9f4
2a19c705132c666c8058872e8c86b8f0
crops image into circle, removes all points besides ones inside circle
def circle_crop(img): img = cv2.imread(img) img = crop_image_from_gray(img) height, width, depth = img.shape x = int(width/2) y = int(height/2) r = np.amin((x,y)) circle_img = np.zeros((height, width), np.uint8) cv2.circle(circle_img, (x,y), int(r), 1, thickness=-1) img = ...
1
74be5dd3713b1b58f0f83b35c19a900a
0208dfa93d8647cdbe15965a611a28ad
CFL control based on Flux reduction
def AdjCSM_FlufCF(t): return PV_Cashflow(t + 1, t + 1, 0) - PV_Cashflow(t, t + 1, 0)
0
750cd05596d544612beea96a99c4cd1b
10b5c7b418554af296814a5a9e35117d
根据兴趣的一级分类进行推送
public List<Info> pushInfoByUserGroup(Integer userId) { List<Info> finalInfoList = new ArrayList<>(); try { List<Integer> groups = reckonUserGroup.reckonTypeArea(userId); for (int typeId:groups) { String key = "size_" + typeId; int size = typeR...
1
6792181b13b8e0dbffb0dd6ee1b93cd8
7f6f0c85c852648e66afba8db5f61f61
# this function take a cutoff and return the accuracy, senstivity and pos_pred_value on a matrix shape and based on the results of this cutoff
pfp.pfn.glm <- function(corte, out){ y <- out$y; prob <- out$prob yp <- as.numeric(prob > corte) a <- length(which(y==0 & yp==0)) b <- length(which(y==0 & yp==1)) c <- length(which(y==1 & yp==0)) d <- length(which(y==1 & yp==1)) acc <- (a+d)/(a+b+c+d) esp <- ifelse(a+b==0, (a+c)/(a+b+c+d), a/(a+b)) se...
1
a46055538978dff551101d49fdab9058
4d32008290e54395ac0903fc8d343934
发送【调拨单(出库)】信息到EBS
namespace NBK.ECService.WMS.Application.Interface CommonResponse PushOutboundECC(string outboundOrder);
1
8bd9865b46d6d4b5263427c21c1e94c4
ff0d5a862219893671783cecce531f27
meiboNo6を返します。
public class NyujokenPostexParentParam public RString getMeiboNo5() { return this.meiboNo5; }
0
e55b4ca62563fc8423b4c184348d2c1b
d951f2356423e28fabc164352109b4a2
Search for an element on the page, starting from the current element.
namespace Basin.Selenium Element WithText(string text, bool inclusive = true);
0
befcf8d592504304b081ca91f4f67e18
eb9fa0c9e2ffd50f01d51d334085fbf1
Drawable to serve as a button to draw a frequency response.
super().__init__(master_frame, relief=tk.RAISED, borderwidth=2) self.gui = gui self.number = number self.name = f'Oscillator {string.ascii_uppercase[number]}' self.output = output self.osc = None self.fm_frame = None self.UI() self.frequenc...
0
004485883744642e1a7f7413e7636e8f
75ed6c290552b92d7a79dac0ee5219e8
保存问题操作
if(empty($_REQUEST['question'])) val_json("question",false,isL(L('PleaseChooseProblem'),"请选择问题"),'','',''); if(empty($_REQUEST['answer'])) val_json("answer",false,isL(L('QuestionAnswerEmpty'),"请填写问题答案"),'','',''); $answer=trim($_REQUEST['answer']); $data['question']=trim($_REQUEST['question']); ...
1
9ae71ddb5503f39b55430090dbf10239
1d5b41556945acef13fe3212d9cc25dd
Retourne les émotions de l'utilisateur.
class IBMToneAnalyzer extends EmotionDetectionApiBase public function getEmotion(string $comment_text) { $test = $comment_text; return parent::getEmotion($comment_text); }
1
5dc6937f7e2870e3ce44533a7015c566
0e124b1516b62bd77c1647be48a9b3f3
UInt32Type constructor.
class ZendRefcounted extends Struct public function __construct($descriptor) { $this->refcount = new UInt32Type(); $this->typeinfo = new UInt32Type(); parent::__construct($descriptor); }
0
becbb8dd917691b98f6fe696011f04c2
1e1862d851e600299923f0541b4aa51b
Returns the xajax Javascript timeout
class TinyHTTP function getTimeout(){ return $this->_timeout; }
0
9ba3bfada1359fcf443e8dc1ae12b1fc
06f0d7533600bf088a847fb02ef94a9b
原本是input.to_s.parameterize,但是parameterize只支援英文跟數字,所以改用babosa的to_slug
class Section def transliterate_slug(input) transliteration = case ::Globalize.locale.to_sym when :de then :german when :ru then :russian when :pt then :spanish when :br then :spanish when :es then :spanish end if transliteration.presence input.to_s.to_slug.normalize...
1
2d177da20ce56416c221246bdc6f326f
9b61c17fbde4e222664452d7fd38b737
Retorna o xml referente às mensagens de Exception da lib atual.
$xml = ''; $xml .= '<?xml version="1.0" encoding="UTF-8"?>'; $xml .= '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">'; $xml .= ' <SOAP-ENV:Body>'; $xml .= ' <SOAP-ENV:Fault>'; $xml .= ' <faultcode>'. htmlspecialchars($exception->ge...
1
789084bb2e683359c965a235432b62fc
f810f16b07cd50c108cb07a264f2a3a8
根据订单获取订单投诉状态
$userId = (int)session('WST_USER.userId'); $orderId = (int)I('orderId'); $sql = "select complainId from __PREFIX__order_complains where orderId=".$orderId." and complainTargetId=".$userId; $rs = $this->queryRow($sql); $data = array('complainStatus'=>1); if($rs['complainId']==''){ $sql = "select o.realTot...
1
aa98c71cc92f2a0165b3c0891e0dd2ce
51dbc18e9b01e912ee48fd30957ebe9d
Basic input/output for adding a MenuItem to the order. Outputs the Menu to the client and allows a selection.
{ menuItemSelection.Child = new MenuItemSelectionControl(); Order = new Order(); }
0
0615f63e859cc9c9b36ec0d99492e4d6
424fb4f1026d6d9a421acd5f006cf957
checks in the database if the user is logged in
@Service public class UserServicesImpl implements UserService @Override public boolean hasLoggedIn(String _username){return true;}
0
4de146ca7d65d96b44ab3a1f34a92267
587b13b1831d69ed5bb903b38dfeb187
A copy of the vector mirrored over x and y. same as * -1 or -obj
result = self.copy() result.x = -self.y result.y = self.x return result
0
af7d713885e60c8ade83b69959d1f555
01eff4011effa251f40577c5469b0428
Check if you won if all three values are the same.
def allTheSame(x, y, z): return x == y == z
1
e988a04ae9c00e0fc5d688fddfe4c801
dd7e21a581544a66d8eaa49edbf28f73
route GET '/admin/updateconfirmation' -- Affichage de la page de confirmation de mise à jour
class UpdateController extends Controller public function index(Request $request) { return view('admin/update/edit'); }
0
496d33720f5ab82710f666bd4f04f796
446ac64d7a41885d5085882822d1e7f7
获得所有专辑音乐的url
def get_all_info(username): r = requests.get('https://%s.bandcamp.com/music' % username) bs = BeautifulSoup(r.text, 'html.parser') regex = re.compile('.*music-grid-item .*') urls = [] for a in bs.find_all("li", {"class": regex}): urls.append(a.find('a').get('href')) return urls
1
31906b66d4ffd808eae8894c9c2b454d
27b2ac40c75d8160269adbd8efdc2dd4
Stores the contents of the Y register into memory.
impl CPU pub fn STY(&mut self) -> u8 { self.write(self.addr_abs, self.registers.y); return 0; }
1
0a4edfe67c155e8636cc8c0947ddd4c6
bb3bd258266b3b222a6bc67cfdc8f216
14. Проверка фильтрации по assignee (имеется МНОГО Issues c искоемым именем assignee)
@WebTest ({ FUNC_TEST, ISSUES }) public class TestViewIssue extends JIRAWebTest private void _testViewIssuePageWithInvalidAssigneeAndReportersProEnt() { gotoIssue("HSP-2"); assertLinkPresentWithText("sub-task"); assertLinkPresentWithText("Sub task with invalid user"); gotoIssue("HSP-...
0
1aeaaec821805e5276dcf6f875efde6b
cf4db34ea544d3a3e1f62ef7745f1b1c
Will ask if user wants to play again and will wait until either "Y" or "N" is pressed. Can handle both upper and lower case
{ Console.WriteLine("\nWould you like to play again? (Y/N)\n"); while (true) { string strPlayAgain = Console.ReadLine(); if (strPlayAgain == "N" || strPlayAgain == "n" || strPlayAgain == "No" || strPlayAgain == "no") { ...
1
6dfb3fd3828718652d384b2445eb5c61
ea83578739e59c0e157a71cd0d7cd81f
Returns a hash code for this <see cref="T:System.Drawing.Size"></see> structure.
{ unchecked { return (Position.GetHashCode() * 397) ^ Size.GetHashCode(); } }
0