query_id
string
corpus_id
string
query
string
code
string
label
int64
650e5eb1a86251b8596d02cde2955b49
7f61448ad6da3ef0f9cb03f40c5be655
entry point of the progrma
cases like (1)
0
a0e5a590e96b622a5d2870710644f28e
28f7a2e7107df788789cd7252ff508dc
Draws the calc output
void displayResult(MathStack& calc) { for (int i = 0; i < calc.getSize() && i <= 16; i++) { gotoxy(2, 22 - i); cout << calc.get(i); } }
1
073a7819b07e34503912fb6251e03374
a85d9ef7e8a53763c864351cde0197b5
with border
void CornerGrabber::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { _outterborderPen.setCapStyle(Qt::SquareCap); _outterborderPen.setStyle(Qt::SolidLine); painter->setPen(_outterborderPen); QPointF topLeft (0, 0); QPointF bottomRight ( _width, _height); QRectF rect (topLe...
1
f84096e0ce4936d0032f9a8da56a8ada
9db73f40b83e7f6ce5d4dcf56efd2cfc
Y component of the second eigenvector of the diffraction anisotropy tensor. The applicable orthogonalization convention is that specified by _reflns.pdbx_orthogonalization_convention.
class TL(): def theta_2(self): return self._theta_2
0
60d7bdbc126c041cdff60fbfb1f49975
d2afb397027cc8d4029c6e752c997fce
Takes tab and backslash inputs and converts them to their character equivalents. I also attempted to do this with backspace, however the terminal eats the character before it can be processed.
{ int c, state = OUT; while ((c = getchar()) != EOF) { if (c != ' ' && state == IN) { state = OUT; } if (c == '\t') { state = IN; printf("\\t"); } else if (c == '\b') { printf("\\b"); } else if (c == '\\') { prin...
1
c8fdf6339d2b797d00d041d5e8d54097
5f0870a2b966c2866017b5b622dc0e16
返回是否开启跳过中间点模式(默认为false)
function M:getIsSkip( ) return isSkip end
1
0969f25ae21b21fc1c5db124e963a1ca
8a6f6197ae11dcfbe43813001b871bf1
Generates an 64 bit random IV
def genIV(): return os.urandom(16)
0
fffc80330de8a212f04de9219357d600
b83d6d1ab20186cb606d0481b7b60d60
停止指令,使读写器停止RFID操作,进入空闲状态
namespace HBLib.HR8002Reader public class Reader : FrameHelper public async Task<InfoBase> CloseRFAsync() { byte[] frame = CreateCloseRFFrame(); CommunicationReturnInfo cri = await com.SendAsync(frame); if (cri.ReturnValue != ReturnMessage.Success) { ...
1
ea56cf7f67a906debe0e5903f2eb1d44
ba5a90749bfe615ae706d6e112c03664
Function takes in a string and calls upon is_berry to return a number Function takes in a string and binds it to the fruit variable. It calls upon is_berry and looks for its result. If is_berry is returning True, then shipping_cost returns 0. Otherwise if is_berry is returning False, then shipping cost returns 5
def ground_shipping_cost(weight): flat_cost = 20 if weight <= 2: weight_charge = weight * 1.50 elif weight <= 6: weight_charge = weight * 3.00 elif weight <= 10: weight_charge = weight * 4.00 else: weight_charge = weight * 4.75 return flat_cost + weight_charge
0
aff756c27297a5f8841484af69038972
5c56b901ef2d89189032d9fa95f58c87
Создает матрицу поворота и вращает по ней куб
{ const int z = 1; Matrix4x4 m = Matrix4x4.TRS(Vector3.zero, rotationTo_, Vector3.one); SmallCube[,] newlayer = new SmallCube[3, 3]; for (int x = -1; x <= 1; ++x) { for (int y = -1; y <= 1; ++y) { Vec...
1
a3fa0673bf7b1778fbf3efeca95d3162
9628aa0beca6744383513239f0f1fc06
pid参数初始化配置
void PID_Para_Init() { Ctrl_Para_Init(); h_pid_init(); }
1
72b4eb59bb9fe52f20346fda7434b9c5
8a31074d27205e9eb7a1af14be6783c5
Ermittelt erstes Vorkommen einer Zeichenkette in einer anderen
int pozice = 0; int s_len = length(s); int search_len = length(search); char *sub_str; int posuv = 0; int match = 0; int no_match = 0; sub_str = malloc(sizeof(char) * length(s)); if (s_len < search_len) { pozice = -1; return pozice; } if (search_len...
1
cc48b24c480a9cca4a8dd87af8a9821d
6a7b371803fab5be1e2a17477b6571b8
获取子弹容器
export default class GameTest extends cc.Component public getBulletLayer(): BulletLayer { return this.bulletLayer; }
1
40eb9714d46de2b845622eec8bad410f
627e0b17b3da592c7004956aa10fcefe
Endpoint para busca de Ocorrências por data abertura da ocorrência
class OcorrenciaController extends Controller public function index(Request $request) { $ocorrencia = new Ocorrencia; if ($request->data_ocorrencia != null && $request->tipo != null){ $request->validate([ 'data_ocorrencia' => 'data', 'tipo' => ['required',...
1
f5e21c44fe541359d294d144455cdb72
da7d30921aa9bf9744ec4afef6fd721c
Truncate an integer to an unsigned 8-bit value
def uint(x): return x & 0xff
1
b082133d4e9610e1c2c0e187d0966503
f0e1edb83d488609c36c16efb808b5b7
Argparse type to check non negative int.
x = int(x) if x < 0: raise argparse.ArgumentTypeError("{} is not a positive integer, should be 0 or higher".format(x)) return x
1
4a2ce0f27fb044843759798787766bfe
f45bceaf6972fc1884dea431e8791ecf
Replace asset dependencies.
class Asset extends FileAsset implements DependentInterface public function setDependencies(array $dependencies) { $this->dependencies = $dependencies; }
1
207d41652df171f6f769e922149bc676
ed30006ecd764ab4170707fea7b8bd89
查询没有被选择演员列表
string strsql = "select Staff_Name from Staff where Staff_Name not in (select Actor from F_Record where ItemsID=@id and datename(year,Comment_Time)+'-'+datename(month,Comment_Time)=@time group by Actor)"; SqlParameter[] paras = { new SqlParameter("@id", id),new SqlParameter("time",time) }; ...
1
44fbed542143fe14642e4a4d1a5b9c0a
403ecfa46f2accd813b80cb1c9d4ebb4
exit_thread - the thread to run when the current thread is done thread_function - the function assigned to the thread This function creates a thread by populating the Thread structure and doing the voodoo magic of setting up its context.
{ thread_func_t funcPtr = threadFuncPtr; void *funcArgsPtr = threadFuncArgsPtr; mutex_release(&threadCreationMutex); funcPtr(funcArgsPtr); sys_exit_thread(); }
0
b8b4e641a53e40ed39fbae8cb7af7121
4809536c98a30369433b744c2979a931
###Deze functie moet nagaan of er nog geen andere gebruiker is met hetzelfde mailadres.
class user extends database public function checkFree() { $query = 'SELECT * FROM `USER` WHERE email = :email'; $sql = $this->database->prepare($query); $sql->bindValue(':email', $this->email, PDO::PARAM_STR); $sql->execute(); return $sql->rowCount(); }
1
f7bfb11de92b320785b82de1b65b608d
b5d2e25ba3c69157a6894ff6bd67bda5
Рисуем линии между частицами
GameObject myLine = new GameObject("Line " + start.ToString() + "--" + end.ToString()); myLine.transform.parent = transform; myLine.transform.localPosition = Vector3.zero; myLine.AddComponent<LineRenderer>(); LineRenderer lr = myLine.GetComponent<LineRenderer>(); lr.mater...
1
f2900b5e0a0b53cfbd2fc6490d34c00f
ea2c8db38ab8820496a00ced46fe16e7
Command to get IP. Example output: +CGPADDR: 1,0.0.0.0,0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 OK
class Node(amom.node.Node): def _get_ip(self): cmd_ip = 'ip route | grep ^default | grep -oE [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' process = self.execute(cmd_ip) return process.get_stdout()
0
5b406b5f92818023efff16a09a72a1f9
d87a2925537217a0f2ba128a1af5af49
Get an array with all instances per cluster.
class KMeans getAllClusters() { var res = [] var assignments = [] this.means.forEach((m, i) => { assignments.push([]) this.assignments.forEach((a, j) => { if (a === i) { assignments[i].push(this.data[j]) } })...
1
095e154cf1b963a5039d85590046a614
b8d02d977dcb3781290cb0510994c802
邮件中转
function transMail(){ resetSend(); $("txt_title").value = "[转发]"+g_title; $("txt_content").value ="\r\n\r\n" +"---------------------------------------------------------------------------------------------------------------" +"\r\n发件人:"+ g_sender +"\r\n发送时间:"+g_sendtime +"\r\n收件人:"+g_rece...
1
cfd1542a107ce4550f79e6dc98635a03
c23a149f35dd76301dd4aa0fbf6f2163
הוספת מבחן חדש לרשימת המבחנים, תוך בדיקת מקרי קיצון שונים
function addExam($examName, $questionList) { $questionIdList = questionIdsFromDictionary($questionList); $result = sendSQLQuery("INSERT INTO `ahm28`.`ExamTable` (`testName`, `questionList`) VALUES ('$examName', '$questionIdList')"); $result2 = sendSQLQuery("SELECT testId FROM ExamTable ORDER BY ...
1
2c20f0cecb0f02a4fe0c30475b8c7f76
4f3369bb751b89cbb8f661885c929abc
Recalculate minion positions since minions may have been removed from the board recently.
{ for (int i = 0; i < minionList.Length; ++i) { if (minionList[i].Equals(minion)) { minionList[i].transform.position = originalPosList[i]; } } }
0
1f31333fab608bb63e3f6c7d09d62fd9
9df21454d37655de9f23f22864c1d9ef
打开气缸,可选延迟
def open_air_cylinder():, modules['air'].write_data(0x01)
0
319d7643ce6365ae86369bf583561d1c
00f9dc6c2554a9812454400bccc5f14d
Test passing just one frame. The UVT should be the same length as the frame.
const AnalysisDataTestInputFrame &refFrame) { checkHeader(frame.header(), refFrame); ASSERT_EQ(refFrame.pointSetCount(), frame.pointSetCount()); for (int i = 0; i < frame.pointSetCount(); ++i) { const AnalysisDataPointSetRef &points = frame.pointSet(i); const Ana...
0
74bc7dd3441f9b2bbb4dcc812a7d0f3f
2e3cfc5f744856d1711e0652f552c827
Set the values of the sliders and call its handlers.
const index = values[0]; this.updateReadout(index); if (this.model.get('continuous_update')) { this.handleSliderChanged(values, handle); } }
1
53138102ab3262eb028c3e34b3e374f2
39f3a1e79aacdffbe7e2d3d05d324d31
Insert space before capital letter.
class qstr public static function insertSpaceBeforeEveryUppercaseCharacter($term) { $r = ''; for($x=0; $x<strlen($term); $x++) { $character = $term[$x]; if(qstr::characterIsUpper($character)) { $r .= " "; } $r .= $character; } $r = str_replace(" ", " ", $r); return $r; }
1
312c72255f042ff255a77261c50430a1
b04012105245600f1127f26ba7e9d293
默认设置 - 隐藏标题
abstract class BaseActivity<T: ViewBinding, VB: BaseViewModel> : AppCompatActivity(), UICallBack override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) requestWindowFeature(Window.FEATURE_NO_TITLE) mActivity = this imm = getSystemService(INPUT_METHOD_SER...
1
55d419a91c8dc447047f312ee0aad344
f048320ae9e1bc8c6abebf3e42ffed57
元素入栈,从栈顶插入
PStackNode new = (PStackNode)malloc(sizeof(StackNode)); new->data = ele; new->pNext = stack->top; stack->top = new; stack->count++; }
1
81275dfd8a7e76dfe1d6db5a1dcb5892
36e3d7b16b5590b4c5904f0f6d67cbd8
Sets the value of the inputBranchPastDueIncome property. allowed object is {@link String }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "GWRInterestAccountingDetails", propOrder = { "description", "behalfOfBranchAdvanceExpense", "inputBranchAdvanceExpense", "behalfOfBranchAdvanceIncome", "behalfOfBranchArrearsExpense", "behalfOfBranchArrearsIncome", "behalfOfBranchArrears...
1
4033599ea3edd8b514d514ef50ee3b01
bb617df6c75930561d84a1004ac1e722
Delete item by item type id アイテムタイプIDで指定されるアイテムを削除
class RepositoryAction extends ActionBase function deleteItemType($item_type_id, $user_ID, &$Error_Msg){ $result = $this->deleteItemTypeTable($item_type_id, $user_ID, $Error_Msg); if($result === false){ return false; } $result = $this->deleteItemAttrTypeTable($item_type_id, $...
1
085c9a684cb0a379c58adba6c13ea171
142ebc78bf2c3f9d19000831f2495580
Get a specific event object for a specific recreation area.
class Component_Search_Area extends ServiceAbstract public function getFirstEventSearchArea($eventId) { $record = Dao_Area::getInstance()->selectFirstAreaInEvent($eventId); return Entity_Search_Area::createSelf($record); }
0
03a1105ecdf45532abe200c96f26a1ad
d6b50de90779fdd40bca837e884684b9
Description : check and manage member list in wireless network
{ time_t time = std::time(NULL); std::vector<MembershipList::tuple> list = membershipList.get(); while(true) { time_t diff = std::time(NULL) - time; if(diff > 1) { list = membershipList.get(); time = std::time(NULL); } if(membershipList.size() > 1 && diff > 1) { std::string message = messageCre...
1
3fc21db1536136bc4129651d5f0813f0
1556acdeac7aef0c764a099903981dbc
Return the SOP Class UID of the referenced structure set.
public class HierarchicalSOPInstanceReference public String getSOPInstanceUID() { return sopInstanceUID; }
0
f2e6c097db201c1ae9f2832ea6cbe485
354c4b45aba07506247942612c76d237
根据code向用户组添加用户
if(StringUtils.isEmpty(atUserId)){ boolean result = aus.queryByInameToinsert(atUser.getIname()); if(result){ AtUser au = (AtUser)session.getAttribute("atUser"); atUser.setCpCode(au.getCpCode()); atUser.setIsUsed(0); atUser.setItype(1); atUser.setIsAdmin(0); atUser.setStatus(0); atUse...
0
0b613cf315b4c2295b70e424e7aa7d18
4e3fc478a6a1f3173a74f2cf2de0a184
le chemin absolu du répertoire où les images uploadés doivent être sauvegardés
class Travauxfini protected function getUploadRootDir() { return __DIR__.'/../../../../web/'.$this->getUploadDir(); }
1
3a70dafd76fce7bdea9fdaf8d5dba3c6
c7ec4c8431830fe2d483f85248430e16
扫描屏范围内玩家对象
{ LPOBJ lpObj = &gObj[aIndex]; for (int n = 0; n < MAX_VIEWPORT; ++n) { if (lpObj->VpPlayer[n].state != VIEWPORT_SEND && lpObj->VpPlayer[n].state != VIEWPORT_WAIT) { continue; } if (lpObj->VpPlayer[n].type != OBJECT_USER) { continue; } if (OBJECT_RANGE(lpObj->VpPlayer[n].index) == 0) { conti...
1
c47e0cead8da3a26307ddc42b20f5666
31b064d6b3bb1031fa74e1c593120164
国内各省份现有确诊病例数(中国地图用No )
var mapName = 'japan'; let scales1 = echarts.init(document.getElementById(scales)); var option = { tooltip: { trigger: 'item', triggerOn: 'mousemove', backgroundColor: 'rgba(0,0,0,.8)', show: true, formatter: function(params) { ...
0
eb2ba68a095bd47fd8fdeaae4236739c
ff91d8d307ae01a4acfe369956bff8f1
Convert from cubic inches to cubic meters.
public class VolumeConverter private static double cubicFeetToMeter(double inputVolume) { return (inputVolume / ConversionLiterals.CUBICFOOTPERCUBICMETER); }
0
8d625c205cf1d6771336415e9810c6e3
a046cb6eff5e908decb7a825a37aa4d3
can view single private profile
{ if(Auth::user()->role != 'Test Participant' || (Auth::user()->role == 'Test Participant' && Auth::user()->id != $id)){ $user = User::find($id); $security_question_1 = SecurityQuestion::find($user->question_id_1); $security_question_2 = SecurityQuestion::find($user->question_id_2); ...
1
0fe37141e51dc602e63e7675a9a42344
b47b6dc52fbfe0e25db2f2474e67dcaa
가장 큰 소수 구하기
def main(): return max(prime_factors(600851475143))
1
57c74b16e0b001f3640deac08fb39abe
3a0a15a604981520c0643034a4db66c0
SdtFindInitializeWin32kCall Locate prologue of win32k!InitializeWin32kCall.
{ DWORD proc32; proc32 = (DWORD)GetProcAddress(getNTDLL32(), "NtDelayExecution"); memcpy(scWorker32 + 8, &proc32, 4); proc32 = (DWORD)GetProcAddress(getNTDLL32(), "LdrGetDllHandle"); memcpy(scLoadDll32 + 15, &proc32, 4); proc32 = (DWORD)GetProcAddress(getNTDLL32(), "LdrLoadDll"); memcpy(scLoadDll32 + 35,...
0
96b83efd8374a2ca93f6d59b724e2ae7
d07f76ceb6ba3d281fc15cfc21433a4d
Set averaging count. Input: val (int) : Averaging count. Output: None
{ lps25hb_reg_t reg; int32_t mm_error; mm_error = lps25hb_read_reg(ctx, LPS25HB_RES_CONF, &reg.byte, 1); reg.res_conf.avgt = val; mm_error = lps25hb_write_reg(ctx, LPS25HB_RES_CONF, &reg.byte, 1); return mm_error; }
1
07fcaa4c58747dc6b7cec64613ab82b1
bb6ebb65a0717d96b3e7182b474697c8
返回指定的高斯滤波模板
if len(m): m = m[0] if m < (round(3*sig)*2+1): print("warning:sigma is too small!") else: m = round(3*sig)*2+1 k = m//2 G = np.zeros((m,m)) s = 2*(sig**2) for i in range(m): for j in range(m): x = i - k y...
1
a8cb6312086114b5c0eaf0a17366973a
db6a06bbcb54fb0491dd79a8612b302e
@brief This function is called when acknowledgment does not arrive within ack_timeout.
bool on_time_ext_ack_timeout( const struct dhcp_header* received_header, struct dhcp_client_context* context) { ssize_t send_bytes; struct dhcp_header header; struct sockaddr_in server_addr; assert(received_header == NULL); assert(context != NULL); memset(&server_addr, 0, sizeof(struct s...
1
473a4e04065c5fbc6ebaf76c0dd5da8e
04bf70d97e2a5199bc93004efd771619
Builds the full raid text
function showRaid($raid_id) { $db = getDb(); $sql = "SELECT * FROM pqr_raids WHERE raid_id = ".$raid_id; $rslt = mysql_query($sql); if (mysql_num_rows($rslt) > 0) { $row = mysql_fetch_array($rslt); $signups = getSignupsByDay($db,$raid_id); $raid_oclock = strtotime($row['raid_oclock']); $str =' <div id="...
1
7d764b73de7cd6cca7f5932a4ef77436
3a377fc2f3e31ff3b1e9401fc63019e6
******* Autorizar Requisición RM ***********
$server = $_SERVER['REQUEST_METHOD']; $http_usuario = isset( $_SERVER['HTTP_USUARIO'] )? $_SERVER['HTTP_USUARIO']:""; $http_token = isset( $_SERVER['HTTP_TOKEN'] )? $_SERVER['HTTP_TOKEN']:""; $url_permisos = "http://52.44.90.182/api/privileges"; $url_token = "ht...
1
8fc13737cfecad3174f0b01a24138490
1b420cc63b2f6f582ad53e56cf1e280a
Forces initialization of a lazy object and returns it.
T lazyInit();
0
1bf11e67414a02adb3603b0bd12dbfe5
96a9ce941d2867cca68003e005704b74
Represent a timedelta as an ISO8601 duration. http://en.wikipedia.org/wiki/ISO_8601#Durations
def convert_timedelta_str(dur): micro = ".{:06d}".format(dur.microseconds) if dur.microseconds else "" return "P{:d}DT{:d}{}S".format(dur.days, dur.seconds, micro)
1
8cd6449b4d85c712ed9a08cefee8a387
c42a972613620306664d5d977cd15e99
similar to the add [but preserves the original ID]
function upsert(array, item) { const i = array.findIndex(_item => _item.id == item.id); if (i > -1) array[i] = item; else array.push(item); }
1
c442d26336d4bd45774bd10f4474c11a
9bb590d37cd7850f05cc18c6dca879ab
call this every 1msec to increment the power on time and set the flags.
static void tenMinTimerHandler(void) { TOGGLE_HOLD_POWER; powerOn = ((powerOn == false) ? true : false); }
0
a86eaf9cbefdffe20ebd2c099f015d3e
f3c9cb2e96fbc8b5750d4f11cf9bc862
ECHO USER ARGUMENTS
func main() { fmt.Printf("Arguments 1: %+v\n", os.Args) flag.StringVar(&versionFlag, "v", "v1", "The version of the API endpoint") flag.StringVar(&endpointFlag, "e", "", "The name of the API endpoint") flag.StringVar(&modelFlag, "m", "", "The model of the request") flag.StringVar(&operandsFlag, "op", "...
1
f439df5cd00e9f5670d3711fdc7fa639
ba0ee5d5ead24de219581f31e74e53fc
Generate json for response for login route
{ return response()->json([ 'access_token' => $token, 'token_type' => 'Bearer', 'expires_in' => auth()->factory()->getTTL() * 60, 'user' => auth()->user(), ]); }
1
bf0f44aebb7ca316839fa1e1cfd8bf52
080eb3d0d36505bb6e1ef2aa608fd234
Przesyła wszystkie utworzone pokoje
{ ui->listWidgetRoom->clear(); pack_t packUpdate; memset(&packUpdate, 0, sizeof(packUpdate)); packUpdate.type = TYPE_UPDATE_ROOMS; this->clientSocket->write((const char *)&packUpdate, sizeof(packUpdate)); }
0
7bdd1be07c4b63855a54e76230b2b160
e561421fb4dd462e40610977f13618db
Reconstructs a Unity Vector4 as a numpy array of shape (4,)
def V4(x=0, y=0, z=0, w=0): return np.array((x, y, z, w))
1
d6482d3de2c0d0086140cdd29d90d2b7
141a5f2a57a19d9a545386fa33bf77a5
append the given info text to item and column
long lItem , const wxString& rsStr ) { wxListItem vInfo; vInfo.m_mask = wxLIST_MASK_TEXT; vInfo.m_itemId = lItem; vInfo.m_text = rsStr; SetItem(vInfo); }
0
c530bee31c355220386992ae85382e4c
d7dd74610ee2b9991e59941abadd13ca
判断股票的ID是否是6位,不是6位的话,在前边补0
class VolatilityBreakthroughTest(): def standardCode(self, code): code = "{0:0>6}".format(code) return code
1
f06d5bff756de2746f6d897501bfd087
d6f5cae9824057dbeb842b828f2cad86
1.1创建碎片形式 dom 节点
function createFragment() { return document.createDocumentFragment(); }
1
9c927b56512e34e0175ca272c81c2091
405c9bc3679442a9876c570ecc0145ca
根据condition条件及管控查找产科护理记录单(产后、术后)数据集合
public List<AppParentingEarlyStageDetailsPO> findAppParentingEarlyStageDetailsListByCondition(Map<String,Object> map);
0
d25b1432ead2b55f498ab03de72bc39f
621ee6b4c45afafa34afdc5b330bd234
Phase 9: 生产部队
if (!currentPhase.equals(Phase.FINISH)) { return false; } battleFied.clear(); commanderShips.clear(); currentCommander = new Random().nextInt(COMMANDER_SIZE); for (Player commander : commanders) { createCommanderField(commander); } switchPhase(Phase.DEPLOYMENT); return true; }
0
acf3cdd16059c7fc4a95e2e9cca3d374
763d3894d720419d52c5055518998833
get the position of a pawn that could be promoted after a certain move
{ ExtMove *moves, *extra = end; for (moves = stack; moves < end; moves++) { Move move = moves->move; if (type_of(move) == PROMOTION && !pos.empty(to_sq(move))) { (*extra++).move = (Move)(move - (1 << 12)); (*extra++).move = (Move)(move - (2 << 12)); (*extra++).move = (Move)(move - (3 << 12...
0
2373a23eab83b3ef08811953d2df54d9
e9f602a6ea576a58d0a25395005187dc
Refresh data from Stripe.
def sync_charge(stripe_id, stripe_account=None): return sync_charge_from_stripe_data( retrieve(stripe_id, stripe_account=stripe_account) )
1
b60cc5707a7057e94b5f7c61347c9a5d
818c6c600f261df5c7c3d913a3eedc06
Validates following rules: 长度8-20个字符,仅允许字母和数字,不允许纯数字.
class DouyasiValidator extends Validator public function validateStrength($attribute, $value) { $digit_regex = '/[0-9]+/'; $alpha_regex = '/[a-zA-Z]+/'; return ((strlen($value) >= 6 && strlen($value) <= 16) && preg_match($digit_regex, $value) && preg_match($alpha_regex, $value)); }
0
6f50c5cfef82b2f469752b5046d378ed
9b64c76b3e8acb20f4d04f5d6303fa21
Sets the file the piece is going to
public class HW2View extends BorderPane public void setFile(File f) { file = f; }
1
7444a10f354c84feca5af95fb4badc0e
885ee23e29e4a80502aa98fa1002d8d6
"BorrowStat" Ability - Increases stat if it is lower than another party member's by an amount relative to that party member's
value = operate_value(@parameters[1], @parameters[2], @parameters[3]) $game_party.gain_armor(@parameters[0], value) return true end
0
c80bbb80ae94f5ed104f4db8156555c0
9077a1275689b1eb875ad2c3ec10a1ae
Full iteration test 1 from Figure 16 of spec.
class TestShgoArguments: def test_6_2_simplicial_min_iter(self): options = {'min_iter': 2} res = shgo(test3_1.f, test3_1.bounds, constraints=test3_1.cons, options=options, sampling_method='simplicial') numpy.testing.assert_allclose(res.x, test3_1.expected_x, rtol=1e-5, ...
0
244c708a4bbecca6faf06194941b3882
3dac1e323f6d694c0f246bad135baa8e
分享apk文件
Intent intent = new Intent(Intent.ACTION_VIEW); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); Uri contentUri = FileProvider.getUriForFile(getApplicationContext(), "com.fangzuo.assist.pad.fileprovider", apkFile); ...
1
a18f51478e151d8547e49353afa8906f
522a06f3b7d8511c095f5c7cf7224fd5
Gibt die Action zum "Drucken" zurück.
class SetaPDF_Core_Document_Catalog_AdditionalActions public function getWillPrint() { return $this->_getAction('WP'); }
1
702d165f17b327faca183d6029d67015
badb96ec9e87591f845b7f75cb68ead4
A string like "The resource type '{0}' is not a type that can be returned by a service operation. A service operation can only return values of an entity type, a complex type or any primitive type, other than the stream type."
namespace Microsoft.Data.OData internal static class Strings internal static string PathParser_ServiceOperationWithoutResultKindAttribute(object p0) { return Microsoft.Data.OData.TextRes.GetString(Microsoft.Data.OData.TextRes.PathParser_ServiceOperationWithoutResultKindAttribute,p0); }
1
a8a719197173dbe8b14eba3f35f74062
2da8e2a6c7ff7c5ef4311d2015761b73
Print text with pretty colors and indented to level
try: table = [ ('\n', ''), ('\t', ' ') ] for t in table: content = content.replace(t[0], t[1]) for i in range(self.get_level() - 1): content = ' ' + content except AttributeError: ...
0
c3ca0eaf6b28ddec957ef465231c2127
7a57373c2e842ff9e7eb27a111c3e9bc
Delegates the call to the wrapped JMS consumer.
public abstract class AbstractNonCrKafkaConsumerClient extends AbstractKafkaConsumerClient implements Controllable @Override public void event (MBeanServerConnection jcp, OperatorContext context, Controllable.EventType eventType) { }
0
e808692aafbcba77b57a6c03bd7eb70b
af5b9e8c2a662ffb0770e1303c81c133
Converts a list of {expression, operator, expression, ...} into a tree, taking operator precedence and associativity into account.
int countLeafs = 0; int countOps = 0; Stack<Node> stack = new Stack<>(); for (int i = 0; i < in.length(); i++) { char c = in.charAt(i); Node node = new Node(c); if (Character.isLetterOrDigit(c) || c == '&') { node.n = countLeafs; countLeafs++; stack.push(node); } else { node.n = coun...
1
73c1fe9a111e6de7ed82012b4e77ba7a
f8285fa74b5d15bba5bceb08e6283738
把指定二维码从Loading集合移动到Free集合
for(int i = 0;i < used.Count; i++){ if (disk.GetInstanceID() == used[i].gameObject.GetInstanceID()){ used[i].gameObject.SetActive(false); free.Add(used[i]); used.Remove(used[i]); break; } } }
1
59d029ef37da050480e5e42522b1f6ac
24944eba6a2c9c9ae4d3c4427c344b0f
以同步的形式发起HTTP请求并返回类型为泛型的API响应对象。
public class Client public <T> T post(Class<T> responseClass) throws IOException { return post() .getEntityAs(responseClass); }
1
4e36b05bf053f61c6b12aec6c6a074af
7776d9b0bf72c8472695fee96363ca83
Returns a new GeoMetadata object based on an URL input as metadata source.
self._path = path self.setRotate(0) self._geoTag.value = False self._image = Image.open(self._path) exif_data = self._image._getexif() if exif_data != None: self._exif = { TAGS[k]: v for k, v in exif_data.items() ...
0
d52cf95257a7d9c253655fad95d9bd8c
aad9cda6675259fa5deffad69f7d9574
Twitterのホームタイムライン取得
const client = createClient(token); const type = (mentionMode) ? 'mentions_timeline' : 'home_timeline'; let param = { tweet_mode: 'extended', count: count }; if (!mentionMode) param.exclude_replies = true; const tweets = await client.get(`statuses/${type}`, param).catch(err => ut...
1
c98e74efb07c5b7df0ca82d4e13379f0
4f5c0ac5ca91c98936f828febf076bc5
在指定类和该类的基类中查找指定方法名、参数类型的方法,优先查找public修饰的,若没有,则忽略修饰符 类或接口的Class对象 方法名 参数类型数组
public final class ReflectUtils public static Method findMethodByMethodSignature(Class<?> clazz, String methodName, String[] parameterTypes) throws NoSuchMethodException, ClassNotFoundException { String signature = clazz.getName() + "." + methodName; if (parameterTypes != null && parameterTy...
0
8a561939cc77fbc768f50a6300540946
0f53ad872ef5a0487f61b66ce56d7fc6
交叉验证法得出最佳K
k_range = range(1, 31, 2) k_acc = [] for k in k_range: acc = 0 for i in range(0, 10): X_train, Y_train, X_test, Y_test = LDA_return(train_set[i], test_set[i], dimension) _, acc_oa = predict(X_train, Y_train, X_test, Y_test, k) acc += acc_oa k_acc.a...
1
9b72fee1413948abbbc9d7541e06cc3a
77d94e7ea03b826a77c7446e48b0df65
====================== Get Approval details to either approve or deny ================================
class Process extends CI_Controller public function approve_job_request(){ $ac = $this->validation_model->access(); if(in_array('AJR',$ac)){ if(isset($_GET['loadtable'])) { $output = $this->getdata_model->approve_job_requests('loadtable', $_GET); $response = array( 'aaData' => $outpu...
1
61f2e25914ebcc09c889fbde8a2c2e6c
9ea9cb3bcec4c445a9eb76bb342883c8
Serialize a program for bulk API request
with open(self.tmp_file, 'w') as f: for sid in self.programs_info: program_info = self.programs_info[sid] program_info_encode = json.dumps(program_info) f.write(program_info_encode+'\n')
1
aae8b36bf8c224467249e12226168160
06df44357bc33110b6ebba8fa935b656
将动作配置的根目录的树结构转换为字典,返回给mainwindow
class CUIConfig(AbstractModule): def UITree2Dict(self, treeItem): if treeItem is None: self.logger.error("UITree2Dict failed, treeItem is None") return DebugItem = treeItem.child(0) ShowImageItem = treeItem.child(1) SaveResultItem = treeItem.child(2) ShowS...
1
f60b3c01d92fd65495f1a0e99a24f237
138e586abc3dcb78ac3abbd85c24beeb
# convert months -> days
leap = 0 if ((year %% 4 == 0 & year %% 100 != 0) | year %% 400 == 0) leap = 1 return(switch(month, '01' = 31, '02' = 28 + leap, '03' = 31, '04' = 30, '05' = 31, '06' = 30, '07' = 31, ...
1
b2b8d319b0931e6643dfb525484cb884
75aef6b268dff10a73153887018c8edb
增加一个Server要监听的端口,意义同 listen 接口
impl NewServer pub fn add_port<P>(&mut self, port: P) where P: Into<PortRef>, { self.nics.push(ServerNIC::WithPort(port.into())); }
1
cf8012231221b24d810a1a6de56a1716
c15f6fa46e5f324e44593bc581e76fa9
Navigates to the configuration page via configuration tab.
class IXAdminPage(BasePage): def click_config_management_submenu(self): self.switch_to_frame(self.header_frame_locator) self.select_submenu(self.config_menu_locator, self.config_management_submenu_js_function, script_executor=True) self.wait_for_ajax_spinner_load() self.switch_to_default...
1
ac0d3d137a11b7b8beb7f3e6c30c1398
eb57f52b67663fba02c9665ef4508325
Check whether the method requires authentication or not.
abstract class App_Controller extends CI_Controller protected abstract function _needsAuth(): bool;
1
ba8a351686c2b99a59b849ce67290f5b
5e24c66039ccea4fb799d66c1145e878
Формирует ссылку для iframe'а с офферами
class OfferItem extends AbstractAdItem public function getOfferUrl($source, $ref = '') { $externalKey = $this->getExternalRedirectKey(); if (empty($externalKey)) { return $this->getUrl(); } $partner = $this->getAssociatedPartner(); $partner = $partner ? '.' . $partner...
0
cfa1754fc232fbfdb691cbc34eec076c
362a9783aa02a2e861467d1b99d2d911
sets the center position (x,y) of each cases
n = " " array_case[0].value = n array_case[1].value = n array_case[2].value = n array_case[3].value = n array_case[4].value = n array_case[5].value = n array_case[6].value = n array_case[7].value = n array_case[8].value = n end
0
5bdd1955d4a63155f165fa458e6fd162
5f3847cf2d406422aed8a0c322c0d83f
将drl内容转化为session
public class RequestUtil public static String formatSession(Map session,String s){ String s1=""; String target=""; String replacement=""; if(s.indexOf("fun.getSession(FORM)")!=-1){ target="fun.getSession(FORM)"; replacement=String.valueOf(session.get("FORM")); }else if(s.indexOf("fun.getSession...
0
b3535f78fd4038c90d22e05bfb774a3b
01173df1cbb265e19bbfd2f055dd4c9f
Change displayed units
class UnitCharacteristicsWidget(QWidget): def showEvent(self, e): self.update_units(self.units)
1
c7d382768fd94984be38f5f7360cae86
40b8e07bed66af57f1dd765f97070703
Test that Autofill_samba fails unless object is a sambaAccount.
AP = accpac_class.Accpac() TestString = 'bob ' TestString = TestString.encode('utf-8') TheReturnedString = AP.SAS(Obj=TestString) self.assertEqual(TheReturnedString, 'bob') del AP
0
2e43ad08dee245e1e14a8f3b5807baad
77f0990c206b8f47e46324f8b8474e16
@brief Function for decoding setup ip port.
{ int32_t i = 0; uint16_t *p = NULL; uint8_t temp = 0; uint8_t *str[3] = {"X","L","H"}; p = (void*)port->ports; buf[0] = 0; for(i = 0; i < port->num; i++) { temp = ((p[i / 8] >> (2 * (i % 8))) & 3) % 3; strcat((char*)buf, (const char*)str[temp]); } }
0
36c99c39e97d63e3ee35f7fcefa15120
7a01cfe2e4d9a5e5756ef3cef089355d
@brief Generates CONF_MEASx register value for Differential measurement of FDC1004 for specified settings.
ftm_1x_meas_register ( void ) { boolean result = TRUE; result = ftm_meas_register(RFM_1X_MODE, &ftm_1x_meas_apis); if( result == TRUE ) { memset(&ftm_1x_meas_enter_param,0,sizeof(rfm_meas_1x_enter_param_type)); memset(&ftm_1x_meas_exit_param,0,sizeof(rfm_meas_1x_exit_param_type)); memset(&ftm_1x_m...
0
7dd18ab23f3ebbf5751b2344e4a8f3d9
47df0e22c724f3a97b20cc7d158453a1
Given all the lines in the file split based on the three sections and return the lines for the header and a list of lines for each section that is not 'None'.
def parse_split_file(filename): f = open(filename, "rb") lines = f.readlines() del f lines = map(lambda x: x.strip().split(), lines) return lines
0
be40e762b4265f7b614a3da6797bdd3a
29fcd0df5f9f4a6397a62f7aa50d4194
Creates a new adapter for an object of class '{@link org.xtext.eis.eis.CharConstant <em>Char Constant</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
public class PhotoShopFXAdapterFactory extends AdapterFactoryImpl public Adapter createEObjectAdapter() { return null; }
0
b845fae7b38782525be642fe5a38ff2b
fd632b010555d6452e825824431f22c4
设置对象属性,值为布尔
namespace Modules.Acl.Internal [DataContract] internal sealed class PropertyObject : IPropertyObject public IPropertyObject SetBool(string key, bool? value) { Add(key, value); return this; }
1
a905cbdbd237201d0dab4274b8892811
2e8e5556e192fd08d8d3da3781a6405e
创建军团
playerInfo["job"] = constant.GUILD_MEMBER_TYPE_1 dataDict = Guild.to_create_dict(name, lv, playerInfo) data = dict(name=name, dataDict=dataDict) try: guildId = Game.store.insert(Guild.DATA_CLS.TABLE_NAME, data) except: return 0, errcode.EC_GUILD_CREATE_FA...
1
2e577885958a202bc7eada037cbfcd8e
4e8432d9f1f4341527e5a306b729918c
Get width of entire PathwayModel view (taking into account zoom)
public class SlideoutPanelController public int getWidth(){ return linkedView.getWidth(); }
0