query_id
string
corpus_id
string
query
string
code
string
label
int64
f272b661e3c0a68053407cd396a96576
f809e791568453a2604b9c51ac02376a
Returns the pointer to the message data.
void * message_get_header(message_p m) { return m->data + sizeof(msg_hdr_t); }
1
809bcc5a54ce5cf6fe72cdd2fa4820f9
f562a75317b2892b51312e1f4da80bed
Diese Funktion muss implementiert werden. Hier wird das Verhalten der KI bezueglich ihrer Planeten spezifiziert.
public class Driver implements Menu private void addCelestialObject() { }
0
29d1a379c9b43dc2c97181140dd8aff3
263edd9f8e41fdd436ae4cc9cd77c7ea
clones a pair of slices, maintaining adjacency
void ADCL_CHANGE_SB_PAIR ( ADCL_request_t *req ) { int i, j; int nneigh = req->r_emethod->em_topo->t_nneigh; int ndims = req->r_emethod->em_topo->t_ndims; int offset; if ( nneigh == ndims ) { offset = 0; } else { offset = 2*nneigh; } PREPARE_COMMUNICATION(req); ...
0
a66d01874000bd6d09032cb65d74c858
3f9d7728e1fa0f94d4dff4e2ac485776
Set daily weekend period 6.
class HysenHeating(ClimateDevice): async def async_set_period6(self, hour = None, min = None, temp = None): await self._try_command( "Error in set_period6", self._hysen_device.set_period6, hour, min, temp)
1
ad36cd1e37e5c879e230fa6bf297ced9
d855ca13303303c1207c566719c7947c
Print is a utility function that unpacks statuses and prints one error per line.
for result := range results { log.Printf("%s:\n%s\n\n", result.Field, result.Content) } }
0
5ea57999e43084d24bed0339fe321d96
787cf8946d8a70e5a7799d4e2144f729
Method to hit cart details api after login response
const token = this.loginService.getToken(); const url = '/api/checkCart'; const body = new HttpParams() .set('token', token); this.http.post<Desserts[]>(url, body, { headers: { token: token } }).subscribe(res => { console.log(res); this.desserts = res; for (let a = 0; a...
1
1f8af963eb1cc0b2a0be4a418d1a2b38
4aef8cdcfce1c6b8ec2309b2dca8ad6b
比较两个数组从指定下标,到指定长度存在的重复子数组长度
int k = 0; int limit = arra.length - start; if (limit > arrb.length) { limit = arrb.length; } for (int i = 0; i < limit; i++) { if (arra[i + start] == arrb[i]) { k++; } else { break; } } ...
1
c9f9a01a4f63b1cd94ddd03a2bfac7ca
cf6ccb381853337eec6a286e406c2739
Return the port taking care of handling defaults for http and https if not explicit in the uri.
public final class URL implements Serializable public int getPort(int defaultPort) { return port <= 0 ? defaultPort : port; }
1
690598253a2f3ad76f242601aa49361c
dae57d1ba636f7c948c3d467ca4af829
Calculate a knot hash for a string
def knot_hash(string): salt = [17, 31, 73, 47, 23] lengths = [ord(char) for char in list(string)] + salt sparse_hash = calculate_sparse_hash(lengths) return calculate_dense_hash(sparse_hash)
1
74d7f15538c147fffaab4383f2d708eb
c5142158c94da1b38ae0c68bde1fb7ab
Calcule la vitesse à donner aux cibles selon le score atteint (fonctionnement par palier)
{ int score = monJoueur.score; if (score < 5000) { this.speed = 1; } else if (score < 10000) { this.speed = (float)1.3; } else if (score < 20000) { this.speed = (float)1.7; } else if (score < ...
1
f813605f2f7944a51406e4eb33aea5b7
df5b2504837c97d75554eaa0df1e9527
Decode the unsigned big-endian base64 url encoding of an elliptical curve point.
static CK_RV pk11_get_Decoded_ECPoint(PRArenaPool *arena, const SECItem *ecParams, const CK_ATTRIBUTE *ecPoint, SECItem *publicKeyValue) { SECItem encodedPublicValue; SECStatus rv; int keyLen; if (ecPoint->ulValueLen == 0) { return CKR_ATTRIBUTE_VALUE_INVALID; } keyLen = pk11_get_EC_PointLenI...
0
d8c2d826aaceadf7e66fe7e62c31e24a
8d1c4012b9e26518ffb545f419fcdac5
アドレス帳をCSVでダウンロードさせる
logger.info(f'[{current_user.login_id}] coupon/holders_csv_download') token_address = request.form.get('token_address') _holders = json.loads(get_holders(token_address).data) token_name = json.loads(get_token_name(token_address).data) f = io.StringIO() data_header = f"token_name," \ ...
1
f1d897c64edd1d7f4933c04fb1c1b573
52e21fb7b611ee83e2b083c47a0c3210
Create a new RelaxNG from the contents of +string+
class MujocoXML: def from_string(cls, contents: str): xml_root = et.XML(contents) xml = cls(xml_root) xml.load_includes() return xml
0
6d8eb661a13fbcacafe3535cc799b0db
019247992c5fb8f2860c6f96ba921d43
画笔沿当前方向前进step
def curvemove(step): for i in range(step): right(1) forward(1)
0
b09636c5b461f8a563c0ba60d047f77e
8e727feffa72422eade689c604d01d1d
Set the cookie name that will be used for the SSO cookie.
class CookieAuthenticationHandler implements AuthenticationHandler public function setTokenCookieName($tokenCookieName) { $this->tokenCookieName = $tokenCookieName; return $this; }
1
d3d3b18639eb1c64e36339cbec1ae8b2
4c0b1e2af468d86a510b8cdfe6b043cc
Gets the Relying Party's privacy document's version.
@Nullable String getDocumentVersion();
1
698826d25ab07e661564f0bdcbb85908
425076f55653b7ed34ce4b238dc7627c
十大股持股比例从高到低排序
List<SortInfo> sortInfos = new ArrayList<>(); for (StockPO stockPO : stockPOS) { Double score = 0.0; for (Map.Entry<PriceIndices, Double> entry : priceIndicesWeight.entrySet()) { score += getValue(stockPO, entry.getKey()) * entry.getValue(); } ...
1
495c79e257436cdea9a2d941a5bb9463
4cab9cf1cbcea392fd6cc932b49aff19
Moves the preview building
{ if (this.previewBuilding == null) return; this.previewBuilding.Effect.SetObstructArea(false); this.previewBuilding.Effect.SetDeployArea(false, false); this.previewBuilding.Effect.SetAttackRange(false); if (this.previewBuilding.BuildState == BuildState.PREVIEW) { ...
0
9e5120a6aa4609628a696b912245b2bf
0c99f96ffbce5ad7be44d074cc1cadae
Writes the computed hash value to the sepcified output.
{ byte[] bytes = BitConverter.GetBytes(this._hash); bytes.CopyTo(destination); bytesWritten = bytes.Length; return true; }
1
4910717e725e559d2911ab206450593a
fcaae4ae1767b4ae0ad182f5a77100b5
如果已经创建了一个驱动,就允许断开连接这个操作,如果没有驱动创建,就不进行任何操作
{ if (caphwnd != null) { isstart = false; return VideoAPI.SendMessage(caphwnd, VideoAPI.WM_CAP_DRIVER_DISCONNECT, 0, 0); } else return false; }
1
343eb9d407b8b62aaef0006348cdf5b7
b9aa5a254810e1310e9549109e6dc41d
判断蓄水期,返回不满足判断条件时段的id,即index
global $mysqli; $sql="select $this_bgtime_field from eco_system where Id='$Id' "; $result=$mysqli->query($sql); $nums=mysqli_num_rows($result); $arr=array(); if ($nums!=0){ while (($row = mysqli_fetch_array($result))!==false&&$row>0...
0
57081103149ef8fcc5e31a73b6731c6c
ca5805633e7bb0ad9bd6ee55bdf67989
check existence of cells in all 8 directions and if cell exists, add its position to neighbor positions list
std::vector<int> Maze::GetValidNeighborList(Cell* currCell) { std::vector<int> allValidNeighbor; if (currCell->GetNorthNeighbor() != -1) { if (ValidCell(cells.at(currCell->GetNorthNeighbor()))) allValidNeighbor.push_back(currCell->GetNorthNeighbor()); } if (currCell->GetSouthNeighbor() != -1) { if (ValidC...
0
b607afa46b271a560464feceb86e6575
86396f35aac96d4b373c3ff264141aa5
Do roles need to be updated?
public class UpToDateBuilder implements ContextAware{ public boolean isRolesOutOfDate() { return !getValidRoleEmls().equals(getEmlsToCheck(EmlType.ROLE)); }
1
227215aaf793177c1cb71e77664a5718
29713372fedd096ad95c151dc0042066
Return a new SpikeTrain obtained by slicing between t_start and t_stop, where t_start and t_stop may either be single values or sequences of start and stop times. Inputs: t_start - begining of the new SpikeTrain, in ms. t_stop - end of the new SpikeTrain, in ms.
if len(t0) == 2 or t0[2] is None: t0 = (t0[0], t0[1], 1) start0, stop0, step0 = t0 start1, stop1 = t1 if start0 < start1: n = int(numpy.ceil((start1 - start0) / step0)) start2 = start0 + n * step0 else: start2 = start0 max_stop = min(t0[1], t1[1]) if (max_stop...
0
89ef825e7edae7de8304d40fd33f6480
2b883f62421ad837fc8ce1e4ac57bb64
Get emergencyContactPhone1
public class SIPerson extends DBIOEntity public String getEmerWorkPhone() { return emer1Add.getWorkPhone(); }
0
b501ada84821789eba0590b1113b741e
9d7336e2165cd916d9496fefd7fb82f6
Check if it returns new instances.
$entity = $this->generator->fetch(); $this->assertEquals(true, $entity == $this->entity); $this->assertEquals(false, $entity === $this->entity); }
1
c1f414c6c3131e901740d1d587e87693
4eb54a678f1cc27613dcb35520df0eda
Erase, and then reconstruct the menu item list in order by stage.
{ foreach (ToolStripMenuItem item in _itemMap.Keys) item.Dispose(); _itemMap.Clear(); if (MRUList().Count > 0) _mruItem.Visible = false; _mruItem.Enabled = false; var offset = 1; var parentMenu = (ToolStripMenuItem)_mruItem.OwnerItem; var parentItems = pa...
1
b5f0bc6336cb55c33e3c0d3e99512d40
0d473850dda94ec38c55ef2d6ac70cbb
发起私信的用户(多对一)
class Message extends Model public function user(){ return $this->belongsTo(User::class); }
1
d559d53d2c44314c92eb2af324ec961c
9752856a3fb1ae59896952ac96737bd2
输出长度为8的小写字母加数字的字符串
y := "" rand.Seed(time.Now().UnixNano()) for i := 0; i < length; i++ { x := rand.Intn(8) y += strconv.FormatInt(int64(x), 10) } return y }
0
d239ae5e42d421f5823b0de800e3cbbf
7215940ede81f357aedafa40f13a7205
Checks if level is the last level of current biome.
public class DomainController public boolean isEndOfLevelReached() { return levelRepository.getLevel(levelRepository.getActiveLevel()).isEndReached(); }
0
7417ebb396ef1ae770c1a3dce3707eb1
a3afec88827fbf572d60c590d23e274f
看该服务器是否是第一次配置,如果是,就进行验证 加载类的时候,获取开发者AppId和AppSecret,获取access_token
@Component @Aspect @Slf4j public class ApiAdvice @Before(value = "execution(public * com.rfchina.wallet.server.api..*.*(String,..)) " + "&& args(accessToken,..) && @annotation" + "(tokenVerify)") public void verify(String accessToken, TokenVerify tokenVerify) { if (tokenVerify.verifyAppToken()) { ResponseValue<...
0
4b31c09c72d951e1107c7dcb5d7551bb
88668b02dd44b965b5d3051fdb1285f7
判断能否抽卡,并发送一定的自定义信息
{ try { $lucky_draw_times = Db::table('mp_user') ->where([['id', '=', $this->myinfo['id']]]) ->value('lucky_draw_times'); if (!$lucky_draw_times) { return ajax('您已经没有抽卡机会了', 49); } else { $cid = $this->get_ra...
1
6906f8f88ea06644fc316a6f18a4403c
085fbc758da0fc0c684f6794e89f603d
选择方差最大的那个维度
const Quat& lhs = *this; int imax = 0; double vmax = lhs[0]; for (int i = 1; i < 4; i++) if (data[i] > vmax) { vmax = lhs[i]; imax = i; } return imax; }
0
15fd58d4fe8ee36f3e7f28ac44d32031
98d0295798ca40fa1fd3f4d5b9a6cc4a
If {@code true}, native window behavior (like Aero glass, Aero Snap) will be used instead of a cross-platform imitation of it. Currently, this is only supported on Windows 10.
public interface IPlayer fun setNativeRender(b: Boolean = true){}
1
eccd4faea7278c2a6f23d12dbf097d78
3686f8fecaaf4cbbb8f0eb1b6d4b0c38
创建BO表的功能测试
STable table = new STable("t_5"); TableRowWithData datas = new TableRowWithData(table); datas.addField(new SField("name",table), "马云"); datas.addField(new SField("create_date_datetime",table), null); datas.addField(new SField("update_date_timestamp",table), null); datas.addField(new SField("pk_t_3_1",table)...
1
b40a1a2430b4efa7844235bf41404383
2f624ad8a979292a123ec6f601373052
Производит авторизацию при помощи API ключа.
class API: def authorize(self): auth = tweepy.AppAuthHandler(self.key.ck, self.key.sk) self.api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True, compression=True)
1
2be8163ab4482bb709bb86e54074dc0a
a7a20d051dc85216c28a2ab39bc05686
更新网吧PC信息
{ this.SyncUrl = "http://baselib.io.niuwan.cc/dev/getlist.api"; bool result = false; try { CPsEntity currentEntity = new B_DevBLL().GetLastSingleData(); WebClient client = new WebClient(); string responseData = Encod...
1
0a0eb8c96e9108cc7f40db13fff7bca7
bf7c5fa29b6de2dabf505f7e4e5e9370
Función auxiliar para algoritmo de Prim
int i; for (i = 0; i < maxV; ++i){ if ((matriz[target][i] != 0) && (d[i] > matriz[target][i])) { d[i] = matriz[target][i]; whoTo[i] = target; } } }
1
237b8156008c9ec5939e5f5f18b02209
c227cf18dd7e885228a4386a634ab5a4
Syntax: update datum_key datum_value [...] Updates the model using the datum and calculates weights for it.
class Diva::Model def merge(other) @value.update(other.to_h) validate self.class.store_datum(self) end
0
a4f194aaca0b9791b02a90d4b9b0025e
c8d18f03576c841a43c0f5a836f12d69
Returns the world y coordinate of the ground at the given worldPosition
{ FVector WorldLocation; FVector WorldDirection; APawn *Pawn = GetPawn(); if (nullptr == Pawn) { return FVector::ZeroVector; } else if (!DeprojectMousePositionToWorld(WorldLocation, WorldDirection)) { return Pawn->GetActorLocation(); } else { FVector Origin = Pawn->GetActorLocation(); float d = FVect...
0
e5d3c8c2568972549c5b6707ecc0937a
58d2d412cf2d979e545ccd4e5933cb22
Get most played track of today
Track most_played_track = tracks.get(0); for(Track track : tracks){ int play_count = track.get_play_count(); if(play_count > most_played_track.get_play_count()){ most_played_track = track; } } return most_played_track; }
1
a0853999c2af91cc55c64b7db1a5ebd4
859e3da39ac5f2fb08842545757d3024
PreviewMouseMove event handler.
namespace Bettery.Kiosk public partial class Exchange : Page protected override void OnPreviewMouseMove(MouseEventArgs e) { base.OnPreviewMouseMove(e); BaseController.ResetLastActiveTime(); }
1
29bbf5dbceeaefc01c120556ebcab9a3
342fd1c62a4a205268c0cb629d4a4ab9
SRL解析单个句子
{ if(sflag==0) { return; } else if(sflag==-1) { apply_rl(0); return; } else { apply_rl(1); return; } }
0
f1f5e77b4838c7f8da456fea3dd18266
56313bb5d7c68d77518c1efc6de02856
comprueba si el cliente está autenticado
class VistaclienteController extends Controller public function __construct(){ $this->middleware('auth'); }
1
7a73eefefe7670032c6d8acc050bafbd
d4f431267fd219572611a0f8c9c2b684
Событие после выполнения консольной команды
namespace Framework.Remote public class CxCommandController protected void DoAfterCommand(CxCommandData commandData) { }
1
345a8b35c2d8ebe31d8e2cfe2996ec23
970df175065d4b57a526798cbedf0c18
Check each trigger to see if it updated yet, and if it did, save new seconds-per-nation and move to the next trigger until the target has updated or the user has interrupted.
self.sleep(2) try: while True: if self.business_hours(): self.download_interval = int(self.pluginPrefs.get('downloadInterval', 900)) self.refresh_bike_data() self.process_triggers() self.sleep(self.do...
0
24288d1eeb60c5a51490f3696a3ac5af
4d019911b09e51b24bc468a258a05594
This method will be used to instruct the Can Collection Box to remove the drinks can shape or drink brand name from being displayed.
public class Vending_Machine public int takeCan(int takeCanAmount) { totalCans = totalCans - takeCanAmount; return totalCans; }
0
cea0a4e0500d1f9bbedbb44f62ea6577
5f3588de87e9a0276d2cef464d9c34be
画面に受信したメッセージを表示
function messageReceived (e) { meslog.innerHTML +="<br>"+"Message received"+e.data; }
1
bd504c37ce57c005c84556d10432c5c6
1f469ebd88ece7c8b24c84ad964349e6
Returns an ordered range of all the data collections where groupId = &#63; and status = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the...
@ProviderType public class DataCollectionPersistenceImpl extends BasePersistenceImpl<DataCollection> implements DataCollectionPersistence @Override public void removeByStatus_G(long groupId, int status) { for (DataCollection dataCollection : findByStatus_G(groupId, status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, ...
0
ae608a4a084f963a3e5697b8474f7475
fe78d5fe22622cdcfe22e8efc8751f0d
Return a list of defined subsets in the ontology.
Subset[] getSubsets();
1
1aa7220483bc073a4823cba090f0f885
5a93e382de0dfdeda116236fa6522e7e
Called when received a frame with mismatch codegen type metadata.
namespace EBPF void XDPEgressPipeline::emitCheckPacketMarkMetadata(CodeBuilder *builder) { (void)builder; }
0
4899954f93fafffef6ad4ea15d094141
b3c6d3a486b5786d1082874a9082914b
Write a program that computes the net amount of a bank account based a transaction log from console input. The transaction log format is shown as following: D 100 W 200 D means deposit while W means withdrawal. Suppose the following input is supplied to the program: D 300 D 300 W 200 D 100 Then, the output should be: 5...
namespace test7._8 class Program static void Main(string[] args) { Bank account = new Bank(); account.inMoney(new DateTime(2017, 05, 06), 2000); account.inMoney(new DateTime(2017, 05, 08), 3000); account.inMoney(new DateTime(2017, 06, 01), 5000); a...
0
7d3cc32a8ab47d4b78bfc498e5dfd7d0
9adcbda443570ddc723112d1da43bdf2
Implementation of a radial focal mean algorithm using itegral raster images. This implementaiton is advantagous to classical focal operators, as it is more efficient especially with large kernels. With radial filters, one probably has to sacrifice some efficiency, though.
img = np.array(img) for i in range(niter): img_pad = np.pad(img, 1, constant_values=np.nan) if (i+1) % factor==0: f = S_Med(Image.fromarray(img),EN=True, PIL_flag=False, radii=radii) else: f = Med_CV2(img.astype(np.uint8), radius) f_pad = np.pad(f, 1, con...
0
54cd37f8f599b089090dbf6990c56fa0
2502a5a33ca13fefda11ccc930cfb3a8
Cancel call forwarding Cancel call forwarding for the current agent.
static const char fname[] = "CC_CallFeature_cancelXfrerCnf"; CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), fname)); return cc_invokeFeature(call_handle, CC_FEATURE_CANCEL, CC_SDP_MAX_QOS_DIRECTIONS, NULL); }
1
45e52d4d64fda9328f35bc3f3e605977
a0362c278632733ded757bb08617dafc
Show the form for creating a new resource. METHOD GET
class HomeController extends Controller public function create(Request $request) { }
0
7807f737563d80acc3c8b00a73e4f313
306900ad457e56042474d1f8e2a7ef1c
@brief 擦除Flash
{ HAL_StatusTypeDef res = HAL_OK; uint32_t FirstSector = 0; uint32_t NbOfSectors = 0; uint32_t SECTORError = 0; static FLASH_EraseInitTypeDef EraseInitStruct; HAL_FLASH_Unlock(); FirstSector = GetSector(FLASH_USER_START_ADDR); NbOfSectors = GetSector(FLASH_USER_END_ADDR) - FirstSector + 1; EraseInitStruct.Type...
1
950c817466d3fc6c3c9b00089ab90d70
056bc8e716c725082c21a4edee26fa74
Method generates PKC10 CSR based on subject name and the key pair then it connects to remote server (CA or RA) to acquire signed cert based on the generated CSR
{ List<string> oids = new List<string>(); oids.Add("1.3.6.1.5.5.7.3.4"); oids.Add("1.3.6.1.4.1.6449.1.3.5.2"); return CreateCertificateSigningRequest(subjectName, keyLength, durationYears, oids); }
0
c766bc632f0ed4cdc03728353fcc784b
13c98ef6cbda12ebb27770e1a184ae01
S型加减速参数初始化,每次电机启动时调用更新
namespace ProDriver.Driver bool SetAxisSigmoidPara(int naxis, float lspeed, float maxspeed, float tacc, float tdec, int sacc, int sdec);
1
418029a0be395f9ee620a5a66b1458e6
54519da8677aa00299be9c62ee652cbe
用str2替换所有在str中出现的str1
void replace(char *str1,char *str2,char *str3) { if (NULL==str1||NULL==str2||NULL==str3) return; while(strstr(str1,str2)!=NULL) { replaceFirst(str1,str2,str3); } }
0
9b33c4fe19a5c76a2e8acb0a8632f84d
6556854a9c364b0c0584e79ea68c5aa4
ReadProgram accepts an input path on disk and reads the program into an int slice
f, err := os.Open(filename) if err != nil { return Program{}, err } defer f.Close() return ParseReader(f) }
0
f98739de05010bf959bb249724f0e2c8
82ae99589ff3185f5f607eceeea4cbc9
Run an incremental sync, slightly overlapping with the time frame of the previous sync.
namespace Aurea.CRM.Core.Session public class UPSyncManager : IServerSessionSyncHandlerDelegate, IUPSyncManager public void SetupNewIncrementalSyncTimer() { #if PORTING if (nextIncrementalSyncTimer) { InvalidateIncrementalSyncTimer(); } #endif ...
0
0a1ef92feeaa4dbe509b63156fe5c9f7
6a65f6fdfae8407ac9a0a8b339588b45
advance to the next triangle index and then make sure that we get to a valid triangle
const int VertexCount = SolidArrowVertexGenerator.VertexCount; int proposedEnd = this.triangleIndex + VertexCount; if(proposedEnd > this.lineIndex) { this.overflowed = true; return; } SolidArrowVertexGenerator.Generate( this.queuedVertices, this.triangleIndex, origi...
1
2575b2c7c4768adb9c090f68e38ae677
11730dd2b51997e03859159bc51b3aba
Handles GET request, adds the current file in the queue, starts the work.
namespace ViewMedia public partial class ViewMediaForm : MoviesFormBase private void Request_Click(object sender, EventArgs e) { AddItemToQueue(); }
0
f238ada3d55c1ff6448fa0af0c599e7a
08f84d41f0e4243bdc046d6ce07807bc
Given an input graph, determine whether it is homogenous
def check_same_type(graph,vertices): checkSum = 0; for i in vertices: checkSum = checkSum + graph.vp.CDstate[i] return checkSum == 0 or checkSum == vertices.size
1
68305ce6883be02e39c03943babba7e9
4df593ab1802269794e40ceb65d300d0
Performs a MySQL query from a raw query string and returns the result. Uses bound variables to protect against SQL injection.
class DB public function rawQuery($queryString) { $timer = new Timer(); $this->queryAmount++; $this->lastQueryString = $queryString; @ $result = mysql_query($queryString, $this->dbResource); $queryTime = $timer->getTime(); $this->lastQueryTime = $queryTime; $this->totalQueryTime += $queryTime; $this->qu...
0
84a220dbab4b6abdf978eef609f05d2d
1ca33aaa0014f4cb2d4f6cd71f282dd8
<br/>Description:添加 SSO Cookie maxAge为两周
Cookie cookie = new Cookie(COOKIE_NAME, "true"); cookie.setHttpOnly(true); cookie.setSecure(true); cookie.setPath("/"); cookie.setMaxAge(60 * 60 * 24 * 356); response.addCookie(cookie); request.setAttribute(ATTRIBUTE_NAME, true); }
0
31565d2f233ff448ff3f382bbc0fb974
102c313b43c3bbf9d16253e1b37c3134
расставляем орудийные расчёты в зависимости от типа корабля и его направления
function loadGuns(elem) { let player = (elem == yourShip) ? true : false; let arsenal = [ [], [], [], [] ]; let brigantine = player ? (ship == "Бригантина") : (shipOpp == "Бригантина"); let frigate = player ? (ship == "Фрегат") : (shipOpp == "Фрегат"); let galleon = player ? (ship == "Галеон") : (shipOpp == "Галео...
1
e3c12720f938688d874e4d7ea1db314f
8d13f6513ef077ffdc1762048a6c56e2
跳转到资源详情页面的后继逻辑
fun adJump(adInfo: AdInfo) { if (!adInfo.jumpUrl.isNullOrEmpty()) { var jumpUrl: String? = adInfo.jumpUrl if (!adInfo.resourceType.isNullOrEmpty()) { if (adInfo.resourceType == "GOODS") { if (AppUtils.isLogin()) { var uuid = SPU...
1
c6edfee5d3e2d2b92e11df0beb188d77
b054b5ef7dd3710e5d3096ea00edc6f3
Does nothing by default, overridden by `BaseBuilder` and `BaseCompiler`.
export class NodeMaterialBlock protected _customBuildStep(state: NodeMaterialBuildState, activeBlocks: NodeMaterialBlock[]): void { }
1
12102665627b926fce7670a68aa25fb7
b4171dc74d06a7f11f11400500dc7475
Updates barGraphItem data depending on plotItem viewRange.
_chartDataModel = chartModel; final ChartType chartType = _chartDataModel.getChartType(); if (isShowAllData && (chartType == ChartType.LINE || chartType == ChartType.LINE_WITH_BARS || chartType == ChartType.HISTORY)) { componentGraph.updateVisibleMinMaxValues(); } if (onResize()) { if (_...
0
0bccd634124e209b7398cb1905ced0ec
78f44367f1af63e93900d8abb3915081
清除登录重试次数
namespace IS.Sess public class session : System.Web.UI.Page public int clearLoginFail() { Context.Session["countFail"] = 0; return 0; }
1
24490cabf0ad03739141c7cd22c6fdb3
7f01c9f953a0566d77bf2fb410ae1d13
Function to check if the contact is member of one of the special groups
class RBlockFacetContact: def in_group(self, *args, **kwargs) -> Any: pass
1
5a9f36a77173342d4feee7b3e75c0ec0
cdf8f7fbbbdb2ade6af7d8891f0c50e6
打包
class PackageAction extends AppAction public function index(){ $id = $this->input('id','int'); $all = $this->com('redisHtml')->get('pack_detail_'.$id); if ( empty($all) ){ $all = $this->load('pack')->getAll($id); if($all){ $this->com('redisHtml')->set('pack_detail_'.$id, $all, 7200); } } if(!$all...
1
f9548dd4f22b39bce08f38a786ec1452
13c39f37e0277e9459c08e1db76e7fa8
Get the string with Variable and indices.
std::string QMNode::varStr() { std::string varString; char varName = 'a'; for(auto& var : value) { if(var == '1') { varString += varName; varString += " "; } else if(var == '0') { varString += varName; varString += "...
0
2b0d9fa650ad29297c5cde9c2df4e396
c5f6685a9e690453ae243f07b4ca0aa5
удаляет заявку на участие
{ using (var db = _context) { var participant = db.Participants.Where(item => item.ID == id); db.Participants.RemoveRange(participant); await db.SaveChangesAsync(); } }
1
36edb8298651083f2f4f20e83d7d0d5e
0a656f2b5f4914b36fe494ba61900280
LongAdder的执行测试
public class LongAdderDemo public void testAtomic() throws InterruptedException { ExecutorService exe = Executors.newFixedThreadPool(MAX_THREADS); long starttime = System.currentTimeMillis(); AtomicTask atomic = new AtomicTask(starttime); for (int i = 0; i < TASK_COUNT; i++) { ...
0
50e601d8a880787870d77df655346c5e
50d487b6c31ce390547ae877b0f86937
Returns a table of all the permutations of length R for string1
perm_list = [] if len(s) <= 1: return[s] else: for idx in range(len(s)): ch = s[idx] new_str = s[:idx] + s[1+idx:] partials_list = permutations(new_str) for item in partials_list: perm_list.append(ch + item) ...
0
773a960d27cde44f2bec904ab02a39d4
98a95bce4c5fdc56c8d2da3a79f2a4aa
添加一个controller的方法自定义参数解析器 这里设置了 用 gson 解析前端请求的json数据并绑定到方法参数
@EnableWebMvc @Configuration public class webConfig extends WebMvcConfigurerAdapter @Override public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { argumentResolvers.add(new RequestJsonHandlerMethodArgumentResolver()); }
1
bc090c2cec986eb05f946f479bc52758
1708b684be0ff8768619c0026dbcf3e4
基準スプレッド_3年 を設定する
public class Mst0001s02Entity extends PageBaseEntity public void setBasicSpread5Year(BigDecimal basicSpread5Year) { this.basicSpread5Year = basicSpread5Year; }
0
aa5748904191433a8676922d6d4608a4
25876f4c30aecb9cff4a469ec9f30c22
mstransform: Check that after spw separation WEIGHT/SIGMA is equivalent to the median of WEIGHT_SPECTRUM/SIGMA_SPECTRUM
class test_spectrum_transformations_mean(test_base): def test_spw_separation_mean_all(self): self.outvis = 'test_spw_separation_mean_all.ms' mstransform(vis=self.vis,outputvis=self.outvis, datacolumn='ALL',usewtspectrum=True, regridms=True, spw='0,1,2,3,4,5,6,7', ...
0
fd2df2bdb78e4dccd35fcb4016eb6150
e8a9ce723e1caf645641935f6f0fa553
@brief Compute the root mean-square-error between two images
namespace dip6 float MSELoss::computeLoss(const Tensor &computedOutput, const Tensor &desiredOutput, Tensor &computedOutputGradients) { computedOutputGradients.allocateLike(computedOutput); unsigned shiftX = (desiredOutput.getSize(1) - computedOutput.getSize(1))/2; unsigned shiftY = (desiredOutput.getSize(0...
0
9f5fe4eeea763ad04b6b4c7d145621df
b770156ed3a91b3751a42a294dacd902
Read the content of the template file 'name' and store the template strings and variables in the template specified. Return 0 on success, -1 on error.
{ XDAS_Int8 *FileBuffer = NULL ; XDAS_Int32 retVal ; FileBuffer = GetConfigFileContent(fname); if(FileBuffer) { retVal = ParseContent(FileBuffer,strlen((char *)FileBuffer)); return retVal ; } else { return -1; } }
0
9d89b83249f08660c71980d154ec1fee
a7ab3ccc0403298a4324245123b25d2f
Calcula y retorna la distancia del usuario a una sucursal
public class HotelInfo implements Serializable public Double getDistanceFromUser() { return distanceFromUser; }
0
d58a8f2202f17b406ddb81ea0237deee
27a20713e7ebbbf50ce2825d5e458bdb
should NOT be able to delete own community post comment reply for closed post if post creator
user = make_user() admin = make_user() moderator = make_user() community = make_community(admin) user.join_community_with_name(community_name=community.name) moderator.join_community_with_name(community_name=community.name) admin.add_moderator_with_username_to_com...
0
d860016b77126d06bedfbf02f10771eb
084cded57abf5ac777179cc65f847120
Calcula la distancia ortodrómica entre dos ubicaciones dadas sus latitudes y longitudes.
degrees_to_radians = math.pi / 180.0 phi1 = (90.0 - float(line1.latitud)) * degrees_to_radians phi2 = (90.0 - float(line2.latitud)) * degrees_to_radians theta1 = float(line1.longitud) * degrees_to_radians theta2 = float(line2.longitud) * degrees_to_radians cos = (math.sin(phi1) * math.sin(phi2) ...
1
37ce24001ca13319a3d2c95f51c29b1a
45143ffbc84ab1c8808a120a0c3bada5
加载一个远程样式文件
function loadStyle(url) { try { document.createStyleSheet(url); } catch (e) { var cssLink = document.createElement("link"); cssLink.rel = "stylesheet"; cssLink.type = "text/css"; cssLink.href = url; var head = document.getElementsByTagName("head")[0]; head.appendChild(cssLink); } }
1
6ae60502d151189609f21193f2ad746c
ce5b1ba56a428d884a1139bf3165e160
deals player an additional card
public class Dealer public void hitPlayer() { hand[CARDS_IN_HAND] = deck[CARDS_IN_HAND]; CARDS_IN_HAND ++; }
1
9fd13650566ac4b0c79e6b9c16516e59
8dd5a5e3d73510fc3dca6b3cae36f27a
Called by GDS to get the schema for the data returned by getData(). See https://developers.google.com/datastudio/connector/reference#getschema
default SchemaResult getSchema(CallContext context, FlightDescriptor descriptor) { FlightInfo info = getFlightInfo(context, descriptor); return new SchemaResult(info.getSchema()); }
1
15d04f270a657d2f0d5d7f98478d4915
106717ef505f48347d99fcf79107b1df
This method loads images from the Internet, and can be substituted for addFile when testing is finished and the application is deployed.
public class ExampleFitPolygon public static void loadImages() { images = new ArrayList<>(); for (int i = 0; i < 9; i++) { images.add(ConvertBufferedImage.convertFromPlanar( UtilImageIO.loadImage("jetson/src/test/resources/downscaled/testImage-" + i + ".jpg"), ...
0
e1d21699bdccaca5ca3fd6ec26bbbf62
8d82e37b465f7abab329d1ff11f16a91
Gets euclidean reconstructed 3D points (i.e. with actual scale) for current pair of views.
@SuppressWarnings("DuplicatedCode") public abstract class BasePairedViewsSparseReconstructor< C extends BasePairedViewsSparseReconstructorConfiguration<C>, R extends BasePairedViewsSparseReconstructor<C, R, L>, L extends BasePairedViewsSparseReconstructorListener<R>> public List<ReconstructedPoi...
1
a3ee9f9fb6660771ba5f10742f4b7bd6
6cb3fab1606eb7f69f1f08f2bb377bf3
Get type of price display from the tax config Returns 1 - without tax, 2 - with tax, 3 - both
{ if ($this->config->isAvaTaxEnabled($this->storeManager->getStore())) { return WeeeModelTax::DISPLAY_EXCL; } return $result; }
0
29ddfea60d1f089177e4bde651b4f187
f8e4eb441e247f7e186ba3f0ba5f74b5
Metodo para crear la descripcion del mensaje que se enviara a la auditoria
class ExpensaApi{ private static function GetDescripcion(){ $textoDescripcion = Diccionario::GetValue(self::TXT_LIQ_EXPENSA); return StrHelper::TxtPadRight($textoDescripcion) . self::$objLiquidacionGlobal->mes . "/" . self::$objLiquidacionGlobal->anio; }
1
dbd2232e5075372deb3ea224c983b5f8
b6254a43e9f0ad16eb7c244a853926e1
根据small_openid获取用户信息
namespace Clump.Host.WeChat public class MiniService public UserInfo LoginOpen(string open) { UserInfo user = null; if (!string.IsNullOrWhiteSpace(open)) { user = userBll.Single(" Open=@open ", new { Open = open }); } return user; ...
1
0de8ac14ac08642bcf9e0062d8bd822a
6d60a9586f35ecff626c605d88b817b9
Convert Simplified Chinese to Traditional Chinese
def SimplifiedToTraditional(line): line=Converter("zh-hant").convert(line) return line
1
44dcef57b5a303ffe15adccb18cdcb9a
24026a361983c0e1207f3d93aa53837e
#cohen's d formula (from Lakens 2013)
k1 <- ifelse(is.infinite(log10(site1)),0,log10(site1)) k2 <- ifelse(is.infinite(log10(site2)),0,log10(site2)) k3 <- ifelse(is.infinite(log10(site1 + site2)),0,log10(site1 + site2)) a <- sum((site1 + site2) * k3) b <- sum(site1*k1) c <- sum(site2*k2) d2 <- sum(site1) + sum(site2) d <- d2 * log10(d2) e...
0
efd3ad94a8fd2ee1618fd6cbd2264e11
f344c8214623413c4d51726dfb8826bd
If a patron enters the carpark before midnight on Friday and if they qualify for Night rate on a Saturday morning, then the program should charge the night rate instead of weekend rate.
{ float TotalAmount = 0.0; for (int i = 1; i <= TimeSpent; i++){ if (CarType NOTEQUAL 'S'){ if (i EQUAL 1){ if (CarType EQUAL 'C') TotalAmount += 0.20; else TotalAmount += 0.40; } if (i EQUAL 2){ if (CarType EQUAL 'C') TotalAmount += 0.20; else TotalAmount += 0.25; } ...
0
dfb77ab07b5489946054dc0ffae51423
6e19358a0d21a31236cd0ce596976934
caricamento delle statistiche delle attività svolte da uno specifico ragazzo
public List<PerformedActivity> loadPerformedActivitiesBySportsman(Sportsman sportsman);
1
abe5b2019dae713d5aff96504ed3e2de
b299d671378cbeb59b061ff3472eaa22
新增通用工具管理
{ string cardno = ""; string tooltypeno = ""; string tooltypename = ""; string toolmodel = null; string modelname = ""; int midNo = 0; int tooltype = 0; string prisonerno = ""; string prisonername = ""; ...
1
c83d40b221975b3a4aaac671b53ff295
31e0b147ac7a0f715942a1dad44830e3
Helper function to add an inset axes and disable navigation in it.
def add_axes_on_top(h_axes, r=0.25): axes_rect = h_axes.get_position() h_axes.set_position([axes_rect.x0, axes_rect.y0, axes_rect.width, axes_rect.height * (1-r)]) h_axes_top = h_axes.figure.add_axes([axes_rect.x0, axes_rect.y0+axes_rect.height*(1-r), axes_rect.width, axes_rect.height*r], sharex=h_axes) ...
0
35635fc0b80a8b2eeb4093b653546530
d0df55a033790fbebbd4960924c58454
バッチNo.(<code>BATCH_NO</code>)の情報取得を設定します。 複数のSQL関数を使用する場合は、以下のように記述します。<br> "SQRT(AVG({0}))"<br> {0} は、カラム名に置き換えられます。
public class ShippingPlanSearchKey extends AbstractSQLSearchKey public void setBatchNo(String arg, String compcode) throws ReadWriteException { setValue(_Prefix + ShippingPlan.BATCHNO.toString(), arg, compcode); }
0