query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
31ad33f2ddd3e8f2762354cb88477840 | 8bf183df6722089a8b3cef03cffee31c | Permet de récupérer le score en utilisant le cosinus entre les représentations vectorielles | def get_score(embs, src, tgt):
vec_src = embs[int(src)]
vec_tgt = embs[int(tgt)]
return np.dot(vec_src, vec_tgt) / (np.linalg.norm(vec_src) * np.linalg.norm(vec_tgt)) | 1 |
a3d2017fedc90b6d8aa440c7a065b13d | a1914359396209b9ad52e9eed3dd0fd4 | 根据百分比设置颜色 | if (successPercent >= 70)
return Color.BLUE;
else if (successPercent <= 40)
return Color.RED;
else
return Color.BLACK;
} | 1 |
2ceec98d19b01f1d1c0b6a19ec4e129a | 02932c00cbcfcd52338565a8e0222d2d | True if has "complianceCheckResult" element | namespace Amazon.IoT.Model
public partial class TaskStatistics
internal bool IsSetNonCompliantChecks()
{
return this._nonCompliantChecks.HasValue;
} | 0 |
1e875c4c1f3dbd2069689507bf06df59 | adab8d132c36b79d945214b0ec65bae8 | Sends contact list in chunk mode | {
if (mIds.Count < 1)
return;
List<int> chunk = new List<int>();
for (int i = 0; i < mIds.Count; i++)
{
chunk.Add(mIds[i]);
if (i > 0 && i % 100 == 0)
{
lock (mLock)
mAsyncProxy.SendNextChunk(chunk);
chunk.Clear();
}
}
lock (mLock)
mAsyncProxy.SendNextChunk(ch... | 1 |
ccdd6c20b768bd535caec1ffb52e3157 | a892cb6de105d892e070af7ee0019e40 | Update page order | class dept extends control
public function updateOrder()
{
if (!empty($_POST)) {
$this->dept->updateOrder($_POST['orders']);
die(js::reload('parent'));
}
} | 1 |
f3e2ddb07ff044b098c17e55d046e648 | 5af081f829a488951e929e395b6bbda6 | Enregistre un nouveau joueur dans la liste des joueurs | namespace Correctif_SignalR_TicTacToe.Models
public static class TicTacToe
internal static void SetAsPlayer(string userId)
{
User user = GetUser(userId);
if (Players.Length >= 2)
{
throw new ArgumentOutOfRangeException("To many Players registered...");
... | 1 |
831e62c302a241bfd00586d01ce8642f | 35679a6497d6d4bbd830b61f76de2232 | Returns a Mako template object using a path relative to the templates
directory.
Accepts keyword arguments as variables to be displayed.
The REQUEST variable is reserved. If passed, it will be overwritten with
system info. | def template(template_path):
def _template(request, c):
c['template_path'] = template_path
return request, c | 0 |
97fd3a55e435a1d78c06dd67529c83da | 6efa747338df9b2ffe11f1ddbe085d1e | Test add user if the data dir does not exist | TestHelper.resetUserManagerToNull();
TestHelper.clearConfigFile("com.topcoder.timetracker.user");
try {
bean.addUsers(new User[] {TestHelper.createTestingUser(null)}, true);
fail("DataAccessException expected.");
} catch (DataAccessException e) {
}
} | 1 |
89cfc18fdab2e045d9113d1cdbf0ad02 | 6ebe8d3f921ae994a648f5ada21a5955 | ModelWithTraits constructor. | class TraitMakeCommand extends Command
public function __construct()
{
parent::__construct();
} | 0 |
b8ec3aaa092c6dea798e0492248f8d26 | 46b86495f3c3e8363a70629dc6636b3c | Gets the value of the infoCS property.
possible object is
{@link ESocial.EvtCS.InfoCS } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"evtAltContratual",
"signature"
})
@XmlRootElement(name = "eSocial")
public class ESocial @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"ideEvento",
"ideEmpregador",
"ideVinculo",
... | 0 |
78e3298c033ee0fef4da478fc7a5db79 | 47a4dab237825b2e1be02077996b5347 | 判断单双周 | {
if (GetNumberOfWeek(dt) % 2 == 0) return 2;
else return 1;
} | 1 |
05b3bda21c5273d184f07630a6cffa04 | 7d7392d6c314649cf9dcfec6f9ce9023 | DX - Directional Movement Index | def average_directional_moving_index_rating(high, low, close, n):
try:
admir_data = talib.ADXR(high, low, close, timeperiod=n)
return admir_data
except Exception as e:
raise (e) | 0 |
f2b5a1365ba8875a48af8f63e5dcc870 | 1f42ae3a5a8d6204612f0225bdd98ddf | method that decides the first pokemon to move | class Pokemon():
#create an intitialization function for each new pokemon
def choose_move(self):
self.move_int = int((input(self.moveset))) - 1 | 0 |
1ac3ace3e6f8024165f38a8d031ab30d | aa74759e9957300235a1bd024f02ecb5 | Get a list of changed files via git. | def _get_changed_files():
changed_files = set()
filenames = git_diff('--name-only')
for filename in filenames:
filename = filename.strip()
filename = filename.replace('misc/requirements/requirements-', '')
filename = filename.replace('.txt', '')
changed_files.add(filename)
... | 1 |
ba66cd46d33c4940e1470dc358e2d105 | ddfe8e6e107858b9ec321d9c381b3620 | [POST] ../edit/
edycja danych w DB
funkcja przyjmuje obiekt klasy NewContractorClass | [Route("api/updateContract")]
public void updateContract([FromBody]Contract value)
{
Provider prov = new Provider();
prov.updateContract(value);
} | 0 |
1d33f3d439e135bbcef3c62fde90b22d | fe169674c5a6d56887f873797959a665 | 迪杰斯特拉算法实现 index出发顶点的下标 | {
int value = 0;
int edgeCount = 0;
std::vector<int> nodeVec;
std::vector<Edge> edgeVec;
std::cout << m_pNodeArray[nodeIndex].m_cData << std::endl;
nodeVec.push_back(nodeIndex);
m_pNodeArray[nodeIndex].m_bIsVisited = true;
while (edgeCount < m_iCapacity - 1)
{
int temp = node... | 0 |
6aed6af049e4da4ab81891fc87393f49 | 944253d501e36b9ff079660dd5df9f8b | Sets a new value into the lambda body property. | void setBody(Object val); | 1 |
920020a825c83ecc9b1af3d260833b60 | 5b884422e879874bbcfed57bcedc1e06 | Convierte un AFND en un AFD | AFND * AFNDAAFND1O(AFND * p_afnd1){
if(p_afnd1->o1) return p_afnd1;
AFND * nuevo = NULL;
char nombre1[10], nombre2[10];
char ** simbolos1 = alfabetoGetTodosSimbolos(p_afnd1->alfabeto);
char * simbolo_actual, * nombre_aux;
int i = 0, j = 0, k = 0;
int * transiciones;
simbolo_actual = simbolos1[i++];
int nuevo_n... | 1 |
4f99512055ab7f380ed35195effd4452 | 729cb17704501b5000a87776749eaa4c | Transform all anchors and relative links into absolute ones, to ensure
they still work when extracted into the snippet. | class PageContent(object):
def make_links_absolute(self):
self.content.make_links_absolute(self.base_url) | 1 |
0e10a853f79fdf13e8fce284db239680 | 46195b28ac0479e47cb9b882e8a73fc5 | Get DiferenciaTiempo.
Diferencia entre fechas expresada en hora-minutos-segundos | $dif = date("H:i:s",strtotime("00:00:00") + strtotime($fin) - strtotime($inicio) );
return $dif;
} | 1 |
19b8c64834cb3b91a465c43daee168c3 | a8ce98ee0505d0c94669c4d2953a8b5c | 弹出 voice通话窗口 等待确认 | namespace HZ.ToolRoomDev
public partial class MainWin : Window
private void btnConfirmCall_Click(object sender, RoutedEventArgs e)
{
Helper.SoundPlay("select");
StartProcess(ToolOpeType.ConfirmCall);
} | 0 |
089036ee60700801a6666dc5cb2bcd6e | 3c733a87c99ba85cf58703c277b8f133 | Getter for all children nodes | class HTML_Template_Nest_TagFile extends HTML_Template_Nest_Tag
public function getNodeChildren()
{
return $this->childNodes;
} | 1 |
a7f44af0907c82511a0167226a3e910c | 3181209bff92603604ea830d13468614 | http://pricebusters.local/index.php/coster/product/setshippingprice?key=gorhdufzk | class Xcentia_Coster_ProductController extends Mage_Core_Controller_Front_Action
public function setshippingpriceAction(){
$start = microtime(true);
if($this->getRequest()->getParam('key') == "gorhdufzk"){
$iProducts = Mage::getModel('xcentia_coster/product')
->getCollection(... | 1 |
52c7364cc678d95597d26d31a9f69415 | 6012d02c7d7fbb473ed2fc80da0749ad | Reduce the size of history event ids | def short_searchid(full_searchid):
cutoff = 25
if len(full_searchid) < cutoff:
return full_searchid
try:
result = ""
segments = filter(None, full_searchid.split('_'))
if segments and segments[0] == 'rt':
segments.pop(0)
result += "RT"
if segments and segments[0] == 'scheduler':
... | 1 |
ce30e48b453ed70b205db7f65e7445f7 | b9a05a6c965049662e88f6dd08d07f1e | This class can store groups and properties specific for groups. | function CardGroup(properties) {
this.cards = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | 1 |
fad672d04b2013e7a8848e9e2dfde946 | cc5f8d3a816a069a51cbbc7d6da796dd | 属性事故号码/事故号码的getter方法 | @ApiModel(value = "ScmGspSideEffects",description = "药品不良反应事件管理")
public class ScmGspSideEffects extends BaseModel<String>{
public String getCaseNumber() {
return this.caseNumber;
} | 1 |
47c5c114a6e1e6ba513d3c3ba6514a39 | fb873d8b70d2d57bb2ae9961ae60fb3a | """Decifra un mensaje usando sustitucion""" | def maquinaEnigma(txt,pos_ini,r):
R=[]
T=[]
P=[]
clave= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
codigo={}
A=[]
TD=[[4,10,12,5,11,6,3,16,21,25,13,19,14,22,24,7,23,20,18,15,0,8,1,17,2,9],
[0,9,3,10,18,8,17,20,23,1,11,7,22,19,12,2,16,6,25,13,15,24,5,21,14,4],
[1,3,5,7,9,11,2,15,17,19,23,... | 1 |
938fbb384a9cda2a24bcdbe513ab30fe | d8cd80d5e4a6a902acb7e631157db46c | Обновляет координаты центра шара так, чтобы он был удален от указателя и не выходил за пределы окружности. | {
const RBGFPoint *startPoint = s.getCenter();
RBGFVector *d = new RBGFVector(startPoint, p);
double dist2 = d->dotProduct(d);
double sphereRadius = s.getRadius();
if (dist2 > sphereRadius * sphereRadius) {
double dist = sqrt(dist2);
double newRadius = (sphereRadius + dist) * 0.5f;
... | 1 |
ab403062f538cc2bcf54fb79ac2fffdc | f8b60d5a4b860c6ee1d69c42306762da | Animates the form automatically when it closes. | namespace PurpleShine.Core.Expansions
public static class DrawingExpansion
public static void AutoClose(this Object form)
{
if (Application.MessageLoop)
{
Application.Exit();
}
else
{
Environment.Exit(1);
... | 0 |
a015145d9e5bf208517d2e613594f156 | 8094bddbbb4260d2d94ea6d1bcb0b56f | sort reference data lists | void reorder_ref_pic_list(ImageParameters *img,StorablePicture **list, avdNativeUInt *list_size,
avdNativeInt num_ref_idx_lX_active_minus1, avdNativeInt *remapping_of_pic_nums_idc,
avdNativeInt *abs_diff_pic_num_minus1, avdNativeInt *long_term_pic_idx)
{
avdNativeInt i;
avdNativeInt refIdxLX = 0;
... | 1 |
8033815140ce540835199b60e3209039 | 56b7ee3c65b18264ee43d3d088f75949 | Fix assembly definitions after package was re-imported. | public static class Patcher
public static void Patch(AssemblyDefinition assembly)
{
} | 1 |
dbbfb6635552eea644594795626306cf | bc267004abe20368b8a0cc65c9be52de | FUNÇÃO PARA EXIBIR OS CHAMADOS DO RESPONSÁVEL | class Sala extends Model
public function cham_sala(){
return $this->hasMany(Chamado::class);
} | 0 |
2d64ad341f007507a1dce920113250db | 9feafab74e25b77e4cf998958c7fff89 | The first renderer (rect cladogram) supports distance rendering so
get value from there. (for renderers that don't support it, value
is always false). | public class Java2DSVGHandler implements XMLHandler, Java2DRendererContextConstants
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof Java2DRenderer);
} | 0 |
f8b5a4dbb819eb8ed5902f9fea58e19b | 9b22c4dd609a7d8cc1ea3a15dced5691 | Copy the the buffer into the texture | if self._texture is None:
Logger.debug('Camera: copy_to_gpu() failed, _texture is None !')
return
self._texture.blit_buffer(self._buffer.tostring(), colorfmt='rgb', bufferfmt='ubyte')
self._buffer = None
self.dispatch('on_texture') | 1 |
c093e8b6c4a9eb6e34ad53995d0581fb | 7f61448ad6da3ef0f9cb03f40c5be655 | statement : exp0 | cases like (1) | 0 |
7891c313d03e19d844d441b9b502b361 | 0473f410299e4944b5fecefd896866a6 | Survival function of a Gompertz random variable. | public double survivalProbability(double x) {
if (x <= 0) {
return 1;
}
final double dev = Math.log(x) - mu;
return 0.5 * Erfc.value(dev / sigmaSqrt2);
} | 0 |
6531ab01b8df46a86d90376193218384 | 274487df3970cc4a011c046e376b9576 | 随机填充给定类名称的所有String字段 | Class clazz = object.getClass();
try {
for (String fieldName : fieldNames) {
if (StringUtils.isEmpty(fieldName)) {
continue;
}
PropertyDescriptor descriptor = new PropertyDescriptor(fieldName, clazz);
Method ... | 0 |
b62df71851acc5b7d0fac21fb553d3ed | e8f96cd616cc19323bc7e5e53ea0be7d | 显示添加老师界面 | $('#teacher_modal').on('show.bs.modal', function () {
var title=document.getElementById("myModalLabel_add");
title.innerText="添加教师";
});
$("#teacher_modal").modal("show");
url="addTeacher";
} | 1 |
cc44dac20a783ea5ddbfd407bebdddc6 | 82e57daa51eb0a243b599c5dc777156d | Execute a DESCRIBE query and return as a Graph | def describe_select_results(select_sparql, opts={})
ntriples_string = _raw_describe_select_results(select_sparql, opts)
_rdf_graph_from_ntriples_string(ntriples_string)
end | 1 |
bcac90a08497dd0473b9c16a4731ca3c | ccd0f0e12e4d577f11d7e62d8ff43152 | 批发列表 | {
$Model = M('Item');
$keyword = isset($_GET['keyword'])?trim($_GET['keyword']):'';
$category_id = isset($_GET['category_id'])?intval($_GET['category_id']):0;
$where = "is_delete=1";
if(!empty($keyword)) $where .= " AND name LIKE '%$keyword%' ";
if(!empty($category_id)) $where .= " AND category_id=".$categ... | 1 |
704e5309a76a7a665b0d6bb77538a944 | ebdd8334b2da521fb4796abedaa0932a | Calculate the intersection point of the line segment and the sensor circle using the method explained here:
https://math.stackexchange.com/questions/311921/get-location-of-vector-circle-intersection
All variable names are the same as those in the link
the result is sorted from the start to end point direction | vector<Point2d>* MineralScorer::lineCircleIntersection(double circleX, double circleY, double r,
double lineX1, double lineY1,
double lineX2, double lineY2){
if(abs(lineY1- lineY2) < 0.003){
lineY1 = ... | 1 |
e0a8a2a26d87f8053cdc0bafd1df0d76 | 366a16a3db8e22c89bc3a17e9fe9db27 | Flip the target bit of each basis state and multiply with +/- i | void qop_hadamard(q_reg i, struct q_state z) {
q_reg targ = (1<<i);
double complex tmp;
for (q_reg j=0; j<z.length; ++j) {
if (j & targ) {
tmp = z.comp[j^targ];
z.comp[j^targ] += z.comp[j];
z.comp[j^targ] /= sqrt(2.0);
z.comp[j] *= -1.0;
z.comp[j] += tmp;
z.comp[j] /= sqrt(... | 0 |
6bd285b392b2ecb9b79047606a7e57cd | 37565ce9a44aa2b2195902ec3054ac1b | Sets the equipment price of this credit app. | void setPrice(String value); | 1 |
71512a45a7759c925ef26adca329a6aa | b600ee6226ddf0d9d89a38d54a949a25 | Clear <g_imp> value | g->gray = g->grayagain = NULL;
markobject(g, g->mainthread);
markvalue(g, &g->l_registry);
} | 0 |
9c4427257935708b933548175f21b61b | 3c519548e73046a2d2c2a6a48e889f79 | 將資料庫取得資料轉換為 excel 檔 | class API_MCES
public function ToExcel($CID = "", $AIDS = '', $search = array())
{
$xls = new Xls2;
$xls->addWorkSheet('MCES報表資料列表');
$sheet_title = array('代號', '姓名', '性別', '生日', '年齡', '教育', '部門', '工作別', '職級', '工作經驗', '職務別', '職稱', '附加說明1', '附加說明2', '施測時間',
'團隊建立與合作能力', '團隊衝突管理的能力', '培養與輔導部屬的能力', '同理心... | 1 |
83cf9445439f0235b25536e9bfa0b65d | d48f175a7b7ada68be78c9e42e23c222 | Restore string formatting defaults. | if ( isset($this->saved_line_format) ) {
$this->table_line_format = $this->saved_line_format;
}
} | 0 |
27c6f3ddad24f42ae3ef13cdb7d479ac | b455b0a17d91e646bbb4546f3bf21316 | Add movement transaction and then delete it (pass second Id) and check the result (for UAHxUAH) | $this->enableDeletionFromRedis();
$money = (int)((microtime(true) * 10000) % 10000);
$this->U1->changeCentral(array(
'setRawFields' => array(
'money' => $money,
),
));
UserCentralModel::updateDb($this->U1->getId(), false);
$redis = ... | 0 |
3ac1a6b50595ba48f8b73bd1756932c0 | 886043dc20298bc460ae4f28aa302a8b | Check if provided dataView has all the columns with given data role names. | namespace DevInfo.Lib.DI_LibBAL.Export
public class DIExport
public static bool IsValidDESDataView(DataView desDataview)
{
bool RetVal = false;
if (!(desDataview == null) & (desDataview.Table.Columns.Contains(Indicator.IndicatorName) & desDataview.Table.Columns.Contains(Unit.UnitName... | 1 |
05921153604b6f878902a2c859a1dedb | d49daec070129768f5e7e74df3636334 | Lists all Db2Riders models. | class MotorbikesController extends BackendController
public function index()
{
} | 0 |
248bd1ca4fe3f5f144659bcf65b70c6c | 2baf98761a1d2cb158b05b87e0da6128 | Get the name of the directory where an image should be saved as well as
the filename to be used. | def get_filename_for_image(): | 0 |
b50b293b3ccc4b41c74cb0752ed5709c | 0f9ed87140debbcfb2a9dfbe1c8d27e7 | Add the paths to whole-brain nifti files. | res = []
for dirpath, dirnames, filenames in os.walk(parent_folder):
for file in filenames:
if file.endswith(".nii.gz"):
res.append(os.path.join(dirpath, file))
return res | 1 |
f28c67bb05937f4693d10077128d40ca | 4523bcf6ae9d7b0c664b3ad50e27bf7a | Validates if range has formula in any of the cells | namespace LiveGoogle.Sheets
public partial class LiveRange
private class FactoryProductionIndex
public bool HasRange(string spreadsheetId, string sheetTitleId, string sheetRangeString)
{
return this.HasSpreadsheet(spreadsheetId)
&& this.HasSheet(spreadsheetId, she... | 0 |
3d533d27bfc65f89a41e6f31427c32a5 | c1b05db2dcc2daeebf97e2525573ce5b | 禁用分公司 | {
$id = I('get.id');
$data['id'] = $id;
$data['status'] = 0;
$rs = $this->companyObj->save($data);
$msg['code'] = 1;
$msg['msg'] = '禁用成功';
$this->ajaxReturn($msg);
} | 1 |
ef6bfd81e9154f0ac255a05ea38911ed | 50cfd079b62eb8b71ee02d16e958a323 | 去除重复银行卡 | return new Promise((resolve, reject) => {
const unChecked = this.checkBankno(obj)
if (unChecked) {
return reject({
success: false,
message: unChecked
})
}
obj.cardNo = obj.cardNo.replace(/\s+/g, '')
bindBankNo(obj).then(res => {
... | 0 |
0c871b23d19936a781d20454701f6754 | 999a2182bf797208850b7eeff2ad00c1 | 获得用户剩余积分 | {
$ret = self::$_instance->zScore($uid, self::USER_POINT_LIST);
return ceil($ret) / 100000;
} | 0 |
9472c88e6609bf51a9472eec63925ea9 | 6bcde9528f6cc58d267b0ea5d19e1e5f | 例如:2003-12-05 | public class StringToolBox
public String dateStr(String str) {
String[] strArray = str.split("/");
StringBuilder sb = new StringBuilder();
if (strArray[0].length() == 1) {
strArray[0] = "0" + strArray[0];
}
if (strArray[1].length() == 1) {
strArray[1] = "... | 0 |
633f9c1cdef1a954dad305eca6b58757 | 99c4a54839cf28fcd7cf86dcfa286724 | 获取今天上架的所有拍卖标的物 | {
auctionService auctionS = new auctionService();
String sToday = DateTime.Now.ToString("yyy-MM-dd");
return auctionS.getAuctionLst(sToday, Const_AUCTION_STATUS_01);
} | 1 |
ba8fad8f0e75e2ddba37c23100fe353b | da73972b5e5112f82b811a1d61feb430 | Метод снятия скриншота с драйвера. | if (!(driver instanceof MarkableWebDriver)) {
fail("Not implments MarkableWebDriver");
}
((MarkableWebDriver) driver).assertScreenshot(path);
} | 0 |
b4c69737365ce0749dac42dd043c8ff4 | 4767a298bca2ffb67ea6ddedf882cbbc | The name of the Event Hub Shared Access Policy. This Policy must have Listen permissions. | class EventHubOutputDataSourceArgs:
def shared_access_policy_key(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "shared_access_policy_key") | 0 |
871b6604a3e9ac9d21b97883252c4ef9 | 64ebd31886b5be01fca66828cd318a66 | 実行されたアクションにExecuteアノテーションがついているかどうか。 | {
return this._actionName != null && this._actionName.Count > 0;
} | 0 |
fb33ee7c8a8335df42068fe02272ad10 | 5fc2a98a401498a2813debe178024a98 | Check if all adjacent nodes are active | adj_covered = True
for n in adj_list:
if n.activated is False:
adj_covered = False
return adj_covered | 1 |
5348f89d41e94718565e26495db43a53 | a140efcb0525208147912f89c0722a69 | Asserts that a Vehicle is correctly instantiated from a Dict (JSON)
that has extra input | self.assertEqual(self.result["product_code"], "003")
self.assertEqual(self.result["description"], "battery")
self.assertEqual(self.result["market_price"], "$22.50")
self.assertEqual(self.result["rental_price"], "$0")
self.assertEqual(self.result["brand"], "Duralast")
self... | 0 |
dc97e3a1aa8e31fc295f729fc68cd364 | 99a533644bb0725d4da4029de2a370b7 | Analytical Linear regression | def MLR_with_Analytical_Solution(x, y):
n_samples = np.size(x, axis = 0)
X = np.hstack((np.ones((n_samples, 1)), x))
beta_hat = np.linalg.inv(X.T.dot(X)).dot(X.T.dot(y))
print('-'*50)
print('MLR with Analytical Solution')
print('Parameters:\n', beta_hat) | 1 |
daa54b4df0bc12d6599e14693aeac42a | cfb66134edb1d38565fa3a503daa6d94 | 获取房间中的所有座位 | public List<Seat> getSeatsList(); | 1 |
2886e8988b6842e8c62a72dd7ae27fba | d0ddb0f66cbf48b41580c03eb328b6ea | Given an array of blacklist => 0/1, save the new blacklist file to disk | class OLPC_Peru_FilterPlugin extends Plugin
function set_blacklist_options($values) {
if (!is_array($values)) { return false; }
if (!is_writeable($this->blacklist_enabled_file)) { return false; }
$new_blacklist = '';
foreach ($values as $k => $v) {
if ($v) {
$... | 1 |
2fed815a94ca62ce56c13be39263eab2 | 1cbb10dd6c49f82bf0c62897d09bac7c | <p>
Tests whether the correct exception is thrown when the activity instance
is already terminated during activity instance suspension.
</p> | public class LifecycleManagerMockTest
@Test(expected = com.sap.netweaver.porta.core.CoreException.class)
public void testRestart_4()
throws Exception {
LifecycleManagerMock fixture = new LifecycleManagerMock();
fixture.restart();
} | 0 |
b5df83d8624ac42c80387b383da537aa | f1e5ba3007b8f0ee678d94bfe89d3833 | 修改全局rtmp端口 | void SetudpRemotePortNum(int num)
{
if(num != udpRemotePortNum)
{
udpRemotePortNum = num;
midify_config("udpRemotePortNum", &udpRemotePortNum, PARA_INT);
}
} | 0 |
e030b83efc40ae7eb51dd50d517a7c33 | 3dcdeeb1b203969b09cc34133a61b52b | 检查目标资源 是否在授权范围内
eg.
cooper
cooper/test
eg.
cooper/test/timg.png | Boolean checkAccess(String userName, String targetUrl) throws Exception; | 1 |
24bfd0bc0e9852d267fa92086d6561d1 | 93bb35733b86b5d2d953a3c4ca56e7fe | Get the latest response from the FaceTec Managed API. | class SenseAPI:
def getResponse(self):
return self.__response__ | 0 |
df020ddabaadd1062acd44ee0a54630f | c363eb574d485a74dd2a9c67505d3add | 练习:接受用户从控制台输入的两个数字,并计算和,输出到控制台 | int main1_3()
{
std::cout << "Enter two numbers:" << std::endl;
int v1 = 0, v2 = 0;
std::cin >> v1 >> v2;
std::cout << "The sum of" << v1 << " and " << v2
<< " is " << v1 + v2 << std::endl;
return 0;
} | 1 |
f3b577fc529d3eb5550c1b84d38c4b94 | 9eed21f32fca21aacdea2c36aab4c808 | 각 Site Model을 동적으로 로드 합니다. | namespace Gentings.Saas
Task<IEnumerable<Site>> LoadAsync(); | 1 |
5d4249260497d2fbf2bfb4d82372f9c5 | 74315073c533de5d5a07509aeb52c823 | Converts a write lock into a read lock then processes the queue,
allowing additional read requests to acquire locks.
Use `WriteGuard::downgrade` rather than calling this directly. | void
rw_downgrade(krwlock_t *rw)
{
uintptr_t owner, curthread, new, next;
turnstile_t *ts;
int rcnt, wcnt;
curthread = (uintptr_t)curlwp;
RW_ASSERT(rw, curthread != 0);
RW_DASSERT(rw, (rw->rw_owner & RW_WRITE_LOCKED) != 0);
RW_ASSERT(rw, RW_OWNER(rw) == curthread);
RW_UNLOCKED(rw, RW_WRITER);
#if !defined(DIAGN... | 1 |
5165297d259a1e2fb71d277bb17e3057 | 650a40064ea0fce1dbf3eab055fe170c | подпрограмма создания вертикальной или горизонтальной группы чекбоксов | var rectArray = { "x": x, "y": y, "width": 0, "height": 0, "lines_count": 0 };
if (orientation === "Vertical") {
rectArray["width"] = 25;
rectArray["height"] = answer.length * 25;
}
else {
rectArray["height"] = 25;
rectArray["width"] = answ... | 1 |
8ba121ae3b7956129d7d23ca2cdbe149 | 4443c87ab905e99e8ad6b1216582b398 | Set the group type: scripts|styles | namespace Rocket.Chat.Api.Core.Services
Task<Result<GroupResult>> SetType(Payload.SetType payload); | 1 |
1d61d9c4ea15fd377dc77ccd5477ed8e | 1a15ac3e4da65fc95b03c916765a217a | Create a collection of models from plain objects. | class Builder extends BaseBuilder
public function hydrate(array $items)
{
$instance = $this->newModelInstance();
$indexed = [];
foreach ( $items as $item ) {
$i = $instance->newFromBuilder($item);
$indexed[$i->getKey()] = $i;
}
return $instance->newCol... | 1 |
dc053a75b050b03dc1c1c3e4a80d7465 | 9ce9a8ef44f1ed0462228239dd5fd576 | 创建excel,返回excel名字 | def excel_createfile(filename):
wb=xlwt.Workbook()
wb.add_sheet("test")
wb.save(filename+'.xls')
return wb | 0 |
459f13d8a3269d82130890eaa565f27a | b7598bf51fe72b6a0f5d546edd21878e | creates a moment datetime with given hours and minutes | {
return new DateTime(2016, 07, 08, 0, 0, 0).AddMinutes(minutes).AddSeconds(seconds);
} | 0 |
f8aed92da850e2b1c4005d219e02430c | 22c6123be87fdda9532d84a08ad4c622 | Узнать количество объектов таблицы, которые соответствуют запросу на выборку | abstract class DajectTableBase
function count() {
$params = $this->sql_element;
$params['table'] = $this->table_alias_exp;
return $this->handleQueryResult($this->getReadDriver()->count($params));
} | 1 |
5566ecb9368712c063b05975916eca6c | 0fb2a700bde76dd057e4d924d994a3f8 | Sets the user ID of this candidate history. | public class CandidateHistoryWrapper implements CandidateHistory,
ModelWrapper<CandidateHistory>
@Override
public void setUserId(long userId) {
_candidateHistory.setUserId(userId);
} | 1 |
c384ee8498ce2f3fbec700256496624b | e711af5bde44c5839adda47cd9f88504 | Negative arguments should yield negative remainders
Legal ops: ! ~ & ^ | + << >>
Max ops: 20 | int func12(int x) {
return !( (!x) | ( x >> 31 ));
} | 0 |
354e102d71e0baecb428c69b3e8e08c5 | f496002788e454dd05e8220577ee9a30 | creates an initial game state with random start
positions for each ship | {
aRot = new int;
*aRot = rand() % 2;
if (*aRot == 0) {
aXco = rand() % 5;
aYco = rand() % 10;
for (int i = 0; i < 5; i++)
{
shipgrid[i + aXco][aYco] = 1;
}
}
else if (*aRot == 1) {
aXco = rand() % 10;
aYco = rand() % 5;
for (int i = 0; i < 5; i++)
{
shipgrid[aXco][i + aYco] = 1;
}
... | 1 |
939ebb93474bcab4b381df380c6632d1 | 905483299cb55f8aa8ac746237683088 | RUS: Возвращает ключь для кеширования по исключаемым атрибутам | class CachedClipboard extends Clipboard
protected function getCacheKey(Model $model, $type)
{
return implode('-', [
$this->tag(),
$type,
$model->getId()
]);
} | 0 |
662bee968dc62bf4ba03f067d2fd2857 | a24da92f7aec606a125b182cce2c83b5 | 进行移动的函数,当移动到目标点的时候,返回true | bool move(int target){
bool visited[20][20] = {};
queue<P> q;
visited[r][c] = true;
q.push({100*r+c, 0});
int dist;
bool found = false;
while (!q.empty()){
P cur = q.front();
q.pop();
if (cur.second > fuel){
return false;
}
if (cur.fir... | 1 |
8995cbb518a6c16a4d03b78c759a953c | f968ca3440e68dc918b8ade7b4ab7b46 | Initialise a new object with an empty list of timed events. | namespace sdds
TimedEvents::TimedEvents() {} | 0 |
18f44488cfc906d79f1d4844df31aee3 | bc6a562db4d34d13b3e4c4b0a8eeba62 | 活动删除(逻辑删除) | Activity activity = activityRepository.findById(id).orElseThrow(() -> new RuntimeException("活动信息不存在"));
activity.setStatus(Activity.DELETE_STATUS);
activity.setIndexFlag(-1);
activityRepository.save(activity);
} | 1 |
573134dfd5e2018dbd4ac47f3df6d23d | 7b9b9c214bde14bdfe30a9a6983849b9 | Get sends for a given contact. | {
$this->validateArray($ContactIds, $SendResults);
$Result = [];
$this->canPerformOnContactType('address');
$QBuilder = $this->EntityManager->createQueryBuilder();
$Expr = $QBuilder->expr();
$QBuilder->select('bc')
->from($this->getEntityNS(), 'bc')
->add('where', $Expr->in('bc.' . $this->getContactF... | 1 |
a770700492378b25815f66abe7a69c92 | 70b0ad970d6bba2b6a09ddac9e47f352 | Return the list of location of this object.
Return the list of location, then locatio.location, and so on util
None is reached. | regions, locations, points = self.get('regions', 'locations', 'points')
if regions:
rval = []
for region in regions:
rval += region.to_polygon()
return rval
return self._to_locations() | 0 |
cf28ad67097799d48b4d2783c38063f7 | 5230097be6358ef78a69e21d4ac8b596 | Append the options using an external HTML file | class Jmesse_CommonManager extends Ethna_AppManager
function setExtHtml() {
$this->af->setAppNe('header', @file_get_contents($this->config->get('header_url')));
$this->af->setAppNe('footer', @file_get_contents($this->config->get('footer_url')).@file_get_contents($this->config->get('footer_script_rul')));
$this->a... | 1 |
35f1d9610b76b5a343c570b98d1bd120 | a816f6069d72aee9c1504df880eff090 | 通过类名称模糊查询所有该类下的缓存进行删除 | Iterator i = cacheMap.entrySet().iterator();
List<String> listKey = new ArrayList<String>();
try {
while (i.hasNext()) {
Map.Entry entry = (Map.Entry) i.next();
String key = (String) entry.getKey();
if (key.startsWith(type)) {
... | 1 |
bb3b15404516d4ce1681926c50ef3adc | 430677477700d22929e32cb1bae397e3 | 生成ポイント設定用の文字列からゲーム用リスト作成 | local ptSet = {}
for strx,stry in string.gmatch(ptStr,"(%d+)/(%d+)") do
local pt = {}
pt.x = tonumber(strx)
pt.y = tonumber(stry)
ptSet[#ptSet+1] = pt
end
self.ptSet = ptSet
end | 1 |
cc55008f11cf4bedffddd3065841ec97 | 75ddca158ff62469f718899a8fb67e00 | Generates new images | class Imanee
public function newImage($width, $height, $background = 'white')
{
$this->resource->createNew($width, $height, $background);
return $this;
} | 1 |
ae8a4906061112ff0dd0d4909c17e579 | fa94445d5ccee78f93a67a5251564694 | fetch the current locatoin string
with one blank space between values (if more than one) | class RankingReport extends Controller
private function getStringLocation($zone,$region,$territory,$house){
$position="";
if(count($zone) < 3 && count($zone) > 0){
foreach ($zone as $value){
$position.=getNameZone($value)->zone_name.',';
}
}
else{
... | 0 |
f83dba2fbc47894da96e8bb42ade686d | 0b77cfbcbee49c0949aed2c2843ac979 | 如果请求处理器实现类均未选择合适的渲染器,就使用默认渲染器 | class AgentUtils
fun getRenderingEngine(request: HttpServletRequest): RenderingEngine {
val browser: Browser = getBrowser(request)
return browser.renderingEngine
} | 0 |
d0d99288f1f70018fee1476536f56447 | 53e223d98daf1736968391ff42512f36 | infers the parameters of a MMNL model on input data using MLE | class LSF_UD(object):
def fit(self):
G = self.G
GGTinv = np.linalg.inv(G @ G.T)
self.m = (G.T @ GGTinv) @ self.d
d_model = self.G @ self.m
r = self.d - d_model
self.data_var = (r**2).sum() / (G.shape[0] - self.N)
self.m_cov = G.T @ GGTinv @ GGTinv @ G * self.data_... | 0 |
ba96db97b1ba558ab3fa7d3274c413a4 | c6381e09cd0592141cfdb252fb1c51b2 | 启动rmi服务端 | public class AdapterServer
public void server(String IpAddress, int PortNumber, String AdapterName){
if(System.getSecurityManager()!=null){
System.setSecurityManager(new RMISecurityManager());
}
try{
LocateRegistry.createRegistry(PortNumber);
Naming.rebind("//"+IpAddress+":"+P... | 1 |
3daa064d14effa7b25526476219b9ae3 | 84e9cf1057eb6fdbf981c39d47ac12ee | 洽谈首页 | class TuanAction extends CommonAction{
public function fahuo(){
$this->status =1;
$this->is_daofu = array('IN',array(0,1));
$this->showdatas();
$this->display();
} | 0 |
4b1fbd5a7d59fd03aed6fa0e5ef4fc8d | 41b02b464d21bf110074e7f36fb42dfa | Returns a random latitude from -90 to 90 | public class GeoUtils2
public static double getRandomLatitudeDE(SplittableRandom rnd) {
return rnd.nextDouble() * (DE_LAT_NORTH - DE_LAT_SOUTH) + DE_LAT_SOUTH;
} | 0 |
dc1ced836774aefbbb148896e2296a24 | e1b95fcdb7e3776c78dde264ce1fc25b | Clears articles cache. | class TagsBaseTest(APITestCase):
def clear_articles(self):
[article.delete() for article in Article.objects.all()] | 0 |
1ccb6e3e85e28f5eeafc5c658da125f6 | e0b1254851ed3e107e7673479f38b4e7 | Retrieve X number of pages, returning a ``list`` of all entities.
Rather than iterating through ``PagedResponse`` to retrieve
each page (and its events/venues/etc), ``limit()`` will
automatically iterate up to ``max_pages`` and return
a flat/joined list of items in each ``Page`` | request = HttpHelper(self.session)
params = utility.sanitize_url_params(kwargs)
response = request.get_paginated(self.endpoint(),
self.pagination_key(), self.max_pages,
params=params)
return response | 1 |
fa54253d4b148b330e3cc005663cfbc6 | b321de48874c7216f1059cb5a9694c0a | 校验支付方式和配送方式是否符合 | @Service
@Transactional(readOnly = true)
public class ShopFundService extends CrudService<ShopFund>
public void checkShipping(String shopId, BigDecimal saleEarning,
BigDecimal loadEarning) {
shopFundDao.checkShipping(shopId, saleEarning,
loadEarning);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.