query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
d640fd0443ace24ddbe85bbbd4afec02 | 9370f6fac4283487f1ebee3ced51a176 | 会员注册绑定新增趋势 | $id = I('shop_id');
$trendi_id = I('trendi_id');
echo $this->error(null, '敬请期待做新版本');die;
} | 0 |
90f90806e3a43e4312154c7b16e90aac | 2e530a5d8492dcbf596ab834333c1eb6 | Generates a random 20-character string used for the ID's of transfer requests. | var ID_LENGTH = 20;
var random = "";
var randomInts;
if (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") {
randomInts = new Uint32Array(ID_LENGTH);
window.crypto.getRandomValues(randomInts);
}
else {
randomInts = new Array(ID_LENGTH);
... | 1 |
609dae8f40d560547ee1b7a675db7c8f | 7e5c184aed93c14254661f4dbd54d5bf | 更新截图进数据库 | public void appUpdateScreenShots(HttpServletRequest request, HttpServletResponse response) {
int flag = 0;
Gson gson = new Gson();
String shotsId = request.getParameter("shotsId");
String shotsName = request.getParameter("shotsName");
String shotsURL = request.getParameter("s... | 1 |
c3e4fd86b7b82154f1eed4d6b9cbe49f | 0e892c2c39cf1cbaa87f03547012ce99 | Boolean check if an object is an instance of a pyrsistent object. | if isinstance(value, trajectory.Trajectory):
return True
fields = getattr(value, '_fields', None)
if fields and trajectory.Trajectory._fields == fields:
return True
return False | 0 |
6deaf2d38a1b566b942aee76b4aba2a2 | 2a2e118155b4e861dbf469245c789b7f | Function to interpret and print out the DPA structure | int pd(void)
{
struct cmmu *cmmu_ptr;
char choice, ch;
int i, Index;
if (cmdcount == 2)
{
if ((strcmp ("I", cmdptrs[1]) == 0) || (strcmp ("i", cmdptrs[1]) == 0))
{
cmmu_ptr = &Icmmu;
choice = 'I';
}
else
{
cmmu_ptr = &Dcmmu;
choice = 'D';
}
}
else if (cmdcount == 1)
{
cmmu_ptr = &D... | 0 |
c432b574fdbc4d585201df2bf8101c0c | ad63c4222dee61496a50f04f8489dc42 | Returns raw data as received from serial. Mainly for debugging purpose. | class serialClass:
def getSerialData(self):
self.val = self.ser.readline().decode('utf-8', 'ignore')
return self.val.rstrip() | 0 |
bf78bd2b232a8ddb0a41dff8e4aba1ca | 68c9f76b8c4e48672b8182a0f92a4c30 | Handles changes to the NeeedsScrollIntoView property. | namespace AICI_DeskTop
public partial class Window1 : Window
private static void OnNeeedsScrollIntoViewChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if ((bool)e.NewValue == true)
{
ListBoxItem iItem = d as ListBoxItem;
if (iItem != null)
... | 1 |
de1bd2337d3ecb291da9ecedb23db503 | 31a24098deea8e35a44035d15f43c982 | List of registered model ordered by priority | def get_model_list():
return sorted(_models.keys()) | 0 |
ec84ed897acee91eaf8c7e419bdc9f42 | c45be8f91cfd2cb5083b28c7ac28d00a | Set modeReglement | class DecTva
public function setTypeReglement(?int $typeReglement): DecTva {
$this->typeReglement = $typeReglement;
return $this;
} | 0 |
cd7bb0cd37803326c3cd263c76411d8b | 03e909f9e24910920b19916f457f273e | Extend a bucket with a new entry on the free list and attach a worker thread
to it.
This function may quietly fail. It is only used by taskq_dispatch() which
handles such failures properly. | {
unsigned long flags;
struct list_head *l;
QE_t *q;
int ret = 0;
spin_lock_irqsave(&queue->queue_lock, flags);
if (list_empty(&queue->free))
goto empty;
l = queue->free.next;
list_del(l);
q = list_entry(l, QE_t, list);
BUG_ON(BAD_MAGIC(q, QUEUE_MAGIC_FREE));
SET_MAGIC(q, QUEUE_MAGIC_USED);
q->SCpnt = SCp... | 0 |
080aefbd278dee989320bfce15b016a0 | 9740137d20b1d575f149d737f687fd9a | Set envelope parameters | void Button::setAmpEnv(float a1, float d1, float s1, float r1){
attack=a1;
decay=d1;
sustain=s1;
release=r1;
if(env.getState()!=0){
env.setAttackRate(attack * sampleRate);
env.setDecayRate(decay * sampleRate);
env.setReleaseRate(release * sampleRate);
env.setSust... | 1 |
c124c49e06e659df71179554bce8f74d | 2a4a9671359e202d466ed5b559adf08a | 获取某元素element下面,元素为elementName,且这个元素含有属性attributeName的所有元素 | String containValue) {
Elements elements = null;
if (element != null && containValue != null && !"".equals(containValue)) {
elements = element.getElementsByAttributeValueContaining(attributeKey, containValue);
}
return elements;
} | 0 |
4932bfd7bd6742b3fc77504f4b1a27eb | d0aac48cf5386ec12f3cda1b5a67b082 | 保存车型对应图片 | namespace CCN.Modules.Customer.DataAccess
public class CustomerDA : CustomerDataAccessBase
public int SaveCompanyPicture(CompanyPictureListModel model)
{
const string sqlSCarPic = "select innerid, settid, typeid, path, sort, createdtime from settled_picture where settid=@settid order by sort;";
... | 1 |
30abaed9c0f6e2ffcb7f72a8287a437b | 4660ffad4d580f0be639a145048435e9 | The Amazon Resource Name (ARN) for the hours of operation. | arn: Optional[pulumi.Input[str]] = None):
if arn is not None:
pulumi.set(__self__, "arn", arn) | 1 |
636e6fa853b4b6f31a871713cbad91d5 | d7b5565b034aa99d8ccd98e2a7163a52 | To run before #tee_test_i2c() to open MINK interface for I2C | {
i2c_device = open(I2C_DEVICE_PATH, O_RDWR);
if (i2c_device == -1)
return;
} | 1 |
97d487b24ccd9833bea40d439272f2ba | d94aa0b1f4c33a2484ba71b8be303e07 | #' Color scale constructor for Nivi colors
#'
#' @param palette Character name of palette in nivi_palettes
#' @param discrete Boolean indicating whether color aesthetic is discrete or not
#' @param reverse Boolean indicating whether the palette should be reversed
#' @param ... Additional arguments passed to discrete_sc... | pal <- my_pal(palette = palette, reverse = reverse)
if (discrete){
discrete_scale("colour", paste0("my_", palette), palette = pal, ...)
}else{
scale_color_gradientn(colours = pal(256), ...)
}
} | 1 |
5a8f3e5566135ee5cd24eb1e36b91105 | b96e44b03ede7ca3e4e40705258da196 | ListOverrides | class App(pyacc.AccCommandLineApp):
def overrides(self):
cmd = {
"copy": self.copy_overrides,
"list": self.list_overrides,
"add": self.add_overrides,
}[self.args.command_override]
cmd() | 1 |
470a8c5d69258bb5458dc06a4fd481d4 | 5da6c71e80e724e2ba1c23bd406bd5c8 | Code for data toggle between general and user. | export class Centralizer extends Component{
toggleUserDetails(){
this.setState({ interface: this.state.interface !== USER_DETAILS ? USER_DETAILS : MAIN_MENU });
} | 1 |
3beb640144c1e87dcc4a29f7fa784c8e | b01e9613f75db5d5fc47888f127b0c69 | Fügt Koordinatenpaare in die Datenbank ein | var db = Ti.Database.install('dog.sqlite', 'db');
db.execute('insert into activity_coordinates (activity_id, lat, lon, log_time, dt, distance,mode) values (?,?,?,?,?,?,?)',activityId, lat, lon, t, Dt, d,activityMode);
db.close();
} | 1 |
c54d42a54e8829db912f337358792918 | 4d8ec4dad9a88952b9ca26c6074636ca | Generate an Adjective Animal Combination | String[] adjs = {"User"};
String[] nouns = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"};
return (
adjs[(int) Math.floor(Math.random() * adjs.length)] +
" " +
nouns[(int) Math.floor(Math.random() * nouns.length)]
);
... | 0 |
80f01efd1d897781483c68c8f816dffa | d25879cad5d0408e183dae71dfa6b0a0 | Load a substory from JSON | function loadSub(req, res) {
submissionService.loadSub(req.params._id)
.then(function (retSub) {
if (retSub) {
res.send(retSub);
} else {
res.sendStatus(404);
}
})
.catch(function (err) {
res.status(400).send(err);
... | 0 |
c04d74ffbaefb44a3b2633fec23382c8 | 542ae432bbb5bf35c734fd68f4bdf471 | Removes the ith "gridCol" element | function removeGridArray(x, size) {
for (var i=0; i<size; i++) {
var idx = getGridIndex(x + i);
gridArray.splice(idx, 1);
}
} | 0 |
4b5d04723132b5ec977d382887d6929b | bbb2aff48d3d5f7838f4ee2ccc0dfacc | Fetch the images and start the slideshow. | public class SlideshowController extends PhotosController
public void start() {
slide = 0;
showPhoto();
stage = new Stage();
stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
processEvent(event);
}
});
} | 0 |
2242dfc1a970eba52ed6ae1ee13b2646 | 83ece6460c75da42308e1dd0972a41f3 | Discover what package types are relevant based on what the package
exposes in the extra configuration. | class Command(object):
def _determine_extra_packages(self):
installed_set = self._get_installed_packages()
req_files = self._get_requirements_from_files()
req_files, removal_set = self._compare_installed_and_required(installed_set, req_files)
return removal_set | 0 |
ce7d864101fcc0ee3ce4bf1aeca88243 | ac1496c84d4930dbb3f23fdaa3cf7bb1 | Find the config file in the top directory of this repo. | def locate_config(filename='zoom.conf', start='.'):
for path in parents(start):
pathname = os.path.join(path, filename)
if os.path.exists(pathname):
return pathname
for path in parents(os.path.join(os.path.expanduser('~'))):
pathname = os.path.join(path, filename)
if ... | 0 |
0e62debbb9e5bcf74c165414b8a2bb01 | be64104aec2fc5d76ffeac5fde0a38c7 | Compute the shortest path (geodesic) between two points. | class Digraph(object):
def min_path(self, start, end, maxD=1e309):
tdist, preceding_node = self.dijkstra(start, maxD)
dist = tdist[end]
backpath = [end]
try:
while end != start:
end = preceding_node[end]
backpath.append(end)
path = ... | 1 |
ada9035168d18760ae2a06b8c78bac2b | a636525473170bf80e0c88ae24c395d5 | Gets the human-readable name of the assembly referenced by this <see cref="IAssemblyName"/> object. | namespace Farfetch.Common
string GetAssemblyName(); | 0 |
a463c9ecb505623bae3d8e04c642917d | 280ce44d721df9dac3a73aa248a7c593 | requirement of function above, actually generates coordinates and sets them to
arrays to be used to define orientation in button creations in Gui Panel.
the function above creates the fake menus needed to generate these coordinates. | top = new Vector3(buttonOffset, 0, -buttonOffset);
bottom = new Vector3(-buttonOffset, 0, buttonOffset);
left = new Vector3(buttonOffset, 0, buttonOffset);
right = new Vector3(-buttonOffset, 0, -buttonOffset);
topLeft = new Vector3(3f*buttonOffset, 0, -buttonOffset);
topRight = new Vector3(buttonOffset, 0, ... | 1 |
cd58b71c103ff0b6d8ac05f768acb440 | 64617986dfcfa3773827bab39510cc01 | 在GXCWinR40GraphInter::Start()调用,启动工作线程,刷新数据 | void CGraph::Start()
{
SetTimer(1, m_refreshRate, NULL);
} | 0 |
377789869c64c7a2347ce15a8ead9df0 | 2c3ae04d1c4d9ef28c7ba89ea61cf067 | Set the threshold constants for the Fmask test.
Note: Most of the thresholds are still defined in the python function
and not here due to licencing constraints. | self.BELOW_LOW_THRESHOLD = -1
self.BETWEEN_THRESHOLDS = -2
self.iou_positive_thresh = iou_positive_thresh
self.iou_negative_high = iou_negative_high
self.iou_negative_low = iou_negative_low
self.low_quality_match = low_quality_match | 1 |
d772e8fa5d26306e9a6a92e4fdb72e47 | a7a11912da27e76a2fc88bcf15f128cd | checks if something is a term
Factor { MultiOperator Factor } | int Parser::term(ItemCur &cursor) {
if(factor(cursor)) {
return -1;
}
while(1) {
if(timesOper(cursor)) {
break;
}
if(factor(cursor)) {
throwErrors(cursor, "incomplete expression");
return -1;
}
}
return 0;
} | 1 |
68ba59b1d725ecfb9e442b23e3499ff5 | 4d11e19bce912675c0ede8562c044b1d | Convertir fecha y hora local en UTC en string para guardar en BD | function fechahora($value) {
if (!empty($value))
return substr($value, 8, 2) . "/" . substr($value, 5, 2) . "/" . substr($value, 0, 4) . " " . substr($value, 11, 8);
} | 0 |
9f97fab1208a140a49bc9c7a2945bead | f93d216d1ce0812dec497943be7adb47 | Generates the player's scores as bar graphs on the scoreboard | love.graphics.setFont(bigFont)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.print(tostring(playerScores[PLAYER1]), VIRTUAL_WIDTH / 2 - 50,
VIRTUAL_HEIGHT / 3)
love.graphics.print(tostring(playerScores[PLAYER2]), VIRTUAL_WIDTH / 2 + 28,
VIRTUAL_HEIGHT / 3)
end | 0 |
f4bc0bd0928a27c966a8335fae8d1cf7 | 9a8838c86ea46862868f68b749058761 | 获取 Tumblr Flurry Key. | public class FBConnect
public static native String getKey () ; | 0 |
1be8bdf14a62bec82d2481d172665386 | a2f9b782edd26d0d3827786dd4b48dc2 | do not mutate static items | if (!config.use_static) {
addPropertyTo(obj, "merge", merge);
addPropertyTo(obj, "replace", objectReplace);
addPropertyTo(obj, "without", without);
addPropertyTo(obj, "asMutable", asMutableObject);
addPropertyTo(obj, "set", objectSet);
addPropertyTo(obj, "setIn", objectSetIn);
... | 1 |
739ed1e7d8ef15b12265f2f2a3353f7c | 7b102c2de7e299978f62b866572ad4f2 | 指定したArchiveReaderからゲーム情報を読み取ります。 | {
reader.Read();
int count = int.Parse(reader.GetAttribute("Count"));
for (int i = 0; i < count; i++)
{
reader.Read();
GameInformation gi = new GameInformation();
gi.GameID = new Guid(reader.GetAttribute("GameID"));
... | 1 |
38402db9ac0c83b0d527e57805c45a13 | dd4180cf30e18742aa5978a02052b70a | \brief Board specific configurations for MCU Ethernet PHY
This function takes care of configuring the internal delays for MCU gigabit
Ethernet PHY | static void ETH_MACDMA_Config(uint8_t _ucPhyAdress)
{
ETH_InitTypeDef ETH_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_ETH_MAC | RCC_AHB1Periph_ETH_MAC_Tx |
RCC_AHB1Periph_ETH_MAC_Rx, ENABLE);
ETH_DeInit();
ETH_SoftwareReset();
while (ETH_GetSoftwareResetStatus() == SET);
ETH_StructInit(&... | 0 |
99134d4cb410e186b4774b0dc1f3f71f | 4f15a0bef088e9ce23f1f22df9e8201a | Waits for the next message sent in this channel from a specific user. | {
string result;
try
{
result = AuthorizeAsync(channelName, socketId).Result;
}
catch(AggregateException aggregateException)
{
throw aggregateException.InnerException;
}
return result;... | 0 |
d8638259e0681afc0f98e91e2b82074f | 24e5a7088c63c8ba1f4bff2984a72599 | Prop check event handler. | void PPComDlgSynchProperties::OnPropToggle()
{
m_xPropTreeCtrl.CheckToggle( );
return;
} | 1 |
2039be10bcff762df3ed98eae7fb1282 | fb4db23949ab2692ca0e08e9046441b5 | Returns a value stored in the Settings for this {@link TimeRecorder} application | {
using (SQLiteCommand appSettingRetrieval = SQL.CreateCommand())
{
appSettingRetrieval.CommandText = "SELECT value FROM " + DB.Table_Settings + " WHERE name = @name";
appSettingRetrieval.Parameters.AddWithValue("@name", name);
SQLiteDataRe... | 1 |
3d2b6d3ce16562c87e59c1471270674a | 875d33305947f5260191a41a8c4642ab | Handle Custom Resouce update event.
Do nothing here. | class AccountEventHandler extends AbstractEventHandler implements EventInterface
public function onUpdate(Model $resource)
{
} | 1 |
ebb2fefc99ddc9b770bff92fe01fc7ce | 8886929b821e40413ed709ba3d5c0a75 | Returns true, if the argument is the name of the namespace
processed by OPT. | abstract class AbstractModule implements Runnable
public function isNamespace() {
return $this->isNamespace;
} | 0 |
3143a7bf8f9162c3c47845be08b774f6 | 55cc266409a32e895eb0bd7d522aa221 | compute next value for Euler's method ODE solver | def Euler(diffeq, y0, t, h):
dydt = diffeq(y0, t)
return y0 + h*dydt | 1 |
fed1e2bbab593011e62620e70dcaa51d | 54660516252ac7e97a2b52e0b3a81e02 | Get the statistic for shortened URL. | {
List<WeiboParameter> parameters = new List<WeiboParameter>();
foreach (string u in url_short)
{
parameters.Add(new WeiboParameter("url_short", u));
}
return (Client.GetCommand("short_url/share/counts", parameters.ToArray()));
} | 1 |
f92a25bc0709429c65e53915fe2ee865 | f7cbf92e077360c664034246681e526a | https://www.codewars.com/kata/582cb0224e56e068d800003c | function solve(s){
let sorted=s.split(``).sort().map(v=>v.charCodeAt());
return sorted.map((v,i,arr)=>v+1===arr[i+1]).filter(v=>v===false).length<2
} | 1 |
b3717d1a3105d561e76ce41f63ca8001 | ae3a1bd41b2e4d1f46c35437920252ef | Code to fake button press animation for file manager | Vibrator vibrator = (Vibrator) mContext.getSystemService(mContext.VIBRATOR_SERVICE);
long[] pattern = {800, 50, 400, 30, 800, 50, 400, 30};
vibrator.vibrate(pattern, -1);
} | 0 |
464d46b77c5b3cc8cc2418a52ca9eb45 | 54f99e8d9f31784287c966507e3b2d7d | model을 key값으로 차량 정보 조회 | $car_model_idx = $data['car_model_idx'];
$sql = "SELECT
a.car_model_idx,
a.model_name,
b.car_idx,
b.img_path,
b.car_name,
GROUP_CONCAT(c.car_product_idx) AS car_product_idx,
GROUP_CONCAT(c.car_product_option) AS ca... | 1 |
54255799173bfa51744559ad45a3b048 | 31348eed6d2d8f8078d50e6e358befde | The CF-style standard name. | public class Cf
public String getName() {
return name;
} | 0 |
f0f4e60d961c99aa5b75cb2efc8c6df2 | e3a3308d673ab8fe3572a863774b40e3 | returns if there is a collision between two spheres | class SingleBallLRA extends Sphere
private boolean checkSphereCollision(SingleBallLRA sphere) {
double newX = pos.getX() - sphere.pos.getX();
double newY = pos.getY() - sphere.pos.getY();
double newZ = pos.getZ() - sphere.pos.getZ();
double distance = Math.sqrt(Math.pow(newX, 2) + Math.pow(newY, 2) + Math.pow(n... | 1 |
6c94ba905016ecc082191f909776b2d6 | 6e75aa752b3b4f88897aa02db52406dd | Permite almacenar cuentas particulares que se adicionen a la cédula. | public class ControladoraDBPerfiles
public Boolean crearParticular(Institucion p)
{
try
{
pp.Insert(p.Cedula);
it.Insert(p.Nombre, p.Ins, p.Cedula, p.Edad, p.Sexo, p.EstadoCivil, p.Nacionalidad, p.Grado, p.Ocupacion, p.Telefono,
p.Provincia, p.Canton, p.Distri... | 1 |
4162a8a9923c3a288c20d5eef3c3f370 | 1eb180ff6cdb11b138c0b715e1a16dc7 | панелька выбора отображаемых столбцов | function showColumnsPanel(own, event){
var left = $(own).position().left;
var top = $(own).position().top;
var height = $(own).outerHeight();
$("#columnsPanel").css({"left": left, "top": top+height+5}).toggle();
event.stopPropagation();
} | 1 |
e4dc550effe0848471ee515e8f3c047d | 9a608783910e938015b4539e954a1b3a | 根据指定的条件来更新符合条件的数据库记录,takeheart_category | int updateByPrimaryKey(TakeheartUserStatistics record); | 0 |
28cf6abb5eca1a880d30f2b1637cc5d9 | 15d966306e32efbbe6b401daf6d49a1d | Get the full display name of the locale in the system's locale.
For example in an English system, en_US: "English (US)", fr_CA: "French (Canada)" | def get_display_name(locale: str, display_locale: str=DEFAULT_LOCALE) -> str:
locale = locale if is_valid_locale(locale) else DEFAULT_LOCALE
display_locale = display_locale if is_valid_locale(display_locale) else DEFAULT_LOCALE
loc = babel.Locale.parse(locale)
return loc.get_display_name(display_locale)... | 1 |
61cf08ac84d3ca064a65b3d2f2af2415 | 8a45e3b4c207cac29bd90d32d33a2cb0 | Converts the value from <c>Boolean</c> to an equivalent <c>Byte[]</c> value. | namespace Cdy.Spider.CustomDriver
public static class ImpExtends
public static byte[] ToBytes(bool value)
{
return BitConverter.GetBytes(value);
} | 1 |
195451561157142439cd3c3baecaa593 | a56aec1a4cb0ea3ae37410a91b9e0007 | Register a DataObject to the Histo Store | DataObject registerDataObject(DataObject dataObject); | 1 |
37e01ce638351997c16fe078e7cc1f1b | 41c966f9d45bcbe62cbab68fb84d9ed7 | wrapper to get all registered routes | public function getRoutesAll(); | 1 |
7f290cc301308c39eb626352e61bc097 | 396c7530a2fa7975e9ea88c271cc0138 | 根据学科id改变课程列表 | var gradeId = $("#gradeId").val();
$.ajax({
url:"/mooc/course/subject",
data:{gradeId:gradeId},
type:"post",
async:false,
dataType:"json",
success:function(msg){
var html = "<option>学科</option>";
$(".subject").html(html);
var subjectList = msg.data;
for(var i=0;i<subjectList.length;i++){
htm... | 0 |
684540bda324edba724339431143b2bb | 59dad7cb237787ba0c3ee169b37a7364 | Sauvegarde les données de la cellule. | function saveDataGrid() {
criteria = {};
criteria['cells'] = {};
vCells = $('#listTable').find('.dataChange');
year = $('#listTable').attr('data-year');
idAssociates = $('#listTable').attr('data-idAssociates');
for (var i = 0; i < vCells.length; i++) {
var htmlCell = $(vCells[i]);
... | 1 |
17496440c3d202e68bf5e0d041a27f77 | aa9b8cbb6b31335674a10bceda499451 | Server call for actually indexing text | inFilename = x['indir']
outFilename = x['outdir']
print(inFilename)
subprocess.call(["curl", "--form", "input=@" + inFilename,
"localhost:8080" + "/processFulltextDocument", "-o", outFilename]) | 1 |
87e52741f4e4eb24c2a1049b6609527f | c735440b724e08dd30c688342f227721 | inserimento, ritorna true se l'inserimento è avvenuto correttamente | bool ClientDatabaseManager::insertElement(QString id, QHash<QString, QString>* data){
QSqlQuery query;
query.prepare("INSERT INTO clienti (ClientFiscalC, clientName, clientSurname, clientRSoc, clientTel, mailClient, pIvaClient, addressClient, cityClient, CAPClient) VALUES (:id, :name, :surname, :ragioneSoc, :te... | 1 |
a359e27f0434b089493c41929a75f43d | b73aeb1f8defdb7209582fe09711a21e | 给定filepath返回对应的name和suffix | class IndexCreator:
def split_name(filepath):
dot_pos = filepath.find(".", filepath.rfind("/") + 1)
return filepath[:dot_pos], filepath[dot_pos + 1:] | 1 |
854bbd197804f351750d8ab6241ecac0 | d3ca6faeb257e93b5fd51278a3528fec | キャンバス上での座標をボードのマス基準の座標に変換する。 | x = math.floor(x / SQUARE)
y = math.floor(y / SQUARE)
return (SQUARE * x) + CENTER_X, (SQUARE * y) + CENTER_Y | 1 |
319da352f9d787b846d142e5f6d215ec | f47c1e848f4ec0c0ce0cd5d420f6509c | Returns an EWMA apply op that must be invoked after optimization. | def wma(x):
return 'wma(%s,%s)' %(x, pe.gen_param('wma', 'period')) | 0 |
0486c7c40dcec5f3a625d0b769aa262d | 5be8c0c7fae790374e73d595d1f77066 | 将本地实体转为传输格式实体 | public class SerialApiConvert
public static ApiDTO convertEntity2DTO(Api api) {
ApiDTO apiDTO = new ApiDTO();
apiDTO.setId(api.getId());
apiDTO.setApi(api.getApi());
apiDTO.setAsyn(api.getAsyn());
apiDTO.setIsClose(api.getIsClose());
apiDTO.setMemo(api.getMemo());
... | 1 |
65d3bb774adfeaf80fc25c28187161ce | ce545981089be07ffb451b2e0657932d | Shut down this IpManager instance altogether. | public final class PushManagerRegistry implements PushListenerService
public static synchronized void shutdown() {
instance = null;
} | 0 |
4587dac17c801c441cb4528d137283d9 | 86589c81ab6d428d5f2c7f2e414be9af | Gets the name of this item drop. | public final class ItemDefinition
public String getName() {
return name;
} | 1 |
139e1848eee4c0e072fda0f44ed62f53 | 85ef8e134e2ec94e243ddaefe2d179cd | Mengembalikan banyaknya substring yang match dengan pattern | public final class RegExp
public static int getSize(String regex, String input){
int size= 0;
Pattern r = Pattern.compile(regex);
Matcher m = r.matcher(input);
while (m.find()) {
size++;
}
return size;
} | 1 |
ee8cf3a2f600fc0ac4d8345783effa12 | 3b86d07a60cce78ca494d2c359fb462a | Set whether to display subsets in hierarchy view. | {
hideDescendants = !hideDescendants;
Properties.Settings.Default.ShowDescendants = hideDescendants;
Properties.Settings.Default.Save();
MenuItem menuItem = this.ContextMenu.Items[2] as MenuItem;
menuItem.IsChecked = hideDescendants;
this.I... | 1 |
37138ad2a4e89bc7664fe477d711ddc0 | 572a95532c822a577abe04ea8c3ee28a | 得到某个 section 上传感器的数量 | Long countBySection(Integer idSection) ; | 1 |
6e6783b4d381f1bd169d8aefaa7356c2 | 779d7043ffb63280b22dd7c819e886d3 | Convert an async iterable to an async observable stream. | def from_async_iterable(iterable: AsyncIterable[T]) -> AsyncObservable[T]:
return FromAsyncIterable(iterable) | 1 |
96794639a848adab2ed69c9511b108ae | abf13095362fb7497dd972bb5623d5ac | 发送客户端事件 | namespace TaidouServer.Handlers
class BattleHandler : HandlerBase
private void SendEventByPeer(ClientPeer peer,OperationCode opCode,SubCode subCode,int roleId,object posObj,object eulerAnglesObj)
{
EventData data = new EventData();
data.Parameters = new Dictionary<byte, object>();
... | 1 |
ca9a191f6ac4799e113398179ee2985e | 832ce7a9c2b38ce41fc6865568294123 | this creates an empty dictionary which will work as key:value pairs with name:number | class storage():
def __init__(self):
self.mydict = {} | 1 |
6469b47857b02ad45c5555edeb670657 | 8f9d87193604347dbca5f8cacc195b67 | 打开添加日程弹出框 | dialogCalendarSure = $
.dialog({
id:"dialogCalEventAdd",
url : _ctxPath
+ '/calendar/calEvent.do?method=createCalEvent',
width : 600,
height : 480,
targetWindow : getCtpTop(),
checkMax:true,
transParams : {
diaClose : dialogClose,
isview : "true",
sectionID :sectio... | 1 |
ff0d5d8b8d27cbbc41d7360f0d0463c0 | ae63ad76fffcefdd7c1170314d210c00 | Initializes Stop parameter list. | void init_stopChars(set<char>& list) {
int i = 0;
char c;
while((c = (int) *(stopchars_c+i++)) != '\0')
list.insert(c);
} | 1 |
d28e1590794efbfdadedd44a52a7d718 | 993ef375b216e0697df9b9b83598f316 | Loads a tilemap from the bundle path with a given name. | public class AssetManager
public void loadTiledMap(String path) {
manager.setLoader(TiledMap.class, new TmxMapLoader(new InternalFileHandleResolver()));
loadAsset(path, TiledMap.class);
} | 1 |
301a80b25ef0c3391959e3af8d731b62 | 9f9fe5247a9a2207142064373f117e1d | tests wether the ghost block intersects with a real block | short b = g_Blocks[_block.id].dir[_block.style];
int x, y;
for (int i = 0; i < 16; i++, b <<= 1)
if (b & 0x8000) {
x = _block.x + i % 4;
y = _block.y - i / 4;
if ((x < 0) || (x >= WIDTH) || y < 0)
return false;
if ((y < HEIGHT) && g_World[x][y])
return false;
}
return true;
} | 1 |
20ebe9f03b773609edb2d6a84b1fd06f | f337d7fa7351052a2961ccda5b827398 | Estimates state of robot from the last three measurements
Assumes each movement of robot is a "step" and a "turn"
Three measurements constitute two moves, from which turn angle, heading
and step size can be inferred. | if self.robot.pose.is_comparable(self.last_evaluate_pose):
dx = self.robot.pose.position.x - self.last_evaluate_pose.position.x
dy = self.robot.pose.position.y - self.last_evaluate_pose.position.y
dist = sqrt(dx*dx + dy*dy)
turn_angle = wrap_angle(self.robot.pose.... | 0 |
b0e141a14d6cbd9332265463319d7463 | fc57e88cac56477edd11c2cb21b3c5b2 | Client facing API to create a blob. | BlobWriteOption... options) {
BlobInfo blobInfo = BlobInfo.builder(BlobId.of(name(), blob))
.contentType(MoreObjects.firstNonNull(contentType, Storage.DEFAULT_CONTENT_TYPE)).build();
return storage.create(blobInfo, content, options);
} | 1 |
d01a6903492c25b797f4dad197451dd2 | 41173150795b405bcfc048cf4e3b4ef4 | Invia email che notifica che la spedizione è stata preparata. | string emailFunc = this._uController.GetUserEmail(idFunc);
string st = this._eController.getEstadoEncomendaS(idEncomenda);
string origem = this._eController.getLocalizacaoEncomenda(idEncomenda);
int idForn = _context.Encomendas.Find(idEncomenda).getFornecedorID();
string destino = null;
if(st.Equals("... | 1 |
371a72fdd9b736328190549c5d1e1cdc | db2a83b87bff49dacbe5b2249ca4b0e2 | Create a collection of all elements that do not pass a given truth test. | {
$elements = $this->toArray();
$collection = array();
foreach ($elements as $element) {
if ($predicate($element)) {
$collection[] = $element;
}
}
return new self($collection);
} | 0 |
5b324b7aa7e15dadf64fb09c4ab49a71 | 73617bed75ee7d94c0dfd505ef40235e | Check whether the JMX connection is connected | class XmppManage private constructor()
fun isConnected(): Boolean = getCM().isConnected | 0 |
edc306c2c06bb3a43c32c136b4d31b09 | 0c571b4a7d71c2a1767f37de7c4f22d9 | Test that the categorical_map attribute is created for the Masker object. | class TestFit(object):
def test_get_numerical_map_called(self, data, mocker):
mocker.patch.object(Masker, "get_numerical_map")
test_masker = Masker()
test_masker.fit(X=data)
Masker.get_numerical_map.assert_called() | 0 |
4ea3cd32f4e16c160881aef164f3fb09 | 1c525c14b2613cc1ab03c7b7fb3fae8c | 打开“选择Leader”对话框 | function zgLeaderSelectCallback(modelName, name, id) {
$.getEle(modelName, "zgLeader").val(id);
$.getEle(modelName, "zgLeaderMc").val(name);
} | 0 |
2964449072a284fc50c142694cb5876b | 611b17beb283431b7eac8bf676d44f28 | Renew the service lease for an absolute expiration time. | CompletableFuture<LeaseTimeToLiveResponse> timeToLive(long leaseId,
LeaseOption leaseOption); | 0 |
36d3aede47ea4f597c204860374669a0 | beb765c94444d3d7ac514358f3a5a2e4 | Логин и пароль - обязательные поля | {
return [
'login' => new RuleContainer([new Trim(), new NotBlank()]),
'password' => new RuleContainer([new NotBlank()])
];
} | 1 |
559d301ccf2891347f092fa4dbbb07f3 | 755fdfd164a23002760e9f745ff9cb8d | 将顺序表中下标s至t的元素逆转 | void invert(ElemType *R,int s,int t){
int k,w;
for(k=s;k<=(s+t)/2;k++){
w = *(R+k);
*(R+k) = *(R+t-k+s);
*(R+t-k+s) = w;
}
} | 1 |
8830e86a6c4828b5feec5601707a8473 | 85806fe7089ddc47d626ed62b7611b5a | Test movie does not exist | movie_to_update = {
"title": "Return of the Jedi",
"year": 1985,
"description": "Ewoks gallore"
}
result = client.simulate_put('/movies/927402', json=movie_to_update)
assert result.status == falcon.HTTP_NOT_FOUND | 1 |
3bab7d8360a1694b310a1770a6948202 | e51bcf88646792339e7cf0512414a401 | Lorsqu'une erreur s'est produite avec Paypal | class paypal_controller extends CI_Controller
function paypal_mobile_response_failure()
{
} | 1 |
cd40dcd13627862eb827affff823dcb5 | 9bc9287b2086456512c6b40a4155fb60 | @brief Creates a new physics object with default settings. | {
POData pod;
pod.m_CollisionShapes = a_CollisionShapes;
pod.m_Position = a_Position;
auto ptr = PPhysObject( pod );
m_Objects.Append( ptr );
return PhysObject( ptr );
} | 0 |
688934000676c8c2a3b58e4d7b7ced16 | fb341c74eb2ab83b21c56cdbbc7947e0 | 敵弾生成 | const node: cc.Node = cc.instantiate(this.enemyBullet);
node.parent = this.node.parent;
node.x = this.node.x;
node.y = this.node.y - 100;
} | 1 |
22ba27a92e71ac0eeeadb6b0ac82a0c3 | 197c090495a5820e1f8640ebf6b5ce61 | Validate that a town has been entered. | namespace TimeStranded.UI
[AddComponentMenu("Time Stranded/UI/Main Menu")]
[DisallowMultipleComponent]
public class MainMenu : MonoBehaviour
public void NewGameValidateNames()
{
string townName = _townName.Value ?? "";
string playerName = _playerName.Value ?? "";
... | 1 |
2fa00815d682a694660cbc44d976caf5 | 40d90be2ceb9af7ae24fb55f83b54170 | 根据商品名称、颜色查询所有尺寸 | public List<ColorSizeDTO> selectAllByGoodsId(Integer goodsId) {
List<ColorSizeDTO> colorSizeDtos = colorSizeMapper.selectAllDtoByGoodsId(goodsId);
if (colorSizeDtos != null && !colorSizeDtos.isEmpty()) {
return colorSizeDtos;
}
return null;
} | 0 |
dad813c8a4a87d5875b29c24c9f1e475 | 3cba6fc60613e9678863aaa0bf8d6e7d | Updates corresponding progress of goals when new records are added. | if(g instanceof TreasureGoal) {
Image treasure = new Image("/gold_pile.png");
Label l = new Label();
l.setMaxWidth(Double.MAX_VALUE);
l.textProperty().bind(Bindings.concat(g.getProgress().asString(), "/", g.getTotal().asString()));
this.squares.add(new Im... | 0 |
c1a5d5e75f9aaac16f9897e9d86ac666 | cb18f936a0b3573945a23d8fb36efc83 | sum till bigger no (included) - sum till smaller no (excluded) | namespace part1
public class LuckyNumbers
public int Calculate(int a, int b)
{
return CalculateLuckyNumbers(b) - CalculateLuckyNumbers(a - 1);
} | 1 |
ad9d10754f9da9eefb6d05ba357289d8 | b618bee7911f79b9e89a36bf0bfd9552 | 用户进行单篇上传操作 | @POST("UploadServelt")
Observable<User> testSingleMultipart(
@Part("description") RequestBody description,
@Part MultipartBody.Part file
); | 1 |
4328500ac46ee351977ab1c239aaf295 | 2502cbe1a0aaa8535e64e11a70389931 | 测试能否连接到excel表 | try {
OPCPackage pkg = OPCPackage.open(new FileInputStream("/Users/gang/Documents/表/Customers.xlsx"));
XSSFWorkbook wb = new XSSFWorkbook(pkg);
} catch (InvalidFormatException | IOException e) {
e.printStackTrace();
}
} | 1 |
c4cd714a7204ac657883a5dcc4a4bcf5 | 60427030c9e2098ea8c6319d677db3be | Capture the excetpion thrown in run method, and rethrow in join method | void runThrowNestedException()
{
try
{
throw std::runtime_error("failed");
}
catch (...)
{
std::throw_with_nested(std::runtime_error("runThrowNestedException() failed"));
}
} | 0 |
12a8386f235529ae3a5d8ddc35ce3fe4 | d14984ee86392b9374d81588f80b842b | 获取医学资讯接口 | def get_news():
url = "http://open.iciba.com/dsapi/"
r = requests.get(url)
content = r.json()['content']
translation = r.json()['translation']
return content, translation | 0 |
cd903bd1a57828cd2339ba89deb91423 | 3820c63b7c46d62e2f55de12d179a53e | Use the Stirling series for the correction to Log(Gamma(x)),
which is better behaved and easier to compute than the
regular Stirling series for Gamma(x). | public class SaddlePointExpansion
public static double getStirlingError(double z) {
double ret;
if (z < 15.0) {
double z2 = 2.0 * z;
if (FastMath.floor(z2) == z2) {
ret = EXACT_STIRLING_ERRORS[(int) z2];
} else {
ret = Gamma.logGamma(z ... | 1 |
bbb6def0be59f00957cb5f506e48a8a3 | 31850102ce35ca27df1dec0dc75403fb | Ends the stream if it does not produce a value after d duration. | size_t kDT_ms = 1;
size_t total_time_waited_ms = 0;
while ( true ) {
if ( flushValue(value_out) ) {
return true;
}
std::this_thread::sleep_for(std::chrono::milliseconds(kDT_ms));
total_time_waited_ms += kDT_ms;
if ( timeout_ms != 0 && total_time_waited_ms >= timeout_ms ... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.