query_id
string
corpus_id
string
query
string
code
string
label
int64
de6564ddaa43ff52fe9568364db4cb3a
2f35e0bd0fc06024c78b85cd2cb821fb
获取建筑目录
public class Novel17SearchJsoup public List<Catalogue> getDirectory() { if (catalogues != null) return catalogues; if (docDetail != null) return Novel17DirectoryUtils.getDirectory(docDetail); return null; }
0
edc174cdf4f9cd4873cc9207481c26e7
583ac6f00f66594960157021e7dace83
Reset the number of hours worked in a week to zero.
def _reset_every_hour(): for key in info_dict: info_dict[key][0] = 0 info_dict[key][1] = 0
0
c2c82a6cc77323b80eb6d4b56a21d9bd
b7ef81db3394eead081a909c296e4b4a
Set players mark.
void CPU::setLetter(char const &player) { if(player != 'X') m_letter = 'X'; else m_letter = 'O'; }
1
159d0b3ad2a845f94a3903c05dce9fae
be76415817035200beba2b3b935b8460
Testing if graphiz graph works.
$graph = new Graph(); $graph->createVertex()->createEdgeTo($graph->createVertex())->setFlow(1); $alg = new ResidualGraph($graph); $alg->createGraph(); }
0
525d87d1d7db5dac22115b04a9395708
dc574a1afc70444503e63653e5fb463d
Parens Open will always start a predicate
if (matchCloseBrace(scanner)) { for (String sequence : sequences) { if (matchWsSeq(scanner, sequence.toCharArray(), true)) { Log.trace("Matched predicate sequence"); return false; } } Log.trace("Matched action sequence [char=" + on(scanner) + "]"); return true; } Log.debug("Missing c...
0
9be2159e123b703a2ddffdfa567d119d
825c15c76344474557175a0d5d14e9a3
Queries a top tier domain by the domain
namespace Cloudmersive.APIClient.NETCore.Validate.Api ValidateUrlResponseSyntaxOnly DomainGetTopLevelDomainFromUrl (ValidateUrlRequestSyntaxOnly request);
0
5aeb4391e4cc16d5e8c43c9fc4f5b163
9975f28b4761dfef993c7fec4d68a43a
Updates an existing LocationManagerAvailability model. If update is successful, the browser will be redirected to the 'view' page.
{ $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->Id]); } else { return $this->render('update', [ 'model' => $model, ]); } }
1
0f8d82996a454d67f7cd643da24154ae
3acf0a5a73271d39c399aa6fe72adbee
選択される都道府県が変更された際に市町村データをリセット
if (e.selectedItem !== null && e.selectedItem !== undefined) { this.bindGovernmentCommunityData(e.selectedItem.cityId); } }
0
613b10945150de7a6f651a7a03334443
63ed9946389e4878d6a1d275f9bc1ead
event handler to check if user clicks red x to exit, and exits if so
namespace AnimateJS public partial class Animate : Form private void OnExitClicked(object sender, EventArgs e) { Close(); }
1
af1a115118e8fff68e36d275ab798a38
914be0c8964cfafe21703c394793ecd5
List Network Zones. This function performs a `GET` to the `/api/v1/zones` endpoint. As opposed to `list`, this function returns all the pages of the request at once. Enumerates network zones added to your organization with pagination. A subset of zones can be returned that match a supported filter expression or query.
class Connection(ApiClientConnection): def list_zones(self): return self._get_iterator( self.service.managedZones().list, self._get_args(), Zone, items_key='managedZones' )
0
209664946656889c2fd41de502fb78bc
5607f04fd083085e17293ba480033433
POST: BlogPosts/Create
[ValidateAntiForgeryToken] public ActionResult Create(Post post) { try { MyNewContext.Post.Add(post); MyNewContext.SaveChanges(); return RedirectToAction(nameof(Index)); } catch { ...
1
1534c5839562ba7e8cfe11193a4afa96
e5cf30ae82e6c9e6c1d6bc6b6c2ca689
要求指定用户客户端变更指定用户数据
{ var nReceiveUser = BLUser.GetUser(nUserID); DomainUserChange(domainName, nReceiveUser, noteCode, ignoreFromUser, dmpw, opUserID); }
1
fa59b334c33dd0bcd3e19fb15118655f
de09b8db92f3b13250972a9922c16887
获取推荐规则
interface IRevenueRulesPresenter : IBasePresenter fun getRevenueRules()
0
b295efcc8b5dbec4ad8157a0821df577
c5e9ea97c96aeda07826d9d4d3221c4a
返回有序集 key 中成员 member 的排名。其中有序集成员按 score 值递减(从大到小)排序
class RedisSorted zrank (key, member) { return this.redis.zrank(key, member); }
1
b8f9a364f42d983bd80b10db069764b5
5c05af2b4cccc32372af4e0c82de237a
在新創建文件夾時,得到一個新文件夾名
function appController(dt, $location, $scope, $timeout, $state) function _getFolderName() { var name = "New Folder"; var index = 0; var check = name; var search = true; while (search) { var found = false; for (var i = 0; i < vm.folder.children.length; i++) { if (v...
1
880ef7e74d1e075bcdb38f4dd7f0c6b7
2ebf488fe97672d5e615a3f1bb87b05c
数组变ini配置数据
settype($ini1, 'array'); settype($ini2, 'array'); foreach($ini2 AS $k=>$v) { if (!isset($ini1[$k]) || !is_array($v)) { $ini1[$k] = $v; } else { $ini1[$k] = self::MergeINI($ini1[$k], $v); } } return $ini1; }
0
b5bf644d20a80d14ca58b1e6daa9b1e2
59d5f18a010f1c74b8a1482d40594d4f
Get all the methodeLuttes.
class MethodesReglementsController extends FOSRestController public function getMethodesReglementsAction() { $methodesReglements = $this->getDoctrine() ->getRepository('AppBundle:MethodeReglement') ->findAll(); return $methodesReglements; }
0
d273ba2f7ba1bd0e7f6b4196a6f16fce
8152c4b2687956ac403c57403c37723a
IndexOf should return negative one if the given character isn't found.
public void Types_StringIndexOf() { string message = "Hello, Captain America!"; int indexOfCaptain = message.IndexOf("Captain"); Assert.AreEqual(7, indexOfCaptain); }
0
b566ef99bb127c5cdd91e9066bd52c41
2ac2dd45cb4f5ee4bf3ae6835354c601
brief - Employ Kawasaki Monte-Carlo
int ix,iy,accepted_config_counter=0; for(int i=0;i<m_L*m_L;i++){ ix = (int) (uniform(rng)*m_L+1); iy = (int) (uniform(rng)*m_L+1); int DE = 2*S[iy][ix]* (S[iy][ix+1]+ S[iy][ix-1]+ S[iy+1][ix]+ S[iy-1][ix]); bool flip = uniform(rng) <= w[DE+8]; accepted_config_counte...
1
c62d77ae6cae6b296b9eacd331ba467a
48076d9d7e8d3ff6b55099328144537f
Iterate through the RAT containers and suspend the active channels.
for (auto it = _channels.begin(); it != _channels.end(); ++it) { if (!(*it)->isStopped() && !(*it)->isPaused()) { (*it)->pause(); } } }
1
8f279f6c6d387debbf44863b0025a619
bdeb443aa4ac2fbe5104b629770890bb
Removes and returns the first element of DQ.
namespace Q T DequeueFirst();
1
5a900358b0bfb650c06b47c9c25f73ad
d76456b64ba0f496ba55b2cce97cc5e1
Block until an item becomes available, and then dequeue it.
if block: self.esema.acquire() elif not self.esema.acquire(0): raise Empty self.mutex.acquire() release_esema = True try: was_full = self._full() item = self._get() if was_full: self.fsema.release() ...
1
d5190ee925e35200e5f44910ddf0c6d1
51ca40ef90be34f73234ef0a84d5591d
Este metodo cambia el estado de exeHalt una vez que se ejecuta HALT. Lo vuelve a cambiar a false.
public abstract boolean getHalt();
0
a002e4f1acc141b6168f6165665d4b4b
3214ed8850e8d68a689e84bf522466c5
Generates an in order list of all vertices of a_poly interlaced with it's intersections with a_intersectors in O(nm) with n the number of segments from the one polygon and m the number of segments of the other polygon
namespace Algo.Polygons public class VertexSimplePolygon private static LinkedList<Vector2> WeilerAthertonList(VertexSimplePolygon a_poly, VertexSimplePolygon a_intersector) { var intersectionList = new LinkedList<Vector2>(); var intersectingSegments = a_intersector.Segments(); ...
1
d837321ae785e8b7f8e2888c9b9743a4
2ed4cbfb0531bb58b964fa0ac2518c43
handles communication with arduino
def steer(): global command_client global ArduinoPort send_inst = True try: while send_inst: sleep(0.1) recvCommand = command_client.recv(1024) if (recvCommand=="q" or recvCommand==""): command_client.close print 'Exit' ...
1
0e7cf15be75571fb3b7e058b1ab5e2c5
eb8f88dc9992fc7ccd44e93929e2ed62
Sprawdza, czy dany collider jest prostokątem.
{ float halfWidth = width / 2; float halfHeight = height / 2; var topLeft = new Vector2(center.x - halfWidth, center.y + halfHeight); var topRight = new Vector2(center.x + halfWidth, center.y + halfHeight); var bottomLeft = new Vector2(center.x - halfW...
0
381545616df4b4b3dca7ac18186dee92
7855885eaa89c99666525e727cffca0c
Maps forms error messages with corresponding translation
class Impounding implements MapperInterface public static function mapFromErrors(FormInterface $form, array $errors) { if (!empty($errors['messages'])) { $formFields = $form->get('fields'); foreach ($formFields as $element) { if (array_key_exists($element->getName(), ...
0
e12f33da213136fefac05142ff4ce8e9
5e647c6f72860745053ee2c1d93c5209
GET: api/crm_usuariovsgrupo
{ sesion = Session["vars"] as ContenedorVariablesSesion; List<string> validacion = new List<string>(); List<UsuarioViewModel> Usuarios = null; try { string[] Grupo = new string[] { "GR Jefes", "GR Gestor Compras" }; Usua...
1
6a6f03cb1720d8274353cd9a5cf24acb
3664c4a165d0ee8ea728f78a05ac2db3
Once our order is created, this method places the order with the restaurant.
namespace RestaurantPOS.Repositories.Interfaces bool PlaceCustomerOrder(CustomerOrder customerOrder);
1
c02e42d40dc5e791b979c00adc3c72aa
0cdd895dd2ae1372decbfca1c82a40b4
Test of potencia method, of class JUnit.
void testCalculPuissances() { double pi=3.1415926535897932384626433832795028841971; testCalculPuissance(pi,3,pi*pi*pi); testCalculPuissance(pi,5,pi*pi*pi*pi*pi); testCalculPuissance(pi,7,pi*pi*pi*pi*pi*pi*pi); testCalculPuissance(pi,9,pi*pi*pi*pi*pi*pi*pi*pi*pi); }
0
324aacea8ed53c683f8183b2b54af471
d465e063547eb237608a8a2909ac3ddc
Construire une nouvelle étape de quete
$('#sommaire').html("creation des jours"); nbEtape++; nbJour=0; $('#nbEtape').html(nbEtape); $('#nbJour').html(nbJour + 1); var maxEtape = $('#nbEtapeCircuit').val(); if (nbEtape > maxEtape) { $('#messages').html("max Etape"); $('#contenuJour').show(); $('#contenuEtap...
1
15298b9755713f4fd971cc8824acadb2
f83cc2afacefea7a37489832561621f6
skip if it's not a sectionmarker (so far - could also have to do textboxes and other stories)
protected boolean acceptLayoutSection(int sectionNumber, LayoutSection editLayoutSection) { return sectionNumber == 0; }
0
25a6aff615b867fb1e0cf7eb73562df6
3afe0e0d841360ccfae26223e5b1d472
获得碎片集
local acVo = self:getAcVo() if acVo ~= nil then return acVo.piecesCfg end return nil end
1
82f5460736e740e652730d216315fdcb
285efe555947b0aafdfa12476ff18837
Inverts the greyscale (Black to White, White to Black)
int nx = input.getWidth(); int ny = input.getHeight(); ImageAccess output = new ImageAccess(nx, ny); double value = 0.0; for (int x=0; x<nx; x++) for (int y=0; y<ny; y++) { value = input.getPixel(x, y); value = 255 - value; output.putPixel(x, y, value); } return output; }
1
da88b34bf7935826eae7704f7d9b1121
d12a09646986c8f04c8752b9578330d7
Create an instance of {@link CtSituacaoDentes }
public class Registro1500 public SituacaoDocto getCOD_SIT() { return COD_SIT; }
0
30f2dc14edd8ad15f56f34dcc05428ce
ea1d78b8e521177b8e35b4a7882ba824
Optional method for generating configs for the web config interface. This method should be called at the on_init part of the game loop in order to access corner marker IDs and detection accuracy in the web configuration interface.
class IFootprintCornerIndices(object): def footprint_corner_indices():
0
9ef2ce63338eed3b0d4f1ea32566931c
d9744907f2922a642e35019b6e5fd00b
移除所有标签页,根据不同科室选择添加不同标签页
{ ucOthers = new UCOthers(); ucIemOperInfo = new UCIemOperInfo(); ucIemDiagnose = new UCIemDiagnose(); ucIemBasInfo = new UCIemBasInfo(); this.Controls.Add(ucOthers); this.Controls.Add(ucIemOperInfo); this.Controls.Add(ucIemDiag...
0
94a28fe2ed9fa5b268068a01600c2e16
41085929326b93ef7fd09d800d256a56
得到指定状态的品牌的总数
namespace BrnMall.Core int AdminGetBrandCount(string condition);
1
d09e32ace30df0e640a7ba56d07f6393
7a5ae9f03fc179e3a990691ff6a0736c
Method to pass current date to all templates.
now = datetime.datetime.now().strftime('%B %d, %Y') year = datetime.datetime.now().strftime('%Y') month = datetime.datetime.now().strftime('%B, %d') covid_cases = get_current_covid_data() death = "{:,.0f}".format(covid_cases.death) positive = "{:,.0f}".format(covid_cases.positive) hospitaliz...
1
4bc7c5d079b00daab365c96de2046894
ad4abd0888c1d866ab91a80d9486ea09
Affiche la description du véhicule
class Vehicle public function __toString() { return 'Brand : ' . $this->brand . '<br>' . 'Type : ' . $this->type . '<br>' . 'Horspower : ' . $this->horsepower; }
1
28f091c0abc64b5f121f43565366fcda
2d3eb2fd48f82f41575c1b4a4f235ca6
从数据库中提取一条音频数据
$db = & db::getInstance(); $eID = $this->_PrepareData($data); $row = $db->get_row(" SELECT * FROM audios WHERE aud_id='$eID'"); if (!$row) return $this->Error(''); foreach ($row a...
1
571e61e54a00983275b5722ea795168f
2c67b2b9742940fcf500f8b1a6aa9c8c
获取剩余话费
@namespace("user/freehour") public @caption("免费小时") @table("cs_free_hour") class CsFreeHour implements java.io.Serializable public String getCsfhRemain$(){ String strValue=""; strValue=$.str(this.getCsfhRemain()); return strValue; }
0
6cc34ebccf1783fffba4a034bb0fb89c
a7a90447b6a1c61d0d73ea7182d4851a
生成一百个小格和随机生成10个雷
for (var i = 1; i < 11; i++) { var tr = document.createElement('tr'); for(var j = 1; j < 11; j++){ var td = document.createElement('td'); td.id = 'td'+i+j; tr.appendChild(td); } boxCon.appendChild(tr); } var row = Math.floor(Math....
0
824d8c3654d06ccc6adaf35130039aeb
6fbc7652c730d335e2a63ca8ffeee2a2
Called by {@link AutoFillUI} to fill an activity after the user selected a dataset.
public void FillData(UIData data);
1
22196a79ef9f12d82b15a839e150f5bd
4be655bef00974e8e5fecc496261bf5a
Utiliza el tamaño del collider y la escala que se le aplica para averiguar la anchura de la plataforma InGame
float centerX = platform.GetComponent<BoxCollider2D>().bounds.center.x; float width = platform.transform.localScale.x * platform.GetComponent<BoxCollider2D>().size.x; print(width); horizontalMove = 1; minX = centerX - width / 2; maxX = centerX + width / 2; }
1
af39404ac5226a1663fdb8aaeedb6252
f05f25e24fd52f3ed128873b930929ea
デフォルト承認解除ワークフローコメントを取得する。<br>
List<WorkflowDtoInterface> findApprovable(Date fromDate, Date toDate) throws MospException;
0
93387d700615b7c1015c96c7e0a49655
d2ae4c673bf5abedfb67c5c8533cb6a8
Assign the point to their closest neighbor from the ground truth data. Can of course fake ground truth if no survey available! Only SHP file supported for now Make sure no false positives are in input_coords And ground truth covers all clousters (even with 1 point only)
{ int SurveyIDFieldIndex, BatchIDFieldIndex, NextBatcID, PointIndex; IFeatureClass RandPointsFC, ExcludeFC; IFeatureBuffer InsertBuffer; IFeatureCursor InsertCursor; NPSGlobal NPS; IRelationalOperator ThisRelOp; IPolygon Boundar...
0
9a822014589f617f91ae323b9502111f
a921ef68a014bc0528096572d8b250b5
Mètode toStrings per tal de retornar el títol dels vídeos.
class Video String getTitle() { return title; }
0
5796e1347602ec6bb2c7094d1c50e0d4
5dcd5404109eef9de4c0de3aa1fb581c
手术室信息查询
@Service public class OpZt01Ser extends BaseManagerImp<OpZt01,Integer> public PageInfo<OpZt01Resp> query(OpZt01Req req, SysUser user) { OpZt01 zt01 = new OpZt01(); zt01.setSslb(req.getSslb()); zt01.setZtlb(req.getZtlb()); if(req.getSfqy() != null && req.getSfqy().intValue() == 1){ ...
1
47ee41796dd54a507178a3662f9b64eb
9195077892180652fa9542ccb0f3d7d2
GET api/EM_MDM_Risk
namespace A100_AspNetCore.API.Controllers [Route("api/[Controller]")] [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] [ApiController] public class SpecificationsController : ControllerBase [HttpGet] [Route("DictionaryRiskLevel")] public async Task<List<RiskLev...
0
9b62b7585bf34fa672a8a49cc49f7b46
0c37e5cac70659444ec84dd4b33f3595
takes a points on a left and right convex hull, returns the points on the convex hull of the combined hull
class ConvexHullSolverThread(QThread): def removePoints(highPoint, lowPoint, hull, isLeft): i = hull.index(highPoint) j = hull.index(lowPoint) if isLeft: rotatedHull = ConvexHullSolverThread.rotateList(hull,j) if len(rotatedHull) == 3: p1 = rotatedHull[1] p2 = rotatedHull[2] if p1.y() > p2.y(): ...
0
bfde9f4ab24095c3c19fef15c72cf7d3
5ab1a30912721146eadc77c257e9ddf6
Modifies the target of an existing Maintenance Window. You can't change the target type, but you can change the following: The target from being an ID target to a Tag target, or a Tag target to an ID target. IDs for an ID target. Tags for a Tag target. Owner. Name. Description. If a parameter is null, then the correspo...
java.util.concurrent.Future<UpdateMaintenanceWindowTargetResult> updateMaintenanceWindowTargetAsync( UpdateMaintenanceWindowTargetRequest updateMaintenanceWindowTargetRequest, com.amazonaws.handlers.AsyncHandler<UpdateMaintenanceWindowTargetRequest, UpdateMaintenanceWindowTargetResult> asyncHand...
1
9342fc6ae6a606515dba80d21c13b432
475b4832f70fef212fb55fe786ea65e9
Deletes a sampling form C.
{ var webValidationErrors = new List<WebValidationError>(); var samplingFormCGuid = samplingFormCId.ToGuid(); var samplingFromC = SamplingFormCRepository.Single(sfc => sfc.Id == samplingFormCGuid); var validationErrorsInDb = ValidationErrorManager.GetValidationErrors(samplingFormCId); ...
0
3624a0e128552200c499da5d7d07fa8a
203c3bf1997d090ea8188fb8f76aa716
Takes list of trials as a string of "X-Y" and creates a list ranged between X and Y. Or simply takes a comma separated string of Trials and makes them into a list.
l = [] for itm in NumStr.split(","): if "-" in itm: a, b = [int(x) for x in itm.split("-")] l.extend(range(a,b+1)) else: l.append(int(itm)) return l
1
bd8fa384273f43b6cdf8af29135c1a1f
6d9e8b009dee440365082ef5555e3c92
从repeat_call_analyzer table中根据analyzer_id删除analyzer
{ StringBuilder strSql = new StringBuilder(); strSql.Append("delete from Bse_ExcuteAnalyze "); strSql.Append(" where id=@id "); MSSQLHelper h = new MSSQLHelper(GlobalHelp.ConfigConn); h.CreateCommand(strSql.ToString()); h.AddParameter("@id"...
0
a2e46403da360df79a743a3cf94314a0
993b048a1fb828e9e89f65a0544222f6
Test nodes can be bulk-unpublished.
$this->createNode([ 'type' => 'event', 'field_content_visibility' => 'public', 'status' => NodeInterface::NOT_PUBLISHED, ]); $this->createNode([ 'type' => 'event', 'field_content_visibility' => 'public', 'status' => NodeInterface::PUBLISHED, ]); $this->setUpCurren...
0
a4f75877195a5c9f507a961ad28a14b5
e0c8e4b0b1d7fc3a724c1d453de013b7
根据key查询val
@Service @RequiredArgsConstructor(onConstructor = @__(@Autowired)) @SuppressWarnings({"unchecked","all"}) public class CodeRedisServiceImpl implements CodeRedisService @Override public String getCodeVal(String key) { try { return Objects.requireNonNull(redisUtils.get(key)).toString(); }c...
1
64eacf66c7b2c853210d7e4ecc979917
14ca4a183bda11d0295a8cbee739eb53
Writes one training sample to a CSV file.
f = open(out_file, 'wb') f.write(','.join(sample_label) + '\n') for line in sample_data: strline = [str(item) for item in line] f.write(','.join(strline) + '\n') f.close()
1
86dddfea4e7f9f899f5be0dad8f860be
87ecda99a078c598bb0c368be5d56cfa
Removes the value on the index. Returns the value removed.
{ if (index < 0 || index >= Count) { throw new IndexOutOfRangeException(); } else { var removed = this[index]; for (int i = index; i < Count - 1; i++) { array[i] = array[i + 1]; } Count--; return removed; } }
1
ab9bda7a6898a658f5857931c8406b81
9aa02d5eed6aeef3823ac93718bee5b3
Updates this persons velocity buffer with its current velocity while ensuring a maximum velocity buffer length is maintained.
vel[vel.length - 1] = 0; for (int i = points.length - 2; i >= 0; i--) { double velFromAcc = Math.sqrt(Math.pow(vel[i+1], 2) + 2 * dec * DIST_STEP); vel[i] = Math.min(velFromAcc, vel[i]); } }
0
9fb4c1712f2a2b3c9ee76a01a908960b
692459990140d217d1784424c6799609
若原先处于unchoke状态,收到该消息后更新peer中某些变量的值
void sentUnchoke();
0
347afd9378c94f82cbd9a5c4da5f90dd
a606fe279f5b01656d2acaa33b3e7463
========================================================== METODO PARA AGREGAR PRODUCTOS A LA LISTA ==========================================================
class AgregarController extends Controller public function index() { $medi= DB::select('select codigoM from medidas '); $cate=DB::select('select codigoC from categorias '); $msj=""; $lista= DB::select('select * from products'); return view('listas.listaagregarproductos',com...
0
91d35f6f8fa886d76413d607fc8f152d
3f18c8709eeff9ac80273c72b8510544
Adds Band 'bandName' to the bands table
class DBDetails{ public function addBand($inputband) { try { $db = $this -> connection(); $this->dbTable = self::$tblBand; $sql = "INSERT INTO $this->dbTable (".self::$band.") VALUES (?)"; $params = array($inputband); $query = $db -> prepare($sql); $query -> execute($params); } ca...
1
6b50a09e4ae689b6ec75aa0888cc0153
c5af2b490d87e774494dc55beaa7d469
Tests if assigning 0 tokens leads to error
void StreamTest::testCreatingChannelWithZeroSizeTokens() { this->chan = vftasks_create_chan(16, 0, this->mem_mgr, this->mem_mgr); CPPUNIT_ASSERT(this->chan == NULL); }
1
d8f78f78b74590a65cc36b4a3da0291b
415981b86a797ba488a6d4be89bad3a0
判断n是否为某数的二次方,不能使用求根公式 使用二分查找
for i in range(1, n+1): if i*i == n: return True elif i*i > n: return False
0
9c4127e9b9d407bbf7c82e0cedae7d65
aa0b3308bdd74aa3990c6e105214c02e
左右移動、ジャンプによるローテーション.
number = @parameters[0] + ($game_temp.in_battle ? 50 : 0) $game_screen.pictures[number].rotate(@parameters[1]) return true end
0
4b2a100ab58eb2496cb326eeb67c6c83
3bf819f5599bc0bb52cae45553205ec0
Retourne les articles publiés pour une année
fetchArticlesByYear(year) { return Axios.get(`/timeline/${year}`); }
1
731bac04dc448641e5e78a87bf3b8d80
eafba042a72ea78e32e8385154fd0ae3
Deallocate ip synchronization related mutex and data
int ff_del_syncobj (_SYNC_t sobj) { caribou_mutex_free(sobj); }
1
b0b5ad82d14822f3cf38818e6296b8af
832fe86b49dffc18bd12c9974e6e6e9c
if the wrapped Map doesn't issue its own events, then this Map has to generate them itself
try { return makePopulatedMap(); } catch( UnsupportedOperationException e ) { return makeEmptyMap(); } }
0
352ba5b48af205bbca96c631eb39b7b8
c4206b6d6b748456ce6932df89b9129c
The first should be bigger than the second argument.
public void whenSecondLessThanFirst() { Max maxim = new Max(); int result = maxim.max(2, 1); assertThat(result, is(2)); }
1
cc77e223ef41f4a1b9861908b6a8b052
702a9f66bd7acbf6b4044ddb77402723
fonction qui retourne l'année en cours
export class Soutenance getYear(): string{ let params = this.date.split(" "); return params[2]; }
0
61f28479749aa4cb72033ce19d12ed85
5b3e54bccfd0028e054cc8478ef9b125
setter - description of the action
class Action extends Model public function setAction($action) { $this->action = $action; return $this; }
1
fa94b330a8cff6cd07bd44301acfedf1
3f86c55cf68c2eab88b46b9376b87e6e
source: https://stackoverflow.com/a/9419208
def which(program): import os def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = os.path.split(program) if fpath: if is_exe(program): return program else: for path in os.environ["PATH"].split(os.pathsep): path ...
1
e7a3e46767c4287cbde60c736bb95674
f827bdb40cd8e2d3f4d2c075193365e2
获取 codeforces rating 数据
users = User.objects.all() for item in users: item_codeforces_rating = crawler.UpdateCodeforces(item.codeforces_id) item.codeforces_rating = item_codeforces_rating item_bestcoder_rating = crawler.UpdateBestCoder(item.bestcoder_id) item.bestcoder_rating = item_bestcoder_rating ...
1
bdc5ca1ae20ff4b29bdd270e2f98e197
89c6b70fa62a6f4ac1cdd4b3416a43b1
Test that there is a match if the string contains white space at the start and end and that the tostr() output is as expected.
def test_empty_strmatch(): grammar = """ Rule: first='' 'a'; """ mm = metamodel_from_str(grammar) model = mm.model_from_str('a') assert model
0
792321d60dd645b7f07f63c6461d4c3f
84df07fba4bb2d51ed4a3f2e08dde0af
Reads all variables that are present in currentScope from the passed-in result object. This is used to re-establish a scope at the end of an aggregation or stream operation.
final String value, final Collection<T> scope, final T reifier, final Collection<String> iids, final Collection<IVariant<T>> variants) throws MIOException;
0
0077284740d8e96b7ba629840f9cafc8
5c168b23afdfa5933756f3d30a6337b1
把目标文件修改成可以访问的日志文件
f = open(Dir.log_config_path()) tag = "'.*_Output/log/wy_autotest\.log'" t_str = "_Output/log/wy_autotest.log'" content = f.read() f.close() f = open(Dir.log_config_path(), "w+") content = re.sub(tag, "'" + Dir.project_root_dir().replace("\\", '/' ) + t_str, content) f.write(content) ...
1
a82aa3f7967f504cf4dd17b6cc5674f2
c3ea280cc526f5aeeb44da139c77384a
Draws all the roads' contours.
public class PDFOutput public void drawRoadNetwork(RoadNetwork roadNetwork) { Iterator<RoadEdge> edgeIterator = roadNetwork.getEdges().iterator(); while (edgeIterator.hasNext()) { RoadEdge edge = edgeIterator.next(); RoadNode nodeA = edge.getStartNode(); RoadNode nodeB = edge.getEndNode(); Color color =...
1
0d8c518aef93022fa896cb405795ac36
1f25a971c9fb0480265aa55bbdfb51f2
Восстановка подписок после перерендера
{ if ($token = Request::input('renew_token')) { if ($subscription = $this->subscription()->renew($token)) { if ($order = $subscription->getOrder()) { $form->session()->put($subscription->getOrder()->get('subscription_form', [])); foreach ($...
1
fb7af854053ffa60cc06d82479c581bd
53891f7a01b78970fbbde39207e62607
Attach a file to a receivingWorksheet by URL.
class ReceivingWorksheetApi public function addReceivingWorksheetFileByURL($body, $receiving_worksheet_id) { $this->addReceivingWorksheetFileByURLWithHttpInfo($body, $receiving_worksheet_id); }
1
884d14099150e2f52ee03429e7202cd6
618ecd99412248beda1777994d871121
Листинг всех новостей с опцией редактирования.
{ $config['base_url'] = 'admin/components/news/edit_news/'; $config['per_page'] = '3'; $data['rows'] = $this->dbmodel->get_num(); foreach ($data['rows'] as $item) {$config['total_rows'] = $item['num'];} $this->pagination->initialize($config); $data['news'] = $this->...
1
8aa0d173932ea2d01d28729ecf79d4ba
a744340ee69987deb24e9ec620d71e4e
Write raw data to the UDP socket
size_t serialUDP::write(uint8_t data) { if (! _active) return 0; if (_ip == "") { Serial.write(data); return 1; } else { _client.beginPacket(_ip.c_str(), _port); _client.write(&data, sizeof(data)); _client.endPacket(); delay(1); Serial.write(data); return 1; } }
1
6b1153e1538dfb3150e4aeea802cc4ce
e7073811656cd25fa782f9d0d17a3595
保存多个数组到同一个文件中,保存格式是.npz,可以同时保持字典
def saveListOfArrays(fname, listData): arrayOut = np.hstack((0*np.ones((len(listData[0]), 1)), listData[0], )) for i in range(1, len(listData)): arrayTemp = np.hstack((i*np.ones((len(listData[i]), 1)), listData[i], )) arrayOut = np.vstack((arrayOut, arrayTemp)) ...
0
aeb418f12721c2a12ab66d4d91a111a1
89893b31ec50e76150594361942cd558
Returns whether the value of the '{@link org.omg.spec.bpmn.model.TEventBasedGateway#isInstantiate <em>Instantiate</em>}' attribute is set. <!-- begin-user-doc --> <!-- end-user-doc -->
public class GamificationFacade public Boolean isInstantiate() { return gamificationApi != null; }
0
d9fae6dc54bbf8aff4cbd59837615b5e
2c71274f43b041880c6cfd5fad69d9f4
Iteratively parses through each element in an OSM file. For 'node' and 'way' elements, it parses through the 'tag' sub-elements with 'address:city' as their 'k' attribute and add its value to a set
tags = {} osm_file = open(filename, 'r') for event, elem in ET.iterparse(osm_file): if elem.tag in tags: tags[elem.tag] = tags[elem.tag]+1 else: tags[elem.tag] = 1 return tags
0
b185b047ee44e48064e814c2b7593ce4
4fe7339ae756a007b4c4cd09662a0194
DESC Set the auto off time in seconds. This function returns the
void adc8_tcb_set_offt(adc8_tcb_dev_t *dev, float offt) { u32 uofft; memcpy(&uofft, &offt, sizeof(float)); WRITE_REG(dev->baseaddr, REG_OR_OFFSET, uofft); }
0
534378f7babdd9be38780ef65620f79d
bcc6c2937b231aa0a0bec9bf8d78ca3d
Checks if the specified point is within or on the bounds of a rectangle
public class BreadthFirstDirectedPaths public static class RectHV public boolean contains(Point2D p) { return (p.x() >= xmin) && (p.x() <= xmax) && (p.y() >= ymin) && (p.y() <= ymax); }
1
bcc08804984de139aaa042212cb2fe2c
ff28fe9f0dc4e1df8c1bebfa601c51f7
Récupération asynchrone de la liste des héros à afficher
function getHeroes() { $http.get('/heroesroute').then(function(response) { console.log('data', response.data); $scope.heroes = response.data; }); }
1
33231049a9f698c3e8904682db9073be
78801559ea33e2448b216b786d0a1f8d
设置附魔方式
{ if(!empty($harmType) && is_array($harmType)) { $this->config = array_merge($this->harmType, $harmType); } return $this; }
0
5d4fe1bb36b683118f8fb7831f46396a
24f2e3efbb4081d157ca416dcacb0be6
获得所有不重复地址的车位
public class ParkingSpaceServiceImpl implements ParkingSpaceService public List<ParkingSpace> findAllBackUpParkingSpace() { return parkingSpaceDao.findAllBackUpParkingSpace(); }
0
c78be60b1a2b106f50312fa6870767b7
fbe54310c6c507305e857ca0b05fef13
Updates the employee password on the local database.
public void updatePassword(String password, Employee employee) throws SQLException;
1
7d6ac15f5300ab0a5f5b50ad3d9b7426
6ea3da92da90d058d42f33deaa921213
<p>bfsSize を取得します。
public class VisitFootprintAdapter extends ReplicatedClusterAdapter public int getSize(int owner) { int size = 0; UgcFootprintCachePrx prx = null; try { prx = getVisitFootprintManager(owner); size = prx.getSize(owner); } catch (Ice.TimeoutException e) { Oce.getLogger().error( this.getClass().getNa...
0
bfd8e8a07b084aa31a5374fbae7e505a
908f860430e20059da09ad2f524d49fd
播放唤醒提示音
function playTisp(){ mui.plusReady(function(){ var p = plus.audio.createPlayer('../../audio/msgtisp.mp3').play(); }); }
1
40980ac41f4525603558e65f96e05c3d
921855fb34021f1b5623b70a3507b281
根据地图ID读取设备
namespace BAMSS.MXComponent public class PlcConfigLoaderSQLServer : PlcConfigLoaderDataTable protected sealed override DataTable GetPLCDeviceMapInfo(string mapID) { using (SqlClientAccessor db = new SqlClientAccessor(this._connectionString)) { db.Open(); ...
1
da8bf642e7c4923b5af597ea754a82ed
ff5e033045fcfa269dbd38d1bf2b2eac
年の文字列表現を取得します。
@Bean(table="和暦マスタ") public class Japanese_Calendar_M public String getYear_num() { return year_num; }
0
5d8e1d95fd7080e11bb4ce52e2413853
322744d5decb2f46ece92ffc750b3a59
возвращает максимальный размер скидки
double maxDiscount = 0.0; if (mealDeal() > maxDiscount) { maxDiscount = mealDeal(); } if (spendOver() > maxDiscount) { maxDiscount = spendOver(); } if (LocalDateTime.now().getHour() >= 14 && LocalDateTime.now().getHour() <= 16) { if (af...
1
6d22d34b03624b4bca0158c4340ad826
fce96922cbbb3ef46d5b9cd7c4095b3f
Creates a new user with a name and a default image if not set
UserDao newUser = new UserDao(); newUser.setUserName(userName); newUser.setChosenSkinImageId(R.drawable.skin_basic); newUser.setMusicOn(true); newUser.setAllSkins(returnNewAllSkinsArrayList()); newUser.setNumOfWins(0); newUser.setFirebaseUserId(FirebaseAuth.getIns...
1
17be9baafabf7b372589396fb4d74503
18555b84be08737c05a739d439dab8a9
Returns the list of channels found in edf file `efname`
class ChannelInfo: def get_electrode_names(self): chan_elec_names = [re.search('^\D+', chan_name_i).group() for chan_name_i in self.chan_names_no_eeg] return np.array(chan_elec_names)
0
3249d558cdfe664dc54fd8eb2a231949
4b9acc5947141587283393a1423b66e9
Returns a compound type name
{ if (GenericTypes.size() > 0) { String args = ""; for (std::vector<CDataType*>::iterator iter = GenericTypes.begin(); iter != GenericTypes.end(); iter++) { if (args != "") { args += ","; } args += (*iter)->ToString(); } return Identifier.Get_String() + "<" + args + ">"; } else { return...
1
4ca585af17a57d0704c265fcdd3de8db
62d4cbb517caf70b50fe67b3a2e7cb3e
Uses the django ORM to add a potential customer to the database.
def push_customer_account_to_db(username, password, email): db = pymysql.connect(host="academic-mysql.cc.gatech.edu", passwd="zPMhu_0n", user="cs4400_Team_72", db="cs4400_Team_72") cursor = db.cursor() sql = """ insert into customer values(%s, %s, %s, %r) """ cursor.execute(sql, (username, pa...
0