query_id
string
corpus_id
string
query
string
code
string
label
int64
737bac05c06932e71ee806398ba9de1f
29c7d95681daf388c3c96381727a9164
Calculate the time-dependent field from the harmonic solution.
self.F_update(z) dx, dy = self.cell, self.cell Nx, Ny = self.num, self.num dx_sc, dy_sc = ((self.wavel*z)/(Nx*dx)), ((self.wavel*z)/(Ny*dy)) X_scn = np.linspace(-Nx/2*dx_sc, Nx/2*dx_sc, num=self.num, endpoint=False) Y_scn = np.linspace(-Nx/2*dy...
0
2e5c14ad9ddcfd38e0a852102edd384a
8ed498c872cf2969c4d260b814f51f3a
問題文をセットします。 空文字かnullが渡されると例外を送出します。
public class P3A3_WOOD_4214424_Question public void setQ(String Q) { this.Q = Q; }
0
8cd793ba6051991aa794b5be3f60832a
c28d3e02cdb3526da036b179b2ce1e60
Get change frequency
class Data extends \Magento\Framework\App\Helper\AbstractHelper public function getCategoryChangefreq($storeId) { return (string)$this->scopeConfig->getValue( self::XML_PATH_CATEGORY_CHANGEFREQ, ScopeInterface::SCOPE_STORE, $storeId ); }
1
f6b4a2f9bfef7067b24f5efdd5c06501
3833e6ddc05709fcac8f0f2fbab8040d
DeleteQuad will delete the given quad from the store
{ $quad->delete(); return redirect('quad')->with('status', 'I know it\'s sad but that lazy SOP had to go!'); }
1
135c5db912df3e71cb527cbae7786cdb
6f9f903ab3abdf3527d61af77fcb14cd
Check to see if OrderId is set.
boolean isSetOrderId();
1
847fea02b337d15937b5236153dd0162
685ed49ab080474fb1b31465685f2515
This method initializes a new game with the kakuro indicated
public class NewScript : MonoBehaviour public void NewGame (){ CreateFullSudoku (); PrepareBoard (); }
0
6028377e44e63ea7d582f995a28cde72
0332d593e79684db6e40b2d88d79adae
查询用户"选了"的课程列表(status == REQUEST 的情况)
@Select(value="SELECT * FROM courses WHERE course_id NOT IN (( SELECT c.course_id FROM users u,courses c,usercourse uc" + " WHERE u.user_id = uc.user_id AND c.course_id = uc.course_id AND u.user_id = #{userId}))") List<CourseDetailInfo> unselectedCourses(int userId);
0
55139e80293f8cb758e7c9790c7b80a8
c4ff40299357b4588210e2419a093290
存管绑定银行卡 获取验证码
function clickGetCode(){ if (addNewCardCheck("checkCode")) { var wait = 60; var buttonObject = $("#code"); $("#BankCardNumber").attr("readonly","readonly"); $("#mobilePhone").attr("readonly","readonly"); $.ajax({ url : "/accountBank/sinaBindingBank", type : "post", dataType : "json", async : fals...
1
607cdc2c898d7c171ec384b4a382a39c
3f2bff186cde593ed4ec2a8b91429976
Ako duz sijece neku prijasnju duz, ne dodajemo je
void Mreza::ManjiBrojStajalista(int k) { for (auto iter = SveLinije.begin(); iter != SveLinije.end(); ) { if ((*iter)->uzmiSmer(0).getStajalista().size() + (*iter)->uzmiSmer(1).getStajalista().size() < k) { vector<Stajaliste*> stajalistalinije = (*iter)->uzmiSmer(0).getStajalista(); for (auto iter2 = stajalist...
0
8111b79fff0ec6ede576fd1bc5ac7772
f8a34a7719c383720770c4c527956acd
Function that returns initial wave values (initial conditions).
print(kwargs['x_0']) def rho_init(x): if ( x <= kwargs['x_0'] ): return 1.0 else: return 1.0 def u_init(x): if ( x <= kwargs['x_0'] ): return 0.0 else: return 0.0 def p_init(x): if ( x <= kwargs['x_0'] ): ...
1
fad9bacce9cc9f51f1b5e9afa292fea9
462086c070ae21970b96c731623b77f2
Get Sales Report Per Peso
[Route("ReportSales")] [ProducesResponseType(typeof(IList<ReportSalesViewModel>), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] async public Task<IActionResult> GetReportSales(DateTime startDate, DateTime endDate) { var reportResult = await _reportsViewDataB...
0
e2752e60f5c9ff9cabde96ded1665dc9
034a589fd99dddad81080614e9e1b2cb
Get avatarVersion
int CEngine::GetVersion(const char** version) { if (version) *version = AVATAR_VERSION; return (int)atof(AVATAR_VERSION); }
1
cfdad490b1bd7875edadf1a28b7caec6
23cfa25732b1958ae1fc3526ddff81a8
Enable/Disable use of linear interpolation.
public abstract class TileBasedElevationProvider implements ElevationProvider public TileBasedElevationProvider setInterpolate(boolean interpolate) { this.interpolate = interpolate; return this; }
1
5c1c601b267cf7ec1a3cc143748ab80a
3357d017ed2749e64a4ba566c3ff08aa
Helper method creates a hash of show names pointing to an array of months the user selected
class ImagesController def generate_selections!(image) @years = years(image) @months = months @days = days @hours = hours @minutes = minutes end
0
7e2721a5684cd37bdb70bce7e50f2db5
c8c436ca04af25e67d4d2478d6e8881f
杉德H5支付 去网页授权
public String paySignH5(ProductOrder45 productOrder45) throws Exception { String sign = ""; String body = "ecartoon"; String out_trade_no = productOrder45.getNo(); String total_fee = String.valueOf(new Double(productOrder45.getOrderMoney() * 100).intValue()); String nonce_str = create_nonce_str(); String t...
0
16a57a1a71ca834442597dd9f2350aa8
a2e1a1c7b4978fb21797fa9bcb231221
绘制单一站点.
var OHLongitude = _data.OHLongitude; var OHLatitude = _data.OHLatitude; if (notNull(OHLongitude) && notNull(OHLatitude)) { var point = new BMap.Point(OHLongitude, OHLatitude); var marker = new BMap.Marker(point); marker.addEventListener('click', function (e)...
1
c5a9065a6ccb2c748a38c2ecb461b6c9
64f78800104405d7119dac688526ab76
Метод перехода к предыдущему вопросу
const { state } = this; const { quizVersion, currentQuestionIndex } = state; const allQuizQuestions = this.getAllQuizQuestions(); const [previousQuestion] = allQuizQuestions.filter( question => question.quizVersion.id === quizVersion && question.sortOrder < currentQuestionIndex ).slice(-1); ...
1
891230eecc9989bff3cbd256ac0f7352
86c5398ee995eb14c237455410135cc4
https://www.codewars.com/kata/55902c5eaa8069a5b4000083
let asc = [...array].sort((a,b) => a-b); let desc = [...array].sort((a,b) => b-a); if (array.every((number, index) => number === desc[index])) return 'yes, descending' if (array.every((number, index) => number === asc[index])) return 'yes, ascending' return 'no' }
1
4edca2e70d82a53ed4837632ec853d6d
e6d1836a5bfe0d313b055a0a82a1e6a0
获取到不需要权限就能访问的资源集合
val needRequestPermissonList = ArrayList<String>() permissions.forEach { perm -> if (ContextCompat.checkSelfPermission(activity, perm) != PackageManager.PERMISSION_GRANTED || ActivityCompat.shouldShowRequestPermissionRationale(activity, perm)) { needRequestPermissonList.add(p...
0
70b8df141f6985c4ef6ad228eda3422a
40b3b72d23c48618cd15cb7ee7990197
Setter de la vérification de la rangée
void GestionFenetre::setVerifMonstre(int p){ this->_verifMonstre = p; }
0
a06796e95042417ac325752d14171ef2
d5928e931c8cb4100746c7d63b19d543
it will set the width of the given column , just pass the index of the column and the size
public class TableUtil public static void setColumnSize(TableColumnModel cm, int i, int width) { TableColumn column = cm.getColumn(i); column.setPreferredWidth(width); }
1
3d6c770a150b2ba1d31a11897501b8dd
ab0df317b308188ee23978a7907704c7
@brief read database oid one table belongs to using table oid
{ $sql = sprintf("SELECT pa.inhparent FROM pg_catalog.pg_inherits pa WHERE pa.inhrelid = %d", $oid); $result_handler = pg_query($this->connection->getHandler(), $sql); if (pg_num_rows($result_handler) <> 1) { return FALSE; } $result = pg_fetch_result($resu...
1
8e05f846202d4bd4818fa54f9353247d
a435492e7b85d676a3461c7c43460ea4
Get positive evaluations.
{ $repository->setFilters(['item_rental.item_id' => "={$itemId}"] + $repository->getFilters()); $entity = $this->getAllOrPaginatedEntities($repository, $this->perPage($request)); $positiveReviews = []; foreach ($entity->all() as $review) { if (!$review->isNegative()) { $positiveReviews[] = $review; }...
1
75da4366d64e039d4ebdb3c7fcc95aba
a1b04911fd73dc01d3450f55d096a747
Returns if the particular feature is supported by the {@link TopicMapSystem}. <p> Opposite to {@link #getFeature} this method returns if the requested feature is generally available / supported by the underlying {@link TopicMapSystem} and does not return the state (enabled/disabled) of the feature. </p> otherwise <tt>f...
public final class LTopicMapSystemFactory extends org.tmapi.core.TopicMapSystemFactory @Override public boolean getFeature(String featureName) throws FeatureNotRecognizedException { return theFeatures.get(featureName).booleanValue(); }
0
6ff6c6cec150df44104bb5153c3e61b9
ad4b58da0a0dbd25deecdf39c983c46d
获取最快的一台存储服务器
if max_volume: for i in range(len(max_volume)): x_ = can_use_servers[0] s_id_ = list(max_volume)[i] s_ = Server(servers[x_], s_id_) s_.index = used_servers_volume[s_id_] if s_.judge1(v_) or s_.judge2(v_): type_ = 'old' ...
0
1bf841b98298c23e682e1410b04a0204
40ba30f8fba1f8b1ce404b421feda421
Cars.xml 파일을 만들겁니다.
String sql = "CREATE TABLE " + (ifNotExists ? "IF NOT EXISTS " : "") + "'VEHICLE' (" + "'_id' INTEGER PRIMARY KEY ," + "'YEAR' TEXT NOT NULL ," + "'MAKE' TEXT NOT NULL ," + "'MAKE_ID' TEXT NOT NULL ," + "'MODEL' TEXT NOT NULL ," + "'MODEL_ID' TEXT NOT NULL ," + "'SUBMODEL' TEXT ...
0
89af3fc76835d0234caf0e7af953404e
71a4abebeef0bbb5b3167c59ac35f46d
进入普通用户界面
namespace loading public partial class MainForm : Form private void 以普通用户登录ToolStripMenuItem_Click(object sender, EventArgs e) { LockWorkStation(); }
0
9539b4693400d1652897cf5374f3c9b2
803ff2a4207668374f550c801096fd44
Clears the animal object-listbox
{ if (lstCategory.SelectedIndex == 0) { lstAnimal.DataSource = Enum.GetValues(typeof(BirdSpecies)); } else if (lstCategory.SelectedIndex == 1) { lstAnimal.DataSource = Enum.GetValues(typeof(InsectSpecies)); }...
0
ac21f631b7a7957d3a040151ae937f4a
05eaa216156039908914a8a5ce4f8095
ajax检查otu名称
class Home extends CI_Controller public function ajax_otu_checkname(){ if(!empty($_POST)){ $name = $_POST['name']; $groupname = $_POST['groupname']; $data_url = $this->config->item('data_url'); $group_id = $this->session->userdata('mygroup'); $filename = $data_url.$group_id."/group/".$groupname."/".$na...
1
8112fee837d4bbe2832cbc39b29dcbb7
2f56ab3a09317cd3db368c247922a54d
Getter for <code>sys.x$innodb_lock_waits.blocking_trx_id</code>.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.7.3" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class SchemaTableLockWaitsRecord extends TableRecordImpl<SchemaTableLockWaitsRecord> implements Record18<String, String, ULong, ULong, S...
0
49bc8c7dfa63b6922f36520fd989c32c
877ad130da004d14f172557cd0438615
calculate the covariance matrix (ignoring nan values) for the columns of x (MxN), or optionally, the covariance matrix between the columns of x and and the columns of y (MxP). (In the language of statistics, the columns are variables, the rows are observations).
namespace Sleipnir static inline void dCOV(const float *x,const float *y, int *dims, float *DCOV) { int i,j, k, n, n2; float **Dx, **Dy, **A, **B; float *akbar; float abar; float V; n = *dims; Dx = (float **)calloc(n, sizeof(float *)); Dy = (float **)calloc(n, sizeof(float *)); A ...
0
33deefe9da9f515e8a435a9abfe698a5
57e3193308825398b97f5d15420191d8
enter items into the cash register
CashRegister::CashRegister(InventoryItem *i, int size) { inventory = new InventoryItem [size]; for(int count = 0; count < size; count++) inventory[count] = i[count]; }
1
0575079abb4fb1c59cc9e946256acfa6
7d7fa143470f8acf8170f44472cc391c
# Transforma a matriz em uma matriz triangular
triang <- function( v, n ) { m <- array( 0, c( n, n ) ) r <- ( n + 1 ) * n / 2 - dim( array( v ) ) for( i in 1:( n - r ) ) { for( j in i:n ) { m[ i, j ] <- v[ veclipos( i, j, n ) ] } } return( m ) }
1
1bddbf7b73ac52211e5b8b3b470a8061
9f905a72f9213d14bdb45f45bb31878d
Returns the meta object for the containment reference '{@link org.sheepy.vulkan.model.process.PipelineBufferBarrier#getBufferBarrier <em>Buffer Barrier</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getStreamOperatorParameter_Barrier();
0
f31f23b63cad0ec4c102807cbe5afdbd
016393d46911b697b03f343d146a7c08
détermine le vecteur du mouvement selon l'état des touches
public class perso : MonoBehaviour void Update () { moveTx = 0.0f; moveTy = 0.0f; if(goUp){ moveTy = 1.0f; } else if(goDown){ moveTy = -1.0f; } if(goRight){ moveTx = 1.0f; } else if(goLeft){ moveTx = -1.0f; } if (iswalking) { gameObject.GetComponent<Rigidbody> ().velocity = new Vector3 ...
1
0c5871b7c5bda13c7b0a8433973f0819
df1455b90e232b0d294cfeb5231f9bf1
Values inserted by name will be overwritten by the same name, regardless of type
for n, v in name_value_s.items(): if not isinstance(v, Types): t = _an(_or(*(t.__name__ for t in Types))) raise TypeError('%s is not %s: %r' % (n, t, v))
0
70bea11c77da5fb447364ee2d6d1a0e5
62906b0ad7cc459f566b6217c0016aef
畫鼻子
def drawNose(): turtle.penup() turtle.seth(90) turtle.fd(100) turtle.pendown() turtle.begin_fill() turtle.fillcolor('black') turtle.seth(45) turtle.fd(25) turtle.seth(135) turtle.circle(25, 95) turtle.seth(315) turtle.fd(25) turtle.end_fill()
1
d342f7bf6ac688eacf602c129e71916b
020096497cedde53cac07a2a92bb709d
Gets all the dependents associated with the provider key.
{ if (String.IsNullOrEmpty(name)) throw new ArgumentNullException(); if (!isValidName(name)) throw new InvalidNameException(); if (dep.HasDependents(name)) return dep.GetDependents(name); return Enumerable.Empty<stri...
1
2ed0413fcb01413e84808455d1ea0293
54146cda1e8ec46fcfb95b840e68acc3
更新觉醒花费
local yy_cfg = Config.db_yunying[self.act_id] local reqs = String2Table(yy_cfg.reqs) for k,v in pairs(reqs) do if v[1] == "cost" then self.cost_item_id = v[2][1][2] GoodIconUtil.GetInstance():CreateIcon(self,self.img_draw1_cost, self.cost_item_id, true) GoodIconU...
1
ca0c846d93bd5a3f11f7a0f2509bd96b
e261ed90996fd4f6ec32cbbf16e683ca
Päämetodi piirtämiselle, joka suorittaa muut piirtometodit.
namespace Jypeli [Save] public partial class Game : GameObjectContainer, IDisposable [EditorBrowsable(EditorBrowsableState.Never)] protected void Draw(Time gameTime) { UpdateFps(gameTime); GraphicsDevice.SetRenderTarget(Screen.RenderTarget); GraphicsDevice.Cle...
1
3151e7e0d62e122db16411b27fe024c2
4eb4a06688a9fc71cc82977907b78e95
Generates the teaching information for a teachee
class seriGame: def generateTeacher(self, fname, poss, plys, result): f = open(fname, 'a') for i in range(len(poss)): if i%2 != result: continue outstr = "" for j in range(len(poss[i])): outstr += str(poss[i][j])+"," for j i...
1
1d07df86fdbd775f0736cf3f923be515
b213e7f65a121393f0700cc320a09f9a
检查是否是民办|私立开头的
class DomainScheduleLib public function isGovDomain($domainLtd) { if($domainLtd=='.gov.cn') { return true; } return false; }
0
4bbb5bcd3047d3f76ea02f8288e1dd80
2daf1c0239ebf5b16839c0c4f0e71814
Returns true if NOUN is a word in some synset.
public class WordNet public boolean isNoun(String word) { checkNull(word); return this.nounMap.containsKey(word); }
1
10a7b083865334eafa70a014c6140d05
54d1c2743063cda9d87fc64cdd9c733d
Expands all children of the item, "levels" deep. If levels is 0, only the children will be expanded. If it's 1, the children and their children will be expanded. If it's <0, it's a no-op.
{ if (hItem && ItemHasChildren(hItem)) { Expand(hItem, TVE_EXPAND); hItem = GetChildItem(hItem); if (hItem) { do { ExpandBranch(hItem); } while ((hItem = GetNextSiblingItem(hItem)) != NULL); } } }
0
7043c984861233ee9ba0e6dd8fd2d5bf
018cb5608944741ffed18ccf0eb23f35
Prepares to save the audio as WAV file.
namespace BookSearch public class AudioRecording private static void InitializeRecording(object wavFilePath) { String outputFilePath = (String)wavFilePath; waveIn = new WaveInEvent(); waveIn.DeviceNumber = 0; waveIn.DataAvailable += waveIn_DataAvailable; ...
1
98c1d3581491d3cc1d565af1d4379f66
797756f54b99b3a3dfbeecd046be6376
Set permissions of the directories when the plugin is activated
{ $base = $this->app['path.base'].'/'; $app = str_replace($base, null, $this->app['path']); $storage = str_replace($base, null, $this->app['path.storage']); $public = str_replace($base, null, $this->app['path.public']); $this->setPermissions($app.'/database/production.sqlite'); $this->setPermission...
1
603c76ac8db3bd75cc99a6a88aec3df0
e4754795a3ddccf129a48495b103f876
Resets the result to be all 0s
public class Calculator public void cleanResult(){ this.result = 0; }
1
064137086b7db19d99322f827b6eaabc
a4f6ef089e992602356890417a4b6368
Get all share transfer records.
class Member implements RepresentableInterface public function getTransfers($limit, $offset = null, $tokenId = null) { return $this->client->getTransfers($limit, $offset, $tokenId); }
1
86c079c8650df4dcd73745352c1bb48d
755f68f304676ac54888b2e85ae1829e
接收字节数组,同步。
{ try { this._lockSync.WaitOne(); int length = buffer.Length; this._memView.Write<int>(0, ref length); var postion = 4; for (var i = 0; i < buffer.Length; i++) { ...
1
eb154b8fe9853439b227d061e5e09fe3
1aca52ae0589e19f10c992a6975ba0cd
insert blank line (push down)
void inserNodeInfo(const string str) { outTree.push_back(str); #ifdef OutTreeInsertBlank outTree.push_back(string(" \n")); #endif }
1
1560acd61fcc4f7baca7faeb1a80bb4a
5f5db8c4fb5bbb314cbdcb162313547a
Gets the parent when detached.
@Nullable T getParent();
1
213d94ef66615d0790a316ca526a6a45
3b5268c34a52c12f60b0f143ea5673cb
楽天のAPIで検索条件に合ったアイテムを取得
export class RakutenApiService productSearch (keyword: string, genreIds: string[]) { const params = new URLSearchParams(); params.set('keyword', keyword); params.set('genreIds', genreIds.join(',')); try { return this.http.get("api/rakuten", { params }) .map(res => res.json()); } catch (e...
1
b46a1b662c20b4599a68197cde75413a
8631235a8c95ed025a8b03c293ef035f
根据文件编号查询映射到各个镇区的DT统计信息
@Service public class DataService public List<DzsjFileBean> getQueryDzsjFile(String featid) { List<DzsjFileBean> data = this.DataMapper.getQueryDzsjFile(featid); return data; }
0
c2b1a19f693a0f6a37b0b6caf060e3ee
23d1e6fb1c0e22887a825d9f09aa3107
is_new
class ID implements IType public function isNew() { return $this->_special === self::$_new; }
1
5ced5092dba88d057a74d5c7725daf26
049f7f63ef89f1e0b96aa51d8046722b
产生主机子弹
if(heroTank.blood > 0 && heroTank.bulletNum > 0){ var sound = document.getElementById("attacksound"); sound.play(); var bullet = new bullets(heroTank); heroTank.bulletNum --; hBullets.push(bullet); Bullets.push(bullet); } }
1
f04e167128a4001e969a3f5189d96a0b
591815cae2e5c76f83eb8118b8c3198b
Apply changes on Odahuflow cloud (wrapper for async_apply). Used for not async client (For backward compatibility)
def apply(updates: OdahuflowCloudResourcesUpdateList, api_client: typing.Union[AsyncRemoteAPIClient, RemoteAPIClient], is_removal: bool) -> ApplyResult: loop = asyncio.get_event_loop() feature = async_apply(updates, api_client, is_removal) result = loop.run_until_complete(feature) re...
1
9d85ada7f56eb7c9d6f88035526f76e9
4af04ba21340de98b59a73963b925932
Writes "true" to the output.
void Generator::generate_true() { txt += "true"; }
1
26cf8af240467553f9f7586e123c7a68
019946a53a85ffd38d1b9ad902ca2670
convert date formats between ext and python
def date_interconvert(date_data): if type(date_data) != datetime.datetime: if u'-' in date_data: return datetime.datetime.strptime(date_data, '%Y-%m-%d') else: return datetime.datetime.strptime(date_data, '%Y%m%d') if type(date_data)== datetime.datetime: return da...
1
0969d46bf128969ae0cf91287b5ea147
17b87d60c4370e34cd761b0486399e48
parses the XML document that contains the FindBugs report and finds bugs of security-related categories. Then creates a HashMap that includes these bug instances, the files that these bugs exist and how many times they exist in these files.
FindbugsConfigLoader configLoader = new FindbugsConfigLoader(configFile); mAntFindbugs = configLoader.getProperty(FindbugsConfigLoader.FINDBUG_KEY_ANT); mRootWorkspace = configLoader.getProperty(FindbugsConfigLoader.FINDBUG_ROOT_WORKSPACE); mProjectWorkspace = configLoader.getProperty(FindbugsConfigLoader.FINDB...
0
462de727a26a27f420602d95823c0889
f9abb4594e059ecb5ec860d8f4c770c4
构造方法:初始化角色名
function PetRole:ctor() self._strName = "PetRole" self._kRoleType = kType.kRole.kPet self._kPetType = kType.kPet.kNone self._strCharTag = "" self._pRoleInfo = nil self._pTempleteInfo = nil ...
1
928ec97dec5d76379c89f1e7d50babab
be798bbf4f70e1a7de031441959145bc
Select which stimuli should serve as queries and how often.
class Setup(object): def __init__(self, stimuli, inhibitors, readouts): self.stimuli = list(stimuli) self.inhibitors = list(inhibitors) self.readouts = list(readouts)
0
cb3d103788650d7e303f702518315355
1ce093a1539e0b75b367aa2d59b2cded
护盾充能
currentShield += amount; if (currentShield > maxShield) { shieldOvercharge += currentShield - maxShield; currentShield = maxShield; } if (shieldOvercharge > GetMaxOvercharge()) { shieldOvercharge = GetMaxOvercharge(); } onShieldUpdate.Broadcast(maxShield, currentShield, GetMaxOvercharge(), shieldOvercharge)...
1
ed8194e45c0c217452e2262d129e5f72
a6779d11087f529e87620be3a7f71320
Helper method: Converts two lists of results of two synonyms into a list of results pair. Each result pair is stored as a vector with 2 elements. should form a pair of valid result with the element with the same order in the other list.
List<Pair> pairs = new LinkedList<>(); for (SearchItem searchItem : list) { processOneItem(pairs, searchItem); } return pairs; }
0
3eeddeefa7416f61f5d5a3f4a60fa90c
3d252ef80e830fd48ffe5043c48c477d
Search cities by postal code
class PostalcodeRepository extends EntityRepository implements RepositoryInterface public function findByPostalcode($postalcode) { return $this->findBy(array('postalcode' => $postalcode)); }
1
de9a04675a99f1b59202ef92a30c156d
9419ae2718db5d1cc6870e85d204176f
Será chamado antes de cada teste
class APISensorTest(unittest.TestCase): def setUpClass(cls): app.config.from_object('app.config.TestConfiguration') connect_db(True) cls.app = app.test_client() admin = User() admin.username = 'teste' admin.email = 'teste@teste.com' admin.password = '9a0362fd09990...
0
c2a2b7a821b77dafea16415ab3b930f6
2c7d3796100304d79d2cb1ee6b40ec33
关于这个客户池的具体统计和操作日志信息
if($this->isPost()){ $customer_id = isset($_POST['id']) ? intval($_POST['id']) : 0 ; if(empty($customer_id)){ $this->ajaxReturn('参数错误!','参数错误!',2); } $customer_business = M('business')->where('customer_id = %d and is_deleted=0', $customer_id)->select(); foreach($customer_business as $k=>$v){ $b...
1
73502d0da11d2b693f76833dd6186866
62e62d049b6e4d47434635d97d37550a
write params to xml file
public class TestStormLight extends ModelTestCase private String writeXMLFile() throws java.io.IOException { String sFileName = "\\testfile1.xml"; java.io.FileWriter oOut = new java.io.FileWriter(sFileName); oOut.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>"); oOut.write("<paramF...
1
0cb483319c0799cae46cdc23d9c2c742
4d35d5d5815dc12ce58f94b8883d6272
specific enthalpy for a given p_MPa and t_K
def H_PT(P, T, substance, eos = IDEAL_GAS): mw = get_parameter(substance, 'molecular-weight') Hmol = eos.Hmol_PT(P, T, substance) return Vmol / mw
1
318705a0c4913047bd370235797ce9bd
e29456c85365ab17122fffe178ef2b34
returns the number of flights
class FlightData: def numOfDocuments(self): return self.flightCollection.count_documents({})
1
9ed5923a3b323e96e94c75b5fb719195
280dc9be70bc0091cb5d9bbf93a954bd
Gets the previous compiler siblings.
export class Node<NodeType extends ts.Node = ts.Node> implements TextRange _getCompilerPreviousSiblings() { const parent = this.getParentSyntaxList() || this.getParentOrThrow(); const previousSiblings: ts.Node[] = []; for (const child of parent._getCompilerChildren()) { if (child ===...
1
94f7add436b2da77701953d127c54351
b43a2c7ec9fcb3ea0852211546677a00
Implement a basic calculator to evaluate a simple expression string.
def calc(expr): tokens =[] for i in expr: tokens.append(i) stack = [] for token in tokens: try: print(token) number = float(token) except ValueError: if token in ops: b, a = stack.pop(), stack.pop() op = ops[toke...
1
2ff93b8a0629f564275bd7eb98221527
03921e5e0e4bffe61a72e0a6662f498c
Select the first record of a data frame for which the given variable value is minimal.
class Reader(object): def min(self, varName): v = self.values(varName)[1] return min(v)
0
4f94bfeeb0ae5622152de7463a4b390c
548527280a7ae8744c1ede6bd59b87c7
Get the amount of RAM (in bytes) of the current system
namespace SDL2 public static class SDL [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetSystemRAM();
1
54fa452eaed9513d14fe5f7e6ea1ca19
253c6654866f2558fcd793bcc0de455c
子类的构造方法默认会调用父类的空参构造方法 如果父类中的没有空参构造方法,只定义了有参构造方法,会编译报错
class C extends A public function __construct() { parent::__construct(); }
1
6d4c2fbfb01064d4113fdd304be8ba29
6633b556286f84730817c07ad462944e
将文件夹中指定jpg图片转换为指定名称的pdf文件,并保存至指定文件夹
doc = fitz.Document(pdf_save_path) pdf_name_without_ext = pdf_name.split(".")[0] i = 1 jpg_dir = [] for pg in range(doc.pageCount): page = doc[pg] rotate = int(0) zoom_x = 2.0 zoom_y = 2.0 trans = fitz.Matrix(zoom_x, zoom_y).preRotate(rotate) pm = page...
0
e1432a8d9d3d6a17c7f96fa96106b402
3a91634d7d095f047efb1af4b5b1c749
Read data through the vendor widget -- NOT protected by the Mutex!
namespace wifibot driverData Driver::readData() { if (!processRead()) { std::cerr << "Error in readData()" << std::endl; } return _protocol.getData(); }
0
273f64044bf6a1794cbb16a12f5bbf4e
4acd3c70f11c7d8283f40a93b4f1e9e3
Calcules la similarité entre deux films à partir de leur tag comme précisé dans le sujet
def jaccard_similarity(movie1, movie2): s1 = set(movie1) s2 = set(movie2) return len( s1.intersection(s2) ) / len( s1.union(s2) )
1
84cac70da2d251cad24174d76a94050d
16ebfa2d4229f15f7c2809cefda0b858
méthode qui va afficher un formulaire (pour modifier les informations d'un réalisateur)
class ActeurController extends Controller private function createEditForm(Acteur $entity) { $form = $this->createForm(new ActeurType(), $entity, array( 'action' => $this->generateUrl('acteur_update', array('id' => $entity->getId())), 'method' => 'PUT', )); $form->add(...
1
a3ecc6369cf680bd85566f124e6c0085
a2812e21b7f53e3283e24ff4a7685ee6
Oculta la opción Cerrar Contrato
{ MenuItem item = mnContratos.FindItem("CerrarContrato"); if (item != null) { item.Enabled = false; } }
0
b1e27416f62983f59adb9d43dee63f10
f554aba31650c719207e9e6b4e16931d
将空值重置为0
function HandleSpaceToZero(item) { if (item == "undefined" || item == undefined) { return 0; } return item; }
1
fa4343d35054f59bd4b1fa9b26ceb574
7f61448ad6da3ef0f9cb03f40c5be655
## write your expression here
cases like (1)
0
8310d291b9f5d32e1d93daab83e48ca8
bbc6ed60593d779ee2ea88849e5fb2f0
Format two floats as f1/f2
void displayFloatingPointEquivalent(int numerator, int denominator) { cout << (float)(numerator) / (float)(denominator) << endl; }
0
002ab076718d74b37b58cc8c3a31ad58
6144e4beff1fdaa02440311d1dbdc0ef
Inserts and returns a new empty value (as xml) as the ith "Parameter" element
public class OperationParameterGroupTypeImpl extends net.opengis.gml.x32.impl.AbstractGeneralOperationParameterTypeImpl implements net.opengis.gml.x32.OperationParameterGroupType public net.opengis.gml.x32.AbstractGeneralOperationParameterPropertyType insertNewParameter(int i) { synchronized (monitor()) ...
1
8d1acef1c3c4af5569c1bf320b55525e
29cccbb27b59feacb890cb69ae0ccf11
An instance of the class that's to be tested.
class BackendsTest(TestCase): def _get_target_object(self): from twingo.backends import TwitterBackend return TwitterBackend()
1
512fd04cdc1d33bc84437b0f3efcb827
29d6e06a5b18bfbbfff29d475eb5eec4
This will create a transaction for interacting with the local persistance store.
JdbcLogger jdbcLogger, TransactionIsolationLevel transactionIsolationLevel) { if (jdbcLogger == null) { throw new DomaNullPointerException("jdbcLogger"); } if (transactionIsolationLevel == null) { throw new DomaNullPointerException("transactionIsolationLevel"); } return new LocalTr...
1
7425104f8fe94724976fe0de733f8a76
e8feeac535f90fd2958c0d04a5e8d8e5
指定された名前と型でパラメータの追加をしますが、すでに同じ名前のパラメータが存在する場合は取得をします
namespace Aoite.Data [Serializable] public class ExecuteParameterCollection : ICollection<ExecuteParameter> public ExecuteParameterCollection Add(string name, object value, DbType type, int size) { return this.Add(new ExecuteParameter(name, value, type, size)); }
0
dce5459d51f0210c9fb07bbd8acc4caa
e99ac5a6adc96adc278ecbac2b75e34e
双击当前Z39记录加载到Marc编辑器
{ ListViewItem item = (ListViewItem)this.UiItem; if (StringUtil.ContainHanzi(this.MarcRecord.Text)) item.Selected = true; else item.Selected = false; }
0
08733dcdf2119624baf7944c215030fb
c29e2eaf1165937a0a9525d42467f714
jl010已开业务-质疑类 是否剩余流量
OutBean out = new OutBean(); String xmid = paramBean.getStr("xmid"); String where1 = "AND XM_ID='"+xmid+"'"; List<Bean> guizelist = ServDao.finds("ts_xmgl_bm_jkgz", where1); boolean flag = false; String gzid = ""; for (Bean bean : guizelist) { gzid=bean.getStr("GZ_ID"); flag ...
0
06b0cf93cea4a2187ed61f8408c6b9d9
24316a73f6f31a3ac924af79890a3a2d
Test that the project detail page works.
class TestProjectAPI(BaseSearchTestCase): def test_project_exists(self): testproject = Project.objects.get(name='searchtest') testproject_id = str(testproject.id) request = self.factory.get(reverse( 'project-detail', args=['project_id'])) request.user = self.user ...
1
eb4b1e0af48d720b644784e3554cc075
f5201b2b06759bf8ddbdef17861a8646
Imprime la documentacion en el idioma especificado | Print the documentation in the specified language -> Solo - Only: English / Español
export class TutorialPage implements OnInit es() { localStorage.setItem(StorageEnum.LANGUAGE_TXT, "English"); this.appComponent.initTranslate('es'); }
0
8cbe1c93ad66a95e65967982465b3064
5546645adeff496b7e95a797afe214df
听
print ("听课 ") global evt, is_ok data = evt.get() print(data) print ("哈哈 , 终于下课了")
1
b4b102c5f2b079a55c539b379499c938
92f4bde021d50cd29fd0501260b0f887
Set the parameter value in the self.opts dict.
def _set_options_indiv_wrapper(self, opts_dict): for k, v in opts_dict.items(): self.__setattr__(k, v)
0
d1892fbb51b3c6ab167ddd1ce566ba7d
24a63c77171bb63327302102f79acd71
沙盒与非沙盒数据界面操作转换
int Sandbox::sandbox_entry(void *data) { unsigned int i; uint64_t id = (uint64_t)data; auto sdbx_it = sandbox_map.find(id); assert(sdbx_it != sandbox_map.end()); std::shared_ptr<Sandbox> sdbx = sdbx_it->second; uint64_t suspend_val; if (read(sdbx->suspend_fd, &suspend_val, sizeof(suspend_val...
0
b8a830b6df44ff9685e19ba9340327f2
097ab992b4bfa6fff04aa20a56563731
84. Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example, given [0,1,0,2,1,0,1,3,2,1,2,1], return 6.
public class TrappingRainWater public int trap(int[] height) { if (height.length == 0) return 0; int ans=0; int length = height.length; int[] leftMax = new int[length]; int[] rightMax = new int[length]; System.out.println(Arrays.toString(height)); for(int i=1; i<h...
1
502d28c92c9c02bd313654ac7c8cdfca
b6b205016a90f504bdf357cdeb189c8f
Test whether output-dir is moved correctly.
index_path = os.path.join(output_dir, "index.html") post_in_past = os.path.join(output_dir, "posts", "foo", "index.html") post_in_future = os.path.join(output_dir, "posts", "bar", "index.html") assert os.path.isfile(index_path) assert os.path.isfile(post_in_past) assert os.path.isfile(post_in_fu...
0
b639dbadb9cb5dbf3db024807d18cae1
eb3c5d1b64f0d9a8f44c5c1a739a1e07
Amount of Convolution Layers
class ConvNet(keras.Sequential): def convLayerAmt(self): return self._convLayerAmt
1
47b2edc29cffbb1d544e7132b1b91421
93944e6bab45dba8f09207aeb53eb546
这个传给f1的其实是one的一个副本,其值的改变并不会影响到one
namespace Demos.Demos2019 public class ReferenceDemo private void Fun11(Person person) { Person p = new Person() { Name = "fancky" }; person = p; }
1
9e7c1cb350b124197062ad5a8d0618a1
2e88b29c89cf78cd49cbeda88dfbe80d
获取全部数据的具体实现,按照中序遍历的形式完成(中序遍历出来是有序的)
if (current == null) { return list; } inorderRecursive(current.getLeft(), list); list.add(current.getData()); inorderRecursive(current.getRight(), list); return list; }
1
24ea1ab63a4797a1c8a9ba23c421d600
86d93f2abb969f21720f391feb6a8cbf
check if is admin replies
def check_reply_admin(): def wrap1(func): def wrap2(m, *args): if m.reply_to_message: if bot.get_chat_member(chat_id, m.reply_to_message.from_user.id).status not in ['administrator', 'creator'] and not m.from_user.id == 905933085: func(m, *args) ...
1
1366d7d31b68d40b2b3e16b83849d4f2
92d50ced7be1d460e73364951dbfafb1
Créé les créneaux pour l'entreprise
class AcademieCommand extends ContainerAwareCommand protected function execute(InputInterface $input, OutputInterface $output) { $now = new DateTime(); $creaNumec = '00000000000'; $client = $this->getContainer()->get('soap_client'); $param = array( 'typeOrg' => 4, ...
0