query_id
string
corpus_id
string
query
string
code
string
label
int64
fa7973f2724dfedcefe7889f9ac92bef
077959ada97bb5e7a70991707cfb0678
Handles the CanExecuted event of the ApplicationCommands control.
namespace TC.WinForms.Commands [DefaultEvent("Executed")] public class ApplicationCommand : BaseCommand public override void Execute() { if (CanExecute) OnExecuted(EventArgs.Empty); }
0
cef52c77eea9eef50e5bdeb13987dc5f
adaa5ef3ecb9a59ac77594121794922a
Return ValueError, because this metadata attribute is not changeable.
class Descriptor(object): def __set__(self, instance, value): raise AttributeError('cannot set new attribute')
0
1734803c1cd53a340d3f48c6ed096abb
1fb7f28a2b16621bbc4f24764618ed03
function that prints a text with 2 new lines after each of these iacters: ., ? and :
if not isinstance(text, str): raise TypeError("text must be a string") for c in ".?:": text = text.replace(c, c + "\n\n") print('\n'.join(t.strip() for t in text.split('\n')), end='')
1
5c02eb80d91ce376322ad722ccbf2be8
dbf54995b2d869dd8977b3fa5e0e2b2b
Add points to the player's unscored pool, capped at the fish species' maximum.
void CChildView::OnAddfishNemofish() { if (mAquarium.GetNumPredators() < mAquarium.GetNumPrey() / 2.0) { if (mAquarium.AddScore(nemoCost)) { auto fish = make_shared<CFishNemo>(&mAquarium); fish->SetLocation(InitialX, InitialY); mAquarium.Add(fish); Invalidate(); } else { AfxMessageBox(L"Not e...
0
6f6ac462ab95b929e444acdec4dbb976
60aada824823002a78a48407cb8d2c3d
Calculates the cShake128 of the test exit token and returns its representation in two 64bit halves.
unsigned sh_post) { llvm::APInt x, y, q, r; x = x.getAllOnesValue(96).zext(128); y = (x * llvm::APInt(128, magic_number)).lshr(32); q = ((x - y).lshr(sh_pre) + y).lshr(sh_post); if (q == 0) return 0; llvm::APInt::udivrem(x, q, q, r); uint32_t result = q.getLimitedValue(std::numeric_limits<uint32_...
0
191e09d35491107762eb5cca629ecce6
b79217963f542a7d8a2044193210d917
修改供应商合格评审表明细(VendorQualifyReviewDetail)
PageVO<VendorQualifyReviewDetailVO> queryVendorQualifyReviewDetail(VendorQualifyReviewDetailFilterDTO vendorQualifyReviewDetailFilterDTO);
0
bc01b5e082d8bba841691a2d2d00b96f
4709ed0d0a751ccd89f41adb7f66c465
Function calcAverage accepts five test scores as arguemtns. it cals the function findLowest to determine th lowest score. The average of the four highest scores is then calculated and returned.
void calcScore(float a,float b, float c, float d, float e){ float high=0, low=10, avg; if(high<a){ high=a; } if(high<b){ high=b; } if(high<c){ high=c; } if(high<d){ high=d; } if(high<e){ high=e; } if(low>a)...
0
cb3d2c5c9b3ef76bcd3b9041ec6587f7
d85cde1b80f722b9a493e590d0810691
Creates fixtures from SOURCE_ITEMS. Call with SOURCE_ITEMS and start dir; calls itself recursively to create complete fixture tree.
{ if(!file_exists($source)) return false; if(is_link($source) or Eleanor::$os=='w' and readlink($source)!=$source) return symlink(readlink($source),$dest); if(is_file($source)) { static::MkDir(dirname($dest)); return copy($source,$dest)...
1
df9556056c24880d20ee83d66a27e4ef
f321f9c473ee7ac59244365909527ec6
Create an instance of {@link AuthorizeResponse }
class ListApplicationAuthorizationsResponse(AbstractModel): def __init__(self): self.AuthorizationInfoList = None self.TotalCount = None self.RequestId = None
0
25cc2d2ae2d112080e13d0fac63a0b87
bdd980f826dec4fdbca0c3f550e7375d
Sprawdza, czy dwa punkty leza po tej samej stronie prostej wyznaczonej przez odcinek s
bool sameside(const P& p1, const P& p2, const line& l) { return sgn(cross(p1, l.a, l.b) * cross(p2, l.a, l.b)) > 0; }
1
05e2c3843b34a3113da162752bc61188
55e12bbf74c87d2960af42a1ed5a0c70
Returns the meta object for class '{@link EER.Aggregation <em>Aggregation</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getColumnAggregationInheritance();
0
d623c2e8a3586144d303279f3a73fd5b
ca61962832f6f6fa454169d459c2a6c1
跳转到添加里程信息管理
function addCarInfoManageFrom(){ $("form[name=page]").attr("action",Ext.basePath+"tjsinfo/lhcrms/carInfoManage/addCarInfoManageFrom.action"); $("form[name=page]").submit(); }
1
f998c336ff22a830b75d130c19747360
2652495544f9fd647a8fb31428a97453
在给定点范围内生成太阳能板
function draw_solar_panels(points_sequence, panel_width, panel_length, width_offset, length_offset, rooftop_offset){ var lons = []; var lats = []; for (i = 0; i < points_sequence.length; i++) { lons.push(points_sequence[i][0]); lats.push(points_sequence[i][1]); } var west = Math.min....
1
9febf12f5c434aaa02fd6a474fd65885
4daf34e6805f21a57f2b74cd6c746950
Gets the revisions_upward_last_7_days of this ZacksLongTermGrowthRate. # noqa: E501 The number of long term growth estimate revisions upward in the last 7 days as a dictionary. Useful for Panda Dataframes. # noqa: E501
class Ticker(_YahooFinance): def grading_history(self): return self._quote_summary_dataframe("upgradeDowngradeHistory")
0
f6fdb203e7926c609c1825a5a04e1b89
166265253538e70b97edfe23613c984d
u''' Получаю описание апплета по имени
class Apps_Processor extends SiteBill function get_apps_by_name($name) { $DBC = DBC::getInstance(); $query = 'SELECT * FROM `' . DB_PREFIX . '_apps` WHERE `name`=?'; $stmt = $DBC->query($query, array($name)); if ($stmt) { $ar = $DBC->fetch($stmt); if ($ar['app...
1
bdc7fae219660c30277b947acb51c874
cd6f54f7728da13bdbf2c181b219a838
Initializes the two adjacency lists representing the graph. One adjacency list can resolve directly connected adjacencies such as switches and circuit breakers. The second adjacency list can resolve any series connectin adjacency.
namespace SynchrophasorAnalytics.Graphs public class TransmissionLineGraph public void InitializeTree() { if (m_adjacenciesHaveBeenResolved) { foreach (VertexAdjacencyRow row in m_directlyConnectedAdjacencyList.Rows) { if (row.Heade...
0
bd4c059cb2025e71b702149bad084e31
591e7cbd6d6adfbf9e181537b6b7d83d
Helper function for calling Slack API endpoints.
def post_to_slack(slack_message): SLACK_ENDPOINT = "https://hooks.slack.com/services/000000000/000000000/0000000000000000000" SLACK_CHANNEL = "my_lovely_slack_channel" SLACK_USERNAME = "my_lovely_bot" SLACK_TEXT = (str(slack_message)) SLACK_JSON = { 'channel': SLACK_CHANNEL, 'usernam...
1
e7ac56020346d1e4da3f0117f1af1d95
6002302e00a776ff4eeafc8a0a43a25b
The gravitational field of the Moon is approximately `17%` of that on the Earth. Write a program that calculates the weight of a man on the moon by a given weight on the Earth.
earth_weight = input("What do you weigh on earth? ") mars_weight = float(earth_weight) * 0.38 jupiter_weight = float(earth_weight) * 2.34 print(" ") print("On Mars you would weigh %0.2f pounds." % (mars_weight)) print("On Jupiter you would weigh %0.2f pounds." % (jupiter_weight))
0
c19a42453c9e304bcb6211eb47f2b31d
1a7ef3f5cddd8635055c2dfd1e8e52ac
Make a timestring in the format of '00:00:00'
function makeTimeString(timeObj) { return zp(timeObj.hours) + ':' + zp(timeObj.minutes) + ':' + zp(timeObj.seconds); }
1
c51c5f6f0835e29288c1fbb126789401
cfced3c19bdaebc2c977d1506e343444
Initialize the image slide show in the folder view
this.tile.getChildren().clear(); for (int i = 0; i < UserPageController.selected.images.size(); i++) { if(UserPageController.selected.images.get(i).getfile().getPath().contains( "\\users\\stock\\stock photos")){ UserPageController.selected.images.get(i).setfile( System.getProperty("user.dir") ...
1
68aab88203889c52db83cba669c7abb8
eb0e9020480cc9abb84765b5af4a450a
$hasTaintFlow
case t_action when TaintAction::NOTHING return when TaintAction::XFER taint_mem!(mw[0], mw[1], taint_label_mem(mr[0])) when TaintAction::UNION m_label_src = taint_label_mem(mr[0]) m_label_dst = taint_label_mem(mw[0]) m_label_dst |= m_label_src taint_mem!(mw[0], mw[1],...
0
fbcd1c2ed3d35c0972feabbef14ba815
53c1d4139c0d7cfd11a5b91519e38d0b
Random a subset of Component[] that elements are different each other.
final var subset = new int[k]; next(n, subset, rnd); return subset; }
0
0717f6c0c53fb10019ad9bac9f332dbe
c962a8abb1712b9d15efab3223cc2dc7
获取一条等待执行的邮件任务
String sql="from MailTaskModel where id=?"; MailTaskModel mailTaskModel = new MailTaskModel(); Object[] value = {id}; List<MailTaskModel> list = this.getHibernateTemplate().find(sql,value); for(MailTaskModel Model: list){ mailTaskModel = Model; } return mailTaskModel; }
1
c71ebd12f397487468fd1fc833b3ea9a
35a42db4b1dcef59d137789d72751174
Communicate with the main process. See ipcRenderer details at <https://electronjs.org/docs/api/ipc-renderer>.
export class IpcRendererService send(message: string, args: any[]) { this._ipcRenderer.send(message, args); }
1
8a373970342f705e7c3287096465762f
6dcee1ea723c92c85f24821e4af35760
敵のパーティー生成 enemyClassがHuman型の場合はPlayerPartyGeneratorの結果をそのまま返却する(使用するレベルはenemyClassが持っているレベル) 以外の場合はenemyClassの持つ情報を元に新しくmemberListを生成して返却する
class EnemyPartyGenerator(object): def generate(enemyClass) -> List: _memberList = [] if isinstance(enemyClass, Human): _memberList = HumanPartyGenerator.generate( enemyClass.level, Alignment.GOOD if random.randint(1, 6) < 5 else Alignment.EVIL) if __debug__: ...
1
d1c38fc698021cbefed5a01738527d94
b08ce7ad64ad0f46783353ceaf8bfb6c
Mahasiswa constructor.
{ $dosen = Dosen::all(); $user = \Auth::user(); return view('mahasiswa.create', compact('dosen', 'user')); }
0
ae861998f0b25a89a0e1415aa5411d3e
3fcbbcf5582696fdc3b90490ce3856da
Marks order as cancelled. Notifies the order book about it
if client_order_id > self.last_client_order_id: self.send_error(now, client_order_id, b"out-of-order client_order_id in cancel message") return if client_order_id in self.orders: self.etf_book.cancel(now, self.orders[client_order_id])
1
8542df70ec20ba8f259bd8f0dd5c840f
f14607ca22177b620a989b5f832e024e
Updates comment log on report (assessment etc.) for user with access to learning object instance.
namespace OSBLE.Controllers [OsbleAuthorize] public class FeedController : OSBLEController [HttpPost] public ActionResult DeleteLogComment(int id) { ActivityEvent logCommentEvent = DBHelper.GetActivityEvent(id); if ((logCommentEvent.SenderId == ActiveCourseUser.UserProfil...
0
24935f05a55d965c81c02812933b73c0
e95b4a1d74d154fb32f63e7e0ee7242f
An iterator to give the scenario sub-models in an ef
def extendedscenarios(): masterdictionary = { 'H': {"Het": 0, "Anis": 1}, '37': {"Het": 0.1, "Anis": 2}, '38': {"Het": 0.1, "Anis": 5}, '39': {"Het": 0.1, "Anis": 10}, '40': {"Het": 1, "Anis": 2}, '41': {"Het": 1, "Anis": 5}, '42': ...
0
2a69028d5c43f1d906b694b56e63e522
205d8718016317e8aab9bfd43472be5a
Redirect to the overview page
class Analytics_TrafficController extends Pas_Controller_Action_Admin public function indexAction() { $this->_helper->redirector('overview'); }
1
96f1c4a44a763b9a49b98891b871d2b3
41100257af41792a793a8363e2cb6366
1、同步删除非空目录及子目录(深度优先)
function delEmptyDirPath(path: string) { return new Promise<boolean>((res, rej) => { path = Path.normalize(path); fs.readdir(path, (err, file) => { if (err) { logger.err(err); res(false); return; } if (file.length === 0) { fs.rmdir(path, err => { if ...
0
83ab8f9c3149df16e31ab6606247448e
f053dd08835e0963287dd81ea8744e88
Checks whether the current user can create other user accounts.
if ( ! current_user_can( 'create_users' ) ) { return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create users.' ), array( 'status' => 403 ) ); } return true; }
1
58bd05f996e41b1b6cd0c258692a34ca
8a61112d2e28d5466abec5030fff4f2c
将point以center为中心旋转angle角度后的坐标值
public class PointUtil public static Point rotate(Point point, Point center, double angle) { return rotateAndStretch(point, center, angle, 1); }
1
90588eba7085f49774811d41d8b8f143
27aa01b1ca94a2bbe1ed039a6349eb65
Emit event through socket
export class SocketService emit(eventName: string, data: any) { this.socket.emit(eventName, data); }
1
820e866ea1cb129762e02cb049db4491
8c1b7187b750a37d2303d8983f6b3576
查询子公司信息(模糊匹配)
@Headers({"urlname:production"}) @POST("system/query/allorg") Observable<SubsidiaryCompanyBean> getSubsidiaryCompanyList();
0
1d7fd122f2ea5c47d3df4c53335f32db
2ce559c3bfb3c137fe3bb8a70bd9df0c
réinitialise toutes les aides pour qu'ils soient réutilisable
public class ShipViewPoint : MonoBehaviour public void ResetAllAims() { m_StraightAims.transform.localScale = m_StraightAimsBase; m_Ship.m_ShipEquipementBehavior.m_ShipAims.SetActive(true); }
1
6524f0aa33db92652376e75c53abfd45
54074ba4ee15c807a6f317799f65dc78
Vẽ Khối gạch kế tiếp
namespace Tromino public partial class Form1 : Form private void buttonNext_Click(object sender, EventArgs e) { if (i <= size * size - 3) { graphics.FillRectangle(brushes[i % 20], Board[i].X, Board[i].Y, sides - 1, sides - 1); graphics.FillRectangle(br...
1
82bbc18bbc1204a5d41f5b72a4e68f37
e433401d96f89f493bffbcf8c9f316f5
Do an inq_var_chunking on a netCDF variable. This function is only run on IO tasks.
nc_def_var_chunking(int ncid, int varid, int contiguous, size_t *chunksizesp) { return nc_def_var_extra(ncid, varid, NULL, NULL, NULL, NULL, contiguous, chunksizesp, NULL, NULL, NULL); }
0
95b1b042087130cb698986ad0362ce59
a4b237d92b949e6b3d4d93a39b626e15
Invoked to ensure that share is exported.
class ZadaraVPSAISCSIDriver(driver.ISCSIDriver): def ensure_export(self, context, volume): pass
1
e67d6d3b8b93200c290a3dab7aa2a300
d20d43e3fda7548672656c7602087a4a
根据时间戳计算调度模式和时间是否匹配
{ bool flag = false; var nowDate = Convert.ToDateTime(DateTime.Now.ToShortDateString()); TimeSpan ts = Convert.ToDateTime(model.ENDDATE) - Convert.ToDateTime(model.STARTDATE); int yearDiff = Convert.ToDateTime(model.ENDDATE).Year - Convert.ToDateTime(model.STARTDA...
1
4c5ed805d88d54b7bda80d1a8e7146fe
97d027c19a2091cfd15dabf1f782bf09
Convenient way to check if a JDBC-originated record was <code>null</code>. <p> This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values. {@link CallableStatement#wasNull()} is <code>true</code>
public class JDBCUtils public static final Boolean wasNull(SQLInput stream, Boolean value) throws SQLException { return (value == null || (!value && stream.wasNull())) ? null : value; }
1
333e555dc575985c1ff11c55a01c2062
97816b22c9a5f4265fba31f8a61cec0b
Filters out everything but available look and feels.
public class BaseFrame extends JFrame implements WindowListener protected JMenu getLooknFeelMenu() { menuLooknFeel = new JMenu("Look 'n feel"); btnGroupLooknFeel = new SimpleButtonGroup(); UIManager.LookAndFeelInfo[] look = UIManager.getInstalledLookAndFeels(); for (int i = 0; i < look.l...
1
b357cbda6770e6cd0a15d774fde379bf
b52368cceedd3a21e60ce9038d140725
設定のバリデーションの実行と保存を行う
class LC_Page_Plugin_AnTracking_Config extends LC_Page_Admin_Ex public function actionSave() { $form = $this->buildForm(); $form->setParam($_POST); $errors = $this->validateForm($form); if ($errors) { $this->form_values = $form->getHashArray(); $this->form_errors ...
1
ef6ac329c70912eddc4c6b5745658211
d551d3ec1f6ccc3c7d3eab302c446a0e
Deletes all media items for the given user
public function removeAll($userId);
1
841bec0c03be2be54939039d63111439
2afb4c577ee5ff0e4eb8c911d7ccb8a8
Permite comprovar la exixtencia de un articulo.
$currentUser = parent::auntenticarUsuario(); parent::isAdmin(); if(!$this->articuloMapper->articuloExiste($codigo)){ http_response_code(400); header('Content-Type: application/json'); echo(json_encode("El codigo no existe")); exit(); } $articuloArray = $th...
1
7cb0f5e1395adf3081bb9ec499030fb5
1e78dd82c54c2b264676f13443e9bfe1
根据入病案时间查询出院病人信息(查询今创数据库视图)
{ string sqls = @" select patzhuyuanid 住院号,patbedno 床号,patname 病人,patdpm 科室, patage 年龄,patsex 性别,oname 手术名称,pattmd 术前诊断,amethod 麻醉方式, PatID 病人编号 from Adims_OperSchedule where CONVERT(varchar, Odate , 23 ) = '{0}'"; ...
0
bf55379fb51975a7fbd3fd9d038bb333
c401d42a76f3ad86f851bdeb4bc7d72a
Returns all info relevant to a packet, using the helper methods described below
class BurpUtils: def getInfo(self, isRequest, requestResponse): if isRequest: return self.burpHelper.analyzeRequest(requestResponse) else: return self.burpHelper.analyzeResponse(requestResponse.getResponse())
1
03e3fcf22ff3b36158e61e8d4c82aaa7
18258252be0275234453f946b279a06b
Deplacement tire aleatoirement parmi ceux possibles pour l'entite
function debutRandomMouvement() { var chiffreRandom = Random.Range(0, 2); yield WaitForSeconds(chiffreRandom); deplacement = true; }
0
0776476e5d13036c6f9a3801e374fdcf
7c22650c816cd12fecbb9a20d43e268f
Compile the VPCurve into a display-list
public class Origin extends StaticShape private void compileVectors() { gl.glNewList(vectorDisplayList, GL2.GL_COMPILE); double lineLength = 2; Line line = new Line(lineLength); line.drawCoordinateLines(gl); gl.glEndList(); }
0
123b1990ff35736094c332cc662989f2
aa8b5050eccd953a707da6dda0a7ca94
计算飞到半人马座阿尔法星所需的天数
GDY = lct_gday(12, 0, 0, DS, ZC, DY, MN, YR) GMN = lct_gmonth(12, 0, 0, DS, ZC, DY, MN, YR) GYR = lct_gyear(12, 0, 0, DS, ZC, DY, MN, YR) LCT = 12 DY1 = DY MN1 = MN YR1 = YR MM,BM,PM,DP,TH,DI,P,Q,LU,LCT,AU = moon_rise_az_l6700(LCT,DS,ZC,DY1,MN1,YR1,GDY,GMN,GYR,GLat) if LCT == -99: return LCT LA = LU for K ...
0
b007f0660a94cca8e02aa4617497102e
96fc74aac7e03429979b6fbc878213f2
Returns the current undo level.
public class MancalaModel public int getUndoCounter() { return undoCounter; }
1
3d90c7c82541cc16784585be3dfb5b9f
6b4c423596f11d73259031997dfb394b
Definition of ntohll
I2htonll( uint64_t h64 ) { uint64_t n64=0; uint32_t l32; uint32_t h32; uint8_t *t8; t8 = (uint8_t *)&n64; l32 = (uint32_t)(h64 & 0xFFFFFFFFUL); l32 = htonl(l32); h64 >>=32; h32 = (uint32_t)(h64 & 0xFFFFFFFFUL); h32 = htonl(h32); memcpy(&t8[0],&h3...
0
58771ce27698546f75de5cf46dd5cb30
a839549be2d6e25ae53932504d8ce4f9
Returns an edge from this node to the specified destination. If there is no edge from this node to the destination, the method returns null. The edge is returned at the top interface level, which might often require subsequent casting to be useful.
Edge<E> getEdge(E source, E dest);
1
708643a418ad6da9aab817c09822608c
69960cb587b6420db0d821b219185985
将键值对放入到map中,不覆盖旧值,而是将旧值和新值合并后赋予新的数组
value = $.trim(value); if(key){ if(map[key]!=null){ if($.isArray(map[key])){ map[key].push(value); }else{ var values = new Array(); values.push(map[key]); values.push(value); map[key] = values; } } else{ map[key] = value; } } }
1
fa1daa14fd5e5b5f8747f4254b1aecc2
fd27492fea293e4aee0c5b22cbcd0179
Drop in replacement for normal linear layers Uses factorized gaussian noise - more efficient than independent noise Original in (Fortunato et al, 2017) https://arxiv.org/pdf/1706.10295.pdf Adaptation in (Hessel et al, 2017) https://arxiv.org/pdf/1710.02298.pdf
super().__init__() self.inplace = inplace self.alpha = alpha self.alpha = torch.nn.Parameter(torch.tensor(self.alpha, requires_grad = True)) self.beta = beta self.beta = torch.nn.Parameter(torch.tensor(self.beta, requires_grad = True))
0
4353cb8071276bc3caf494d683114817
f9ae542ab6b044d3eb3bf6bc278ea22d
Инициализация колонок в таблице tblRequiredDurability - статистика испытаний ГП.
colDateStat.setEditable(false); colDateStat.setCellValueFactory(new PropertyValueFactory<Stat, Date>("testDate")); colDateStat.setCellFactory(new Callback<TableColumn<Stat, Date>, TableCell<Stat, Date>>() { @Override public TableCell<Stat, Date> call(TableColumn<Stat, Dat...
1
252ff4fc7c9ca90cbeb7f0e0218863a5
5e3aab156930da9293d6a1972f6fd858
Gets the automatic completions.
class InputHandler extends Disposable getAutoComplete() { return this.ac_; }
1
5940ced7e329a82c0cabd571ad5118f4
69f8d3f98f38a309c671b90fb1fc78c3
Проверяет, можно ли заспавнить врага и мониторит, не находится ли последний заспавненный враг в точке спавна
class KachanovDrone(DeusDrone): def validate_place(self, point: Point): is_valide = 0 < point.x < theme.FIELD_WIDTH and 0 < point.y < theme.FIELD_HEIGHT for partner in self.headquarters.soldiers: if not partner.is_alive or partner is self: continue is_valide = is_...
0
4aae645a66bb5ec865c865a5c434e561
cdc745e730d772810d6513e2ce960e20
1、解压Aar 2、解压aar中的jar 3、删除已经被解压的jar
void apkToJar();
0
b40942bfdb5b7577e4ba019d2c0c0509
2376facd286c6c5b5ae7630c358726e5
Get a list of all the alliances a corporation has been a member of
function getAlliances($chars) { global $db; for($i = 0; $i < count($chars); $i++) { $in[] = ":char".$i; } $sql = 'SELECT plrAlliances.id AS `id` , plrAlliances.name AS `name`, plrAlliances.ticker as `ticker` , COUNT( * ) AS quantity FROM plrChars INNER JOIN plrCorps ON plrCorps.id = plrChars.corp IN...
0
d23e12cfb4ad08443195ec3bd1ffd1ae
7948851deb1cd6f5145af4a3c5e6305f
Function to determine if something is a valid long integer
int isValidLong(char *x) { char* endp; strtol(x, &endp, 10); return !*endp; }
1
fe85f916897e3df63d22d98cc3d069d7
bd94899c1626061eb154c630ab75d1cc
`prof3to2` entry point.
{ dt_provider_t *prv; FILE *f; char *buf = NULL; char *p; const char *mod = modname; size_t n; dtrace_syminfo_t sip; dtrace_probedesc_t pd; prv = dt_provider_create(dtp, prvname, &dt_fbt, &pattr, NULL); if (prv == NULL) return 0; f = fopen(PROBE_LIST, "r"); if (f == NULL) return 0; while (get...
0
2236e14ff7f7e0cd6761653945d28479
fedba7fb8e90aa95e0d057a7dce913c0
сравнить скорость машин
var type1 = auto1.type.toLowerCase(); var type2 = auto2.type.toLowerCase(); var score1 = 0; var score2 = 0; var typeArray = ['roadster','pickup','suv','wagon']; for (var i = 0; i < typeArray.length; i++) { if (type1 === typeArray[i]) { score1 = i - 10; } if (type2 === t...
0
25786a6e10c277fd57ba6dd0b817b7ba
f6ba29104dd3116d08a2ea88a1acb174
Reads data from channel and returns result as 10-bit value
{ uint8_t tx[] = {1, control_bits(channel), 0}; uint8_t rx[3]; struct spi_ioc_transfer tr = { .tx_buf = (unsigned long)tx, .rx_buf = (unsigned long)rx, .len = ARRAY_SIZE(tx), .delay_usecs = DELAY, .speed_hz = CLOCK, .bits_per_word = BITS, }; if (ioctl(...
1
29f4d2cb285a78a4d6ff8304acc37a7c
adc1b041addadf9cfb3eef43a6baae26
处理四舍五入防伪码
{ if (code.Length == 4) { code = "0" + code; } else if (code.Length == 3) { code = "00" + code; } else if (code.Length == 2) { code = "000" + code; } ...
0
78324f692f76a7da80a6b9678c1aec42
38c4ca4609db653de69bea0584ddba5c
List all users as CSV output
{ $permissions = new Checker(); if ($permissions->canAccessUserSearchExport()) { $headers = [ 'Content-Type' => 'text/csv', 'Content-Disposition' => 'attachment; filename=concrete_users.csv', ]; $app = $this->app; $confi...
1
0805cfba01e93f48a46e75d179a2aa01
f5269cd7f8eb54f2a532fccdbad8bf1a
Se compara la palabra ingresada con la palabra a adivinar.-
export class ExercicesListeningComponent implements OnInit checkSiEstaBien(){ if(this.answer.includes(this.palabraPrincipal)){ document.getElementById("correcto").style.display="inherit"; document.getElementById("incorrecto").style.display="none"; }else{ document.getElementById("incorrecto").s...
1
5e112b08865ca715f01036d6a38a75b7
13e523b9d588c786dc0ffcce060eb751
function to bubble sort based on total marks
lst = len(tup) for i in range(0, lst): for j in range(0, lst-i-1): if (tup[j][1] > tup[j + 1][1]): temp = tup[j] tup[j]= tup[j + 1] tup[j + 1]= temp return tup
1
7b7482f6fad345bf6a6bd08fb84ecac6
b9fe6f7a097eddf8aa17f35a90ee94ba
Get all major cities by country name(full / part).
{ $query = "SELECT *, city_name AS label, city_id AS value FROM cim_view WHERE city_name LIKE '" . mysql_real_escape_string($city) . "%'"; return $this->_DB->prepare($query)->query_select()->query_result_array(); }
0
e8c47bad96fb031b36813b41ed2e2e1f
d9b31ea6bf3ebad749f33748ab143084
Same effect as when player left-click breaks a block, but will not cause actual breakage of the block
if (world.getBlockState(pos.down()).getBlock() == state.getBlock()) { world.breakBlock(pos, true, player); return true; } else { BlockPos up = pos.up(); if (world.getBlockState(up).getBlock() == state.getBlock()) { world.breakBlock(up, true, player); return true; } ...
0
58c8d30daf72f3ad8f5a83d5486768e4
0edeb85fc4d2532638bad8ed78db2c1e
根据用户id删除用户信息(将标志位改为0)
@Select("delete from userinfo where userid=#{userid}") Integer deleteUserinfo(Integer userid);
0
98ef0cdce7c8947e02f66f1ffd342678
ff5a38d3bef2fa409b97b5dbe05202b9
Print out values of Gaussian parameters
def print_paramter_vals(laplace,pos_prior): print(f"Unigram Laplace {laplace}") print(f"Positive prior {pos_prior}")
0
fb2f471e4ecba8baa0ae8e59656595b0
845b449bc87df78f26bee6531891824d
Retrieve all LibGuides assets.
{ $guides = Guide::all(); $data = [ 'guides'=> $guides, 'columns' => $this->columns ]; return view($this->viewDir . '.index', $data); }
0
66e4b515b1078552ca9f5d729d5afa51
bd4dd7adb0aa67a8824cbde908adad8a
Display the video recording screen.
def ly_record2(): return render_template('video.html')
1
da98fa3a8870b0546fe66a99a38123f3
72aafd049810f5359889df266c4c7f84
로그인이 필요한 페이지
HttpSession session = req.getSession(); Object o = session.getAttribute("SID"); if(o != null) { try { resp.sendRedirect("/cafe/main.cls"); } catch(Exception e) { e.printStackTrace(); } return; } String view = "/WEB-INF/views/member/login.jsp"; RequestDispatcher rd = req.getRequestDispatc...
1
24281fb124fe7484fdb9915edaf01e8e
e30a827e0ebb07d8bbda328a73762003
Sets the number of worker threads dedicated to mirroring between repositories. If unspecified, {@value #DEFAULT_NUM_MIRRORING_THREADS} threads are created at maximum.
public class GiraphConfiguration extends Configuration implements GiraphConstants public void setNumInputSplitsThreads(int numInputSplitsThreads) { NUM_INPUT_THREADS.set(this, numInputSplitsThreads); }
0
fbf24b61acb9579d0f4c9532da3e76d7
86583db577214c3181067fcab96acd83
setter method for allowedValues
{ if (is_string($allowedValues)) { $allowedValues = explode(',', $allowedValues); foreach ($allowedValues as $allowedValue) { $this->allowedValues[] = trim($allowedValue); } } elseif (is_array($allowedValues)) { $this->allowedValues = $...
1
4e8fe24afeb75245c3323f73b7b60ec7
6fedcad6ede5f62111d09810c7961e5a
1日前の日付を設定する
EDaySet tmpDaySet = new EDaySet(); tmpDaySet.addDate(new EDate(nowYear, nowMonth, nowDate)); setDaySet2(tmpDaySet); }
0
4a344652f65dcb8ebbfe41d55a484b01
095a9299aa6911d410f2c1eaa66ab15a
Pass on context manager exit to proxied object.
class DaemonContext(object): def __exit__(self): self.close()
0
6bf8c68ebe5055b95fe3b04cc9834746
459d4c05356b728f87532211d67d68ea
Update the world inverse inertia tensors of rigid bodies
static inline void _transformInertiaTensor(Matrix3 &iitWorld, const Quaternion &q, const Matrix3 &iitBody, const Matrix4 &rotmat) { real t4 = rotmat.data[0] * iitBody.data[0] + rotmat.data[1] * iitBody.data[3] + rotmat.data[2] * iitBody.data[6]; real t9 = rotmat.data[0] * iitBody.data[1] + rotmat.data[1] * iitB...
1
19bd5e0b25abc73a873d8e59db7641c1
f3e77a7e8e6952d7fd73c375ae3b689a
<pre> 功能描述:取得指定标识的持久化对象实例,若没找到返回null </pre>
@SuppressWarnings("unchecked") @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true) public Object getObjectById(Class cls, String candidateNo);
1
1057eedfe4fd502474f2fcdbfb1a29e1
925a5dd2d71ae77845c2d63a298a2ec4
Method to create a JTable and fill it with the store item information.
{ tblDetails.removeAll(); TableItem tiNew = new TableItem(tblDetails, SWT.NONE); tiNew.setText(new String[] { "key", csStoreItem.getKey() }); tiNew.setData(csStoreItem); tiNew = new TableItem(tblDetails, SWT.NONE); tiNew.setText(new String[] { "display", csStoreItem.g...
0
14277b24080f81d53a4263c4329f510d
4aa5da0d3ae9d9b8518aa5c0562f00b6
Проверка нового состояния на уникальность
class StateConstraintValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$value->getEntity()->isNew() && !$value->isValid()) { $this->context->addViolation($constraint->message, ['@state' => $value->value]); } }
0
9f5f8715eb6de0cf14239186c1ff0925
9ff81d8759c21495d675de8e0bfcf4d3
Map database-neutral column name to database-specific column name.
class Ingestion: def _map_column(col: str) -> str: return col if col not in COLUMN_MAPPINGS else COLUMN_MAPPINGS[col]
1
80680aee501c2e6f1639c623d99fa6c4
e55b0486c31a89376732870236a9d4b8
takes a list of user objects and displays them to gallery
users.forEach(function(user) { $container.append('<li class="list-group-item"><p>' + user.login + '</p><span class="badge details">Details</span><div><img src=' + user.avatar_url + '</div><a href="'+user.html_url+'"class="btn btn-primary">Go to Github profile</a></li>') }); }
1
0b1aaf8714ac395bcef000901cea5eeb
3a419ce9d060b7deb680cd468d9fb965
Register a property as searchable. <para> Use this if you can't alter the source code of the object to index, thus preventing you from using [Searchable] </para>
if (!$this->isProperty($prop)) { return false; } if (!is_array($this->_searchProperties)) { return false; } if (in_array($prop,$this->_searchProperties)) { return true; } $this->_searchProperties[] = $prop; return true; }
1
4593f52163bf578703ce47b674ca8ac6
646fa9984762f0c04c643f8e8f531296
保存下一次跳转后的视图ID
class GuidePage fun skipId(@IdRes skipId: Int): GuidePage{ GuidePageSpec.skipId = skipId return this }
1
e80c13f54c475f150da1fb6f4de2947d
54e778bc3c3eb6467a3105edca559b5a
İlçe Dropdownlistini doldurur.
{ String itemId = DropDownList4.SelectedValue.ToString(); Dictionary<String, BackEndObjects.Localities> localList = new Dictionary<string, BackEndObjects.Localities>(); DropDownList5.Items.Clear(); localList = BackEndObjects.Localities.getLocalitiesforCityDB(itemI...
1
0f15eeb6e3e8aa54cdf8e1274758a324
852127cffc7bf8c9e672a4c171051398
Copy a classfile and its dependencies into a jarfile
TurbineOptions options, Map<String, byte[]> lowered, Map<String, byte[]> transitive) throws IOException { Path path = Paths.get(options.outputFile()); try (OutputStream os = Files.newOutputStream(path); BufferedOutputStream bos = new BufferedOutputStream(os, BUFFER_SIZE); JarOutputSt...
1
088b1909e1bdc80e386e69ab4d07c58d
f132748b1aab1af30cde869288f0ffaf
Returns the number of distinct SRC_IP in the X minutes surrounding the event
class Features: def get_iat_backwards_min_times(self, df): src_times = self.get_dst_times(df) if self.multicast_flag == 1 or src_times.shape[0] == 1: return 0 else: return min(src_times.diff().dropna().tolist())
0
9fedb1818aead4c0a0768404f20d17ff
9b04c38764568b3542ea65d616679762
XSS protection
class Security extends IICA_Parameters public function XSS_Protection( $value, $mode='ASCII' ) { switch( strtoupper( $mode ) ) { case 'NUMERIC' : if ( $numeric = ctype_digit( $value ) ) { return $value; } else return false ; break; case 'ALPHA' : if ( $alpha = ctype_alpha( $value ) ) { $valu...
1
5eb2ac635f5c8435eeeb4794613df537
a33e9a9281b44fc2f4249507c83395b7
Construct sequence encoders.
super(EncoderStack, self).__init__() self.layers = [] for i in range(params['num_hidden_layers']): self_attention_layer = Attention(hidden_size=params['hidden_size'], num_head=params['num_heads'], atten...
1
53eaab92ecbe8c55ec19442ee6ec9db8
63837f04a4deb5ad1f68901ec13d4369
是否是同步操作,目前只有over 特殊场景会是true
boolean synchronous ();
1
666a3bbfde48ee34cc56d0b237a7c194
e97feaf7655c9c400eaf6ebc9edd8f01
When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
namespace GSF.Communication [ToolboxBitmap(typeof(ClientBase))] public abstract class ClientBase : Component, IClient, ISupportInitialize, IPersistSettings public abstract int Read(byte[] buffer, int startIndex, int length);
1
b56cde2ddaf645a4d5de8ed065af7c41
1f93ab562499b4b8c9677f1887a58159
Get Include_Job_Profile_Compensation_Data value
{ if (!$item instanceof \WorkdayWsdl\\StructType\Job_Profile_Exempt_DataType) { throw new \InvalidArgumentException(sprintf('The Job_Profile_Exempt_Data property can only contain items of type \WorkdayWsdl\\StructType\Job_Profile_Exempt_DataType, %s given', is_object($item) ? get_class($item) : ...
0
b13eef778bc59b0a8bb41954da255aff
ce50bff95c3443f5dedcf69647b53049
Add a teacher on course
const body: { insert?: string[], delete?: string[] } = await setSchema.validateAsync(ctx.request.body) const repo = ORM.em.getRepository(Course) const course = await repo.findOne(ctx.params.courseID, ['teachers']) if (course === null) ctx.throw(404) const teacherRepo = ORM.em.getRepository(Teacher) if (body.ins...
1
bf83b56c35c027774f0480d37ebd81ea
f48e6e8d4dd6385ffb9f57a406135e01
Gets all upcoming auctions
class AjaxAPI extends CI_Controller{ public function getPendingAuctions(){ $auctions = $this->Auction->getPendingAuctions(); echo json_encode($auctions); }
1
d2649679247f06fbfcee6c7738eb265e
a1a0b2248e2a9e867903773fc009dddb
capture ENTER key, up arrow key, and down arrow key, then MakeFocus by next or previous BView
switch (ev->keyboard.keycode) { case ALLEGRO_KEY_LEFT: case ALLEGRO_KEY_UP: return algui_move_focus_backward(wgt); case ALLEGRO_KEY_RIGHT: case ALLEGRO_KEY_DOWN: return algui_move_focus_forward(wgt); case ALLEGRO_KEY_TAB: if (ev->keyboard.m...
0
73180faa16c4880b9dad7d3161dfca92
ec9fded44216a3eac30c390df1e65d4e
告知监听者加载完成
public class AssetBundleInfo : GameBase protected void afterLoaded() { foreach (var item in mChildren) { item.Value.notifyParentLoaded(this); } foreach (var item in mParents) { item.Value.notifyChildLoaded(this); } if (mLoadedChildCount == mChildren.Count) { notifyAllChildLoaded(); } }
1
8fc0140c588478bae52c199c047db8c1
3af20547aefb5cc71f30ca5d274a54ff
Enable mouse hover event tracking
export default class RelationAnnotation extends AbstractAnnotation setHoverEvent () { if (this.element) { this.element.querySelectorAll('path').forEach(e => { e.addEventListener('mouseenter', this.handleHoverInEvent) e.addEventListener('mouseleave', this.handleHoverOutEvent) }) } }
1