query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
06ded9cf02e688511322c57fcb5dac53 | 12db0ba3a84f561543eb5984f64d7eef | FUNCTION
DESCRIPTION
This function check whether the certificate is valid or not
PARAMETERS
void
RETURNS
void | uint32_t verify_cert_chain(void)
{
uint32_t flags;
print_error_cycle(mbedtls_x509_crt_verify(&cert_chain,
&root_trust,
NULL,
NULL,
&flags,
... | 1 |
26a2514202602bda52119f66c6b3c202 | ed4e9093ad3e2e03b409c1de801052b3 | Convert temperature data to null-terminated string. | const unsigned char *data,
unsigned int len, char *DDSbuff) {
const unsigned char *x = data;
const unsigned char *end = data + len;
char temp[TEMP_BUFF_MAX_SIZE] = {0};
zprintf(f, "\"");
snprintf(temp, TEMP_BUFF_MAX_SIZE, "\"");
strncat(DDSbu... | 0 |
18395df81cda94f224adc1d091eed172 | 862270249aa95a949566666e0e5bc11a | Gets a list of records for teams in the league. | {
List<SpannableString> recsPerTeam = new List<SpannableString>();
foreach (int i in GetTeamList())
{
recsPerTeam.Add(GetRecordForTeam(i));
}
return recsPerTeam;
} | 1 |
879442d274f7511ce750c5b03ef1e6fc | c8f923fdc911422f1e2a1bac53f0c7a4 | 通过id删除所有选中的User信息 | interface UserService
fun delSelectedUser(ids: Array<String>) | 1 |
407dfdd5c9b93b5711f214cee0c5c425 | 22e4128f013b124ab77dc795e37ffa33 | 序列化 CPK 节点到流中。 | throws CacheIOException
{
try {
Integer cookie = output.getContext().getCookie(graph);
if (cookie != SerializationContext.InvalidCookie)
{
output.writeInt(cookie);
return;
}
cookie = output.getContext().remembe... | 1 |
406b5a9e808ce81203c118e20865aa53 | f367d757c4e1ef79b6dbdd37eff060f3 | !
Returns an interface to \QD's extension manager. | class Application implements ApplicationInterface
public function extensionManager()
{
return $this->extensionManager;
} | 1 |
af2c9eabc4c7534ee9a3ff06ec58ce6b | 75e0903f796a243b982b11d56e1e7378 | Returns only the ORFs longer than threshold | desc = record.description
seek = record.seq.tostring()
start_dict = {0:[], 1:[], 2:[]}
stop_dict = {0:[], 1:[], 2:[]}
start = re.compile(r'ATG')
stop = re.compile(r'T(?!GG)[AG][AG]')
def scanner(codon, seq, dic):
finds = re.finditer(codon, seq)
while 1:
try:
rec = finds.next()
dic[rec.start()%3].a... | 0 |
a6baeb22c7f324129215ba7a9e981999 | 2144b589a024194779abe2edc1a87a5e | Called before light rendering start
Override this if you are using custom light shader | namespace UnityEngine.Rendering.LWRP
public abstract class ScriptableRenderer
public virtual void SetupLights(ScriptableRenderContext context, ref RenderingData renderingData)
{
} | 1 |
b2abc37221be982aa39698032cacd09d | b290ddfb949165daa36ce3de554c2344 | Test the reponse to an unknown river direction | {
$this->user = $this->user->find($this->app_id);
$api = new \App\Services\Api('3RkTSJ', 'KjdTEANlw6YPxKIPORINgmMKzQBTJtDt', $this->user);
if($api->authenticate()){
$data = [
['c_direction' => 12, 'wind_direction' => 'P'],
['c_direc... | 0 |
e87011559780d3e8ac02b327661079ce | 142eae22b4ef8d23cfc133c532971417 | A visitor can see the front page. | {
$this->browse(function ($browser) {
$browser->visit('/')
-> assertSee('HAVANAO CALL CENTRE');
});
} | 1 |
d08015d242d0a54a0c591d5537d941e9 | 6b7d13ea15a08bc6b01388e0f069c9c0 | Calculates and displays the path of the projectile that will be fired with the line renderer component | public class RendererBallisticPath : MonoBehaviour
void Update ()
{
Vector3 vectorVelocity = transform.forward * initialVelocity;
lineRenderer.SetVertexCount ((int)(maxTime / fixedTimeStep));
Vector3 currentPosition = transform.position;
int index = 0;
for (float t = 0.0f; t < maxTime; t += fixedTimeStep) {
... | 1 |
14b75b7b789d9c3d3ccecea0f1ab8bb0 | e0fcbb9bb4f7de44538d1f7eb97d1cae | Change progress wheel state | button = sender
if self.spinning:
button.disable()
else:
button.enable()
return 1 | 0 |
ce0a70d7103bd78b72cb273d5ca822b4 | 14420cb93a7cbbbad444fb8aedfef63a | Get the Windows API window handle (HWND) previously set with
L{libvlc_media_player_set_hwnd}(). The handle will be returned even if LibVLC
is not currently outputting any video to it. | class MediaPlayer(object):
def get_hwnd(self):
return libvlc_media_player_get_hwnd(self) | 1 |
efa1f8ca4548ac5e07a11133f5fbcf7a | ed4ef40ea2c61e3f7483e973cf8d544a | 将int转为16进制的字节 | public class DigestUtils
public static String byteToHexString(byte ib) {
String r = null;
int val = ((int) ib) & 0xff;
if (val < 16){
r = ("0");
}else{
r = Integer.toHexString(val);
}
return r;
} | 0 |
7337ed0a260166de08a59e2762b759f4 | de032b1ae8a5e1eb4966f3762a1c48a7 | Connection to the SQLite DB with enabled FK support and custom methods. | class SQLiteConnector(DBConnector):
def __init__(self, credentials : SQLiteCredentials):
super().__init__(credentials) | 0 |
e5d6f3ce63b159d435863b0efc3cd487 | 30cdcf4759d8aae6c6022f0a15c7c023 | Color the seam in the image. | if (seam == null) throw new java.lang.IllegalArgumentException();
if (height <= 1) throw new java.lang.IllegalArgumentException();
if (this.Horizontal && this.isTransposed) {
transposeColorMatrix();
}
Color[][] newColorMatrix = new Color[width][height-1];
for(... | 0 |
8fe119207f3dab1b5148651f7c9c2c8c | 55bf7fad73955a9ec34a8bd3f1963520 | 添加角色id和角色名绑定关系 | public int addRoleAndFunctionRelation(Map<String, Integer> map); | 0 |
1937434516f036c4a4bfd4dd49512d5e | b804b86dad4a52ea4a96ca36217fb208 | Load data from a subscription preview node. | namespace ChargifyNET
public class RenewalPreview : ChargifyBase, IRenewalPreview, IComparable<RenewalPreview>
private void LoadFromNode(XmlNode renewalPreviewNode)
{
foreach (XmlNode dataNode in renewalPreviewNode.ChildNodes)
{
switch (dataNode.Name)
... | 1 |
1087dfa734c68f503bac2a177823f8a9 | 8de162d5be2c18a6ca2b60d28de3a135 | 배치 내 할당되지 않은 주문을 컷오프 시킨다. | with self.engine.connect() as con:
query = self.table.update() \
.where(self.table.columns.order_id.in_(orders)) \
.values(courier_id=None, assign_time=None,
assigned_type_coef=0)
con.execute(query) | 1 |
8c32bd1344e1d9477108c79b4c0804ba | ec8559463382981f542e07069def889d | Вывод думпа переменной | class Templates extends HelperAbstract
public function print_var($sVarName){
if(isset($this->ParsedBlocks[$sVarName])){
echo $this->ParsedBlocks[$sVarName];
}
} | 0 |
386d259ead6b38f9ddfe3f185569880d | d0b13e4d9f16e311d23a14155caea884 | convierte HH:MM a MM | function hhmmss2hhmm(&$t){
$t = substr($t, 0, -3);
} | 0 |
374554e101cc3bdbb4a49687c600133b | 7dc9d913081433b49dc9d5a5d568c00c | Used to query the Paystack REST API verify/ endpoint | public class NetworkDataSource
public LiveData<VerificationResponse> verifyTransaction(String reference) {
final MutableLiveData<VerificationResponse> mutableLiveData = new MutableLiveData<>();
mExecutors.networkIO().execute(() -> {
PaystackInterface mPaystackInterface = PaystackClient.getCl... | 1 |
2a03203d7f16e67776e9929b366e6229 | 0e5c8d6a367d3977a49d24c50a71fc9c | Vrati vhodnu triedu podla nazvu FK entity. | class EntityBuilder
public function getRefClass($tableName)
{
require_once $this->getEntityFile($tableName);
return new \ReflectionClass('\\' . ucfirst(strtolower($tableName)));
} | 1 |
3179c1487f9b37e0325b5ca8c474491d | 2d7308e36852be8ffe09b7aa4dcb1ec0 | Проверка равенства кораблей | {
if (Rows == B.Rows && Columns == B.Columns)
return true;
return false;
} | 0 |
bf3853a19ed7c6ff524ef21bc25056b7 | f0f361119350560453a708d19732e07c | 删除群组的具体应用 | class RoleController extends CommonController
public function setApp() {
$navTabId = "Role";
$callbackType = "closeCurrent";
$forwardUrl = U("Role/index");
$id = $_POST['groupAppId'];
$groupId = $_POST['groupId'];
$group = D('Role');
$group->delGroupApp($groupId);
$result = $gr... | 1 |
54e4fb50256a94b226e2c80713a3edb7 | c43aad09925cbdac5823f467dac1eb81 | Configure USCI_B0 for SPI operation | EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_SWRST;
EUSCI_B0->CTLW0 = EUSCI_B_CTLW0_CKPL
| EUSCI_B_CTLW0_MSB
| EUSCI_B_CTLW0_MST
| EUSCI_B_CTLW0_SYNC
| EUSCI_B_CTLW0_UCSSEL_2
| EUSCI_B_CTLW0_SWRST;
E... | 1 |
39020c60a187fb527fac3f08b7b07c57 | 3929b29f537eb1c0f679e1d03bc7365b | 通过权限主表Id获取对应的自权限数据集合 | @Component
public class AuthorityDataDetailCopyService extends ConfigDefineDaoService<AuthorityDataDetailCopy, AuthorityDataDetailCopyDao>
public List<AuthorityDataDetailCopy> getByAuthorityDataId(String authorityDataCopyId) {
return getDao().getByAuthorityDataId(authorityDataCopyId);
} | 1 |
0dcd3f33fbe2893b68cc897b34be49b7 | dbc6e14efe98b6526782d5a24a9a725d | 订单保存到中台 | class Order extends ApiController
public function save(Request $request)
{
$data = ['name' => 'api', 'url' => 'gms.com'];
return ['data' => $data, 'code' => 1, 'message' => 'save创建订单操作完成'];
} | 0 |
f7de9127a731f111becf23789c5b3e58 | fc2fcb55e5e3dae92ddaac0351dcc7d2 | Retrieves the client rectangle representing the requested interval | namespace GamenShot
public partial class CaptureForm : Form
private Rectangle GetClientRectangle(Point p1, Point p2)
{
(var cp1, var cp2) = this.GetRegion(p1, p2);
return new Rectangle(cp1.X, cp1.Y, this.GetLength(cp1.X, cp2.X), this.GetLength(cp1.Y, cp2.Y));
} | 1 |
aee5760be5ba8e0467d713b4a92f8668 | 3d927ddb3b6193d186702edc866015eb | wrong while statement: missing statement | input = """
procedure main () ;
begin
while (True) do ;
end
"""
expect = "Error on line 4 col 28: ;"
self.assertTrue(TestParser.test(input,expect,232)) | 1 |
379de0057bf8005d256f734a47d779d6 | 3c49e747af42224f6f3d4a5653c698dc | Returns a new object of class '<em>Controller Segment Element</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | TypeAssociationSiteEltCtrl createTypeAssociationSiteEltCtrl(); | 0 |
d023c727609cdbbaecc4ff8f79f6d408 | 94b06eb5dab5d52c4da9feb3a32eac2b | Get The ciphertext data to be decrypted. | public final class EncryptResult
public byte[] cipherText() {
return ImplUtils.clone(cipherText);
} | 1 |
2c3c820d7ebaf711f325c7d99d0a3b55 | 35f934030047bcac8f4555affc439365 | Get the global user id. Same as ``os.getuid()`` | func Getuid() int | 1 |
bf1ce393a415c4fef148f9836596318d | 826e30722a1f6415def115ca4c1a396a | 删除自动创建的默认线路加速,前提没有存在依赖与他的其他线路加速 | {
DataSet dsReturn = new DataSet();
List<string> sqlCommandList = new List<string>();
string sqlCommand = string.Empty;
try
{
if (!string.IsNullOrEmpty(routeKey))
{
sqlCommand = string.Format(@"DELETE... | 1 |
7eb3ecb8e1b0fc02e3524fc7892f03bd | 146c2d06006c59308330f765fc0aa8a6 | This method returns whether the menu is displayed or not | public class MenuItem
public boolean isShown() {
return _shown;
} | 1 |
aaef74ae051c1e3354521fb26a7f966c | bf3ff51e5c0da1fadb4e8e15218c96f4 | Interrupt Service Routine for TouchScreen | {
TS_State->TouchDetected = tsc2007_TS_DetectTouch();
if(TS_State->TouchDetected)
{
TS_State->x = (((A1 * tsc2007_MeasureXpos()) + B1)/1000);
TS_State->y = (((A2 * tsc2007_MeasureYpos()) + B2)/1000);
}
return TS_OK;
} | 0 |
a3718a101db69460b33945bcfe9c878d | 969feae37a0aaf350281cffb876eb262 | Write a context number into the BLR buffer. Check for possible overflow. | union { float fnum; uint32_t inum; } data = { num };
return l_buffer_append_uint32_t(buf, data.inum);
} | 0 |
96b19cf6242011fd9579848f7481ae83 | dd48672d863de88eb186a472b18a7050 | Register the parameters used to call ``setup`` at local machine.
This information will be sent to remote workers to re-setup the experiments.
This private method is for parallel processing. | class FederatedClient(fl.client.NumPyClient):
def get_parameters(self):
raise Exception("Not implemented (server-side parameter initialization)") | 0 |
0fd474416aea5ec5c006d777e20b7ba7 | adff49f8370525680d3e15689b59cc34 | Sorts the elements of an option in descending order. | var previousOption = findSelectedOption();
if (option.active) {
option.desc = !option.desc;
} else {
previousOption.desc = false;
previousOption.active = false;
option.active = true;
}
if (angular... | 0 |
03a6854da869604901f99ca3f2e65f7b | bbfcf550fc627be83051417f8fed5acb | This function is used to eliminate classes with examples less than threshold | X_trainvarth = np.empty_like(X_train)
X_trainvarth[:] = X_train
sel = VarianceThreshold(threshold=thresholdn)
X_trainvarth = sel.fit_transform(X_train)
idxs1 = sel.get_support(indices=True)
X_testvarth = np.empty_like(X_test[:,idxs1])
X_testvarth[:,:] = X_test[:,idxs1]
return X_trainvar... | 0 |
f24289450465ca4efebad3cb78c2caf0 | 21f6f7a077c2ac545df3b7f3432bb9d6 | The time at which the final video load request will be made (the final video may not finish loading until shortly after this time) | public class AnalyticsImpressionDetails extends BitmovinResponse
public void setVideoStartupTime(Long videoStartupTime) {
this.videoStartupTime = videoStartupTime;
} | 0 |
369a9552d1b7067fc2e70983b676e8d5 | 6d0e214c8d4214f43c0e4aa62129d493 | Given two nodes in a binary search tree, finds their lowest common ancestor | class Binary_Search_Tree(object):
def lowest_common_ancestor( self, node, value1, value2 ):
if node is None:
return
if node.value > max(value1, value2):
return self.lowest_common_ancestor(node.left, value1, value2)
elif node.value < min(value1, value2):
return... | 1 |
6263c357ece517a2d931356eb725a961 | fef44cefdd2c4bed347dbb1d21095874 | Retorna Dados dos produtos e serviços da NF-e | namespace Glass.Data.DAL
public sealed class ProdutosNfDAO : BaseDAO<ProdutosNf, ProdutosNfDAO>
public ProdutosNf[] GetByNfExtended(GDASession session, uint idNf)
{
string sql = @"
Select pn.*, p.CodInterno, p.Descricao as DescrProduto, p.IdGrupoProd, p.idSubgrupoProd,
... | 1 |
4ee43a2d762c0a6f0acb2b14a3063d6b | b020f0dbfdac48e2293f8e9c9552833f | Counts of days where wind is flowing westerly (W, WSW, WNW) which suggests that
the mid-latitude jet-stream is not propogating vertically over this cell. | public class State
public static Int32Vect2 stateGetHorizontalWindspeed_i() {
if (!Std.bit_is_set(state.wind_air_status, WINDSPEED_I))
stateCalcHorizontalWindspeed_i();
return state.h_windspeed_i;
} | 0 |
cd0913cc814925d5599bccd215667fc1 | 429d18859422ad48a12d3b9b84252157 | Returns the length of the longest location in the project.
Returns | max_deep = 0
for project in project_list:
if project.get_deep() > max_deep:
max_deep = project.get_deep()
return max_deep | 0 |
7d272cbb57cfae32fcdc4b49c5a02e8f | 8c7fa068e970f41d2c6d733f90e168e0 | function that will check and see if the process is meant to be ran in the background | class CommonUtils
fun isRunAtBackground(context: Context): Boolean {
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
val appProcesses = activityManager.runningAppProcesses
appProcesses
.filter { it.processName == context... | 1 |
040889c71908585264d3bad08f33896f | 6976ffcff648dbb4438c47433022a666 | Initialize the MP3 reader. | WiiAudioMp3::WiiAudioMp3()
{
myFilePointer = NULL;
myAudioBuffer = NULL;
MP3Player_Init();
MP3Player_Volume(127);
} | 1 |
c36aa1a14acfead0de70e145249184c2 | 4e62de889ab8716a4df5fb6ca7b64b35 | Adds a course prereq to a course objects's prereq attribute
and checks if the course has been added to prereq | class Majors:
def add_req_courses(self, course):
self.set_req_courses.add(course) | 0 |
5f1149f710989e1ecf88c0c00ac32a90 | 8fbb7293fe7f960a9aacc9475ce26656 | 拖拽消息列表结束 (鼠标按键松开或鼠标移出边界) | {
Lib.Listener.Instance.Event("Mouse_Drag_Pawn_End", this, eventData);
UserInputScript.GetCurUserInput().RemoveDragObject();
content.color = Color.white;
foreach (var child in content.GetComponentsInChildren<Image>())
{
child.color = Co... | 1 |
899f687865ca9555594221603a1a660d | 4fab65a9a5ff06ed22ace979c48a191e | Checks if the NPC has a quest | class BlobAccData extends \DrSlump\Protobuf\Message
public function hasQuestnpc(){
return $this->_has(15);
} | 1 |
2b60c1556d1042512d4b90a6f03ffe88 | 1358e57a0ce7e0bc9bcc28f51a95e09f | 缓存策略是否只允许 ALL | default boolean strictExpireMode(LocalCacheConfig config){
return config.strictExpireMode;
} | 0 |
2b9af02aa3eeb01ec260b12391773b18 | 5585d51b436d537ed53875240fa91da4 | Exists - This is called to verify a resource still exists. It is called prior to Read,
and lowers the burden of Read to be able to assume the resource exists. | namespace Kingdoms_Clash.NET.Interfaces.Resources
bool Exists(string id); | 1 |
2da79080492e83d16c85baa927de584d | ce8f55c4510d2d01c11fdf1cec0caafc | routine for assembling pdu with given length. The actual time is
written to the pdu | {
if (t->type != PADN)
return -1;
t->length = length;
char *body = (char *)calloc(length, 1);
t->tlv_body = body;
return length + 2;
} | 0 |
ad1857cdccb92e8fa9f409d5a099b71e | e1e4eafc02c2f77537bfe990483c9859 | Get group code by field. | class Fields extends \Common\Handler
public function getCodeField($sField)
{
$arFields=$this->loadFields();
foreach($arFields as $iIndex=>$arField)
{
if($arField['name']==$sField)
{
return $iIndex;
}
... | 0 |
f951bf7847b15fa39e69fc535241587c | 2e38461e5761520e55e907a047d23102 | fonction qui renvoie un pointeur sur la case mémoire correspondant
aux coordonnées fournies | static square* get_field(gamma_t *g, pair cooridnates) {
return &(g->board[cooridnates.fst][cooridnates.snd]);
} | 1 |
cb2cabc343a9994393cb7326da35364d | 5c765574d4b8875c6c575ba3ac96c3de | Tests if the game ends when one player reaches high score | game = BloomsGame(size=4, score_target=15)
board = game.getInitBoard()
board.captures[1] = 15
assert game.getGameEnded(board, player=-1) == -1.0 | 1 |
2b42fdc14ca1b7a5f3af7dd9e478c84e | d500180d4945a82d691599b88f6ea772 | Total number of segment across all lines. | class Page extends \Kaitai\Struct\Struct
public function lenSegments() { return $this->_m_lenSegments; } | 0 |
70688c2454650565662df34606c5890a | d87c2858253d6239a43e0cadd32c6d4d | 向下移动字段 | $db=core::db();
$data=$db->fetchArrayOnce('SELECT sort,formId FROM frmField WHERE id='.$_GET['id']);
if(!$data) core::error404();
$db->query('UPDATE frmField SET sort=sort-1 WHERE formId='.$data[1].' AND sort>'.$data[0]);
$db->query('DELETE FROM frmField WHERE id='.$_GET['id']);
core::redirect('?controller=... | 0 |
81c6381337440ef77410eb63b6e54496 | dde23bebf5d539e4b49461f994a99fbe | Ensure URL resolves with pretty format and trailing slash | from smoketest.lib import get_valid_url
test_url = get_valid_url(
"fooddive.com",
"/events/"
)
self.assertEquals(test_url, "http://fooddive.com/events/") | 1 |
77a88704408071766c9d29357048597b | 4cda5480a360ae6f18c4963e335b0b29 | The MIME media type for HTML. | public class SportletResponse implements PortletResponse
public String getContentType() {
return "html";
} | 1 |
be82b2a8de8fc66fab56b5102e809187 | dd92c0e90e412de9f7ea861c1a015470 | An init function that is used to create and update the game board object. | class PyGameController(Controller):
def __init__(self):
Controller.__init__(self)
self._game_board_view = None | 0 |
fd68b2c9fab8b17c6cc412862f91a976 | 5912c283926671fba5f89b12f429722f | Noop - here for backwards compatibility | func NoopUnmarshal([]byte) {} | 1 |
d8b41f7d4236e9d2912226977b2c4dd8 | d2f868774b7f06c00d942d07d86d8993 | Initialize a list of booleans, one for each node, determining whether
the node is wearing a mask or not. | class KwikModel(object):
def all_features_masks(self):
return self._features_masks | 0 |
b8be1920efb282910cdeb5fdee000f68 | e3bc64ea5df2e9060089a8206c85c54a | Number of items on last page | public class ItemsDto
public long getLast() {
return getTotalPages();
} | 0 |
477f8c8f9978f804dad3cb9cbf8c195a | f5dbab4ed5b2417b7a2c26bb7d9dbecb | 根据颜色编号查询尺码; | Optional<Socks> findByColorAndCottonPart(String color, Integer cottonPart); | 0 |
bf4c2e11c2002432d78f7359f0a6e1f3 | d3bcbb1ae641847e8a8aa1d3f4a0dd74 | Tracks the (ajax) add-to-cart event. | const variant = evt.variant;
if (variant) {
if (variant.available) {
$(selectors.addToCart, this.$container).prop('disabled', false);
$(selectors.addToCartText, this.$container).html(theme.strings.addToCart);
} else {
$(selectors.addToCart, this.$container).prop('disabled', t... | 0 |
0aa6836be89610f36ea823e38afabab6 | c1ba6fa8ee5a59af2746f2b80081e3e0 | 获取昨天的壁纸 | namespace Azylee.YeahWeb.ExtWebAPI.BingWebAPI.WallpaperUtils
public static class WallpaperTool
public static WallpaperModel GetYesterday()
{
return GetSomeday(1);
} | 1 |
0f989771c436af1b7c49333cf08ba651 | 0421b18e865a6d8f5027e5f52bf31427 | Редактирование поля "Модуль" | class ModuleController extends Controller
public function update(Request $request, Territory $territory, Module $module)
{
if ($territory->admin_id === Auth::id()) {
$moduleNew = $request->module;
$moduleRules = [
'name' => 'required|string|max:80',
'c... | 1 |
57ee2034e157e99586c9939925aac149 | d173f2ea8b37262a0d46cc6abba25410 | Generates workout reference sheet | $result = array();
$params = array(
"userid" => LoginControl::get("userid")
);
$where = "";
if (isset($data["startdate"]) && $data["startdate"]) {
$d = DateTime::createFromFormat("Y-m-d",$data["startdate"]);
if (... | 1 |
fd1ba663988a25aaabdea919c5416941 | a68bc05ee65231df40daa86e51d74aab | Get the logged in user id from the Security Token Storage. | class UsersController
private function getUserId()
{
return (int)$this->securityContext->getToken()->getUser()->getId();
} | 1 |
d8b5bf9254bb24f411e3ab64dac432c7 | 9caeb33b3caa384611e9cfdbbca8dfc2 | 根据企业ID,业务类型名称查询 | WnkCommodityTypes selectByNameAndBusinessId(String type_name,Integer business_id); | 1 |
e1563a64d4fc4e433db0ab9a7f83771c | 3b40ace23d43ad58d182b476416bcd8c | Finds if the number is prime and returns the number
if the number is not prime, it returns the first factor where test of primes failed | func primeX(number int) int {
if number == 1 {
return 2
} else if number == 2 {
return 3
}
var prime int
check := 5
number -= 2
for number != 0 {
if getPrime(check) == true {
prime = check
number--
}
check++
}
return prime
} | 0 |
34d85e69a6d78fc0277f9e74ee063ec2 | 608eb4073e4656952b3f4961b91dcbfe | Trigger a close event on the next event loop run. | namespace AngleSharp.Dom.Events
[DomName("close")]
void Close(); | 0 |
1c96da719eade617d1548df804836405 | 9f53e2db08bf926595b57be453d7701c | 使其按时间戳从小到大排序 | public class OrderTimeBean
public List<String> sortTime() {
List<String> keyset = new ArrayList<>(orderDatas.keySet());
Collections.sort(keyset, new Comparator() {
@Override
public int compare(Object lhs, Object rhs) {
if (parseData(lhs.toString()) > parseData(rhs... | 1 |
5a24686d56c0774f820fa93c89a5aa8e | dd0ab09a88f9ce5985beb6baffb266df | 输入用户ID,验证是否是管理员 | public class PromoteUserAction extends ActionSupport
public void isAdmin() throws Exception {
ServletActionContext.getResponse().setContentType(
"text/html;charset=utf-8");
PrintWriter writer = ServletActionContext.getResponse().getWriter();
if (adminService.getAdminById(uid) != null) {
writer.write("succe... | 1 |
9b4822c223a8409cf77d3b2c441e570f | 9b28232b4590ac5d71c794fecf9f4254 | Create a key having the given name | Optional<KeyDefinition> createKey(String name, CreateKeyParameters createKeyParameters); | 1 |
d070b09d72fa99c01f2031e90a8b9894 | ba42810d641ecee17376472158ddc62f | 添加一个数据库 | public async Task<IActionResult> AddDatabas(string path, string dbName)
{
if (!HttpContext.IsAdmin()) return Ok(new RecoverModel(RecoverEnum.未授权, "该用户无权利"));
DatabaseAddressOperation databaseAddressOperation = new DatabaseAddressOperation();
var address = new Database... | 1 |
08adcc2c1a6644e541edeba00c008257 | f44612622560b685aeb450f3f53b4653 | Call handler for both trigger and non-trigger functions | function hook_trigger ($hookname)
{
global $hook;
if (isset ($hook[$hookname])) {
foreach ($hook[$hookname] as $func)
{
call_user_func ($func);
}
}
} | 0 |
2ff9b8e77c3abf94aa06e7b1de8543fa | bff567059d9bcbf707b0c69ef877524f | Valida que la cédula introducida tenga un formato válido.
Este método se ejecuta cada vez que se abandona el campo "cedula" del
registro de usuarios. | {
$numero = (string)$numero;
$this->setError('');
try {
$this->validarInicial($numero, '10');
$this->validarCodigoProvincia(substr($numero, 0, 2));
$this->validarTercerDigito($numero[2], 'cedula');
$this->algoritmoModulo10(substr($numero, 0, 9)... | 1 |
5a738ca8ff2ea9d35dae397c82107909 | a278f3c69a0d5272ea4e03000504b7a3 | Xóa trong trường hợp các danh mục cha bị xóa , thì danh mục con của nó cũng sẽ bị xóa | class CategoryRepository extends EntityRepository
public function delCats($catlist){
foreach($catlist as $item){
if ($item->getSelected() == true){
$parent = false;
foreach($catlist as $aim){
if ($aim->getParent() == $item->getId()){
... | 0 |
930c7a607b4af809153cff560d90d0e5 | 1e6fc848bc6f045b4048f15db7ec1322 | Function iterates over record generator from PyTuples and efficiently digests record and generates tuple of tuples with record id and hash values. | def gen_from_fasta(file, preprocess_funcs=None):
def gen():
f = open(file, 'r')
for record in SeqIO.parse(f, 'fasta'):
x = record.seq._data
if preprocess_funcs and isinstance(preprocess_funcs, list):
for func in preprocess_funcs:
x = func(x)
... | 0 |
d2dd74ac05a635b58a4374dcb203275a | 0f6d2e0d299ef402ef2ce5ef19a20f58 | Fill the user input buffer with zeroes and set it's index to zero. | class SerialProxy:
def reset_input_buffer(self) -> None: | 0 |
c9dc9c76ead6a4de8b9ffa01be41080f | eb9a49cc180f127cb843106d93812edd | Levinson Durbin Recursion | double darb[][LMAX+1])
{
int ip, jp, kp, i, ii, j, lleft, mflag, iend, idif;
double a, oneovk, dif, difprv, step, stepi;
ip = *iptr;
jp = *jptr;
kp = *kptr;
arb[1] = tau[1];
arb[abs(kp)+1] = tau[ntau];
if(kp < 0)
{
kp = -1*kp;
for (i = 2; i <= kp; i++)
{
a ... | 0 |
0f1c3b8621fdc52f11ee839c0f225ea6 | 155d922ac20c7195886e1fd2ce187973 | Called when global bool changes, updates objects if it was the gamePaused state bool | public class Map : MonoBehaviour
public void SetGamePaused(bool gamePaused) {
this.gamePaused = gamePaused;
} | 0 |
8178ce1ccd61c0924c34542c26e60865 | bf12bca9847514a8f2c4de5c4234f90e | Function creates an identical copyy of the current expenses list and returns it | public class Expenses
public Expenses clearExpenses() {
return new Expenses();
} | 0 |
4b51b7c8c6a3e6167ea4310771fd4698 | fc4f0e9eac28446253fd7a96e8c40cae | Inside a method body, we found a reference to another type (e.g. ldtoken, or a member access.)
If the type is a generic instance, record any bindings between its formals and the referencer's
formals. | self, typ: TypeInfo, obj: GenericAccessibleObject
) -> None:
if isinstance(obj, GenericCallableAccessibleObject):
self.__callables.add(obj)
self.__modifiers[typ].add(obj) | 0 |
3a1a00b92f7ca08796719cbd3a91e86d | acd7b3372bc37bcd732071deb37d21b5 | This places each of the child algorithm histories into the
HistoryView object. The parent is retained as a marker so we can
"roll" the history back up if we want. This method does nothing if
the history object has no children | class History(NullView):
def __init__(self, *args, **kwargs):
super(History, self).__init__(*args, **kwargs) | 0 |
bfb44e95c25bcda8fbfdc6556681c384 | ee0e6ab583807d3c5161909c66a48c4d | 渐变圆 | float startDegree, float toDegree, float borderWidth, Color32 borderColor, float gap,
float smoothness, int gradientType = 0, bool isYAxis = false)
{
if (radius == 0) return;
var isCircle = Mathf.Abs(toDegree - startDegree) >= 360;
if (gap > 0 && isCir... | 1 |
58a5d809dd60113a1547f28e9b4d4808 | 133c2f3e9955597d0994cbbd53aac67d | Exit函数根据参数code的值来让当前程序立即停止,0代表成功停止,非0代码错误停止。
此停止会让defer延迟函数得不到执行。 | if(fatal_fn){
fatal_fn(errcode);
exit(errcode);
}
else if(errcode == EVENT_ERR_ABORT_)
abort();
else exit(errcode);
} | 1 |
d5a623624863438307d1cba72ed0704e | 156b7c60f2ca67097d656b03e31afc11 | Sets starting and ending node. | public class PetriNet
public boolean setStartAndEnd() {
startExists.set(false);
endExists.set(false);
startMoreThanOne.set(false);
endMoreThanOne.set(false);
startNode = null;
endNode = null;
for (Place p : places.values()) {
if (p.pre.isEmpty()) {
if (this.startNode == null) {
startNode = p;
... | 1 |
e0d9f588bab461464afd63c302f5db94 | d095857968783060e91e9cff979a705d | Sets Huffman codes of an array of symbols and returns the root of a huffman tree | def make_tree_code (list_symbols, lengths):
tree_code = []
list_symbols = sorted(list_symbols)
root = create_tree_root()
for x in lengths:
node = root.search(x)
tree_code.append(node.value)
node.close_node()
return {key: value for key, value in zip(list_symbols, tree_code)}, root | 1 |
b66a08e1551d3b860c385ed58efdaa68 | 38a6dca9a391c3d45f05c5a3ec88d1a6 | <summary>
Get preview mismatch count.
</summary>
<returns>preview mismatch count.</returns> | @NativeType("struct DriverDirectMode_FrameTiming")
public class DriverDirectModeFrameTiming extends Struct<DriverDirectModeFrameTiming>
public static int nm_nNumMisPresented(long struct) { return UNSAFE.getInt(null, struct + DriverDirectModeFrameTiming.M_NNUMMISPRESENTED); } | 1 |
d7929c974d663e894bc237734a6ba912 | bb4e67ed7dbf36948906a86aba6628c1 | Gets the wire on the loft at a given eta | permeability):
num = 2*np.cos(phi_eta)
den = permittivity*abs_eta + permeability/abs_eta
return num/den | 0 |
b76c11d9417846febca78adbe658d434 | a9f010972963255da198112c4629eab9 | This method is not normally needed, but in the event that a special ValidationObject is needed,
wrap the business object with a new object, containing everything required to validate. This
is executed before any validations are executed. | namespace ReactiveValidation
IObjectValidator Build(IValidatableObject instance); | 1 |
027039ef8cb59aeef42c1d90ed971053 | e1562b8eee2253627b87c6a61f82ffb9 | 下载单个歌曲 | RetrofitWorker.retrofitWorker
.downloadSongFile(songPathBean.url)
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.map<ResponseBody> { responseBody ->
if (LocalSongsDataSource.getInstance().queryLocalSong(songPathBean.... | 1 |
c09e9044e6b1a9807bb777e85471a788 | 5984a1252f14edaddba37b97fadb3fea | Pobiera próbkę uczącą sieć.
Próbka jest konkatenacją wierszy. Wartości próbki to wartości poszczególnych pikselów.
Rectangle field - obszar z ktrego została pobrana próbka. | if box == "":
box = (0, 0, pic.size[0], pic.size[1])
rgbimg = pic.crop(box).convert("RGB")
rgb = numpy.array(rgbimg.getdata())
return [self.__round(rgb[:,0]),
self.__round(rgb[:,1]),
self.__round(rgb[:,2])] | 1 |
b42e0a9aff23ab1044072b750e9b2c13 | 8a4f6c43a7b9d2146e64a1bd9b130737 | Guide the ship towards the current enemy target | Ogre::Vector3 newDirection = GetVectorFromTwoPoints(playerPos, ship_node->getPosition());
newDirection.normalise();
currentDirection = newDirection;
RotateShip(currentDirection);
ship_node->translate(currentDirection * ENEMY_MOVE_SPEED * (-1));
} | 1 |
797e18645d36cdb798ce245014c51b90 | 6baeb9b23d7b7fd64eacb6859343f297 | Recherche des campagnes de tests d'un sujet | {
$qb = \Zend_Registry::get('tceridude_em')->createQueryBuilder();
$qb->add('select' ,'m')
->add('from' ,'\entities\Associations a, \entities\Maps m')
->add('where' ,'a.active=1 and a.obtypeFrom=2 and a.obtypeTo=1 and m.id=a.mapTo and a.mapFrom='.$subject);
$query=$... | 1 |
e1ca6aa4bcd887a79367858ca501cf20 | 64142ea07af1b3aad8fa00d16862dbf2 | Handler for Component -> Rendering -> Light. | function LightComponent(options) {
BaseComponent.call(this, options);
this.selected = null;
} | 0 |
f04482409a848ebd83d2eeeac01d3a73 | e0d93d7c938cbdb100e239548a39c308 | método para borrar un item del historial de navegacion | {
string cmdline = "delete from [una].[navigation] where id=@id or idparent=@id";
SqlParameter[] parameters =
{
new SqlParameter("@id",id)
};
return ExecuteNonQueryWithParam(cmdline, parameters);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.