query_id
string
corpus_id
string
query
string
code
string
label
int64
19efb5faadb79c624d3fa722c4e210dc
c5768771347b4487e916ca6d386e54d9
设置0~1 之间的浮点数,细节部位图片左上角 y 坐标在原图中的位置比例 参数示例:<pre>0.5</pre> 此参数必填
namespace EarthView namespace World namespace Spatial namespace Display public class PictureFillSymbol : EarthView.World.Spatial.Display.FillSymbol public void SetOffsetY(double value) { EarthView_World_Spatial_Display_CPictureFillSymbol_setOffsetY_void_ev_real64(this.NativeObject, value); }
1
449f2f925c45fb384e295e53509071b6
c2a16eec59dca07bbbc1f1f3212455fc
Gets an instance of the given <typeparamref name="T"/>. Must return <c>null</c> if the service is not available (must not throw).
namespace Goo.Core TService EnsureGetService<TService>( );
0
50491185664daa2da07da96bd0301a57
b47ae39106b44818863aba9a322f0d83
Set the start address for program execution.
class Assembler(object): # Input: # options - The program options. def _set_address(self, address): self.address = address if self.verbose: print "Set address to 0x{0:08x}".format(self.address)
1
955ec2e2729dbf3e4bdb5b5f8cbcc483
b69596f957e229b002fc19b3c3c6b038
Get count of records at date
function getCount($main_db, $day) { $sql_select = "select date from join_date where date='$day';"; $retval = mysqli_query($main_db, $sql_select); $num = mysqli_num_rows($retval); $day = substr($day, 5, 2) . "." . substr($day, 8, 2); $per = array("date"...
1
e07ff104724e671998ec251c0fb7abc6
96114fdd360a5e246d0d0f6e38d1aee8
Возвращаем уже занатые часы раба, на которые претендует текущий хозяин
public ArrayList<Point> build(Worker worker, Board board) { return getSharedTurn().build(worker , board); }
0
3cf1db131677d834ae26c3850e631669
47a0f8a1a81279b78d77ca448e03263f
requête retournant la dernière expérience publiée
class BaseConfessionDao extends AbstractDao public function findLastPublishedConfession() { $sel = $this->getTable(); $sel->where(self::COLUMN_MARK . ' != ?', 4); $sel->where(self::COLUMN_RELEASE_DATE . ' <= ?', new DateTime()); $sel->order(self::COLUMN_SORT_DATE . " DESC"); return $sel->fetch(); }
1
7efa2a6ed2f9280abe3e78bf97784c6c
37f74c8b6aa3fa4b327525a45343f07b
Presumably due to NHibernate proxy "magic", the C# 'is' operator isn't correctly identifying types which implement ISecurable. This extension method uses a slightly more verbose method that has been shown to work.
{ switch (type) { case IList: case IDictionary: case ICollection: case IEnumerable: return true; } if (type.IsArray) { return true; } if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>)) { return true; } if (type.G...
0
ba261df5210b3400dc0f04765a577c8c
e11cb78da13f8098507fb5807b8df32b
获取选择的性别
public class StudentsSearchAction extends ActionSupport public String getSex() { return sex; }
1
36e0340806baf34f272845c6719863b1
d435a9a8b5210140c81d19a6f4540b9b
Use data parallel to copy the model across several gpus. This will take all gpus visible with CUDA_VISIBLE_DEVICES.
class ReaderModel(object): def gpu_parallelize(self): self.gpu_parallel = True self.network = torch.nn.DataParallel(self.network)
1
0f6d3d13b67d5892d5d0412a439f5c60
7f61448ad6da3ef0f9cb03f40c5be655
{ <intro>
cases like (1)
0
2d5199725074942448e176f5c39312ab
c20eff191bcac7843a7613f0d981be6e
关联多个项目到一个借款
$where['loan_id'] = $loan_id; $data['project_id'] = $project_id; $data['loan_price'] = $price; $a = $this->model->get_one($where); if($a==true){ return $this->model->update($data,$where); } $data['loan_id'] = $loan_id; return $this->model->inse...
0
30c241c202832c7ce490396aeb9abd29
47419200e9d4ef2eaa74fe1e94387d47
Extracts the etag from the response headers.
{ string fingerprint = _fingerprintGenerator.Generate(ArrayFactory.Create(requestUrl, responseBody)); string eTagValue = $"\"{fingerprint}\""; return EntityTagHeaderValue.Parse(eTagValue); }
0
4e129739f9512aa653b339bced6f1637
573b7e6159e49f45077b602ab42a4048
Gets the flag if column is read only or not Creation date: (8/10/01 11:32:06 AM)
namespace Aurum.Xpo public class DBTableEx : DBTable public virtual bool ColumnIsReadOnly(DBColumn column) { return constraints.Exists(c => c is DBReadOnlyConstraint && ((DBReadOnlyConstraint)c).Column.Name == column.Name); }
1
99f64e5615e0927f5fbad722e2fe3335
87c3a35a0b10cd45da1fe3170c81fa42
从字段列表中,获取指定字段名的Field, 如果找不到就返回空。
public class FieldUtil public static Field getField(List<Field> fields, String fieldName) { if( null == fields || null == fieldName ) return null; for( Field f : fields ) { if( f.getName().equals(fieldName) ) return f; } return null; }
1
fe59710af9e0c328a787026a25f2c798
c7787b1b88ff7f751b8c5e08918c8bd5
Check if the bis login page shows the invalid credentials message.
browser.type("userName", "invalidUser"); browser.type("password", "password"); browser.click("//input[@class='imgLogin']"); browser.waitForPageToLoad(TIMEOUT); assertTrue("login should be rejected, error message must be correct", browser.isTextPresent("The following error...
1
eb75617e1525d7ca0c21427fe3b3c8ba
3c0a0caf24e1790e79f7cfe3edd8940b
Size setter
void Figure::setHeight(int pHeight){ this->_height = pHeight; }
1
9189050a5f3d3ef7084429512a86c901
1388874d0d9ab7e66b3466f468419011
Проверить, что данный компрессор включает алгоритм шифрования
class PhpRedisLock extends RedisLock protected function zstdCompressed(): bool { return defined('Redis::COMPRESSION_ZSTD') && $this->redis->client()->getOption(Redis::OPT_COMPRESSION) === Redis::COMPRESSION_ZSTD; }
0
cb56dbc8e5aada8d62f0a90d76dcce3f
1ada5dbdaa5b3a65dfec81143b4fbb15
This function sets the geographical coordinates and the directions of the horizontal vector points.
void Environment::updateGeoVectors() { double originLatitudeDegrees = background->getLatitudeDegrees(); double originLongitudeDegrees = background->getLongitudeDegrees(); double latRadians = originLatitudeDegrees*PI/180; double latRadius = abs(PLANET_RADIUS*cos(latRadians)); double longRadians = originLongitu...
1
da61a5ea442f393c204c8ad8aeaea048
c3a1b944db9dc3a31b8aac9d0b8be081
Tests the conditional And.
public class StateConditionExtensionsTest [Fact] public void TestAnd_4() { IStateCondition condition1 = new EqualCondition( "a", "1" ); IStateCondition condition2 = new EqualCondition( "b", "2" ); var and = condition1.And( condition2 ); var json = Json.ToJson( and ); var resu...
1
9bb828f2ef4c7915d56fd1ed5eadc83d
a35aaee6552cc9c59b9f85bd7839c802
门诊待缴费记录查询
class Payment extends Base public function outpatientQuery() { $orderNumber = $this->data['orderNum']; $hid = $this->hospitalId; $data = Loader::model('Order')->detailByNumber($orderNumber); if (!$data || $data['type'] != 4 || $data['project_id'] != $this->projectId) { Response::message(30011); } if (...
1
dfcd35cdc3f0f373a295c95b1acb4b86
10f6d47a3914df99f8d2ff681a6f2bcd
print the expression in pre-fix order (recursive)
class BinaryTreePrinter(object): def printPreorderExpression(self): node_list = self.tree.get_preorder_node_list() for node in node_list: print(' ' + node.data['word'], end='') print()
1
cc8a90a37ebaab557a3a8c45497b44fa
12598c679c6382f1b8d303525145a8ed
checks if the next token is escaped
if (pos < 0) { return false; } for (int i = 0; (escapeChars != null) && (i < escapeChars.length); i++) { if (buffer.charAt(pos) == escapeChars[i]) { return !isEscaped(buffer, pos); } } return...
1
85c35fe69e547f72a4f010adba4e61e9
992d3d593a795c10e003bf06ab6e944c
Get a nested property of a resource, via a dot-separated string path.
if (propertyPath == null || obj == null) { return null; } return propertyPath.split(".").reduce((current, nextProp) => { if (current == null) { return current; } return current[nextProp]; }, obj); }
1
7ff85dcf755ff3fda2730bcaf016daaa
3828683b5aed1093a5c0d226ca5e525b
Clean up double negations
def double_neg(phi): if type(phi) is str: return phi elif type(phi) is list and phi[0] == "not" and type(phi[1]) is list and phi[1][0] == "not": return double_neg(phi[1][1]) else: return [phi[0]]+[double_neg(x) for x in phi[1:]]
1
802c8ce5f4706bcd8167796e022045ea
ff05295759cbe6e44aec10776cf99649
replace the local lineage with the original one
def belowMinRank(index): rtest = [e.lower() for e in ranks[i][:-2]] return min_rank.lower() in rtest lineage_ids = resolver.retrieve('classification_path_ids') ranks = resolver.retrieve('classification_path_ranks') for i in range(len(lineage_ids)): merge = False referenc...
0
a68481b6defff4ee7aeeb1b5e9873355
5ea1c4b05b1a21a6e999157eff9b766b
\fn IASM(const IASM&) \brief Constructeur par copie du deassembleur (inutilisable)
divisor(const divisor&) = delete;
1
d53fdac1c33993f4cc9ac2457a85619a
537d059959bf7aa2a1cff9677cd633bc
得到某一课程的介绍、目标、适合人群
course = self.neo4j.get_course_node(course_name) if not course: return ResponseData(ExceptionMsg.NONEXISTENT_COURSE).encode() data = self.neo4j.get_course_adv(course_name) response_data = ResponseData(ExceptionMsg.SUCCESS, data=data).encode() return response_data
1
8b6ccd88dade4846812dd1b529fbc691
af44b58d48c52090ab7540348778a520
Run a multiline script locally and pass the environment variables to it.
class Local(object): def run_script(self, script, env=None, return_output=False): command = ["/bin/sh", "-e"] command.append(script) return self.run(command, env, return_output)
1
b9688d5dc96dcb9366cde1c1c77b662d
bfc56e6228e99741397d005ed17e9e73
Test building a shape where there is not a shape key.
inst = Drawing( shape_or_null=None, ) assert isinstance(inst, Drawing) self.assertFalse(hasattr(inst, 'main_shape')) self.assertTrue(hasattr(inst, 'shape_or_null')) self.assertIsNone(inst.shape_or_null)
1
cb20c9481f14630b069558ad35b4ad7a
e90a28ea7aff8ea4aafc9926c1f92f9d
Calculates closest intersection of the line and circle
double r = radiusInCircle(len(Vec(pa, pb)), len(Vec(pb, pc)), len(Vec(pa, pc))); if(fabs(r) < EPS) return std::make_pair(r, Vec()); double ratio = len(Vec(pa, pb))/len(Vec(pa, pc)); Vec pt = pb + (ratio/(1+ratio))*Vec(pb, pc); Line l1 = fromPoints(pa, pt); ratio = len(Vec(pb, pa))/len(Vec(pb, p...
0
de891b0f937879391c657aec2f429410
e6edebdddfcaeebddb7684d6aac710a6
Get the point indices being removed
namespace xms VecInt MePolyMesherImpl::GetPointsNoDelete() { VecInt noDeletePts(m_outPolyPtIdxs); for (size_t i = 0; i < m_inPolys.size(); ++i) { for (auto& ix : m_inPolyPtIdxs[i]) noDeletePts.push_back(ix); } for (auto& ix : m_refPtIdxs) noDeletePts.push_back(ix); return noDeletePts; }
0
a475a2c6024e82c460dd41499463fccc
c4625a9355a1565c8e33c6fdf0f40e56
Raised after damage is applied
ApplyDamage( self.damageTable ) local sound_attack = "Hero_Grimstroke.InkCreature.Attack" EmitSoundOn( sound_attack, self:GetParent() ) end
1
97369fc5b0560fc350e156144018e2f2
ae2fd98ed467150887fae9874d9bc230
Метод для отображения статистики о продуктивности сотрудников
{ int rowsCount = dt.Rows.Count; int columnsCount = 6; double total = 0; if (rowsCount < 1) { WarningMessages.WarningMessage(lblStatMessage, "No Data!"); return; } dataGridStat.RowCount = rowsCoun...
1
1e6c0b5b015df647376216a32c112efd
6dac64ef4abcd59e2e207055c26b888d
Servicio para obtener lista de Procesoss a partir de unos filtros
namespace Pe.Stracon.SGC.Aplicacion.Core.ServiceContract ProcessResult<List<ContratoResponse>> BuscarBandejaProcesosContratoOrdenado(ContratoRequest filtro, List<CodigoValorResponse> lstTipoContrato = null, ...
1
947a242449cd491a4ff791ef298bf63d
3f655d637df2664f6f7f63fe92c7d381
Deletes all web panels created by this application.
void removeAllApplications(NamespaceId id);
0
214ad699af916ba117088df0a989de23
3cd36b1d3a5067a35c5237f6e504bda7
メイン画面の表示テスト
class WelcomeTest extends TestCase public function testWelcome() { $this->withoutExceptionHandling(); $response = $this->get('/'); $response->assertStatus(200) ->assertViewIs('welcome') ->assertSee('「ITやデジタルは難しい。誰に聞けば…。」'); }
1
611262608c9589f74341d2a4fd27a977
661177759eb6f1ec54dff90c4fbc16d1
method GetWithOutHtml returns the boolean value of withoutHtml value.
namespace Webrowseren public class ConfigCollector public Boolean GetWithOutHtml() { return Convert.ToBoolean(ConfigurationSettings.AppSettings["withoutHtml"]); }
1
5ff072b73be0de9b3ece939bb3f2d15e
18429afdce0cf7954cd081288abf086d
Метод проверяет - находится ли новая голова в пределах комнаты
{ Point nextStep = this.getPointForward(this.getHeadPosition()); if (this.tail.Contains(nextStep)) { return false; } if ((nextStep.X > 59 || nextStep.X < 0) || (nextStep.Y > 9 || nextStep.Y < 0)) ...
1
96a8788213e91753976c01383654edeb
484109fc7a30a445ad8b970d5ad3312b
读取无格式结果文件
def read_result(path): results = {} with open(path, mode='r') as f: data = f.read() data = data.replace('\t', ' ') data = data.split('\n') for item in data: if item != '': s = [i for i in item.split(' ') if i != ''] if s[0] == '#': ...
1
19af0ec437495740d2cea5c95bb44678
cf6a23618e9d5227fdaab42d3331c6f7
Overrides ==
namespace jswf namespace avm2 bool Object::operator ==(const Object &rhs) const { if(klass == rhs.klass) return sameTypeEquals(rhs); if((dynamic_cast<const NumberBaseObject *>(this) && dynamic_cast<const StringObject *>(&rhs)) || (dynamic_cast<const NumberBaseObject *>(&rhs) && dynamic_cast<cons...
1
8124f53c58c9e3c69cf9a9d1f66ad99c
ce407554729042c7df60ebdf5d37fc69
Destroy the collidable's hitbox(s)
CCollidable::~CCollidable() { }
0
220cb3a2a358b6bcda9d9427e410a0b6
59bda7ee85931c07458790e826d800bd
如果有輸入訊息
class index extends Connect{ function indexMessage(){ if (isset($_POST["submit"])){ $mesname=$_POST['mesname']; $mesemail=$_POST['mesemail']; $messubject=$_POST['messubject']; $mescontent=$_POST['mescontent']; if($_POST['mesname']!="" && $_POST['mesname']!=""&& $_POST['mesema...
1
364ce0d21c9e8534ae39cd29fc6ebcb9
83d972d3b702bc711149659b1a20edf3
根据保险单Id获取保险理赔单集合。
@Repository("claimRelatedPolicy") public class ClaimRelatedPolicyDao extends SqlMapClientDaoSupport public List<ClaimRelatedPolicy> getByClaimNo( String claimNo) { return (List<ClaimRelatedPolicy>) getSqlMapClientTemplate().queryForList(ClaimRelatedPolicyDao.class.getName()+".getByClaimNo", claimNo); }
1
4ae43af56a5c657cefe517f0c896c103
e62364702c0890529ca4eb7e6fe32570
投稿画面に投稿種別メタボックスを追加するために呼ばれます。
class Post_Type_Gallery function add_meta_box() { add_meta_box(self::POST_TYPE, self::META_BOX_TITLE, array( $this, 'meta_box_html'), self::POST_TYPE ); }
1
305752f1065ad7bba54664035c77d4c1
6f640d59f3f767f3c77417c01481eb91
вычисляет цвет пикселя на основании своих соседей
namespace ClickmaniaFinal class Game private void Nieghbor(int rowIndex, int colIndex, int colorClick) { int[,] f = { { 0, 1 }, { 0, -1 }, { 1, 0 }, { -1, 0 } }; for (int i = 0; i < 4; i++) { if (rowIndex + f[i, 0] < field.GetLength(0) && rowIndex + f[i, ...
0
0585a72352b6835ffd56a5663d58923a
41b7bb7cd3809201e8fedfb9781204c0
credentials(주로 비밀번호)을 가져옴
@Data // principal (접근 주체) = 세션처럼 사용 = Spring Security Context 에 보관 됨. public class PrincipalDetails implements UserDetails, OAuth2User{ @Override public String getPassword() { return user.getPassword(); }
1
68e25b4f2976be530070e6a67832c60f
134900630bc1caeca521da859d1178c8
Load swc file into multidimensional array
def load_swc(file_name): df = pd.read_csv(file_name, delimiter=' ', header=None, comment='#', names=['sample', 'identifier', 'x', 'y', 'z', 'r', 'parent'], skipinitialspace=True) return df
0
764d8899b552c17309c1533dc82ec802
28baf8d7418bb11e59a37a0be5f891d9
Moves all the items before the passed `id` to the end of the array. This is useful when we want to loop through the items in the same row or column as the first items will be placed after the last items. The null item that's inserted when `shouldInsertNullItem` is set to `true` represents the composite container itself...
if (index >= this._d.items.length || position >= this._d.items.length) return false if (index < 0 || position < 0) return false this._d.items.splice(position, 0, this._d.items.splice(index, 1)[0]) const item = this.items[position] this.emit('moved', { index, position, item, user }) this.emit('up...
0
7754f024b5ae287f54eec984f57b968d
5def09387a8caa472a3a185461777096
Reset proxy parameters in JVM which is enabled during starting a sink Task. Call this if your test/code executes the Utils.enableJVMProxy function
public class PersistenceManagerFactory public static class PersistenceManagerFactoryBuilder public PersistenceManagerFactoryBuilder disableProxiesWarmUp(boolean disableProxiesWarmUp) { configMap.put(PROXIES_WARM_UP_DISABLED, disableProxiesWarmUp); return this; }
0
7924313deb7c8e8c14ab41fad5734926
525f1357d63bf9ce216b60535304723b
Get information about a single offer from Your Allegro.pl account
public function getActualOffer($params);
1
7a0457572e800a8f969173328061b365
95e7c4bebf6b22ede208c5f62dba937d
Move cursor right one char
void editor_right(editor_context_t* context) { if (context->cursor_index >= context->current_length) return; context->cursor_x += fontlib_GetGlyphWidth(context->str[context->cursor_index++]); }
1
ef6ff0f6ad47cbbebef02303e39a0b8d
13d57e19ae95f1e4b106a244544f2436
This method returns an expression where the occurences of the registers present in the reg_dict dictionnary are replaced by their corresponding value in the dictionnary
def __dict_replace(s, d): for key, value in d.items(): s = string.replace(s, key, value) return s
1
06730ba91d5dbbcd1321b58a6eb8059d
040b522aa41fb41efd9af3bc9d484b71
Create ellipsoid with a, b and c as half-axes and npoints the number of points (has to be an integer) return an array with shape (npoints, 3)
def randomSpherePoints(n): r = 1 phi = np.random.uniform(0,2*math.pi,size=n) costheta = np.random.uniform(-1,1,size=n) theta = np.arccos( costheta ) x = r * np.sin( theta) * np.cos( phi ) y = r * np.sin( theta) * np.sin( phi ) z = r * np.cos( theta ) return (x,y,z)
0
b14ced4670257e837f832835d6864ed6
f95748705c8949c80ede403f6c80af6b
Execute non-piped commands.
logging.msg("pipe", cmd, "user=", str(user)) pm = proctools.get_procmanager() if type(user) is str: user = passwd.getpwnam(user) proc = pm.spawnpipe(cmd, pwent=user, callback=self._status_cb) text = proc.read() sts = proc.wait() proc.close() re...
0
4f84f86e98956a9011baa80467fa631b
30d4a87dda7ef38587f9c50475e72073
检查数字录入是否正确
function checkInput(inputNumValue) { if(inputNumValue.length <= 0) { alert('请输入一个数字'); return false; }else if(!/^[+-]?\d+(?:\.\d+)?$/g.test(inputNumValue)) { alert('请输入一个数字'); inputNum.value = null; return false; }else if(/^[+-]?\d+(?:\.\d+)?$/g.test(inputNumValue)){ ...
1
67eae8dde326a3296d67089561c3ceab
deaffd0c6531f7bd6c5182ef0e103969
Gets the minimumSupportedOperatingSystem property value. The value for the minimum applicable operating system.
class WindowsPhone81CompliancePolicy def os_minimum_version=(value) @os_minimum_version = value end
0
ff940ce7be3f4d18b70db81b3e8d2292
0019e04d1bb754f08683859716147df3
判断本地是否存在图片或图片文件大小为0KB
public class HXImage extends Img{ private boolean isHasBitMap(){ boolean hasPhoto = false; File file = new File(ALBUM_PATH + fileName_); if(!file.exists()){ isNeedDown = true; hasPhoto = false; } else if(file.exists() && file.length() != 0){ hasPhoto = true; ...
1
b54af8021e2b3accac7d334ee5b99ab4
f4b9c3fb24c9680b93acf61e128620cc
if target indices exist, they must be the same
if t1.get("target", 0) != t2.get("target", 0): return False if t1.get("subtarget", 0) != t2.get("subtarget", 0): return False return True
1
dc033bf14827d1fead861ea282752c09
625867ecdb6d6e8ce255727d5f5e0e22
Returns whether the given extra path type is supported.
return ext != null && !(EnrichCallingService.CALL_COMPOSER_FEATURE_TAG.equals(ext) && !isCallComposerSupported()) && !(EnrichCallingService.SHARED_MAP_SERVICE_ID.equals(ext) && !isSharedMapSupported()) && !(EnrichCallingService.SHARED_SKETCH_SERVICE_ID.equals(ext)...
1
12a517a6d6a1a7928890a1657410e85b
db7c31a1e76d1c642eab35c097fe582e
Изменение позиций доп. полей пользователей/групп
{ var documentPosition = DocumentPosition<DogovorPosition>.LoadByDocId(int.Parse(Id)); documentPosition.ForEach(delegate(DogovorPosition p0) { var p = DogovorPositionList.FirstOrDefault(x => x.Id == p0.PositionId.ToString()); if (p == null) ...
0
994900687b530aa7362b3b05fe27b4d7
e81d1432c9c07de36abb325c8ac7d947
下载趋势
void getTrends();
1
1303f78e119e3f8d36b48123165ba063
dbdaa6eacf098da3fd2606b572520736
Implements the regime change logic.
def regime_switch(betas, threshold=1e-5): n = len(betas) init_points = [0] curr_reg = (betas[0]>threshold) for i in range(n): if (betas[i]>threshold) == (not curr_reg): curr_reg = not curr_reg init_points.append(i) init_points.append(n) return init_points
1
b98bccdae9bb982adc2f1c463c172c1d
ec386677cb65083cb52d2ec8645d7e3b
Standard implementation returns null. This can be used to sepcifically load fields. For example, "roles" for users.
class Entry: def _get_field(self, _field): assert 0 and "Unimplemented method _get_field()!"
0
1c697e10bb2879f44313c1bce2e8b333
23ed152c08787b3a75e6b0c4f87565dd
今日日付取得
val date = Date() val syoriYmd = SimpleDateFormat("yyyyMMdd") return syoriYmd.format(date) }
1
1d54608cbab2febdc2c297fb1d33f2a2
aa73c8ec0e40882e5a29e3cc07795a92
Less-than for OrderableCows
class Carre: def __lt__(self, other): lower = self.side < other.side return bool(lower)
0
6f6e48c9e09a3b47e2fd33f0d1d3ee71
84b0ee2d4ec4a191d2c42848c29d1c7e
Takes as parameter the total number of a particular baked good and returns the discounted total price for that baked good.
def discountTotal(price, discount, numBooks): discounted = price * (1 - discount) * numBooks return discounted
1
afe276d5f8f4b49c353cfd687fbaf87f
27031c37c2fcdb33559b66b7033dfcdf
onToolNew @Purpose: perform new measurement setup for toolbox - new
class HP8903BWindow(Gtk.Window): def run_test(self, button): self.run_button.set_sensitive(False) self.action_filesave.set_sensitive(False) for w in self.measurement_widgets: w.set_sensitive(False) for w in self.freq_sweep_widgets: w.set_sensitive(False) f...
0
2afe409532a01ebd3042a533d7d1e8ae
12675f69234f5a4e34e96ccddbe7fdc0
This exception indicates that a mathematical expression is missing a parenthesis where one is required (e.g. to balance another).
public class EmptyParenthesisException extends Throwable public String getMessage() { return "Chemical compound contains an illegal empty parenthesis."; }
0
ca6b59721ce3c6f04a86167382a8bd21
6b45f6f22da8051a42bfd0ee41610797
Measured wires are replaced by classical wires.
public class WireElm_1 : CircuitElm public override bool isWire() { return true; }
0
2fead8c1b06f1b66b70a64f00735d423
756a3353b53514990c039e00ccfa9c94
Gets rows from the datasource based on the IX_Appointment_CustomerId_ContentId index.
{ int count = -1; return GetById(transactionManager, _id, start, pageLength, out count); }
0
b25bbb814352cd0ea9e66a0ca0b4a66d
d3d765621e64d98252b81e14f0b31eb9
Procesa la cadena entregada usando el AFD generado
Finales = [2] estado_actual = 0 for caracter in cadena: estado_proximo = d_bigorequal(estado_actual, caracter) if estado_proximo == RESULTADO_TRAMPA: return RESULTADO_TRAMPA estado_actual = estado_proximo if estado_actual in Finales: return RESULTADO_ACEPTADO else: return RESULTADO_NO_ACEPTADO
1
d06ac3ac07b77716a1897320c1179a2e
137e0b5fd17519cb7d4127944469f7ca
切换是否绝育
switchzq(){ this.setData({ iszq:!this.data.iszq }) }
1
4c8a65573c043484a42c3cb05ff789b5
e3f02d7d87c3fe247d209ba83b03ba86
Chooses a target based on proximity (for attacking towers/enemies) or priority (enemies prioritize the avatar)
public class ChasingCrawlerScript : MonoBehaviour private void handleTarget() { print("SET NEW POSITION?"); if (CheckProximity(2) || CheckProximity(3)) { if(chasingCrawler.active == true) { chasingCrawler.GetComponent<Animator>().Play("crawl");...
0
c28fa20edd924652a023635d689157bc
394e27b20e383ee1902ee75fd32076ec
for now just a daily handler, called at midnight. later we can add additional handlers for weekly, hourly, ...
now: datetime = datetime.now(timezone('Asia/Kolkata')) if now.hour != 0: return resetDaily() if now.weekday() == 0: resetWeekly() if now.day == 1: resetMonthly()
1
7163b025e36c3098a56c15ae2fdf8c75
22a3a036460186607606977911d637ac
Перебор контролов и вложенных в них контролы и делаем кнопки круглыми. С нулевой вложенностью не работает
{ for (int i = 0; i < gv.Controls.Count; i++) { if (gv.Controls[i].GetType() == typeof(Button)) { Button btn = (Button)gv.Controls[i]; Literal l = new Literal(); l.Text = btn.Text; ...
0
e7dface714b1ce84fd901d44387acebe
77f52af582931f2849ba99e810c534f3
add atem object to the container
int flags) { #ifdef PENNMUSH atr_add(obj, atrname, val, owner, flags); #endif #ifdef TM3 int atr; char name[SBUF_SIZE]; strcpy(name, atrname); atr = mkattr(name); atr_add_raw(obj, atr, val); #endif }
0
a03446f5b8ccfdae139dc613e9017a36
15c84fd6cdee482dae6e82adcb3f5037
Accept a rendered frame from a client.
public function screencastFrameAck(ContextInterface $ctx, ScreencastFrameAckRequest $request): void;
1
c4d6a7a05d4fcb8185128c32a4f55b18
0cdee0e587e4c5450cc9d68cc15aced7
Insert or update data collection.
namespace Stream Task<ResponseBase> UpsertAsync(string collectionName, CollectionObject data);
1
107848ac62d9e80788b289efd3bd0d3b
26ca11a6b9e70fd5b03a103cc2abb0df
通过名称移除指定activity
KLog.d("CurBaseName=" + name); ArrayList<Activity> removelist = new ArrayList<Activity>(); Iterator<BaseActivity> it = actMap.values().iterator(); while (it.hasNext()) { BaseActivity ac = it.next(); if (ac == null) continue; String cur ...
1
4e77cd18145970af9ef09273ee4d69d5
e53195be20c3bac20842ea7fc1810f0b
Adjusts the position of the camera based on the information of the two nodes closest to the player
public class CameraController : MonoBehaviour void CalculateCameraPosition(float hDistance, float vDistance) { float totalAngleChanged = target.transform.eulerAngles.y + angleAroundPlayer; float offsetX = (Mathf.Sin(totalAngleChanged * Mathf.Deg2Rad)) * hDistance; float offsetZ = (Mathf.Cos(...
0
e0d89ed907e01f6982fe92e8e5b439db
85bebdb2c116f13245ccba5798ac5868
Facebook 登录
export class AuthenticationService FacebookAuth() { return this.AuthLogin(new auth.FacebookAuthProvider()); }
1
7609c663352a609e9123121294b693ae
0865375e30b4b69701305962f6cdbc0f
@brief Permet d'accéder au nouveau mot de passe entré par l'utilisateur
QString Inscription::getMdp(){ return ui->lineEdit_mdp->text(); }
1
6db7790fbf9f4271949b5fa7379fa35f
9929b3d0d3c9b99966e6471f0191ce84
根据GetQRCodeTicketResultDto - 获取二维码Ticket结果数据结构对象,创建二维码图片
public abstract class BaseController protected WechatQrcode getQrcode(QrCode qrCode) throws Exception { QrcodeAPI qrcodeAPI = new QrcodeAPI(WechatTokenConfig.getInstance().getAccessToken()); QrcodeResponse qrcodeResponse = null; WechatQrcode wechatQrcode = new WechatQrcode(); qrcodeResponse = qrcodeAPI.createQr...
0
106bb239a6103d8b79c10f8d0384d115
85c5dd3299a986f98d942a14956b42f8
Lấy vị trí hiển thị của tabtoolbar
int getTabViewId();
0
8fe03304fdcf5b82d63ef736a3ed7192
feabf5f484be07f390a9d8f96b3b5763
BD09 坐标转 GCJ02 坐标
namespace YanZhiwei.DotNet2.Utilities.Common public class BDGCJLatLonHelper public LatLngPoint GCJ02ToBD09(LatLngPoint gcjPoint) { LatLngPoint _bdPoint = new LatLngPoint(); double _x = gcjPoint.LonX, y = gcjPoint.LatY; double _z = Math.Sqrt(_x * _x + y * y) + 0.00002 * M...
0
cfd2c4255956ced69c22a42ff8858947
f2d6a9213982d9aaaf1d782c93dbbc5f
Return a list of all values whose keys don't start with '_
return [ (k, v) for k, v in self.data.items() if not isinstance(v, IsConfiguration) ]
0
e1176b4b64fe4f0f9e1576014c30db39
9ef643ae99e14dd140d3b29030930fbf
Returns <code>true</code> if current operation is a drag and drop.
namespace wf class xwayland_view_controller_t bool is_dnd() { return wf::xw::has_type(xw, wf::xw::_NET_WM_WINDOW_TYPE_DND); }
1
e4da83060157cc60d8dcb198359d8fcc
1c73f3b52e7dae3856babc11eab3c91d
Reset aim status (Not targeted anymore)
public class MouseLocation : MonoBehaviour public void StopTouchAim() { isTouchAiming = false; }
1
a59adc09c5cfe9f50e233e6e23f8b3d8
b4fe37ec3cd4dddae685c9c7977af26c
Get the ellipsoid's I{flattening} (C{float}), M{(a - b) / a}, C{0} for spherical, negative for prolate.
class Ellipsoid(Shape3d): def get_b(self): return self._b
0
c0078ccf1f4e43dd3a5e65935262a729
c5629a16d6931a617844d4a7d211e1bd
Register audit action resolvers.
{ $resolver->setDefaults([ 'class' => User::class, 'label' => 'label.user', 'choice_label' => function (User $user) { return $user->getDisplayName(); }, ]); $resolver->setDefault('query_builder', function (Options $options) { ...
0
a8c3949c9654fb22ef702d8806959ee5
ff90baf0c36953a8e8c8c973b4292e38
Method to set the base color scheme
numCols = 4; baseColors= new int[numCols][3]; baseColors[3][redComp] = D2KColors.D2K_RED.getRed(); baseColors[3][greenComp] = D2KColors.D2K_RED.getGreen(); baseColors[3][blueComp] = D2KColors.D2K_RED.getBlue(); baseColors[2][redComp] = D2KColors.D2K_YELLOW.getRed(); baseColors[2][greenComp] = D2KColors.D2...
1
3741c5f058ac43349be994f3d7c02cc8
c0142368c89536dce386078f3c5c9d97
Serializes data and sends it to device using device communication.
static void sendDataToDevice(uint8_t * dataBuffer, uint16_t dataBufferLength){ const uint16_t dataLength = strlen((const char *)dataBuffer)+2*sizeof(uint8_t); uint8_t commandBuffer[dataLength]; uint16_t i = 0; for(i=0; i<dataLength; i++){ if(i==0){ commandBuffer[i] = 0x03; }else if(i == 1){ commandBuffer[...
1
2c8b3098a917f3710268e4fe38b03b96
f7e05ea46f4c191fab65586ddd6dcdac
This controller helps to send message from admin to all registered users.
class MessagingController extends Controller public function index() { $role = Sentinel::getUser()->roles()->first()->slug; $this->views['isAdmin'] = $role == 'admin' ? true : false; $this->views['users'] = $this->user->getUsers(); return view('messaging::index')->with($this->views...
0
26eb3891d9ccc175fde78d869f60ab32
e877e713f6bc591edcca733548dc2bdd
Counts number of published posts
class VB5xExporter extends AbstractExporter public function countPosts() { return $this->__getMaxID($this->databasePrefix."node", 'nodeid'); }
0
c7a3dc4cf118cff5ec1879d3c64d6fdc
bbf5186bee22d0275a84bfa2022a42ca
Get configurations from Spring, merge them into the configurations of ServiceComb.
public class Microservices public MicroservicesConfig getMicroservicesConfig() { if (microservicesConfig == null) { microservicesConfig = config(MicroservicesConfig.class); } return microservicesConfig; }
0
fb28cb1a18b42d415fe54bec0dda8a5b
ebb9c56cf94575c2bd60007a2d6cf37e
Print statistics once classification has finished. This is called after all test predictions are made to allow the display of any summary statistics that have been accumulated in the teststats object through use of the eval_prediction function. If this function is not implemented, the default behavior is equivalent to ...
class Trainer(cntk_py.Trainer): def summarize_test_progress(self): return super(Trainer, self).summarize_test_progress()
0
59d6e6694a79add575b59ed1494fa82d
ae42c63a9632ffd2a170517d016ac506
Выполняет подсчет контрольной суммы заголовка IP
ip_make_checksum(uint8_t *ip) { IP_SET_CKSUM(ip, 0); uint32_t cksum = 0; uint8_t *ptr = ip; uint8_t hdr_bytes = IP_GET_HDR_LEN(ip) * 4; for (int i = 0; i < hdr_bytes; i += 2) cksum += ((uint32_t)(ptr[i]) << 8) + ptr[i+1]; cksum = (cksum >> 16) + (cksum & 0xffff); cksum += (cksum ...
1
5b008d6c26bdcc5d1354af74136c79c7
7a12f00b5a7a437ab84922647724292b
2. Упорядочить и вывести числа в порядке возрастания (убывания) значений их длины.
val reader = BufferedReader(InputStreamReader(System.`in`)) val outputSize = reader.readLine().toInt() readAllLines(reader, mutableListOf()) .map { line -> line.trim() } .filter { line -> line.isNotEmpty() } .sortedWith(comparatorOfCharLengthDesc()) .let { sortedLines -> ...
1
deb154f082013e319411d1e137868bfc
8cae02e623e8a4e01cbe24c732aa352d
修改客户咨询信息
class StoreController extends SupController public function modify() { if(IS_POST) { $data = I('post.'); $ke = D('ex_kefu'); if($ke->save($data)) { $this->success('修改成功',U('customer_list')); } else { ...
1
a928d32f91ce7e6d117c18fd21bd6098
cca6569ad9f6cd2105c81f634aa7a3dd
Блок личных сообщений
class PluginSimplerating_ActionAjax extends PluginSimplerating_Inherit_ActionAjax protected function EventBlogsSelf() { if (!$this->oUserCurrent) { $this->Message_AddErrorSingle($this->Lang_Get('need_authorization'), $this->Lang_Get('error')); return; } if ($aBlogs = ...
0