query_id
string
corpus_id
string
query
string
code
string
label
int64
72b8ac0dfe3bee3c88f6932420da873c
3266da1cd2106c2db90368fbcd61f18a
刷新装备按钮
public class EquipMediator : UIMediator<equipmainpanel> private void RefreshBtnStates() { panel.strongBtn.GetComponent<UIToggle>().value = Equip_Func_Type.Strong == cur_type; panel.starBtn.GetComponent<UIToggle>().value = Equip_Func_Type.Star == cur_type; panel.insetBtn.GetComponent<UIToggle...
1
27db92546b2923b779cdecf31f34f942
eac6a3f611da4973c34fa45eac0d054a
Verify that an item is created in database with a nutritional value fat unit field if the field fat unit is available in API response
hnm = nfx.HasReadableNutrientMassesTestable( qty_subject=nfx.HasReadableNutrientRatiosTestable( nutrient_ratios_data={ "protein": qfx.get_qty_ratio_data(subject_qty_g=12, host_qty_g=100) } ), quantity_data=qfx.get_qty_data(q...
0
ddd34ec124c4d576edb3cd28175c5813
cf267e3c605d79ecb1727c107e989075
Replaces characters that interfere with Javascript functions. Came from the jQuery AutoComplete routine. 's came back and were escaped to &#39; Unicode entities. jQuery AutoComplete needs an \ in front of the character to show properly in an input field.
$bad = array('$', '(', ')', '%28', '%29'); $good = array('&#36;', '&#40;', '&#41;', '&#40;', '&#41;'); return str_replace($bad, $good, $str); }
0
89496b1fb5a82d62528bbec2bcbd4495
aff952aa7c8bd3f2b9c34ba918f70adf
fires when nextButton is clicked, goes forward a page of employees
const nextButton = await getElementById( this.driver, 'submitSelectEmployees', ); await nextButton.click(); await this.driver.manage().setTimeouts({ implicit: 3000 }); }
1
0e2aaf1e4db38dbd1f0e7d29a8e1c000
c21c1ab22971cf29d238bb7127da4f10
将此玩家进行踢出服务器
KickReasonResp resp = new KickReasonResp(); resp.setReason(reason.getValue()); ChannelFuture future = session.sendPacket(resp); future.addListener(ChannelFutureListener.CLOSE); PlayerManager.getInstance().channelCloseSetSession(session); }
1
2085d7663e5c8ee828f1584caae37a71
e204a29da299b05a3321834cc686a82b
Increment action result count: created, updated etc.
class Tallink public function setCount($name) { isset($this->results[$name]) ? $this->results[$name]++ : $this->results[$name] = 0; }
1
ed5b79715a21958c8b02adf87ff44469
69ae423b9e4b1de5d7c158cf907183f3
Realiza el registro de un encabezado de pedido de cliente.
class cmp_orden_compraController extends Controller public function storeEncabezado(Request $request){ $hoy=Carbon::now(); $num_orden = DB::table('cmp_ordenescompra_encabezado')->where('cve_compania', '019')->max('num_orden'); $create = cmp_ordenescompra_encabezado::create(array_merge($request->...
1
d8117519fd723096c486c0501ad50c84
e3d3ce27f99c886d2117f48547e820b0
Create an action to update public Trades.
index = "csgointl" doc_type = "product-trade" actions = [] opt = 'update' for trade_id in trade_ids: actions.append({ '_op_type': opt, '_index': index, '_type': doc_type, '_id': trade_id, 'doc': {'status': status} }) hel...
1
6338b5b8ef8c4524f1466db961705779
6fb77acf89159b615e5aa197d29462c9
changes the view form lobby to game board
function restart() { var lobbyPage = document.getElementById("lobbyPage"); var gamePage = document.getElementById("gamePage"); var gameOverPage = document.getElementById("gameOverDiv"); lobbyPage.style.display = "block"; gamePage.style.display = "none"; gameOverPage.style.display = "none";...
0
4906f090e72b86065add330216677cb5
990a7e5323739773b1887b9e7ca6457f
Принимает на вход словарь и проверяет наличие всех требующихся ключей. В удовлетворительном случает возвращает True, иначе False.
def dictionary_has_data(dictionary_to_check: dict) -> bool: return len(dictionary_to_check.values()) > 0
0
70580d35d0e027df3f529901f42f219a
8b3976f96c422698a3aa60caed09834b
Returns the meta object for class '{@link dk.sdu.mmmi.modular.roco2.roco2.Behavior <em>Behavior</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
public class VocabularyClassItemProvider extends VocabularyEntityItemProvider protected void addClassifierBehaviorPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), g...
0
cfa8acc04468cca5816a1619191a883e
0f733f39b91b478a045be6a1d0cfe509
Percent of sold price that goes to the consignor.
class IntegratorShop extends \DDelivery\Adapter\PluginFilters public function getDeclaredPercent() { return $this->getConfig('declaredpercent'); }
1
87baa0da835e85b634df771c0d785cef
2cabe30134c5596121303d14fc5f4544
parentエレメント内で、属性が指定されたものであるエレメントを削除する。 削除したエレメント数を返す。
var len = ary.length, idx = 0; while (idx < len) { for (a in propAry) { if (ary[idx] && ary[idx][attr] == propAry[a]) { ary.splice(idx, 1); len = ary.length; idx--; break; } ...
0
db6438a2cde11f6daf7a8a9ab54d1449
280997179f6853092dc2b01866290e97
门票价格ajax操作
class viewpointAction extends CommonAction public function ajax_tickets_save() { header('Content-Type:text/html;charset=utf-8'); $id = $_GET['id']; $ViewpointTicket = M("ViewpointTicket"); $ViewpointTicket->create(); $ViewpointTicket->id = $id; $ViewpointTicket->names = $...
1
a4dfbcbcd3e5a19be1dcaa240d0a2cb1
4d0d6a69f860523fed351ca68f648f4b
再生開始
public class restart : MonoBehaviour public void Restart() { SpawnPlayer[] spa = FindObjectsOfType<SpawnPlayer>(); foreach (SpawnPlayer a in spa) { if (a.GetStartCell()) { Destroy(FindObjectOfType<highPlayer>().gameObject); FindObjectOfType<SpawnManager>().Ins...
0
42df122852fc2aa9ea4e73a3e1681022
a6a7e882dba97e0442056926b5471d6e
获取前5历史记录
try { let sql = `SELECT DATE_FORMAT(Time,'%Y%m%d%H%i%s') time ,price FROM lottery ORDER BY Time DESC LIMIT 5 `; let list = await db.history.query(sql, { type: Sequelize.QueryTypes.SELECT }); return list; } catch (e) { throw new APIError(e.message, ErrorCod...
1
340b2508368a73330124338cc512d5a7
f25637eb99aa8acffc466bdceed6b967
读取震动开关状态
public class SettingImpl implements Setting @Override public Boolean getShockValue() { return (Boolean) settingPreferences.getData(Setting.SHOCK, true); }
1
7a1559868dfc05a8c3e6fc29616a54de
a23f3f6ef502c1535901914979b146be
Returns true if there is empty space, or false.
function nospace(board){ for(var i=0; i<4; i++){ for(var j=0; j<4; j++){ if(board[i][j] == 0){ return false; } } } return true; }
0
8140db04a43a8ffa0c6df5c8d72fca3c
204503d8fa533964a3e5bf8886b73904
Returns `true` if a car with the given [macAddress] is associated with this phone.
public function hasMacAddress() : bool;
0
feddb4d74efb1151b807aaf188ac7ce8
45bcd151773ef42b8a1144867dd40194
Wrapper for PlayerState as it would appear to an opponent.
class BaseOpponent(RandomObject): def get_state(self): return None
0
1713bf5452f406fef3f3a29bd01ada6e
93937959aa8421cd9da2714bfcec1fcf
Convert stage coordinates into SEM coordinates
void semPoints(double t, double **semP) { evaluateCoef(semP[0], t, SEML.us_sem.n, SEML.nf, SEML.cs_sem.Pe, 3); evaluateCoef(semP[1], t, SEML.us_sem.n, SEML.nf, SEML.cs_sem.Pm, 3); evaluateCoef(semP[2], t, SEML.us_sem.n, SEML.nf, SEML.cs_sem.Ps, 3); for(int i = 0; i < 3; i++) semP[5][i] = SEML.cs_sem.cr3...
1
b82037da67134db663a6241beb395b66
ffa46c7f60de5c2c60ce21fffef267f1
Updates the fields when the user selects another question.
namespace QuizPrinter public partial class MainWindow : Form private void txtAnswer2_TextChanged(object sender, EventArgs e) { UpdateQuestionPreview(); }
0
d616aa22d05794643d778fbd9399a9c1
31f7ea61272865eebb6dceded3db306d
Computes reflection / transmission coefficients on a boundary connecting two isotropic media.
class RefractiveInterface(Interface): def __init__(self, *args, **kwargs): Interface.__init__(self, *args, **kwargs) self.forwardCoating = batoid.SimpleCoating(reflectivity=0.02, transmissivity=0.98) self.reverseCoating = batoid.SimpleCoating(reflectivity=0.02, transmissivity=0.98)
0
47d07a0418a3345b8289d3ae3eb2f235
cdcf5e74bb653b6054c169b2867812a2
kinematics equation for the x-displacement from origin for a projectile that has traveled it's full flight path
fn projectile_x_displacement(u: f32, theta: ForwardTensor) -> ForwardTensor { if theta.data.to_degrees() > 90.0 { return projectile_x_displacement(u, theta - 90.0f32.to_radians()); } u * projectile_time_of_flight(u, theta) * theta.cos() }
1
26c6837f9e3fb353cef32a0779345d20
a69052e15b4c349152de5549fad183e4
Страница по умолчанию приватной части.
namespace WebApp.Controllers public class HomeController : Controller [HttpGet] public IActionResult PrivatePolicy() { return View(); }
1
d649dd130213163ea950d56e96e88cad
f15c367398025f1eb8d866a5f30d7994
recenter the camera on a specific location
namespace NCodeRiddian public class MultiCamera public void Center(Vector2 p) { Center(LocationManager.getPointFromVector(p)); }
1
d629fc717fa2afa50509af1ed70dc270
d0d96a5700196c0dcfa7d26a06d13e98
Display the two images side by side.
def display_two_images(image1,image2,ax=1): image = np.concatenate((image1, image2), axis=ax) display_image(image)
1
23286a1e13882fca9df95043208fc006
9f4db37b80e1e4b314bc4d6c842ae7cf
Establece la Descripci&oacute;n para el {@link IntegradorCuentas} para describirlo.
public class DependenciaTO implements Serializable, TransferObject public void setDescripcion(String valor) { this.descripcion = valor; }
0
e8b765f1b77fbc81133e2068e5016e0a
7700cda7f2b88ddfbccdafc93a7902d2
.encx和.pack固件解析
{ s8 magic[4]; if (pkg->pio->open(pkg, IO_READONLY)) return -CUI_EOPEN; if (pkg->pio->read(pkg, magic, sizeof(magic))) { pkg->pio->close(pkg); return -CUI_EREAD; } if (!strncmp(magic, "pac2", 4)) is_encrypt = 1; else if (!strncmp(magic, "pack", 4) || !strncmp(magic, "PACK", 4)) is_encrypt = 0; else { ...
1
df0c630a172e2304cc1f522450dd9ebb
2266e206f2ede75a7dcc6e02bb9c109e
Повернуть виджет
class ObjectWidget(QWidget): def flip(self): self._orientation = {'h': 'v', 'v': 'h'}[self._orientation] self.update() self.emit(SIGNAL("flipped()"))
1
5a6a6b4a9256d24f17e19cd8743ab213
445380ee25a74269ac18fbfd4768cc74
只要在当前节点上,发现p与q分别在左右子树,或者其中一个是当前节点,就发现了公共父节点 如果不是最近的公共父节点,则p和q会分布在这个节点的同一子树(可画图验证)
public class Medium_236_二叉树的最近公共祖先 public TreeNode LowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { if (root == null) { return root; } if (root == p || root == q) { return root; } TreeNode left = LowestCommonAncestor(root.left, p, q); ...
1
170147600cde798c1d8939cd10397d43
6a11a947a5825e80bf12bb2c6ee2b674
Get the season id property
public class CreateSeason public SeasonId getSeasonId() { return seasonId; }
1
11d21fa2e129172e00cd23c0f96f9846
a1fda0557f8ee896fec4e8f50131d03f
The set of all template types parameterizing this generic class
class FunctionDeclaration: def template_parameters(self): return self.template_parameters_
1
cb86ddc7900462bfda55bd1fec676697
795f2cf3b6b01a07134e795404d504f0
update the note of the given domain
var deferred = $q.defer(); dbService.connect().then(function() { var now = moment(); dbService.db_.update(dbService.noteTable_) .set(dbService.noteTable_.text, text) .set(dbService.noteTable_.dateUpdated, now.utc().toDate()) .wh...
1
c8fea79a085b349e5feef21b1efc7783
ddca92af99010fc4661e72c8922c80ed
根据贴子id获得楼层总数
try: floorNum = floor.select(r'div.core_reply_tail.clearfix div.post-tail-wrap>span')[2].get_text() return floorNum except BaseException as e: print(e) return -1
0
d54f1e4c7042d8f637d1e7c3f199f113
92a5b67d9f022ebc84e5292733d39c9b
Splits an existing time record according to the given date ranges These ranges should all intersect with the existing time record
def slice_date_range(dr, ds): drs = (dr, ) for d in ds: new_drs = tuple() for dr in drs: new_drs += split_date_range(dr, d) drs = new_drs return drs
1
d2325d5a157000a6fdccb702a50812bd
70b357e744aaa1eca9771062c04f5dec
如果没有填写或选择地址就不能支付
const {address,totalNum} = this.data if(!address.userName){ await showToast("您还没有填写地址") return } if(totalNum == 0){ await showToast("您还没有选择商品") return } wx.navigateTo({ url: '/pages/pay/index' }); }
1
0ab54c04a971b6d7ad2c73f1031e0cec
4c6d27b9c3c3a6d4019701c951c493d1
FindNextVolumeMountPoint Continues a volume mount point search started by a call to FindFirstVolumeMountPoint.
public static extern int FindNextVolumeMountPoint (IntPtr hFindVolumeMountPoint, IntPtr lpszVolumeMountPoint_buffer, int cchBufferLength);
1
b154ff70d312b13d0a6b68e1a87a4bdc
6c5ba088c71ee5376e14f8ffc6aefee5
Helper function that writes the command select option to user with file descriptor <user_fd>.
void client_send_option(int socketfd, char opt) { socket_push_char(socketfd, opt); return; }
0
8c8cfab6edc323528c34e2aa572925ab
8f30cd703a72b7c37aff25f605f726cd
以i结尾的最大子数组和
public void maxSubArray() { int[] ints = {-2,1,-3,4,-1,2,1,-5,4}; System.out.println(maxSubArray2(ints)); }
0
2dcdcb708ce4273ab7a6bd1f570aa166
20dfb2d56cb606a03e733a882ce52954
Configuracion para el uso de JSON en el Swagger
namespace Investigacion.WebApi.Extensiones public static class ServicesCollectionExtension public static void AddSwaggerJsonConfiguration(this IServiceCollection services, IConfiguration configuration) { services.AddMvcCore().AddJsonOptions(options => { options.JsonSerializerOptions.Igno...
1
1c5f12590eb5f9227f3e3e92f4c431c8
c9aefb073e2544a58b19e15c91bea07b
Get all cities with associated States.
{ $conn = Connection::getInstance(); $sql = "select c.id as city_id, c.name as city_name, s.id as state_id, s.name as state_name, s.initials from city c inner join state s on (s.id = c.state_id)"; $rs = $conn->prepare($sql); $rs->execute(); ...
1
7f07af7b149d484e60ef8b1af3f392da
656308e7eda3607909c78dce292967b2
Uses recursion to calculate the nth tribonacci number
return nil if n < 1 return 0 if n == 1 return 1 if n < 3 nth_fib_rec(n - 1) + nth_fib_rec(n - 2) end
0
51f8250004dcdad5f81ec8742c529977
04e5b5dff3b1b43328ec6dcc96ba4542
Connect set button depending on what status selected with the backend and change scene back to project manager.
namespace Ecell.IDE.Plugins.Analysis public partial class BifurcationSettingDialog : EcellDockContent public void ChangeStatus(ProjectStatus status) { if (status == ProjectStatus.Loaded) executeButton.Enabled = true; else executeButton.Enabled = false;...
0
f64cacbc9b7b9270ee71fb2fa234d1b5
b901167bb6ccbcf9081d1d7f2cb92791
Compute (spatial) batch statistics.
correct, labeled = batch_pix_accuracy( pred, label) inter, union = batch_intersection_union( pred, label, self.nclass) with self.lock: self.total_correct += correct self.total_label += labeled self.total_...
1
9cac1a23f0d262bc598c20ad2ee8178f
28eeed52208fb06f808bd7c190f281ff
Construct the dictionary based on the args.
class OptimizationExperiment(Experiment): def construct_dictionary(self): return {"optimizer_str": self.optimizer_str, "optimizer_kwargs": self.optimizer_kwargs, "log_kwargs": self.log_kwargs}
1
4d233b1b90b3487484730de288283a78
dd8919254fc126a85e1c4876bebf858a
Opening to remove salt and pepper noise
def salt_pepper(): noise_img = random_noise(img_read, mode='s&p',amount=.3) img2 = np.array(255*noise_img, dtype = 'uint8') display_noise(img2)
0
33e4358579aeb72275e77dfdda58dcfb
f891277155ca208aa77cd635a36b5bc4
主窗体选择要素后刷新属性表
namespace MapGIS_WPF public partial class AdvanceSearchWindow : PUWindow private void AttrListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (AttrListView.SelectedIndex == -1) { return; } int i = SQLTextBox.SelectionStar...
0
6b9a93b105e7a40fd10d6a0b7b50a123
07a5c88c019c6df5a0f6162bd015043d
Al cambiar el personal seleccionado busca las entidades que le faltan
export class AcompananteComponent implements OnInit busquedaPersonal(): void{ if (this.buscar_personal == ""){ this.alertas.alertcampos(); }else{ this.servicioAcompanante.busquedaPersonal(this.buscar_personal).subscribe( (res) => { console.log(res) if (res.length != 0){ this....
0
ddc611783730bcbd38168daee0f61fec
a1173d794d67638eb938d48c0ac11d79
实现反转单词的方法
public class ReverseString151 class Solution public String reverseWords(String s) { StringBuilder sb = trimSpaces(s); reverse(sb, 0, sb.length() - 1); reverseEachWord(sb); return sb.toString(); }
1
8e64d6a40452e0917de1ce202a9db609
30e639ce80d7841d919d58d6dc0fb3bb
Get all admin account IDs
class DBManager public static function getAllAccount() { $accountIds = Account::find(array("columns" => "id")); return $accountIds->toArray(); }
0
15a2ce02b14dd7628df59051a0d5f10d
90f5595aa10ef037d30f6ebee9d9c1d1
Uses a previously trained lda model to estimate the topic distribution of a document
input_column = input_column.astype('str') input_column = input_column.fillna('nan') input_column = input_column.apply(basic_clean) input_column = input_column.apply(lemmatize) count_vect = CountVectorizer(max_df=max_df, min_df=min_df, stop_words=stop_words, ngram_range=ngram_range) doc_term_matr...
0
f93e7122ac2c1a4be72ddb43f65c93ab
f88469ac7ea7ae9820d30ee077205df5
Gets the value of the OutstandingIndemnity_cur field.
@gw.internal.gosu.parser.ExtendedProperty public typekey.Currency getOutstandingIndemnity_cur();
1
59bf5c2905e119e5d9c8e3212c2de63a
a93caa1e24d95b7d2e8618683ed1e95e
method that decides which items are to be shown and hidden for breadcrumbtype=HideMiddle
{ updatePanel.Visible = true; tnFilterDiv.Visible = true; if (!showTravelNews && !showVenueNews && !showUndergroundStatus) { updatePanel.Visible = false; tnFilterDiv.Visible = false; } System.Web.UI.WebContro...
0
e0e71064c8d7f623ba6e49eebd44d51c
8af2097b1acb782f393fb1fe89284827
Add data in a precomputed format to the specific folder hosted via http.
def uploadData(): UPLOAD_URL="%s/receiver/batch/%s/document/upload" % (HOST, BATCH); c = pycurl.Curl() c.setopt(pycurl.URL, UPLOAD_URL) c.setopt(pycurl.HTTPHEADER, ['Accept: application/json', 'Content-Type: application/x-www-form-urlencoded']) c.setopt(pycurl.POST, 1) c.setopt(pycurl.POSTFIELDS, post) c.setopt(...
1
c0a544010ee02cc9ed56184821b2f2f2
609acd6533a522c97dcf75f00c78ea1f
异步初始化UI插件
setTimeout(function () { $.ajax({ url: "/wui/common/page/pluginManage.jsp", type: "POST", cache: false, async: true, dataType: "html", success: (data) => { $("head").append(data); }, error: () => ...
1
41cfb65a4e8143c07eb9972bc4c5bd28
27ff9db0bd52b45d2847d4d2e9b45959
Adds some filters to a query such that only the models with permission are shown.
class MappingSearchViewSet(ElasticSearchBaseViewSet): def filter_permissions(self, search): return search
0
d710cf935f6ea8aea836b50685cfcc4d
1838a3746beab85222c7ba84ed23977d
Validates Districts, Division and Value In Previously Saved Configuration Popup.
namespace SouthernCompany.Distribution.NSEE.Web public partial class StormEvent : WebFormBase protected void customvalidatorPDAreaInsert_ServerValidate(object source, ServerValidateEventArgs args) { try { Logger.Enter(String.Format("{0}:{1}", MethodBase.GetCurrentMeth...
0
6ef7619fc6bc78387d8c9cfe607e4be5
9b0e26d06660bfe74fae28305647b24c
Returns random powerup type
public class TankGame extends Game public void randompowerup(int x, int y, int type) { things.add(new RandomPickup(x,y,0,0,powerup,events,2,everything,type)); }
0
e5f77cf19e7668e64843954b9bbb7ce4
96047978bd0a44778215f6279125ecae
Checks if the value of the sklt_sayr column is NULL
namespace RWARE_DAL.TypedListClasses public partial class UsageDetailsRow : DataRow // __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfacesRow // __LLBLGENPRO_USER_CODE_REGION_END public bool IsRateValueNull() { return IsNull(_parent.RateValueColumn); }
0
8c2946b6c75a72605dd212e699a7490f
45d4a5457c661f71deed7562d313d7c7
@brief Card detect callback set
__weak void BSP_SD_DetectCallback(uint32_t Instance, uint32_t Status) { UNUSED(Instance); UNUSED(Status); }
1
c8abcdf8ce126dc9a7f5d240268672a0
5ded52fa10032770065258268477f05b
Function Description: For coding reasons, instructions are often converted to alias. Example - instruction Keep cup on sink is converted to Keep_on_sink cup.
string getInstructionName(string line) { string instructionString = StringHelper::trim(line.substr(0, line.find(" "))); for (int i = 0; i < 3; ++i) { if ((int)instructionString[i]<=122 && (int)instructionString[i]>=97) { instructionString[i] = StringHelper::toUpperCase(instructio...
0
83fa927d38f74e86dba87db6cc009108
21c27416dedde54c834298e2e9bc7558
Sends an email to the creator of the proposal with an email with the resolution of the acceptance or not of his proposal.
class Messenger(): def send_accepted(self, proposal_id, accepted_value):
0
1058ba92ccf3893f57644cc7ed145d54
9cb37e36cee86bdc1112522e7668fc8f
Builds a filter from constraints, used to determine total resource count on a primary collection endpoint.
{ if (metadata.FilterColumns != null) { var filterBehavior = includeConcurrencyField ? col => col.IsKey || col.IsConcurrencyCheck : new Func<ColumnInfo, bool>(col => col.IsKey); var filterColumns = metadata.FilterColumns.Where(filterBehavior).ToList(); ...
1
79a49d587001ab18d64d5f336721e11f
3315dc04d291eec5739a1e2c8273b083
Finds a SpaceGroup3 entity by its primary key and set linked value objects if necessary. the primary key
$this->{$this->modelName}->id = $id; $this->set($this->lcName, $this->{$this->modelName}->find('first', array( 'conditions' => array( "{$this->modelName}.id" => $id, "{$this->modelName}.deleted" => 0 ), 'recursive' =...
1
edc2e5dfb896b9d4bbfa8f71ce167740
872c7faeca4e907616043a52dc9e899c
用來接收原始的影像資料
void imageData(const sensor_msgs::ImageConstPtr& msg, const sensor_msgs::CameraInfoConstPtr& infomsg) { cv_bridge::CvImagePtr cv_ptr; try { cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8); mydroneData.imageRow_ = cv_ptr->image; waitKey(5); } catch (cv_bridge::Exception& e) { ROS_...
1
d555dd6b9479fadbbff26936a461444f
8411471c8c7335745bc01ecbe826082c
获取光标在整个文档内的坐标(包裹被卷去的)
function getCaretPosition(txtarea) { var caretPos = new caretPosition(); if(txtarea.selectionStart || txtarea.selectionStart == 0) { caretPos.start = txtarea.selectionStart; caretPos.end = txtarea.selectionEnd; } else if(document.selection) { var range = document.selection.createRange(); var range_all = d...
0
38d5cf4b8f03e9fb886471d004b94581
e56cfe26b4f6a53bef442de9cac30f1a
Helper to check paths passed to methods of this class. Checks whether `path` is beneath `base_dir` and normalizes it. Additionally paths are converted into relative paths with respect to `base_dir`, considering PWD in case of relative paths. This is intended to be used in repository classes, which means that `base_dir`...
def _MakeRelativePath(base_path, path_to_make_relative): def _GetPathAfterPrefix(prefix_path, path_with_prefix): assert path_with_prefix.startswith(prefix_path) path_without_prefix = path_with_prefix[len(prefix_path):] normalized_path = os.path.normpath(path_without_prefix.strip(os.path.sep)) if norma...
1
601a1eea31c6fab023f3191a480f1482
ae95937dd012b4207fc6d774837c76c5
Deze methode retourneert het resultaat die je krijgt als je de eerste parameter van deze methode tot de macht van de tweede parameter berekent.
public class Calculate public static double exponent(double operandOne, int operandTwo) { double x = 1; for (int i = 0; i<operandTwo; i++) { x = (x*operandOne); } return x; }
1
22a81fa6897769106e82a007f6b0dc94
8ccbd3569cb851f22f49a7831462b29b
We want to sell jobs one at a time
class Truckenv(Env): def newJob(self): job=[0,0,-1] job[0]=random.randint(1,self.graph["N"]) while(True): job[1]=random.randint(1,self.graph["N"]) if(job[0]!=job[1]): break return(job)
0
8afc974d06dac8f204998f738e04df16
dd6bf58a3d9de8d1dcefe05f5df7c2e7
Displays formatted options for each item in `menu_dict`. A custom username is shown if `user_obj != None`.
for arg in args: if arg.lower() == "main": for option in self.main_options: print(f"| {option} | {self.main_options[option]}") elif arg.lower() == "product": for option in self.product_options: print(f"| {option} ...
0
995c6c1c0640dbb3e240516f100a4c81
4d3e62f47e7a615384565e1ce23adc18
Remove and return the instances with ids in ids_to_remove
{ List<object> removedIds = new List<object>(); foreach (object[] id in ids) { if (await this.RemoveAsync(id)) { removedIds.Add(id); } } return removedIds; }
1
9efee2b13120f20962266d90f16c4a65
ff601b77db3d6d35d016ee16be33916a
检查 Payment 字段是否有不能识别的支付方式代码。
class RfiBank public function checkPaymentSign() { $fields = 'tid,name,comment,partner_id,service_id,order_id,' . 'order_id,type,partner_income,system_income,test'; return $this->checkByFields($fields); }
0
420741f1ef1b5bb72bcfbe1d4f67ef17
7376f6d0b74075d77a9452c266ccd28a
A collection of paths that map requests to backends.
RequestPaths requestPaths();
1
430c3736acfc757632e0460b05a44a38
780a33f2a10c8f61d2e23f5ffb492b6a
Apply a relation to corresponding elements in two sequences and succeed if at least one pair succeeds.
namespace LangExt partial class Seq public static bool Forall<T1, T2>(this ISeq<Tuple<T1, T2>> self, Func<T1, T2, bool> f) { return self.Forall(tpl => f(tpl._1(), tpl._2())); }
0
09e271c3e0b3d473a89aa3c57cccd7b6
5a2792bf340b96efa5199e2ff22bb613
教育机构排行页面
class School extends App public function index() { $list_school=db('school')->where('back_1',1)->where('status',1)->order('up_time desc')->limit(4)->select(); $this->assign('list_school',$list_school); if(input("school")) { $list_all=db('school')->alias('a') ->join('ysj_user b ','b.sid= a.id','L...
1
e0ef61b814a35a104a65e23b62639b42
67b8714a97a5f6b3f1e204b5ea327c62
returns (left, top, right, bottom) of client area in screen coordinates
export class TextView extends mEventTarget.EventTarget getClientArea() { if (!this._clientDiv) { return { x: 0, y: 0, width: 0, height: 0 }; } var _scroll = this._getScroll(); return { x: _scroll.x, y: _scroll.y, width: this._getClientWidth(), height: this._getClientHeight() }; ...
0
907deedc06799b523537108fe6a36032
6aa8f46d258598e1858837240c8f94a0
Determines whether or not a given file is a SvelteKit-specific hooks file
const headerExtensions = [".h", ".hpp", ".h++", ".hh"]; return headerExtensions.some(headerExtension => file.fsPath.endsWith(headerExtension)); }
0
82c26e7fe75d213ba911eb2a536ae938
28209e67a427d3649ee91d832def2772
Save the data of an analysed project to file. To avoid conflicts of multiple processes adding and saving data at the same time, we save all data atomically and using a lock, which prevents multiple executions at once.
class ProjectData: def _save(self, data): projects_data = self.all() projects_data[self.path] = data self._save_all(projects_data)
0
498f743299ef079e13e9c9c9ba851b0c
679278b202e8fe3d348db9e343235f0c
获取麻醉单血气记录
{ try { SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.VarChar, 50), new SqlParameter("@NOOFINPATENT", SqlDbType.VarChar, 50), new SqlParameter("@FATHER_RECORDID", SqlDbType.VarChar,...
0
43b8dd4d2c184277e1ef7dbe1e64eb07
944b09e5857b86c50c279feafee06140
Methode qui contient l'evolution du jeu en fonction de la commande commande utilisateur
class mouvement: def SeDeplacer(self,commande): if(commande[0].upper()=='E'): self.Coordonnees(int(commande[1]),0) if(commande[0].upper()=='O'): self.Coordonnees(int(commande[1])*(-1),0) if(commande[0].upper()=='S'): self.Coordonnees(0,int(commande[1])...
1
72725d7ac3af36b56b708aa543f70cbd
f574396857cc9130347fd32f7605dbae
Teste do construtor (sem parâmetro)
public class TestEstoque @Test public void testConstrutor() { DateFormat sourceFormat = new SimpleDateFormat("dd/MM/yyyy"); try { Carne c = new Carne(1, "Picanha", 22f, sourceFormat.parse("10/10/2017"), sourceFormat.parse("10/10/2020"), 15.32f, "Bovina", "Friboi", 1); Estoque...
0
7735155dd01a2cbc67065b3266e2f855
827923e14b3b2d27a03cebdb4288a690
获取主从显示
MonitorItem.__init__(self,user,password,host,port) try: if self.cursor != None: stmt="show slave status;" self.cursor.execute(stmt) self.replication_info=self.cursor.fetchone() except Exception as err: pass
1
b8db8e6679279ac62718e360bb66eb7f
ff1d960967ae8143b53abd01dc938e26
Ignore lines that begin with #
def line_reader(f): for offset, line in enumerate(f): line = line.strip() if len(line) < 1 or line[0] == '#': continue yield offset+1, line
1
c11fdeec68d60a66abbd82e81c9954bc
9b15b67db7a06891c5237f5df6ed79a3
r"""Maximum number of concurrent user sessions allowed on this virtual server. The actual number of users allowed to log on to this virtual server depends on the total number of user licenses.
class appqoeaction(base_resource) : def maxconn(self, maxconn) : try : self._maxconn = maxconn except Exception as e: raise e
1
80490fe38e8817bd4b502471be974eca
3afa8cd1ffcdd540558c1442b4d806fd
社会治安重点地区排查整治季报上报
class RiChangBanGong(unittest.TestCase): def testConflictRpt_017(self): if simulationEnvironment is True: pass else: addPara=copy.deepcopy(socialSecurityReportAddPara1) addPara['dailyYear.id']=getDbQueryResult(dbCommand ="select id from dailyYears d where d.yeardate='...
1
b025f63d0b4315dbd0c198d5ed502a3d
cad0a2caa3155fa9dfd8054ecc252764
Copy texture data from Y tile layout to linear, faster. Same as \ref ytile_to_linear but faster, because it passes constant parameters for common cases, allowing the compiler to inline code optimized for those cases. \copydoc tile_copy_fn
let dst = dstData.data; let dstRowStride = dstData.width * 4; let dstRowOffset = 0; let srcRowStride = tile.line << 3; let srcRowOffset = tile.tmem << 3; let rowSwizzle = 0; for (let y = 0; y < tile.height; ++y) { let srcOffset = srcRowOffset; let dstOffset = dstRowOffset; for (let x = 0; x <...
1
648828b8bc39a06e1d77ad1f5f066a4c
c99b97583fece23ec5cad5c0bbdc07d5
Removes all previously included tags
Deque<TagDecorator> tagsToVisit = new LinkedList<>(); tagsToVisit.add(currentPageTag); while (!tagsToVisit.isEmpty()) { TagDecorator currentTag = tagsToVisit.pop(); TagDecorator currentParentTag = currentTag.getParent(); if (currentParentTag != null) { excludeTags(excludes, currentTag, currentParentT...
0
1e1022330da317fa3b8aa8cdd55f7878
27bd00a2000ce2d61fc96fa6c562fc6f
비밀번호 숫자,영문,특수문자 조합 8자리 유효성 검사
function isPassword(asValue) { var regExp = /^(?=.*\d)(?=.*[a-zA-Z])[0-9a-zA-Z]{8,10}$/; return regExp.test(asValue); }
0
c6a686b05e41e22d829014a5405f4d9b
2cfe27fbeae9a6f7ab67418f9d17b8ee
Verify that we catch duplicate resource alias found in either template or static VM machines.
def assert_specific_vm vm = ems.vms.find_by(:name => 'rake-instance') check_count(vm, :ipaddresses, 2) expect(vm.availability_zone.name).to eq('ca-tor-1') expect(vm.cpu_total_cores).to eq(2) expect(vm.hardware.memory_mb).to eq(8_192) expect(vm.hardware.cpu_total_cores).to eq(2) expect(vm.har...
0
0a1ddc79643c8997ba77c4c183ba32aa
aca7a04d2a584b976b78d9dd5b732089
If we are getting a real count, we need to query the DB again as some DB's dont return the correct selected amount of rows in a SELECT query result
class MultilingualQuery(Query): def get_count(self, using=None): if ((not (self.select or self.where )) and self.include_translation_data): obj = self.clone(extra_select = {}, extra_join = {}, include_translation_data = False) ...
0
377aa552dc5b5c4bee94ed4b57456704
ad9e18d62cd2f5ead2f18d9294e0b6f0
Getter for majorActor
int getMajor();
0
1cc0c99fcf292442212338cb584a9072
74fa768698530058a4d88bc6eabb8ef1
指定時間待った後、子狼を動かす
public class ChibiZunko : MonoBehaviour void Walk() { if (stateInfo.nameHash == ANI_WAIT) { if (Random.Range(0, walkTiming) < 1) { Vector3 targePosition = gameObject.transform.position; targePosition.x = target.x + Random.Range(-walkRange, walk...
0
cbb08cb2a43cf7ec776296cc5811a1d5
c4c5f432f0ee3c9f643b70fca773ad92
This dialog is used to enter all necessary data needed to create a database.
class ConvertDatabase(QtGui.QDialog, FORM_CLASS): def __init__(self, parent = None): super(ConvertDatabase, self).__init__(parent) self.setupUi(self) self.utils = Utils() self.geomClasses = None self.complexClasses = None self.invalidatedDataDict = dict() self.com...
0
81bc2f3ec079a9975bb753a381624fd0
32a3a1fee143c54f824bf2d7a92923ab
Create the infix. Makes calling the function cleaner and does not require caller to know the inner workings of the tree.
self.token = self.op = op self.left = left self.right = right
0
6a6995a77be421ecadb32f231e48fde3
e46bce19063bc638e91710af8c58f6e5
创建Redis缓存操作助手RedisTemplate对象
@Slf4j @Configuration @EnableCaching(proxyTargetClass = true) @Import({MapValueAspect.class, MapValueService.class}) @EnableConfigurationProperties(RedisProperties.class) public class RedisCacheAutoConfiguration extends CachingConfigurerSupport @Bean("redisTemplate") public RedisTemplate<Object, Object> redisTemplate(...
1
34b2bb87d78cbf44f7deb5d427cfb78c
7bf4de1c359ae9965870661de40a3419
iOS 6+ only! Programmatically decline an invitation to a turn-based match.
public class ShellClient public void declineDrawOffer(List<String> args) { callSimpleMethod( Thread.currentThread().getStackTrace()[1].getMethodName(), args); }
0
02bb21b731fe5c746a85cedfe0538f39
b1fddd04682c92b711b9161a5be5e9d8
returns a list of suit names
public class PlayingCard implements Comparable<PlayingCard> public static List<String> getValidSuit(){ return Arrays.asList("klør","ruder","hjerter","spar"); }
1
aa467f47e3c48db36d8b482d2ffb0bdb
46d009687b15978f870deb7dc93417cf
https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#non-printable-code-point
fn is_noncharacter(c: char) -> bool { matches!( c, '\u{FDD0}' ..='\u{FDEF}' | '\u{FFFE}' | '\u{FFFF}' | '\u{1FFFE}' | '\u{1FFFF}' | '\u{2FFFE}' | '\u{2FFFF}' | '\u{3FFFE}' ...
1
d2bfe7d7ef6a78b96a30056f971ac572
b6655812a5fe8dd01996b03e51569810
Simply foward the call to the handler with the Server ID.
if not isinstance(args, dict): raise InvalidRPCClientArguments(argtype=type(args)) assert(not handler == None) log.debug('RPCClient [%s] sync_call: %s' % (self._name, apiname)) self.rid += 1 args['apiname'] = apiname args['rid'] = self.rid self._event...
0