query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
a8486dd029688cb28d0903128da6610e | 8abe94ee5ed1845541e8e9197fcde08d | get random normlized vector in hemisphere | namespace RAYENGINE
glm::vec3 getCosineHemisphereSample() {
glm::vec2 r;
r.x = rand_f();
r.y = rand_f();
cr_float phi = r.x * 2.0 * glm::pi<cr_float>();
cr_float sinTheta = glm::sqrt(1 - r.y);
cr_float cosTheta = glm::sqrt(r.y);
return glm::vec3(glm::cos(phi) * si... | 1 |
fcf458e529e8fd40077fea337e294a6b | ce6effbd76dac827e30d9b110549b365 | Record request in database. | func recordRequest(w http.ResponseWriter, r *http.Request, a bool, resp string) {
stringpath := fmt.Sprintf("%#v",r.URL.Path)
rawquery := fmt.Sprintf("%#v",r.URL.RawQuery)
passwordstring := fmt.Sprintf("%#v",r.FormValue("password"))
c := appengine.NewContext(r)
var acceptedString string
if (a) {
acceptedString... | 1 |
e26d89e6a4b6c342d1798af0d339c109 | c32deaaf354051d5b50c5f76b13cb950 | Keep node running until resolved/rejected | function runResolverSafely(ctx, then) {
var called = false;
try {
then(function (value) {
if (called) {
return;
}
called = true;
runResolve(ctx, value);
}, function (error) {
if (called) {
return;
}
called = true;
runReject(ctx, error);
});... | 0 |
c1fc4506ed79da7aa18a9173594bcda5 | f17ca81ffe07c57b4a344d4d930ec98b | 첫 방문 행동 가치 MC 예측 | def first_visit_mc_prediction(state_action_values, returns, episode, visited_state_actions):
G = 0
for idx, ((state, action), reward) in enumerate(reversed(episode)):
G = DISCOUNT_RATE * G + reward
value_prediction_conditions = [
(state, action) not in visited_state_actions[:len(visi... | 1 |
17fbb4c460bbb8696ce3bcce817d3e7f | 75972372b104a895781b39de9809fcfd | 根据会话ID删除群信息以及群信息会话记录<BR> | String conversationId)
{
int result = -1;
if (StringUtil.isNullOrEmpty(sysId)
|| StringUtil.isNullOrEmpty(conversationId))
{
return result;
}
String where = new StringBuffer().append(GroupMessageColumns.USER_SYSID)
.appe... | 1 |
d3de515d6fe2b1652865a166b2b17d21 | 708d381fd4cd7018f4bc1503e5f8fa3e | ISR handler attached to the Runner to Host cpu queue | void rpcTransportISR(void) {
isr_stat = hlpuart1.Instance->ISR;
if (isr_stat & USART_ISR_ORE)
hlpuart1.Instance->ICR |= USART_ICR_ORECF;
if (isr_stat & USART_ISR_RXNE) {
isr_data = hlpuart1.Instance->RDR & 0xFF;
xQueueSendFromISR(rpc_q_uart_rx, (void* ) &isr_data, NULL);
}
if (isr_stat & USART_ISR_TC) {
if... | 1 |
149346e810e76351f6054979a2a0abb0 | 336201832573eb02dc6bd26dac036796 | Deletes the complete queue. | public class AmazonSqsTransport : ITransport, IInitializable, IDisposable
public void DeleteQueue()
{
AsyncHelpers.RunSync(() => _client.DeleteQueueAsync(_queueUrl));
} | 1 |
3020adea7b3c61e3d73dbd7c4a6cfc18 | 63fd42f0b93311ec6c4b9959516978b6 | 查询需要上传报告的课设信息 teacherName teacherNum courseDesignName/Num | public Map<String,Object> findUploadCourseDesignInfo(String courseDesignTeacherStudentID) throws SQLException; | 1 |
6ee031d5cb3159822c25bdad95a5b952 | fabd653d213678e34f00e041b362e587 | verification des collisions entre une balle donné et les bords du terrain | function verifierBords() {
if (direction == 0 && (CadreAlien.x + CadreAlien.TailleX) > (canvas.width - 5)) {
direction = 3;
}
else if (direction == 1 && CadreAlien.x < 5) {
direction = 2;
}
else if (direction == 2) {
direction = 0;
}
... | 0 |
e83ee63c5f85e2c462eaaf4b3ee2a2af | f5aec77e50571eb448b3de1c0283180c | @brief Set link force mode on a particular port. | {
uint32 regData;
uint16 *accessPtr;
rtl8370_port_ability_t ability;
if(id >=RTL8370_EXTNO)
return RT_ERR_PORT_ID;
os_memset(&ability, 0x00, sizeof(rtl8370_port_ability_t));
os_memcpy(&ability, portability, sizeof(rtl8370_port_ability_t));
accessPtr = (uint16*)&ability;
regDa... | 1 |
e449cc10d59a487192139ec25dd2afa5 | a484c75c0cb31c1e9ae977899fdf1a58 | 导航弹窗 | class Base{
showModalNav(title, content, successUrl) {
wx.showModal({
title: title,
content: content,
showCancel: false,
success: function (res) {
if (res.confirm) {
wx.navigateTo({
url: successUrl
})
}
}
});
} | 1 |
26cf2857df22e36eba61fff899f475a9 | d88230f188365d2154a78b96e0083683 | TagFieldMap 获取结构中指定 tag 类型的:tag 到 field 的映射 | t := Tag{
Name: field.Name,
}
if v, ok := field.Tag.Lookup(DefaultStructTag); ok {
t.RawTag = v
for i, v := range strings.Split(v, ",") {
if i == 0 {
t.Name = v
continue
}
if v == omitempty {
t.OmitEmpty = true
continue
}
}
}
return t
} | 0 |
eae796a487bb919b2f436b50f94f5781 | 32e954b8e0116dbab2535b240c807a1b | Returns the x-coordinate of the second control point. | namespace Mapdigit.Drawing.Geometry
public class CubicCurve : IShape
public int GetCtrlY2()
{
return (int) (Ctrly2 + .5);
} | 0 |
32a1fdb2c86aa967e1187b8dda6d5d0c | f1e8c380460bd2a150af902d5a17907f | Trigger when Set Blank Image and Mask clicked | {
base.SetDefaultValues();
ImageComponent.color = new Color(1, 1, 1, 0.012f);
MaskComponent.showMaskGraphic = true;
} | 0 |
856caaad4f334ac40ca4d674673478b2 | 64c804f088b6e005b18d205b7d15f84a | determine which type of report it is and decode it | class GLReportsEngine:
def getReportObject(self,reportId,fileNameReport):
return {
'2' : VoissReportDispatcher(fileNameReport) ,
'1' : VoissReportIsland(fileNameReport) ,
}[reportId] | 1 |
9c262826e2fb42794f5677bac974f915 | ecebb71d0926353ac51511d999e79e92 | Decodes the token according to the specified algorithm and key.
Raises an error if the the process fails.
Returns:
The decoded token | try:
kid = jwt.get_unverified_header(token)['kid']
if self.pub_keys and kid in self.pub_keys:
pub_key = self.pub_keys[kid]
try:
return jwt.decode(token, key=pub_key, algorithms=['RS256'], options=options, **kwargs)
excep... | 0 |
e395d93728b5081a1d31e2b8520653b5 | e8fae9c38ea90561f38cfbd17da852b8 | 查询某个物料单产品信息,根据bill_of_materials_id | {
DataTable dtmo_data = new DataTable();
try
{
string strSql = @" SELECT DISTINCT b.goods_id,c.name as name,b.prod_qty,b.next_wp_id,d.materiel_id AS mat_item,e.name AS mat_item_desc,b.sequence_id,b.ver
from jo_bill_mostly a
... | 0 |
7639db30e447995653909598552c42df | e16c18da0bdcf2f67d6a0cae48494dd1 | l. Vacía la lista que contiene los módulos de segundo. | function clearModules(){
$("#moduleFeed").empty();
} | 1 |
f6ce7dda2fa354f6c556253a398a3c64 | d7c1f1ef21da28a6be71ab8e5577d389 | Create the vertex data for a square to be drawn | float[] vertices = new float[] {
x, y,
x, y + height,
x + width, y + height,
x + width, y + height,
x + width, y,
x, y
};
FloatBuffer vertexData = ByteBuffer
.allocateDirect(vertices.length * OpenGlObject.BYTES_PER_FLOAT)
.order(ByteOrder.nativeOrder())
.asFloatBuffer();
v... | 1 |
a470cdf48413389f4c16cc6b6fa8ca8d | 31ad354f3ee4de34b6c8dd241b114f39 | 获取当前节点的领导者信息,然后应答给发送者 | public MetaLeaderResultDto getMetaLeader(); | 1 |
ebe8407c5c55fc2e923209c8e9d7e435 | 9ca4e4b42aa86107f19514cb5d1e54e9 | 设置视图不可见 | @SuppressLint("SimpleDateFormat")
public class GeneralUtil
public static void setViewInVisible(View... views) {
for (View view : views)
view.setVisibility(View.INVISIBLE);
} | 1 |
905f076d183a34c6a78ac68272da4bc1 | ebc0c250ad98c4f1a19663d74bb48e9f | remove useless spaces:
eg: "hello world" => "hello world"
"例 如" => "例如" | class Section(object):
def strip_useless_spaces(line: str) -> str:
return ' '.join(line.split()) | 1 |
8d644a4e76ad270d2b0b665eb3efa25c | 8e3b6118d29aa2291ad359147db3a0f6 | Determine if the given {@code collection} contains no element in the given {@code other}. | CollectionVerifier<C, E> doesNotContainAny(Collection<E> expected); | 1 |
ecf0b265bc84339fa507e4406708bd23 | e082fe37357b32c798c79c232ef9dd52 | DB用のインデックス名称を取得します。 | {
List<string> lstColumnName = this.diSource.Keys.ToList();
if (intIndex < 0 || intIndex >= lstColumnName.Count)
{
throw new IndexOutOfRangeException("指定されたインデックスは無効です。");
}
return lstColumnName[intIndex];
} | 0 |
c9791894afed4709684b028c41fa50f0 | b4c79f7f7d382e24ac3136b3ed26b360 | what happens when crystal add button clicked:
ensure that crystals added to GUI are given a name, and that this is different than all other loaded crystals | if (type[0] === 'b3js') {
if (type[1] === 'create') {
if (block.getFieldValue('NAME') !== '') {
if (valDex[type[2]].has(block.getFieldValue('NAME'))) {
chooseName(block, type);
}
else {
setVal(block, type);
}
}
}
else {
if (!workspace.getBlockById(block.getFieldValue('VAL'))) {... | 1 |
e17dbb2db4884d2ab2df486f32afd9ff | 066490f74ba7bf198fcba0b3258db178 | Exit a parse tree produced by InputFormParser#PatternBlankDot. | public class XQueryBaseListener implements XQueryListener
@Override public void exitDot(XQueryParser.DotContext ctx) { } | 0 |
97e7c2fc50dec455c560a3554a0f8ec1 | cc9190eb6668a518e15ca380b19a22f0 | {@inheritDoc IInk.getStroke} | int thick = getLineWidth();
float[] dash = getDash();
if ( dash != null && thick != 1 ) {
dash = (float[]) dash.clone();
for ( int i = 0; i < dash.length; i++ ) {
dash[ i ] *= thick;
}
}
return new BasicStroke( thick, cap, join,... | 1 |
eb308f4a84a4440246dce8efabed204a | b6d392de7ea545105e1d963e8bc3ff77 | at end of program - turn off all lights | void LightsOn::End() {
} | 0 |
aecedb6a32f747dbc76ffe3d1bf1a483 | e90c444331b9be1d1cf96417eafc5545 | 使用数组的元素来创建一个链表,length表示要添加到链表的个数 | int i;
List l,s,t;
l = (List) malloc(sizeof(Node));
if(l == NULL){
exit(-1);
}
t = l;
for(i = 0;i < length;i++){
s = (List) malloc(sizeof(Node));
if(s == NULL){
exit(-1);
}
s->data = num[i];
t->next = s;
t = s;
}
t->next = l;
return l;
} | 1 |
833b07c283e063796e5b94a1a33c53dc | e053c7dc8865b088f63ce1ccded7e995 | Симулирует заход человека в лифт | {
for (int i = 0; i < MAX; i++) {
Passenger& p = passenger[i];
if (p.waiting_time != -1) {
if (timer >= p.request_time) {
p.waiting_time++;
}
}
}
now_floor++;
timer++;
} | 0 |
f8642b045cd1f7c87b3fffe569e5136d | c8485dae288521a12bd799b752953a3a | Kill the connection with SignalR when the API manager is being destroyed. | {
if (hubConnection == null || myHub == null)
return null;
try
{
hubConnection.Stop(TimeSpan.FromSeconds(5));
hubConnection = null;
myHub = null;
return null;
}
catch (Exce... | 1 |
333ccfe00394c328a39d6dda74e0430d | 5321a765eb7d5a7963a62a8043dc37d1 | ##Wald-type test | if(is.null(dim(x)) || dim(x)[2] == 1 ) {x <- matrix(x)}
n <- dim(x)[1]
d <- dim(x)[2]
c_alpha <- -log(log( (1-alpha)^(-1/2)))
a <- sqrt(2*log(n/G))
b <- 2*log(n/G) + d/2 * log(log(n/G)) - log(2/3 * gamma(d/2))
D_n <- (b+c_alpha)/a
Reject <- FALSE
Wn <- ts(get_W(x,p,G,estim))
test_stat <- max(... | 0 |
0505483a3f299cc10c76bec244bc3d16 | 7d0c1fcd853f596fe25d8e4b6619ebf8 | converts to string. | std::string dns_type::to_string() const
{
return str_;
} | 1 |
7d19f4ecf0b12d1c5880858630f919ec | f3b652cf9e0f4ecae72f32f83e44530f | 设置X坐标轴的标签的值,List中可以放置String类型或者{@link XAxisLabel}
对象,其他类型按照"undefined"字符串处理 | public class XAxis extends Axis
public XAxis setLabels(List<String> labels) {
this.labels = new XAxisLabels(labels);
return this;
} | 1 |
a42e714805458f67a79dbb2da467d058 | 8bc36b6e7615f56f82236fc31ffb1108 | Stores a game session and game session inputs in the database. | Session hibernateSession = session.getSessionFactory().openSession();
hibernateSession.beginTransaction();
hibernateSession.saveOrUpdate(newGame);
for(Condition cond : conditions){
hibernateSession.saveOrUpdate(cond);
}
hibernateSession.getTransaction().commit();
hibernateSession.close();
newGame = n... | 1 |
581c9cfe8c7894f9517aef608fdad2ce | 227d85a8071c08a25af7db2a8f9fc279 | Allows to defer state update to honor a bulk add. | self._bulk_update = True
try:
yield
finally:
self._bulk_update = False
self._normalize() | 1 |
d4bf2f0ce1c5c311ce182e20ae950d29 | 0fce63699c4c7cf2d272c4cb411a4e23 | Returns an SQL statement to get the next value of the sequence. The query
will automatically increment the sequence. | namespace Summer.Batch.Data.Incrementer
public class Db2SequenceMaxValueIncrementer : AbstractSequenceMaxValueIncrementer
protected override string GetSequenceQuery()
{
return "values nextval for " + IncrementerName;
} | 1 |
cc209ec38000e2ace1b38581f55f9da0 | 633ead8bcd841bdec18583bc0402a0e4 | loop through the article list and handle each article. | reports = self.interpreter.process_article_new(article.content.content)
if len(reports) == 0:
return
for report in reports:
self.process_report(article, report) | 0 |
c2e4e5da2debaf3b5b57e61f6f2cd7dc | 29050c42f2aae9fbaafc3d70a65ec27f | @brief TIM DMA Delay Pulse half complete callback. | {
uint16_t hCntSmp, hDeltaDuty;
PWMC_R3_LM1_Handle_t * pHandle = (PWMC_R3_LM1_Handle_t *) pHdl;
TIM_TypeDef* TIMx = pHandle->pParams_str->TIMx;
TIMx->CCER &= 0xDFFFu;
if ( (uint16_t) (pHandle->Half_PWMPeriod - pHdl->hCntPhB) > pHandle->pParams_str->hTafter )
{
pHdl->hSector = SECTOR_4;
hCntSmp = pHa... | 0 |
1754bc191d1b90af18ef69b873c200aa | 023ec515e9e35e9043e0107c0ebf8693 | Provide the software install name. | namespace Microsoft.VisualStudio.Setup.Configuration
[return: MarshalAs(UnmanagedType.BStr)]
new string GetInstallationName(); | 1 |
f68ee087f54abd497b4d95f457cbec43 | 9c130531da68a4a04d42042db293c639 | Converts the given value object to a Image object. | {
if (value == null || value == DBNull.Value)
{
return null;
}
if (dbType != DbType.Binary)
{
throw new ConverterNotSupportedException(typeof(Image), dbType);
}
var bytes = value as byte[];
... | 1 |
4e396bee8f4b371868f0a4dd434bce56 | 1f1c5ca2363ac4329905357986b65fef | WIN32OLE_TYPE#visible #=> true or false
Returns true if the OLE class is public.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
puts tobj.visible # => true | def name?
end | 0 |
7cb1f147cec83f8e9938b4455b1408d7 | a4067423b05038f57fe97ab2836f3ce3 | Fetch notes or send notes if changes have been made | func updateNote() {
} | 0 |
076815d26e988c391c5d1c0be7481d92 | a48d394bfe46bd78d2635d7ce77ccc30 | Compute Stokes parameters from geometric parameters. | c = 1/nu
m = -theta/sig**2 + sqrt(theta**2/sig**4 + 2/(sig**2*nu))
g = theta/sig**2 + sqrt(theta**2/sig**4 + 2/(sig**2*nu))
return c, m, g | 0 |
37451cbc9764293137505f7a852dd959 | 29388c293efe181b166f4769419b4011 | The current incomplete order from the session for use in cart and during checkout | @current_order ||= begin
if has_order?
@current_order
else
order = Order.create(ip_address: request.ip)
session[:order_id] = order.id
order
end
end
end | 1 |
8890eb039c26a15b9c1fd32f2e093315 | 38e74aac75c3c829e4e2710444a5197f | 设置Dgv列可写,以单个列名称传入 | {
foreach (DevExpress.XtraGrid.Columns.GridColumn item in dd)
{
if (item.FieldName != "Selected")
{
item.OptionsColumn.ReadOnly = true;
}
}
} | 0 |
5874783901bb01f3a8440947c8580631 | 17a261f6ca5b122c16a23904806cac98 | Prints the items pre order. | {
if(root != NULL)
{
PrePrint(root->left);
std::cout << root->item << std::endl;
PrePrint(root->left);
}
} | 0 |
dea32581978ad7ffd6d0609685150ce8 | d2359ff8bae3e2ac14d7027780d7fad3 | This method is used to set the format(based on customer) in which data should
be read from socket. This is an abstract method which should be implemented
based on the customer for which the server is run | final XDataReader reader, final int formatVersion)
throws IOException {
return this;
} | 0 |
6810ed739026c7b5fec2cbd51cd807c9 | 9bee9b938fc67d0b2ef05e0a91e625c9 | Mark a given attribute file as having been loaded. | void fileLoaded(ino_t inode) {
pthread_mutex_lock(&mutex_1_fileLoaded);
for (int i = 0; i < 100; i++) {
if (inode == FileBeingLoaded[i]) {
FileBeingLoaded[i] = 0;
break;
}
}
pthread_mutex_unlock(&mutex_1_fileLoaded);
} | 0 |
d09200a54bea214a26d9bf2d782365e8 | 3055f63cea4fcae18c2a2304c811dbf4 | Returns the names of all templates this group inherits from. | public Collection getInheritedGroups(); | 0 |
af546a20b1296ec3436b1a406cfe2aad | aeb50eb2263abd5b7e007107a1be59b6 | Проверка погибло ли существо | class Cat:
def live_dead(self):
if self.fullness < 0:
cprint('{} умер(ла)...'.format(self.name), color='red')
return True
else:
return False | 1 |
3cede58784abab7978f4e0b7b1099e21 | 296d9c4edaa4a22e68c0bf11d55d4669 | calculate return type of a vector -> num arithmetic operation,
argument type is read from top of stack | public static int getReturn(int sort) {
return getOpcode(sort, ARETURN.value);
} | 0 |
9c3c88d3ce81301d51480b945ea5834a | 3a05e74e83fa8374ee132c1bbb952a8c | Returns $TEMP/rprblender/PID temp dir for current process. Creates it if needed | class pm_ProductInfo
public static function getPrivateTempDir() { } | 0 |
85249dc7c3bfb923cebf220f6f523290 | eb811d4e1ad5f605fd2700255650d290 | 在测试代码中skip | def test_skip_1():
pytest.skip('without a reason!') | 1 |
da17c545bdb2b7e2404d801b1ca37308 | e19aaef344ae047b40a4c3f3d563b704 | 深度优先遍历,这里和前序一样 | class Tree(object):
# 树结构
def dfs(self, root):
if not root:
return
print root.data
self.dfs(root.left)
self.dfs(root.right) | 1 |
c08159742ca7c935cd6ab84ed8e2abcd | 9bd34405900c7db996747ff428d157ad | Обработчик кнопки "Выбрать файл" из поиска текста | namespace EditorTextSearchWinForm
public partial class MainForm : Form, IMainForm
private void ButtonSelectFileSearchText_Click(object sender, EventArgs e)
{
_progressBarSearchText.Value = 0;
_labelProgressViewPercent.Text = "";
OpenFileDialog dlg = new OpenFileDialog();
... | 1 |
a3e48d987d4fa9df81fc9abd764555d9 | 61b510e8fa174f13226b6e998fd2746a | ##Function for calculating Gradepoints | within(data, {PPG <- round(PTS / GP, 2)
Dpct <- round(T / GP, 2)
Lpct <- round(L / GP, 2)
Wpct <- round(W / GP, 2)
GDPG <- round(GD / GP, 2)
GAPG <- round(GA / GP, 2)
... | 0 |
2bccec47069c86efd16bdf69f7b25820 | c5b03df6c54041563800aa45a967e2aa | tsce_tx_ppm_adjust_get | static void loc_cc13xx_txPowerGet(int8_t *pc_txPower, e_nsErr_t *p_err)
{
uint8_t c_txPower;
c_txPower = sf_rf_6lowpan_getTxPower();
*pc_txPower = c_txPower - CC13XX_TX_POWER_OFFSET;
*p_err = NETSTK_ERR_NONE;
} | 0 |
fb46c5e3c18d2fa5f6e6888376f1a42f | 964ea5741a74f17d11c4fcd90cbc7a4b | デスクトップ通知の表示時間のセット | public class HappyTurnSpriteContent:MonoBase
public void setNoticeOpenTime()
{
noticeOpenTime = activeTime.getDetailStartTime();
noticeCloseTime = activeTime.getDetailEndTime();
} | 1 |
09f5fe9fe1698cf7a5ed46527d35c19c | d21d76a6d2c7b906aca7bea21ca7d12d | Output: The reverse complement of Pattern | def ReverseComplement(Pattern):
return Reverse(Complement(Pattern)) | 1 |
0e1163b9b2d71a888236c591ef10f69d | 8a3bb0dde2229479be892300e787e611 | Queries the event register for the Standard Event Register group.
Register is read-only; bits not cleared when read. | {
uint16_t us_sec_cnt;
uint16_t us_dummy;
if (sb_component_enabled) {
atpl360_spi_data_t x_spi_data;
uint8_t *puc_buf;
puc_buf = spuc_reg_buffer;
*puc_buf++ = ATPL360_REG_CMD_RD;
*puc_buf++ = (uint8_t)(eAttribute >> 24);
*puc_buf++ = (uint8_t)(eAttribute >> 16);
*puc_buf++ = (uint8_t)(eAttribute >> 8);... | 1 |
09566a978596cb35de2f54fc3a31b3e1 | 5c3bfa0f9d8f92332215347419ae990a | onvif CCTV가 Content Provider에 존재하는지 체크 | var ret = false
if ("com.android.providers.media.documents" == uriAuthority) {
ret = true
}
return ret
} | 0 |
8bc3014e75111c205b7d40089a466d88 | cf9060aa190842e464de489618d85ab4 | @brief function CONCAT_SEPARATOR | {
int len1 = strlen(s1), len2 = strlen(s2);
if (len1 + len2 == 0) return create_empty_string();
if (len1 == 0) return s2;
int final_len = len1 == 0 ? len2 + 1 : len1 + len2 + 2;
string_t out = (string_t)malloc(sizeof(char) * final_len);
strcpy(out, s1);
out[len1] = separator;
strcpy(out ... | 1 |
ff833844799a33cdd4db639d9a5a304e | 539b537c710d613bae90ec9f8478dd7d | returns the creation date as a string with the format YYYYmmddHHiiss | char * date = malloc(sizeof(char) * 12);
sprintf(date, "%d:%d:%d", getPDYear(q->pd), getPDMonth(q->pd), getPDDay(q->pd));
return date;
} | 0 |
363d134c851d7488d8b32e7153fafd1d | 51a57a115e7ec228705092998da93ba8 | получения данных о том сколько пользователь тратил денег вчера | class UserWalletService
public function yesterday(int $uid, $wallet_type_id)
{
$user = User::find($uid);
$this->checkWallet($uid);
$wallet_type = WalletType::find($wallet_type_id);
$name = $wallet_type->slug;
$wallet = $user->getWallet($name);
$decimalPlaces = app(Wa... | 0 |
5b8a00855cbf481e0c5c123af0549749 | 1ea53963c87bc352f22b9033fbd6b3ef | Looks up the blob upload with the given ID under the specified repository and returns it
or None if none. | class RegistryDataInterface(object):
def get_repo_blob_by_digest(self, repository_ref, blob_digest, include_placements=False): | 1 |
18ac9402d4417bdd90924cc771e8054c | c748b9ead2fe2baa66e8eb6280dbc701 | Send data to the target Event Hub | {
synchronized (HTTPS_CONNECTION_LOCK)
{
String iotHubHostname = this.config.getIotHubHostname();
String deviceId = this.config.getDeviceId();
int readTimeoutMillis = this.config.getReadTimeoutMillis();
IotHubEventUri eventUri = new IotHubEventUri(iotH... | 1 |
8b1f5f93b7fe6c90b4efe2196a5f2751 | b8628eb04efc747031c1b8d89d9a4d8d | tang so luong sach khi cap nhat so luong sach nhan duoc | boolean statusExecute = false;
String sql = "UPDATE `sach` SET `soLuongConLai` = soLuongConLai+1 WHERE sach.MaSach = ?";
conn = DatabaseUtil.getConnect();
try {
PreparedStatement statement = conn.prepareStatement(sql);
statement.setInt(1, maSach);
if (statement.executeUpdate() > 0) {
statusExecute ... | 1 |
c41e346f8a14ba25e8260734b2a8c83d | 8b8a80997355039f43d2fd8f70520e05 | 拆分 gif 将每一帧处理成字符画 | def createFrame(gifInput,ls):
im = Image.open(gifInput)
try:
print("图片分割中... ...")
im.save('temp{:02d}.png'.format(im.tell()))
imm = Image.open('temp{:02d}.png'.format(im.tell()))
bg = Image.new("RGB", imm.size, (255,255,255))
bg.paste(imm,(0,0))
bg.save('picframe... | 0 |
3b5db9ccf668d848413567b3f320c48d | a22c59f0ed663d9aeab4a45952e0aca8 | Set ADC to contionusly convert the currently configured channels | void ADCConvert (void) {
LPC_ADC->ADCR &= ~( 7 << 24);
ADC_Done = 0;
LPC_ADC->ADCR |= ( 1 << 24) | (1 << 2);
} | 1 |
aab9358dba744bcd5132fb081a94631b | 7d03fe218e437340a7dcc92c4e000fad | Получить краткий адрес на английском | {
return content != null ?
urlResolver.GetUrl(content, "en") :
string.Empty;
} | 1 |
d9bfabca089cef4b0e97bc1f85c4ace1 | c573a68b3005e525e8642a7a020ba9a3 | This function generates a TypeError | def makeTypeError():
aString = "Hello"
newstring = aString+1 | 1 |
96e59f577c763decb7694e657eda8aca | e3f94af2e2f91ea0d1b950c0b9e2a248 | ★ メモからシステム用文字列を排除したものをメモとして返す | namespace JarvisCore
public class JCore
public String excludeSystemName(String textCommand)
{
textCommand = textCommand.Replace(systemName, "");
return textCommand.Trim();
} | 1 |
1a00bd3b8932c202aa80c692158c29d3 | fbfd22d177dd062f685786202d4521ed | Функция, опредлеяющая являются ли треугольник прямоугольным | def check_right(side_a, side_b, side_c):
if round(side_a * side_a, 2) + round(side_b * side_b, 2) == round(side_c * side_c, 2):
return True
return False | 1 |
00b7a981ec18fe2b3f54896773217bd6 | a5baa8c0d6351039253d5a81d1ba3981 | 此方法获取WRF在哪个主机上运行 | class AgentClient(object):
def getHostName(self):
with os.popen("hostname") as f:
self.result["hostname"] = f.read().split('\n')[0] | 1 |
6b15c6a86af87ab2b4d92c9dad48cf1d | 7d5a914dd78032c904d5bfca257aee59 | Creates empty nodes for all the trees | for(intptr_t i = 0; i < store->inner.len; i++) {
InnerNode * parent = (InnerNode*) tree_store_get_node(store, i + 1);
for(int j = 0; j < 8; j++) {
if(parent->ichild[j] != 0) continue;
Node * node = create_leaf_at(store, parent, j);
node->ifirst = parent->ifirst;
... | 1 |
f2349f73dc20a3538d8c8e707388cbba | f78a59ddfa0ac7d711976be0ccaf902a | 获取文章状态 | class SiteContentData extends BaseData
public function GetState($siteContentId){
$sql = "select state from " . self::tableName ." where sitecontentid = :sitecontentid";
$dataProperty = new DataProperty();
$dataProperty->AddField("sitecontentid", $siteContentId);
$dbOperator = DBOperator:... | 1 |
993747a719bfd6946c83a40b4a39e318 | 9db51bf310ed8997b873abb0d23c5eeb | Find friendly pawns in reach and return a list | public abstract class Ability
public List<Pawn> GetTargetsInRangeOf(Vector3 origin, float dist) {
List<Pawn> adjacent = new List<Pawn>();
foreach(Pawn p in instigator.GetWorld().VisiblePawns()) {
if (p != instigator) {
Vector3 toP = (origin - p.transform.position);
... | 0 |
8473a89846dd8dd987485b450b146309 | 35987a057b77eb812612f7a036bb1b02 | 通过ID,月份,年份获取销量信息 | double[][] productInfoByMonth(String product); | 0 |
16c6c7f8d4d9751e148d3596259fbbba | 2e61bb078a692b039896c535852b59eb | Lists all workloads in this cluster.
Currently supported workloads are deployments, replica sets and pods, and
are listed in that order. | def list(**kwargs):
cluster_call("secret_list", **kwargs) | 0 |
b95009812e8aceae8ce4f8304af05a4b | 6acc8661280d1f206cb8e8baa9d92f19 | This should return a number unique to an instance of the game, for reference by clients. | public abstract class BaseAI
int gameNumber()
{
return Client.INSTANCE.getGameNumber(connection);
} | 1 |
bcf6f681ee0bbd40f12722a9000fc0e8 | 56800372e0449d4ea260cd5a46239846 | UC状态改变回调函数 | VOID __gw_dev_status_changed_cb(IN CONST GW_STATUS_E status)
{
PR_DEBUG("GW TUYA-Cloud Status:%d", status);
if(GW_ACTIVED == status) {
OPERATE_RET op_ret = OPRT_OK;
}
} | 1 |
b32c4c136dd16f555fd6a8ed538a1e24 | 51dec6c6d5a5fcf545994e17ce0366b7 | Funcion que obtiene el label del J | public class CeC_Campos
public static string ObtenEtiqueta(string CampoNombre)
{
return ObtenEtiqueta(CampoNombre, "[" + CampoNombre + "]");
} | 0 |
7cc4b65d00f344fb50660c70b66156aa | 8eaf7c46c69f862f9c3405cc2a2e0174 | Word align the buffer pointer | t_addr hlfsSetPointer(struct hlFileStream *fs, t_offset position)
{
if (position < 0)
{
position = hlfSeek(fs->file, -position, e_fseek_end);
if (position == -1) return -1;
if (position >= fs->_buffer_pos ||
position < fs->_buffer_pos + fs->_buffer_count)
{
position = hlfSeek(fs->file, fs->_buffer_pos +... | 0 |
1e9501eb2430b918196cce3f776c9ddd | 429fdf40d1062fd40a6a15a5615ede2a | print forums | function forum_index()
{
global $enablesidecheck, $forum_skeleton, $forumlang, $user_lvl, $output, $logon_db, $corem_db,
$corem_db, $sql;
if ( $enablesidecheck )
$side = get_side();
$result = $sql["mgr"]->query("SELECT `authorname`, `id`, `name`, `time`, `forum` FROM `forum_posts` WHERE `id` IN (SELECT MA... | 1 |
5d186234286bfbf8a3490f7c428ad106 | 287fa1c729406e662b3090941a7dc9ab | 查找还有一小时开团的活动 | {
$map['shop_id'] = $shop_id;
$map['status'] = 1;
$time = date("Y-m-d H:i:s", time());
$activity = $this->find()->select('id,name,shop_id,images,type,meet_amount')
->where($map)
->andWhere(['<', 'start_time', $time])
->andWhere(['>', 'end_time', $t... | 0 |
a2407f87b4a375dbb95d6fffa14d755b | 4cd9a45ee825c382e5e372d9839398e8 | Builds a ring as part of a cylinder. | {
float segmentAngle = 360f/segments;
float currentAngle = 0;
var ring = new List<Vector3>(segments);
for (var i = 0; i < segments; i++)
{
ring.Add(PointOnCircle3YZ(radius, currentAngle));
currentAngle += segmentAngle;
... | 1 |
ce9ebe456e0a1c8b1477ae167b8b2c1e | e3481e91c72c86558a5e986439ab6d3b | Returns an array with the current gas pressure of the fluid particles. | class HGSO(Optimizer):
def pressure(self) -> np.ndarray:
return self._pressure | 1 |
9e4d8d93f91c4b4ccbb38f9f65394f9c | b1621fa543c722b560f5be84d63eceaa | 拿到当前称号链上所有称号 | local cfg = TitleCfg[tostring(id)]
if not cfg then return end
local list = self.TitleInfo[cfg.type]
if list then
local len = #list
for i=1,len do
if list[i].cfg.id == id then
return list[i]
end
end
end
iTrace.sLog("XGY", string.form... | 0 |
4fd53e776486a1ef43a4c44a07e0498e | b8ec11b9236a9af0c81024638efebb3b | single line status report | func computeMonitorStatusLine(state *synchronization.State) string {
status := "Status: "
if state.Session.Paused {
status += color.YellowString("[Paused]")
} else {
if len(state.Conflicts) > 0 {
status += color.RedString("[Conflicts] ")
}
if len(state.AlphaProblems) > 0 || len(state.BetaProblems) > 0 {
... | 1 |
d2af5fbc03f062f57a48c8b53e623a8e | a6bf5adf8e7462448fbb137ec035aa66 | Validate TinyMCE editor settings. | {
var isTinyMCE = tinyMCE != undefined ? tinyMCE.get(obj.id) : false;
console.log('isTinyMCE: ' + isTinyMCE);
if (obj.value == '' && !isTinyMCE)
{
r = 'false';
}
else if(isTinyMCE)
{
newDataValue = tinyMCE.get(obj.id).getContent();
console.log('validateValue(obj) - newDataValue: ' + newDa... | 1 |
e5cd81f311aebf1b9f2e5f6fc7b682da | c2ae605e9a5ad6afb111801c94b8ecb0 | Define individual elements of hte useragent.
Useragents should be a list of suspect useragents to evaluate.
Default output will be JSON Blob containing descriptive information.
Set output='score' to receive a threat score for each UA.
If you're calling this from your own application, be sure 'useragents' is a list.
If ... | def define_useragent(useragents, output='score'):
response_dict = {'results': {}}
allowlist = ('curl', 'mobileasset', 'microsoft ncsi')
blocklist = ('mozilla/4.0')
for agent in useragents:
pua = woothee.parse(agent)
open_count = len([x for x in list(agent) if x in ['(', '[']])
... | 1 |
49ef80af932b2c8ddaf13e21908b9a0d | d1b29b3f73de313b39603fc1fa5c6491 | Test stock removal. | public class ItemTest
@Test
public void removeStock() {
Item item1 = Item.builder()
.name("item1")
.price(10)
.stockQuantity(100)
.build();
item1.removeStock(30);
assertThat(item1.getStockQuantity()).isEqualTo(70);
} | 1 |
450a98466680fe6512ca0907f2573352 | 94502482293d13771d5db3602463b394 | 根据unionId获取手机号 | Business getByUnionId(String unionId); | 0 |
f19a327fe6110cf0d3d569465d90fbb6 | 96159cad7099921a04fe8248da60f91a | 珍藏阁炼卡 | aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10171001,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c10171001.cost)
e1:SetOperation(c10171001.operation)
c:RegisterEffect(e1)
local e2=Effec... | 0 |
53cfb65a48c135f6193d5a0374007742 | b65ba208d5549b0ef92602ce269fc847 | Allows interaction under circumstance that collider's object has an interactable script | {
Collider2D[] hitColliders2D = Physics2D.OverlapBoxAll(transform.position, new Vector2(1f, 1f), 0);
IInteractedHandler interactedHandler = null;
foreach (Collider2D collider in hitColliders2D)
{
interactedHandler = collider.GetComponent<IInteractedHandler>();
if (interactedHandler != null)
{
Star... | 1 |
90f62c8418fec92348036dfa5812073f | 2ca645fdbaac35c1bc17f8fdde0edfb7 | Ends your media session. Should be triggered after all ads and content have been completed | class MediaManager(Manager):
def media_end(self) -> Optional[int]:
if self.media_state:
return self.media_state.media_end | 0 |
8312a30e9e26122b223f14e5c19da274 | 69b4fc7e0c9b25d472388b775991b82d | Add the messages tab to the customer interface | class Training_Contact_Block_Adminhtml_Message extends Mage_Adminhtml_Block_Widget_Grid_Container
public function __construct()
{
$this->_blockGroup = "contact";
$this->_controller = "adminhtml_message";
$this->_headerText = $this->__("Contact");
parent::__construct();
$this-... | 0 |
6ebd1f1ae8f5f276c7e8ee89fc472890 | c8ba8bf111129e9bbc426c7803767ef0 | プロパティを取得する。なければ例外。 | if (p == null) {
init();
}
return (p != null ? p.getProperty(key, null) : null);
} | 0 |
a5be64cfd70bf8927eaea22012423b6f | 472f3a252f9b6a1eebead1ba7856b243 | Epoxy でリストのデータとして使えるように整形 (contributorの詳細データ、画像無し) | val result = ArrayList<ItemOfPeople>()
for (item in data) {
result.add(ItemOfPeople(item._data))
}
return result
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.