query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
47fd7057ad49ba34ccbdd7f23217b297 | ad91349e0d8716891c63d9e2cfa6b34a | Add an item to the store. Depending on whether the item matches the <see cref = "Filter" /> predicate,
this item may or may not become visible. | {
if (!IsFiltered || m_filter(item))
{
if (IsSorted)
{
int i = m_list_current.BinarySearch(item, this);
if (i < 0) i = ~i;
m_list_current.Insert(i, item);
return i;
... | 1 |
0c4e389bab6b5a2af7a6d4bd6fb79927 | 9f824e08bb83e6c11a31f6cb4530fd0c | Переворачивание строки | namespace homework_04
public partial class Form1 : Form
public string Reverse(string original)
{
char[] arr = original.ToCharArray();
Array.Reverse(arr);
return new string(arr);
} | 1 |
e7d68b6cb586c1291183d0307fe33347 | 4d11312cf52645856fc85d9a919c50bd | Returns a boolean for whether this is an IPv6 site-local address | g_inet_address_get_is_site_local (GInetAddress *address)
{
g_return_val_if_fail (G_IS_INET_ADDRESS (address), FALSE);
if (address->priv->family == AF_INET)
{
guint32 addr4 = g_ntohl (address->priv->addr.ipv4.s_addr);
return ((addr4 & 0xff000000) == 0x0a000000 ||
(addr4 & 0xfff00000) == 0xac10... | 1 |
4c5961d39880a48a219e568db82550f0 | a847464971be1ea1756846caea73019f | keyNameで開始するキーをすべて取得する | class redisApi
static public function keyAll($prefix = '') {
return self::$db->keys($prefix . '*');
} | 1 |
f6282e205764bfa79db0011a45c0a2e7 | a1b7bcc883be8083e7b2cdb155c6441b | Пример фильтрации в агрегирующих функциях. | get_smoke = lambda s: np.average(s['smoke'])
print(grouped.apply(get_smoke))
print("В 12,25 раза = ответ в 12 раз") | 0 |
c2a13f7d0bc8db2bb15ef8a8f2ae9dc3 | 9def5ce41c601bdb348d946c2d1c83d7 | Updates/draws the employees in the assignment tab. | $('#need_assistance_counter').text(Module.employeeCollection.needAssistanceCount());
$('#not_checked_in_counter').text(Module.employeeCollection.notCheckedInCount());
$('#checked_in_counter').text(Module.employeeCollection.checkedInCount());
$('#need_assistance_employees').empty();
... | 1 |
4c145009f088118efbe7eb441756d949 | 6fbf6d74df2af8bda9fd781998f74c23 | 서버에 전송할 값 생성 | makeSendData() {
return this.formData
} | 1 |
f34eb85ca0efc4f93ce13982ad7424dd | 3aec90b459602eafc477263e0d71d048 | Find a dataset's ID given the dataset code configured in the Xibo
CMS. | class ObjectDB
extends DBObjectDB
function id_by_code( $page_code = '' )
{
$query = 'select ID from ' . $this->table_name()
. ' where ' . $this->code->name() . ' = ' . wrap_sql_type( $page_code )
. ' and Host = ' . wrap_sql_type( $this->m_host_code );
$this->m_db->Query( ... | 1 |
0f5304eef02a826e3a427b82b63658d8 | 7bffe7e435b960823065e2c97ac99ea4 | Tests light weight resource streams (everything but FileResourceStream and
UrlResourceStream). These should <strong>not</strong> be cached. | class CloudUrl(StorageUrl):
def is_stream(self):
return False | 0 |
33408076fbc6d3bd1637232a949d8b18 | d3b47c49af04150ce273e4888275cb04 | asks the user their customer info and it stores it in the array | r.question("Enter your First Name: ", function(ans) {
r.question("Enter your Last Name: ", function(ans1) {
r.question("Enter your address: ", function(ans2) {
r.question("Enter city: ", function(ans3) {
r.question("Enter state: ", function(ans4) {
... | 1 |
afe567ab994332ca92797e6f9c24eaeb | 17344d3281d32c42bba13d5b46054600 | Reset time varying state vars and recompute decay. | class VTD(LearningAlgorithm):
def start_episode(self):
self.z *= 0
self.z_bar *= 0 | 1 |
50bcaafb9604baa6d266ca5f9037b664 | dddd5af086db04e4447a06806bf936fb | 根据id解冻平台用户 | public class UserServiceImpl implements IUserService
@Override
public void unfreeze(String uid) {
try {
userDao.unfreeze(uid);
} catch (SQLException e) {
throw new RuntimeException(e);
}
} | 1 |
6b0add586a60e0be736ee3991dfb6e54 | 4c548c5cc29c9ad37ce589b3fbf3d840 | Because the Rust compiler optimizes struct layout, it's possible that
some future version of the compiler will produce a different size. If
that happens, we can either disable this test, or test for multiple
expected values. For now, the purpose of this test is to make sure we
notice if that happens. | fn struct_size() {
assert_eq!(std::mem::size_of::<Storage>(), 40);
} | 1 |
700d9a2208d6762e603bccab5adabf23 | 80e1d59c7d532368ec2e9cf6a603d8b4 | SpringMVC中的Controller层的切点,注解拦截 | "||@annotation(org.springframework.web.bind.annotation.PostMapping)" +
"||@annotation(org.springframework.web.bind.annotation.GetMapping)" +
"||@annotation(org.springframework.web.bind.annotation.PatchMapping)" +
"||@annotation(org.springframework.web.bind.annotation.PutM... | 1 |
a7b4806bc1692b2aa543f36e37637950 | bc29c21334949988a49fe7f1944aba80 | Bans the user from this guild and optionally prunes their recent messages. | class DyscordMod(DyscordPlugin):
async def ban(self, ctx: DyscordContext, user : discord.Member, *, reason):
await ctx.guild.ban(user, reason=reason)
await ctx.channel.send(f"Banned {user} ({user.id}) | Reason: {reason}") | 0 |
3ab9ad601d9ee7d4ae90b22496f852c0 | d3f730ba6835141cdef01ffdc45c1438 | アップされたemmファイルの保存先 | $path = ABS_TMPL_APP . 'alladinExtend/';
$ankenId = $this->_extendAnkenId;
$path .= "{$ankenId}/result/hoten_upload_{$ankenId}.tpl";
return $path;
} | 0 |
6ee630b96855001949c814d42286417b | 23ec66b147d752390ab2a51b8bd2325a | 用于新建单位时初始化调查板块 | @Controller
@RequestMapping("aqpx/xqdc")
public class PageAqpxXqdcController extends BaseController
@RequestMapping(value = "create" , method = RequestMethod.POST)
@ResponseBody
public String create(AQPX_PxdcztEntity entity, String kcnames, Model model) {
String datasuccess="success";
long qyid = UserUtil.getCurr... | 0 |
a2de00675e6b7494d7e19cf23a23e1d5 | b07a07e07ffb863e0bbc0deaaaf325b0 | Create a new money source. Check if have a name and a total value. | class Money extends Component
public function __construct($amount, $currency = null, $convert = false)
{
$this->amount = $amount;
$this->currency = $currency;
$this->convert = $convert;
} | 0 |
78bc2ab56dcd879ee49460ac9dcc3672 | 658f99020bae810b1a29866a0c4fbda8 | Test that we are correctly constructing an S3 key name using the task
instance data. | job_scope = JobScope(
ad_account_id=gen_string_id(),
report_type=ReportType.day_platform,
report_variant=Entity.Ad,
range_start=date(2000, 1, 2),
)
dt_should_be = datetime(2000, 1, 2, 0, 0, 0)
with mock.patch.object(uuid, 'uuid4', return_va... | 1 |
4e059fe14876413cfb6299aaa8d43ee1 | e6b22a4e199ade5a1891154cbc9b2a85 | Discover nupkgs from a v3 local folder. | {
if (root == null)
{
throw new ArgumentNullException(nameof(root));
}
if (id == null)
{
throw new ArgumentNullException(nameof(id));
}
if (log == null)
{
throw new Arg... | 1 |
165a3163f720732e41bbd1818a8cb3c4 | 3f3c507230acf6c0fcb53f0def8c4dfa | The reactions of state QosNotMet1_QosNotMet2. | CQoSTest_707::CQoSTest_707()
{
_LIT(KText313, "qos_707");
iTestStepName = KText313;
} | 0 |
675ce5665a8d2c22f209817e31d22070 | 791983c51d9019c7a69d89585befb280 | Gets isOperatingOnline | {
global $ilDB;
$set = $ilDB->queryF('SELECT * FROM sahs_lm WHERE id = %s',
array('integer'), array($a_id));
$rec = $ilDB->fetchAssoc($set);
return ilUtil::yn2tf($rec["c_online"]);
} | 1 |
89488817b6b222b4026f0d88393d2b84 | 3ff992a8a3a83d1203b895fab4e06f58 | Randomly assign any prehealth condition of the person based on their age by assuming the younger the less likely he/she has a prehealth condition | df["Chi"] = 0
df.loc[(df.Age <= 12),'Chi'] = 1
return df | 0 |
505b612e3a2734d890200b503781be86 | a91c7013d03fec6312f984cc6e91b142 | ミニマップの作成 | namespace HighFive.Editor
public class TileMapUtilWindow:EditorWindow
private void GenerateMap()
{
Vector3Int min, max, size;
if (!CheckTileMapsValid(out min,out max,out size))
return;
if (!Directory.Exists(miniMapGenerateDirPath))
Director... | 1 |
9ebdfd6ca4edf158fca4934e619b21d0 | 80bfd2eab85fed52a62d3ae0b879c4f2 | Resolves the ability of the card or wonder just played. | public class FluxxGame
public void resolveCard(FluxxCard card)
{
switch (card.getCardType())
{
case ACTION:
doAction(card.getEnumCard());
break;
case CREEPER:
doCreeper(card.getEnumCard());
break;
cas... | 1 |
788425019f1fecf6d57202474bf039ff | 29a97cfe7bd0e3f5f383d3ee99116e6d | Function loading the appropriate view for the connecting user | def index(request):
if request.POST.get('invalid') is not None:
template = loader.get_template('share_app/index.html')
context = RequestContext(request, {'error':'error'})
else:
if request.user.is_authenticated():
template = loader.get_template('share_app/user_panel.html')
member = Member.objects.get(user... | 1 |
7d4459795e9daf1b3a120c55e21f895f | c421582df0b367d08239f11e11d1e4f7 | List of purchase order related to Quotation | {
var results = from purchaseOrderRow in SMOWMSDbContext.AssPurchaseOrderRows
join template in SMOWMSDbContext.AssTemplates on purchaseOrderRow.TEMPLATEID equals template.TEMPLATEID
where purchaseOrderRow.POID == POID
select new AssPORowOutputDto()
... | 0 |
264a70b4ad2837d43d190a759ec1b56b | 5624ba52658d942c12001bfbef722682 | Add a new Concept from the current text in the new concept field and update the UI. | var kg = this;
nodes.select('text')
.on('click', function(conceptId) {
var concept = kg.graph.node(conceptId);
var text = this;
var textgroup = d3.select(this.parentNode);
var obj = textgroup
.append('foreignObject')
.attr('width', text.getBBox().width)
.attr(... | 0 |
e6e019421fe3db2dc14b16cb7db9d149 | b400613db1b63cd555e7aafc59550053 | Returns a :class:`fiftyone.core.labels.Detection` representation of
the box. | class DetectorParameters(object):
def rectangle(self):
return self._rectangle | 0 |
7486d7a80c8d82fe21e7a00c73434556 | a6f95f8b4a342c992862cbbe6306b870 | 人脸状态改变业务. | benchmarkFPS();
int isTracking = faceunity.fuIsTracking();
if (mOnTrackingStatusChangedListener != null && mTrackingStatus != isTracking) {
mOnTrackingStatusChangedListener.onTrackingStatusChanged(mTrackingStatus = isTracking);
}
int error = faceunity.fuGetSystemError... | 1 |
56127eced49f995f48f5d01afdb9096b | eb7898141681d52799c5fc06f5ceebc1 | Wait for an item. It will block until there is an item, when it will return it. However, it is
possible that a ThingsException could interupt the block due to a FAULT. | MU_ARG_CHECK(logger, NULL, queue);
atomic_fetch_add(&queue->threads_waiting, 1);
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_sec += timeout;
pthread_mutex_lock(queue->manipulating_queue);
while(atomic_load(&queue->shutting_down) == false && atomic_load(&queue->size) == 0){
int errcode;
if(t... | 0 |
0f7f44abd2418e979c08b70896756687 | 76ff8c6ba2087310b67bf25b70bc3b22 | 根据dt、包名统计设备数量 | Integer selectDevCount(Firmware firmware, Device device) throws SQLException; | 0 |
85989852252f057cc41f2bd3d5fd6184 | 29a154fcc2f19f11f15f37fd8dd8075e | Retrieve content from wincache | {
$key = $this->prefix . $key;
$success = false;
$data = wincache_ucache_get($key, $success);
return ($success) ? $data : null;
} | 1 |
fdebb75eb821965acd06db4e6bd137b6 | 108211d272e1cf02562683696e30124b | 如果当前显示小于即将显示的,向左滑 | function showPrev(){
if(index == 0){
setTimeout(function(){
showPrev();
},0);
index=5;
left = -6000;
$('#slider').css('left',left+'px');
}
else{
index--;
left = -1200*(index);
if(ind... | 0 |
62e336b0f8d9a685fbd2f83ce47f8738 | 7b1b3202048a2495c1763d36975f8249 | 修改导入状态业务持久层实现方法 | namespace ADServer.BLL
public partial class B_Employ_Info
public string ProcDealImport()
{
return dal.ProcDealImport();
} | 0 |
401fbf34882dde34fd73e4dd250b89c8 | d3162da342e7f8765314ab4820e3fb2c | Gets an enumperator that enumerates the dictionaries that represent the row content stored by field name. | {
return new RowOrdering() {
public List<String> getOrderByExpressions(String fieldQualifyingAlias)
{
return dotQualify(asList(fieldNames), fieldQualifyingAlias);
}
};
} | 0 |
107f2f40a731728885ca0fcb66362b3c | 32425e29890c32e5eac4ca0db22ae9b9 | user idを指定すると自分のhigh scoreを手に入れる | player = get_object_or_404(Player, user_id=request.user.id)
scores = player.highscores.all()
return render (request, 'player_highscores.html', {"scores": scores}) | 1 |
d41bddbb167b27b7313fa233dd52a549 | a7a9c8dd2ffd567b8fedc4526f86efce | Gets a player based on color | {
if (index < 0)
return Vector3.one * 0.5f;
index = index % playerColors.Length;
Color c = playerColors[index];
return new Vector3(c.r, c.g, c.b);
} | 0 |
ee197f29a6c499743db0bd251a013605 | 986ea7c060a9d1e59a935cc8cc53bb73 | 分页降序 | Sort sort = new Sort(Sort.Direction.DESC, "id");
return new PageRequest(pageNumber - 1, pagzSize, sort);
} | 1 |
2524b03c53a531ea160050ec68aa96ed | 9e1ce34fc97d5fc93c514ba5d2def664 | Gets the shooting inputs for the current frame. | {
Vector2 shootVec = new Vector2 (CnInputManager.GetAxis ("Horizontal"), CnInputManager.GetAxis ("Vertical"));
if (shootVec.magnitude > 0) {
releasePressDirection [0] = shootVec [0];
releasePressDirection [1] = shootVec [1];
IsFiring = true;
} else {
IsFiring = false;
}
if (CrossPlatfor... | 1 |
1923ba396d6ce4ef7793b9f3264b7587 | 5dda53a1aee19533113d3e4aae9e3cca | Given a list of names in "peopleFile", return a list of people,
with the strings as names and sequential ids. | people load_people(FILE* csv_file) {
people result = NULL, last_person, p;
char* line_buf = malloc(sizeof(char) * 80);
fgets(line_buf, 80, csv_file);
while (fgets(line_buf, 80, csv_file)) {
if (result == NULL) {
result = last_person = malloc(sizeof(struct _people));
} else {
last_person->cdr = malloc(s... | 0 |
5251b5ec7d10a2dbc55e85b14bbbe8e0 | a57f9e93035b38bcc09cc24facecf775 | Returns breakpoints primarily for the Get-PSBreakpoint cmdlet. | namespace Google.Devtools.Clouddebugger.V2 public static class Debugger2
public class Debugger2Client : ClientBase<Debugger2Client>
public virtual global::Google.Devtools.Clouddebugger.V2.GetBreakpointResponse GetBreakpoint(global::Google.Devtools.Clouddebugger.V2.GetBreakpointRequest request, CallOptions options... | 0 |
41f7df7fe3bdda2a5e2458d4a001886b | b34e34ecd4853113ff0fa669a3b9f1c8 | itemsテーブルから全てのデータを取得 | function get_item_list($dbh) {
$sql = 'SELECT item_master.item_id, item_master.item_name, item_master.price,
item_master.img, item_master.status, item_stock.stock
FROM item_master JOIN item_stock
ON item_master.item_id = item_stock.item_id';
return get_as_array($dbh, $sql);
} | 0 |
a74a39f16c7b0b7896bd216a579fdf15 | d5f6caa0364dab121392fc170777c5b9 | 计算两个边界框的jaccard系数(并交比) | def jaccard(box_a, box_b, iscrowd: bool = False):
use_batch = True
if box_a.dim() == 2:
use_batch = False
box_a = box_a[None, ...]
box_b = box_b[None, ...]
inter = intersect(box_a, box_b)
area_a = ((box_a[:, :, 2] - box_a[:, :, 0]) * (box_a[:, :, 3] - box_a[:, :, 1])).unsqueeze(2... | 1 |
cb08664226b7e942252875d38a448766 | 6deda8497078abc48cfb49256cf452be | Main method accessed by ajax request to update recurring events
Parent events are updated if "all instances" was selected | {
parent::__construct();
if($this->sg_get->check("event", Superglobal::CHK_ALL, "\ct\is_valid_id") < 0)
{
$this->set_error_predefined(AjaxController::ERROR_MISSING_ID);
return;
}
$id_data = array("id" => $this->sg_get->value("event"));
$glob_mod = new GlobalEventModel();
if(!$glob_mod->gl... | 0 |
c42782c367f6f67b38f9e67f736bdd5c | e63683a1ea3d9a294cf4f88d4de1a3f5 | Request that the stage preload a sound file for later playback and also implicitly add it to the
list of known sounds for later sound manipulation with the stage sound API.
Sounds are expected to be in a folder named "sounds/" inside of the folder that the game page is
the browser can play and load the appropriate file... | export default class RtcEngine implements RtcEngineInterface
preloadEffect(soundId: number, filePath: string): Promise<void> {
return RtcEngine._callMethod('preloadEffect', { soundId, filePath });
} | 1 |
66847d24ee57efad28526e48543e3eab | e5ea5a0fcb10a89cf244c4d617044542 | Open a Linux SPI device. | class RaspberryPiHardwareSPIBus(base_spi.BaseHardwareSPIBus):
def _open(self):
self._spi_device.open(self._port, self._device) | 1 |
14ff0a5976a162f7e45c05e39df5a689 | f14a713c3c7e3105b85ba0bb55419a60 | 將SysFunction資料表的內容以DataTable方式回傳 | namespace Transfer8Pro.Core.Service.OB
public class SystemFunctionService
public List<SystemFunctionEntity> GetList()
{
return dao.GetList();
} | 0 |
187174a2beb34fa4451bf911c35e706f | 91963a15a3c194a5382f4da3baa7e83f | Initializes a datastore, with a new dictionary. | class DataStoreManager:
def __init__(self):
self._stores = {} | 1 |
6598c5da9aa1c16d822662288b050cd3 | 16327588bb2da43cf02e08a59d3cd136 | Send MRW Command by PDA. | {
char OPRD[OPRD_SIZE];
GET_TOKEN(OPRD);
if(IsReg(OPRD) && IsReg16(OPRD))
{
EncodeSMSW_Reg16(GetReg(OPRD));
}
else if(IsReg(OPRD) && IsReg32(OPRD))
{
EncodeSMSW_Reg32(GetReg(OPRD));
}
else if(IsMem(OPRD))
{
uchar Reg1, Reg2;
uint Offset;
GetMem(OPRD, &Reg1, &Reg2, &Offset);
Encode... | 0 |
a055e4fc84b0cc6d3baab4b2d646468b | e5af026193b4ec6cfe8d64e1264c8641 | This function creates a new study using the REST API
endpoint. Most cases will need to create a study to
test editing certain information, this allows us to
keep it DRY.
Returns | class SeerConnect: # pylint: disable=too-many-public-methods
def create_study_cohort(self, name, description=None, key=None, study_ids=None):
query_string = graphql.create_study_cohort_mutation_string(
name, description, key, study_ids)
return self.execute_query(query_string) | 0 |
652aaac02cd5fc61a7f9b2f74f7c9183 | 5678828a72c82e6e4f5be0fd5821652e | Set the transition animation | public class ViewAnimationActivity extends AppCompatActivity
private void setTransition() {
overridePendingTransition(R.anim.animation_activity_enter, R.anim.animation_activity_exit);
} | 1 |
dd6fcb1f56497b480f66353af3e684b4 | 30d03f8bba62d47dca362bc16df5b50f | A static method returning the size of the specified format. We can't
simply use struct.calcsize, since we define new format specifiers (like
'T' and 't') that aren't defined in struct. | namespace Silk.NET.OpenAL.Attributes
public static class FormatHelpers
public static int GetFormatSize<TFormat>(TFormat format)
where TFormat : struct, Enum
{
var enumType = typeof(TFormat);
var member = enumType.GetMember(format.ToString()).First();
if (!(mem... | 1 |
5576fa74c934d8fb30d513a939f189c0 | b9aab7a1440f2cb1df5e6e78fba89ff8 | 게임 결과 엑셀 저장 | global $db;
switch($game){
case 'klc':
$col=array(
'draws_num'
,'ball_1','ball_2','ball_3','ball_4','ball_5'
,'ball_6','ball_7','ball_8','lottery_Time','total_sum','site'
);
break;
case 'ssc':
$col=array(
'draws_num'
,'ball_1','ball_2','ball_3','ball_4','ball_5','lottery_Time','t... | 0 |
93b09daa85b03db28570ba8012f9c882 | 8269543963ce4514d42d4500b57e0f66 | 每次重新插入投资人数据,删除之前的数据 | List<InvestorAchievementPending> list = investorAchievementPengdingDao
.findAchievementsById(investorId);
if(list.size()>0){
List<InvestorAchievement> oldList = investorAchievementDao
.findAchievementsById(investorId);
if (oldList.size()>0) {
investorAchievementDao.deleteById(investorId);
}
... | 1 |
88b31a2cc8005a96e97813152b430171 | 151b4332d7829901ddeb387866bce5bd | The lines patten depends on the modulus of one of the co-ordinates with
the size | Mat ProcGen::getPattern(Size imSize, uint level, uint direction, bool inverted)
{
int x = imSize.width;
int y = imSize.height;
int nextX = pow(2,ceil(log(x)/log(2)));
int nextY = pow(2,ceil(log(y)/log(2)));
int sqSize;
if(nextX > nextY)
sqSize = nextX;
else
sqSize = nextY;
Mat workImg = Mat::zer... | 0 |
eeb2cb0d23a84506328edce7a7cf95bb | 641d9a15f5bf9654c7a545963cc9410d | Gets the initial action of the flow. | IAction getEntryPoint(); | 1 |
17c89d1b0923a54031b25822d979991b | 03599f004ea791df68a95548c6c05c8d | Stops Analog Joystick data acquisition. | namespace FALibrary.Device.MemoryBaseDevice
public class FAAjinAIODevice : FAMemoryBaseDevice
private class AjinLibrary
public class CAXA
[DllImport("AXL.dll")]
public static extern uint AxaiExternalStopADC(int lModuleNo); | 1 |
6e1b7c2906773bcf0a0efbfbf2d4d95c | ab264a787cde0b6b9e87c4ecad6b7cac | Register the mail-open flag | {
$resource = $this->connection->getResource( TRUE );
$flags = [ 'seen', 'answered', 'flagged', 'deleted', 'draft' ];
if( !in_array( strtolower( $flag ), $flags, TRUE ) )
throw new RangeException( 'Invalid flag, must be one of: '.join( ', ', $flags ) );
$flag = '\\'.ucfirst( strtolower( $flag ) );
imap_... | 0 |
8306f3245044c04f3173de8f2f8fd7be | 8178f2f0727ce5d8a72dad445feb3fed | 指定した文字が先頭にある場合、先頭の指定した文字を削除します。 | namespace Harukaze.Core.Extensions internal static class InternalStringExtensions
public static string Left(this string value, string word) {
if (string.IsNullOrEmpty(value)) {
return value;
}
var index = value.IndexOf(word);
if (index < 0) {
... | 0 |
8fee3c0ebdf6b936ec1da3e9bd5261b2 | b1274bb2dd54bd0ca153f98280620456 | Every tick update the global time and save it to EEPROM (delayed saving) | suspend_time();
sync_end = HAL_GetTick();
uint16_t delay = (sync_end - sync_init) / 2;
uint16_t delay_millis;
uint8_t delay_sec;
_sys_time.hour = temp.hour;
_sys_time.minutes = temp.minutes;
_sys_time.seconds = temp.seconds;
_sys_time.milliseconds = temp.milliseconds;
if(delay >= 1000){
d... | 0 |
5d057be1cbf8d6e5a59b052bf5f01375 | 8c586fde1a2558012f37c3942063aee5 | Create an i18n message that takes one argument. | public class Support
extends Assertion
static protected final String getI18N(String key,
int arg1,
String arg2)
{
return I18NHelper.getMessage(MESSAGES, key,
new Object[]{new Integer(... | 0 |
6edb42a147998a122f225357af3d5cb4 | daa308b64bc9020248c7d85ab13043a2 | Sets the current workflow definition id related to this event
the current workflow definition id | {
$this->initialized['workflowId'] = true;
$this->workflowId = $workflowId;
return $this;
} | 1 |
a81b036537cbb88be6cd8bdaaa014112 | 310348a4396e278dfa2890dddba6b7f3 | populates 3d environment | void fillScene3(Scene &scene) {
scene.addObjModel(Vec3f(0, 0, 0), MAT_SCALE(45, 45, 45), "input/env.obj");
scene.addObjModel(Vec3f(6, 0, -7), MAT_SCALE(15e-3, 15e-3, 15e-3) * MAT_ROT_Y(toRad(-135)), "input/cat.obj");
scene.addLight(Vec3f(0, 50, 0), 20, WHITE);
scene.addLight(Vec3f(1, 4, 5), 25, WHITE);
... | 1 |
68aa80f27cb81affb283ff85552ce1c6 | d665c23c4688a8456de053aa9ae09158 | Lista todos los objetos Grupo_has_participante en la base de datos. | java.util.List<Grupo> findAll(); | 0 |
2e08d88fc2074b7f4b8af69f70edf0e4 | 956d402ca255bc7d73ac0b70db5ce536 | Returns joints effort | [c1,s1] = self.trig( q )
J = np.zeros((3,3))
J[0] = self.l1 * c1
J[2] = -self.l1 * s1
return J | 0 |
daa9a55e363ffd83d2729fa88b96a7e2 | 17fb556750707d2c87457a4edd105aaf | Set the 'Action' element value. Not required for Tenders of "CHECK", "CASH", "BILL TO", or "WRITE OFF". | class PassportInfoMessage_PNRB extends AbstractStructBase
public function setActionCode($actionCode = null)
{
if (!is_null($actionCode) && !is_string($actionCode)) {
throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($actionCode)), __LINE__)... | 1 |
846a87d9a96585ce7cb896dd0ca06b11 | 609d6cef50c3a2358a613eabe3a1063c | für jedes (a,b) ϵ R gibt's (b,a) ϵ R | class IntervalLattice : Lattice<Element>, LatticeOps<Element>
private fun inv(b: Element): Element = when {
b == FullInterval -> FullInterval
b == EmptyInterval -> EmptyInterval
b.first is IntNum && b.second is PInf -> MInf to IntNum(-(b.first as IntNum).i)
b.first is MInf && b.second is... | 0 |
9f375da4cb97b6f04478bbf5d127fccd | 9974e6abe912d75f4a7e325d1fda0d30 | Returns the data as an observable list of Students. | export class CrudService
getStudentsList() {
console.log('Called STUDENTS LIST');
return this.studentsList.students;
} | 0 |
be6a982443f1bb3043d91c7660d64d4d | 554507ef1e5e7ae005c10b232c18cf89 | Frobenius inner product | def inner(u,v):
return np.inner(np.conjugate(u),v) | 0 |
cda727a66aa8dde99958107801dcf5a7 | 3aab365392f1fe2fa52602b172345644 | NewTestEnsembleSpec creates a blank specification for a test ensemble. | func NewTestFactory() *TestFactory {
return &TestFactory{
TestFactory: cmdtesting.NewTestFactory(),
}
} | 0 |
813e741064bd5cab7e34a80d4a82255b | 763133b50f25f3ea3cbdc86c37e3fb0c | Eliminar todas las marcas | class MarcaController extends Controller
public function destroy($id)
{
Marca::destroy($id);
Session::flash('mensaje','Registro eliminado correctamente');
return redirect('marcas');
} | 0 |
9f3a5c078edf6ef10746b7febf2781ec | 510302a56d31a5cc109ff9fec9e7c828 | Adds a query part to the "fixed where" elements.
The elements will always be ANDed in the query. | class DC_Multilingual_Query extends Controller
public function addWhere($strWhere)
{
$this->arrWhere[] = $strWhere;
return $this;
} | 1 |
7d6d9311e3c9ab9e5331d06c1993d227 | 474403579fedbc1b33de42dd487ee0c9 | Set the sprite index for a certain frame. | frameIndex = index;
m_animTime = _frames[index].startTime;
if (_animFrameList.index != index)
_animFrameList.index = index;
} | 1 |
252ab99b87eef09fa1c181d55166f207 | f7fb34bd0fa63e354d11733c37255e23 | specifies that shaders compiled for this pipeline write the attributes for all views in a single invocation of each vertex processing stage. All pipelines executed within a render pass instance that includes this bit <b>must</b> write per-view attributes to the {@code *PerViewNV[]} shader outputs, in addition to the no... | boolean hasNormalPerVertex(); | 0 |
5ee9d001cfe81a731b213c7f72fce971 | 9e30b1b7ec2231d523f9f65ed928fd81 | Yields all distinct subjects. | export default class Graph
* subjects() {
const visited = new Set();
for (let {subject} of this.splo.values()) {
const hash = `${subject.interfaceName}#${subject.nominalValue}`;
if (!visited.has(hash)) {
yield subject;
visited.add(hash);
... | 1 |
c3005062c59159addaedd2e87e83fe02 | b19903ebbb16e0fe4bf7cef3f7fb89e0 | NETWORKDAYS | {
for (var i = 0; i <= 6; i++)
{
document.getElementById ("DayOfWeek-" + i).innerText = fetchIPrefNarrowDayOfWeekName (i);
}
} | 0 |
3df9ef8549a997703fa7cb6327f1ed6c | f4c59b57a050bb70a7e81febfa193662 | 根据dasn查询单条交易量的详细信息 | {
string sql=@"SELECT [Id],[StatisticDate],[TradeAmount],[TradeNum]
FROM
dbo.[StatisticTrade] WITH(NOLOCK)
WHERE [Id]=@id";
DbCommand cmd = db.GetSqlStringCommand(sql);
db.AddInParameter(cmd,"@Id", DbType.Int32,id);
StatisticTradeEntity entity=new StatisticTradeEntity();... | 1 |
38e69ea739194b45551edb1420adb170 | 3d9dcf3865cadf4c65986a818cb5c296 | Read matrix from disk | struct stat stat_buffer;
fstat(d_matrix, &stat_buffer);
unsigned char* matrix_ptr =
mmap(NULL, stat_buffer.st_size, PROT_READ, MAP_SHARED, d_matrix, 0);
matrix_ptr = get_int(matrix_ptr, width) + 1;
matrix_ptr = get_int(matrix_ptr, height) + 1;
double **matrix = malloc((*height) * sizeof(... | 1 |
ccc47db79c058d1f620abffcba02345f | 6cbb8983af8554df5bc1155bfd42ee27 | 根据昵称数组获得用户id数组 | class PwUserDefaultDao extends PwBaseDao
public function fetchUserByName($usernames)
{
$data = $this->_getDao()->fetchUserByName($usernames);
$result = [];
foreach ($data as $key => $value) {
$result[$key] = ['uid' => $key];
}
return $result;
} | 1 |
7003bf42eadee5b6b716b47d646fff99 | 44ba3b65c54f004e51a2412cd36a1271 | 获取当前区域节点下的所有子节点区域Id(建筑节点Id),包括当前节点Id | List<String> getChildRegion(Integer regionId); | 0 |
5ef282d4fa7e0c118cf603bff906fa22 | f548338694a3306677987e71c094de6d | Metodo que se usa para poder actualizar los registros de forma
que quede desactivada la oferta por un momento sin necesidad
de eliminarla para que el negocio no la vuelva a crear, esto si
se vuelve a activar de forma que quede funcional de nueva cuenta | class Desactivar(UpdateView):
def post(self, request, *args, **kwargs):
self.object = self.get_object()
self.object.is_active = False
self.object.save()
return redirect(self.success_url) | 1 |
5c3f48a6eda7d4b084476dcb2e1aa501 | d8f1583fd225f99b1d344fd88a0578bf | Removes each user that is kicked from the set of present users. | public class ClientFrame2 extends AbstractClientFrame
private class KickSelectedAction extends AbstractAction{
@Override
public void actionPerformed(ActionEvent e)
{
if (!selectedUsers.isEmpty()) {
for (int i : selectedUsers) {
String currentUser = use... | 0 |
fade234ade04fbc946ac71d9733eeacf | 41d43d84b9980216d25e44e3dbccc8af | Handler for the mouse up event for the circle tool. This will stop the drawing of an oval
and save the contents from the drawing canvas to the saving canvas. | const eventData = e.detail;
const context = eventData.canvasContext.canvas.getContext('2d');
const config = freehandSculpter.getConfiguration();
if (config.active) {
const options = {
fill: null,
handleRadius: config.toolSizeCanvas
};
drawHandles(context, eventData, config.mouseLocation.... | 0 |
cc44fc96eec15681fc0c9f7dac9292e1 | 06017bae50f4caa8d2534e168f6ef3d2 | Add the locked buffer to the transaction.
The buffer must be locked, and it cannot be associated with any
transaction.
If the buffer does not yet have a buf log item associated with it,
then allocate one for it. Then add the buf item to the transaction. | {
struct ma *ma = buf_ma(buf);
M0_PRE(ma_is_locked(ma) && ma_invariant(ma) && buf_invariant(buf));
if (buf->b_writer.m_sm.sm_rc == 0)
buf->b_writer.m_sm.sm_rc = rc;
if (!b_tlink_is_in(buf)) {
if (m0_thread_self() == &ma->t_poller)
buf_complete(buf);
else
b_tlist_add_tail(&ma->t_done, buf);
}
} | 0 |
99e351261888a3ea6163c7e3b7299cbc | 118613d7bb3d476b1b97d933e0a9d53d | queryEmergencyGroupDto的中文名称:查询应急小组信息
queryEmergencyGroupDto的概要说明:查询单条详细信息
Written by : zy | @RequestMapping(value = "get", method = RequestMethod.GET)
public Result getEmergencyEvent(@RequestParam("id") Long id) {
return ResultUtil.buildSuccessResultWithData(emergencyEventService.getEmergencyEvent(id));
} | 0 |
c12bb88c73e00697d1a0ba2b32341fe0 | c76dc56084e187b0179b6661bdbf9352 | Function to perform the 2D transform (with MPI) | void Transform2D(const char* inputFN)
{
InputImage image(inputFN);
int numtasks;
int rank;
int imgHeight, imgWidth;
Complex *imgdata, *H;
int start_row;
int i,r,c; ... | 1 |
920e5805f07fdcee715e22d918074d44 | 39f48362fa4dc564a223d49dc7edf848 | 编辑配置表tasksParam中tasksParam_id为$tasksParamId的一条数据 | int state,int priority,int dayOfWeek,int weekOfYear){
ContentValues values = new ContentValues();
values.put("title",title);
values.put("content",content);
values.put("timeStamp",timeStamp);
values.put("icon",icon);
values.put("state",state);
... | 0 |
ab7f24fd0cad4a7dca8680693c1c3c78 | c2f193ae8091976aadd07db3b77089b4 | Get reaction kill total. | int kills = 0;
for (MarioEvent e : this.gameEvents) {
if (e.getEventType() == EventType.STOMP_KILL.getValue() || e.getEventType() == EventType.FIRE_KILL.getValue() ||
e.getEventType() == EventType.FALL_KILL.getValue() || e.getEventType() == EventType.SHELL_KILL.getValue()... | 1 |
1a27acfe104e59842951316828820f1e | e59a9c3ea65972c87171825aec9a3f00 | Calculate the integral of the spectral response function for each
detector. | e_true = Quantity(e_true)
if e_reco is None:
e_reco = self.data.axis("migra").edges * e_true
else:
e_reco = Quantity(e_reco)
migra_e_reco = e_reco / e_true
mrec_min = self.data.axis("migra").edges[0]
mrec_max = self.data.axis("migra").edges[-1]
... | 1 |
758353b4ce25d6e08b530022843f052f | 6043ecfdf4f685656dd0d0d6524d9dde | insert a value into an existing node | if key in self.data:
self.data[key][2] = value
node = self.data[key][0]
self.moveToTail(node)
else:
self.data[key] = [None, key, value]
node = Node(self.data[key])
self.data[key][0] = node
if self.length == self.capacity... | 1 |
6aae9c8cbe1e5f0c276ec6a77249a187 | 3b22e26b74f8f54c8140f3e466cf9819 | 获取所有成员变量,访问权限为PUBLIC | Class c = Person.class;
Field[] a = c.getDeclaredFields();
for (Field f : a) {
System.out.println(f.getName());
}
} | 0 |
5810e9a59291ccd282455d22d45336a0 | ef78bd207693e2632f780129b1ee1c1f | Return test accuracy for a particular class label | def accuracy(cls, test_labels):
N = len(test_labels)
total_correct = 100*(N - np.count_nonzero(cls - test_labels.T))/N
lab = np.unique(test_labels)
cls_correct = {}
for label in lab:
idx = np.where(test_labels == label)[0]
N_cls = len(idx)
cls_... | 1 |
d4514532554a701292974c0ed63c57da | 48a1b9de7157582bbbc481fd4a543a89 | Test that only ItemGroupData can be inserted | class TestItemGroupData(unittest.TestCase):
def test_two_same_invalid(self):
def do():
self.tested << ItemData("Field1", "ValueC")
self.assertRaises(ValueError, do) | 0 |
e38bdcfafa5a06b6e4b9193c2538032c | b3bcd69ad8d32dc206205fd48bb55ef9 | Tri par sélection | def tri_selection(tab):
for i in range(len(tab) - 1):
min = i
for j in range(i+1, len(tab) - 1):
if tab[j] > tab[min]:
min = j
tab[i], tab[min] = tab[min], tab[i]
return tab | 1 |
b6faa881870e675d3edafa00930bd55f | 56ace59fe6b2722eeb98e17b037a1478 | 确认学习随从技能 | {
CSrvBaseSkill *pNewLearnBase;
CSkill *pNewLearnSkill;
if( NULL != ( pNewLearnSkill = pPlayer->GetOwnSkill( m_wSkillLearnId ) ) )
{
pPlayer->AddSendErrorMsg( ERROR_CODE_LEARN_SKILL );
return false;
}
#ifdef _DEBUG_MICHAEL_OPEN_GUILDMASTER_SKILL_
if( GetType() == SKILL_TYPE_GUILDMASTER_SKILL ... | 0 |
17c3cf857ad757f82e1073bf7c7b32e2 | 0a4c4fb0a65e275a6cfffcc049f06e0f | List config resource names | class ConfigurationList(ListResource):
def __init__(self, version: Version):
super().__init__(version) | 0 |
91642bebc456a3b214c1dd8ce636899f | 982695249a8e2b86d1c7a0a36d6225d4 | 多点模糊查找函数, 变参, 输入如下格式的参数: x1, y1, color1, x2, y2, color2... | namespace DmNet.ImageRecognition
public class IR
public List<Point> FindAllMutiColor(int x1, int y1, int x2, int y2, string first_color, string offset_color, double sim = 0.9, int dir = 0) {
string result = win.Dmsoft.FindMultiColorEx(x1, y1, x2, y2, first_color, offset_color, sim, dir);
Lis... | 0 |
e50f0999defdcfbd3f4c5d8087cfd69d | a59930638e6722016126689dcc9e2a28 | 遍历,直到没有下一页 | await get_detail_urls(nightmare);
console.log('detailUrls: ', tmp_detail_urls);
const exist_next_page = await check_exist_next_page(nightmare);
if (exist_next_page) {
await goto_next_page(nightmare)
console.log('next page');
return true;
} else {
console.log('last pag... | 1 |
8a8d9f436da261ea9a28f0efc8d28de2 | 45f05cfd3afaee7560764e26566e9d9a | given m types of coins find the #combinations to make n | def make_change(coins, n, memory):
ncoins = len(coins)
if ncoins == 0:
if n != 0:
return 0
return 1
if (ncoins, n) not in memory:
max_coin = (n - n % coins[0]) / coins[0]
max_coin = int(max_coin)
memory[ncoins, n] = sum([make_change(coins[1:], n - coins[0]... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.