query_id
string
corpus_id
string
query
string
code
string
label
int64
17f43ebdbaa6d90efd4997b807264e27
d9d5b66cf880d8387ce0e54548808837
Prints link to the previous post.
function posts_link_attributes_prev() { return 'class="btn btn--secondary btn--small Pagination-Prev"'; }
0
24be87ab85acb88f39a8af275d6e3edb
d7379c530026f55c705519d14ddfd413
Force pick up of any external changes
class Creator(wx.Frame): # custom IDs | I prefer them to be here :-) def on_close(self, event): if self.changes: pass
0
f083941ed03023c41a7ff913a4c18ee3
9e9509ff8888f55c670b68c139e133ba
设置X轴为10的指数格式。
std::ostringstream cmdstr; cmdstr << "set logscale x " << base; cmd(cmdstr.str()); return *this; }
1
b1232390b274b9a5924d4e6529a841ad
f08de939274f382a8d867598738e986d
Insert or update the blocks a member is part of (ie if their details change)
{ RockMigrationHelper.AddBlock( true, "5BD28C0C-DBE0-4E01-844C-C49A12F21E7A".AsGuid(),null,"C2D29296-6A87-47A9-A753-EE4E9159C4C4".AsGuid(),"D70A59DC-16BE-43BE-9880-59598FA7A94C".AsGuid(), "Membership","SectionB1",@"",@"",0,"260CCD16-E664-4F92-BE01-28AB6BBFEE78"); RockMigrationHelper.Add...
0
4d4cc4c833285d3dacbcd5d51120d570
163e1f16df80116fee20a6fa39dc8159
returns true if date is older than one day
int raw = TimeZone.getDefault().getRawOffset(); long day_l = (last+raw)/86400000; long day_c = (current+raw)/86400000; return day_c>day_l; }
0
570a9661c34d6c480d81bec372268c4d
7e1ad27b1e2faf4f29c6f36fbf08ed07
定义切入点:所有带有@MyService的方法
@Component @Aspect public class MyAspect1 @Pointcut(value = "execution(public void org.example.ba07.SomeServiceImpl.doThird(..))") private void myPointcut(){ }
0
c56b614a7ed684e1a4d834834111a2ab
0bfb1319671abcd1b7df1fb0fff188fd
ToStringSlice convert an interface to a StringSlice type.
func strToInterfaceSlice(inArr []string) []interface{} { ret := make([]interface{}, len(inArr)) for idx, val := range inArr { ret[idx] = val } return ret }
0
8d2f52abc21ce2839bdf98be59e9c7a9
09f7f14f525fcadc3fd2397b9d77babe
fetches all Post Entries from the REST API
return (dispatch) => { ReadableAPI .fetchAllPosts() .then(posts => dispatch({ type: GET_ALL_POSTS, posts })) }; }
1
227ef65c1c8cde62783300ca52c80698
364e8fdbf1ecb8ce110cb434beb94a6f
[조회] 표준경보시스템 필터링
@Controller public class MDMA0010Controller @RequestMapping(value = "/core/erp/mdm/MDMA0010_SEARCH00.do") @SuppressWarnings("rawtypes") public ModelAndView processSEARCH00(CoreRequest coreRequest, ModelMap model) throws Exception { ModelAndView mav = new ModelAndView("coreReturnView"); CoreResultData coreResultDa...
0
d6c05811735c69c752fb8b0c028c2585
4d09e23386b1bffb8f7767a6e6977715
Спрятать визуальное отображение номера шара
namespace VideoSearch.ViewModel class MainViewModel : ViewModelBase public void HideWorkMask() { VisibilityWorkMask = Visibility.Collapsed; }
0
07de1d121ac76912a2ef66d8e000968e
d0f7a5656551bf2849e871e04631dc8b
按物品拼音查询
return http({ url: '/goods/selectByGuess', method: 'get', params: data }) }
0
7d29c9563320d702b08e35e3cf448e48
08c6d6c600dd3424cf2297d8ce4e5393
Копирование в буфер обмена текстового значения результата в шестнадцатеричном формате
namespace BlueCentaurea public partial class TransForm : Form private void ASC2Hex_Click(object sender, EventArgs e) { textTransData04.ForeColor = Color.Gray; textTransData04.Text = ConstValue.TEXT_TRANS_DATA_4; }
0
2b34c7a15704a96d9acdf93fd09bb10d
e6829e823c0ae784cacb50dd7c8f20e8
返回日期内每天的涨停股票数
def get_3(day): sql = "select count(*) as num from daily_result_detail where date = '%s' and close_is_raiselimit = 1;" % day num_df = pd.read_sql(sql, mysql_engine) print(num_df['num'][0]) return num_df['num'][0]
1
ef049d55791000db8935713393f7596d
8cedab85b16b882e4446fb5ac3525fb5
查委托响应
void TdSpi::OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { USER_PRINT("TdSpi::OnRspQryTrade"); if (!(this->IsErrorRspInfo(pRspInfo))) { if (pTrade) { cout << "=================================================================================" << endl;...
0
0ff0478b39baeeca39f772485bef6411
f40387a753ca81f0deee8f3f0f820aff
Returns a User for `membersuite_entity`. membersuite_entity is any MemberSuite object that has the fields membersuite_id, email_address, first_name, and last_name, e.g., PortalUser or Individual.
public function getUser($id, array $params = []);
0
2825318a4a8cca16c2cc7ad16a0ad478
75361317311fcff35be0672c566dce66
增加选民
export class ElectorService async addElector(data: Elector) { const campaignId = data.campaign; const elector = await this.electorDto.create(data); const electorId = elector._id; const campaign = this.campaignDto.findByIdAndUpdate(campaignId, { $addToSet: { elector: { electorId } } }); ...
1
61be9c18ea80c3ba66b0d254c3f245fb
56b757f59481c2d48062edeeae8f8b3c
Returns whether this foot switch estimates that the foot has made contact with the ground. <p> It typically relies on force measurement at the foot (either from a force/torque sensor or estimate from joint torques) in addition to some filtering to prune out false positives. </p> <p> Similar to {@link #hasFootHitGroundS...
public boolean isGround();
1
4bb0d5bb970c15069c683e9ac895bd98
7f660591ba1187f266ef14e628d8ef26
Zjistí, zda má pole pouze číselné indexy
$result = true; if(!(is_array($matrix))){ return false; } if(!(is_array($matrix[0]))){ return false; } foreach($matrix as $lineX) { foreach($lineX as $dataY){ if(!(is_int($dataY))){ ...
0
cb250563fa7602cd8938766c487a5e8f
26e282ee6f793152e4dfb1d4f52fd102
Get the frame of the central body.
class ClayBullet(object): def centroid_frame(self): return get_offset_frame(self.location, self.height)
1
ffb627381fbb9586c104c5f61dd5ec08
96173891d900ce62a55f9ca3cdb698f2
Boxgrid for displaying a grid of image box (netflix like)
function imagesToGrid(imageList) { var counter = 0; var gridString = ""; $.each(imageList, function(index, value){ if ( counter%4 == 0 ) { gridString += "<div class=\"row\">"; } console.log(value[0]); gridString += "<div class=\"col-sm\"><img class=\"img-thumbnail\" src=\""+value[2]+"\" data-breed=\""+val...
1
f8f6a55987a19b68ddada045115277ef
11a3d313443de9858e20bb70369bdbd3
获取consigneeMobile属性的值。 possible object is {@link String }
public class FundConsignorDto public String getConsigneeIdMobile() { return consigneeIdMobile; }
0
c5420776540a1b0eaa79d5abe2a4ab1c
4b1be0fd030426d3260beababc3b8587
All nodes a character has unlocked.
final Set<String> locks = new TreeSet<>(); for (final Edge e : getEdges()) { locks.add(e.getHeld()); locks.add(e.getAcquired()); } return locks; }
0
1eb710a0d922650fddafef8e968427e3
c486bac783c5f42d72fb36954f78ece3
open a bus directory and adds all discovered devices to the context
{ DIR *dir; char dirpath[PATH_MAX]; struct dirent *entry; int r = LIBUSB_ERROR_IO; snprintf(dirpath, PATH_MAX, "%s/%03d", usbfs_path, busnum); usbi_dbg("%s", dirpath); dir = opendir(dirpath); if (!dir) { usbi_err(ctx, "opendir '%s' failed, errno=%d", dirpath, errno); return r; } while ((entry = readdir(di...
1
e6b67e863fa326d2b7be69ed7cbb82f7
a36a2fcd88c48a7d18a730d303201b26
Releases the unmanaged resources used by the <see cref="BindableProperty"/> and optionally releases the managed resources.
{ if (disposing) { ReleaseManagedResources(); } else { } ReleaseUnmanagedResources(); }
1
b4907b0a2bfe64b4e17b1a74f21da8d3
ed13cf132f54d473c382c3fabe86a481
Возвращает имя в sql-виде
class Rel: def toSql(self, delimiters=False): return self.table.name
1
cb1cb60a19f3a4b6c0deb778b03f0ac8
fdd4db15d961f11613e5e9522c48c745
Testa a retrieve view dos equipamentos para um id que não existe
def test_equipamento_retrieve_view_successful( detail_url, userClient, equipamento, factory ): res = userClient.get(detail_url(equipamento.id)) serializer = EquipamentoSerializer( equipamento, context={'request': factory.get(detail_url(equipamento.id))} ) assert res.status_code == st...
0
135f963988c26cfc18260c2938895d21
6a3b36a14809d1c3d9ce744c56b7180d
Allows seed number to be adjusted based on form entered value.
function updateForm() { var input_seed = get("input_seed").value; if(input_seed != "") { seed = input_seed; } else { seed = new Date().getTime(); } Math.seedrandom(seed); var input_rate = get("input_rate").value*1; if(input_rate == NaN || input_rate > 1 || input_rate < 0) { input_rate ...
1
4d3ab180726b82a4f07a5f3361ae7c6f
e0736aa4dd4ef410e79131db9d821f1d
用于更换用户密码
public String altUserPwd(String user_number, String user_password, HttpServletRequest request){ HttpSession session = request.getSession(); User user = userService.findByNum(user_number); user.setUser_password(user_password); return "userManage"; }
1
4efa0cfd015d3346882e42977efe3321
befbefcfab262e580c2b9f28df648ae3
align images to reference image using astroalign package
supermatchfin = os.path.join(self.GlobalBlock.obsAlign,'supermatch.in') supermatchfout = os.path.join(self.GlobalBlock.obsAlign,'supermatch.out') supermatchf = open(supermatchfin,'w') S = '%i %i\n' % (len(self.imfiles),self.refImage.extref) supermatchf.write(S) for I in r...
0
44a78f1fb673090bf754e427df3e4e7e
4ddf6fea5d0552b82275da9d495d3835
Set/reset the initial sequence number
void CIOCPBuffer::SetSequenceNumber(int nr) { m_iSequenceNumber=nr; }
1
e5b661cbe17ee50465ce45cf7761ccee
0965198a8bb337e7d1cd65883221611b
Marks/unmarks a currency as unused.
namespace FireflyIII.Api ApiResponse<CurrencySingle> EnableCurrencyWithHttpInfo (string code);
0
29085779db0d409c9f791fca157ce006
ad0fceca7839bd6da0f2a2fede96ae9b
Make sure that if we pass a Pandas dataframe with no categorical features, we get back the matrix we expect.
def test_categorical_looks_like_int(): raw = pd.concat([ pd.Series([1.0, np.NaN, 3.0], dtype='float', name='fruits'), pd.Series([500, 1000, 1000], dtype='category', name='intcat'), ], axis=1) expander = DataFrameETL(cols_to_expand='auto', dummy_na='expanded') tfm = expander.f...
0
68f1a04a7eaa2742f8db2dbe140e49e0
48cfa3dcf5f9d6832e1b8be74479442e
Defines powerup's movement. ...
class PowerUp(pg.sprite.Sprite): def update(self): self.rect.y += self.speed_y if self.rect.top > HEIGHT_PX: self.kill()
1
f8c0624aeab6e545e6b481dfecc857a3
f0e43ecdc8fc9849f711bd6f2ba33ed0
City name to IATA
$aux = explode(',', $text); $cityName = ucwords($aux[0]); $cityName = \transliterator_transliterate( 'Any-Latin; Latin-ASCII;', $cityName ); $cityName = str_replace(' ', '-', $cityName); return $cityName; }
0
025728560a8abd81e5549fc3f1ac1219
991f3754671b8c5fa9ac7fdd8c48cca6
Returns a texture of the current screen.
{ var tex = new Texture2D(CameraWidth, CameraHeight, TextureFormat.ARGB32, false); if (rt != null) { RenderTexture.active = rt; tex.ReadPixels(new Rect(0, 0, CameraWidth, CameraHeight), 0, 0); } return tex; }
1
67d29f7e37af682fb272e1c157c8e0bc
04fc5fd29d1d687ae0a01f5482e97d92
Generate bounds from a center point and dimensions for each direction
class Region def as_bounds if center && span nec = Point.new swc = Point.new nec.latitude = center.latitude + (span[0] / 2.0) nec.longitude = center.longitude + (span[1] / 2.0) swc.latitude = center.latitude - (span[0] / 2.0) swc.longitude = center.longitude - (span[1] / 2...
1
a1e269a65377ac7db85a2c3dfe2e265a
9ba3c31747580f48a198273b418fb502
converts time in seconds to datetime.datetime with a certain base_date
def convert_datetime(sec): value = str(sec) if len(value) == 8 and value[:2] == "20": return time.strftime("%d-%b-%y-%H:%M", time.strptime(value, "%Y%M%d")) return time.strftime("%d-%b-%y-%H:%M", time.gmtime(sec))
0
5391790628d85e38a54867296b7fa9b9
1a0895c6d56dc9e57d31a7423e3e7085
case01-01 : 向专家提问 ; 缺少专家 ID
params = test_data[ "case13" ][ "params" ] result = api_client.http_post( url, params, api_client.MANAGER_TOKEN, api_client.LOGIN_TYPE_MANAGER ) assert result[ "result" ][ "queryData" ][ "totalCount" ] == 0
0
8d3981597b4a66260fd4314b04c9edc6
862f3c7b6e2f068d349dfdd39e2db232
Constructs an Euler rotation matrix for rotation around the axis z.
Mat3D rot_z(const double angle) { Mat3D result; double sAngle = 0.0; double cAngle = 0.0; if (angle == PI) cAngle = -1.0; else if (angle == PI/2) sAngle = 1.0; else if (angle == 0.0) cAngle = 1.0; else { sAngle = sin(angle); cAngle = cos(angle); } ...
1
489d1847ea05bf1ff585356ad6be42fd
9c40283552340e1a893a997b17230da1
SPI软件模拟SCK电平置高
void __CSN_HIGH(void) { GPIO_WriteBit(NRF_SPI_PORT_SS, NRF_SPI_SS_PIN, Bit_SET); }
0
ec4f9f375030e1f3c57945730b12c0d7
85fd250c244678f981399fc405bedb41
Waiting for ipcore status to be ready or timeout. Returns: boolean, [True, False], True is ready,Fasle is timeout.
class EjectTracker: def wait_for_ready(self): return asyncio.shield(self._ready, loop=self.machine.clock.loop)
0
69ce71fda34a98c72de4d04469b73fae
683e0fd325e15b57f808c1799f76ffb4
添加楼盘价格信息
class VillageAction extends BaseAction public function add_history_price(){ $village_id = (int)$_GET['village_id']; $village_name = trim($_GET['village_name']); $this->assign('village_id',$village_id); $this->assign('village_name',$village_name); $this->display(); }
0
604c21dc492461dd0fa53b799025d826
09ca9de719c0d64d7ee7908f64d270cd
Returns a new object of class '<em>Status Register Manu</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
@XmlRegistry public class CopyOfObjectFactory public StatusXML.Status createStatusXMLStatus() { return new StatusXML.Status(); }
0
1b1c203a0c411100d584a0b4d1a23aa4
3aaa25ad3facf07a9a2979f6e378a615
Este método sirve para obtener listas tipo [elemento_tal,siguiente_elemento] y se usa para la operación de cruce
element lasel(list l){ element e; e.type = LIST; e.l = l; return e; }
0
789f007b4d68852119ccb16eb6315fc5
98ba7173c172fedaeb786855640744ca
Получить ИД подписи получателя.
class GLS extends AbstractTracker protected function getRecipient(array $response) { return $response['tuStatus'][0]['signature']['value']; }
1
e16fc852bd2902f92d9cf466a422acd3
3498f6994dff80a0fb4c4331b2ca22a0
选择附加参数
if($par.find('select,input').length) return; var value=($par.find('a').html()); var html=""; if($par.hasClass("type_reg")){ html+='<select onchange="rebuild_arg($(this))">'; for(var i=0;i<regName.length;i++) html+='<option value="'+i+'" '+(i==value?' selected="selected"':'')+'>'+regName[i]+'</option>'; htm...
1
c8936bfdbf6825e463d648940fc78f29
9f36f0bfd6cb928a40ab41c3bce5b24b
Checks the check digits of a Romanian VAT number.
if len(vat) != 8: return False try: int(vat) except: return False if int(vat[0:7]) <= 999999: return False sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \ 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat...
1
ab2c12c1997b876273c3f17139c75494
f3522eb638c57d1fc33f575c201c9961
проверка является ли дробь обыкновенной
{ printf("_\n"); char ch=' '; int fractional; int null_count; printf("Целая часть: "); scanf("%d", &frac.integral); if(frac.integral<0) return 0; printf("Дробная часть начинается с нулей (y/n)?\n: "); scanf("%s", &ch); if(ch=='y') { printf("Кол-во нулей: "); scanf("%d", &null_count); printf("Ока...
0
0bbd533138bbc814c3ad34dd0b425469
eccc9b812c0b6fe90bb31db007da46e5
Returns the value of the '<em><b>Profile</b></em>' containment reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> A profile the specifies the rules that this parameter must conform to. <!-- end-model-doc --> extendedMetaData="kind='element' name='profile' namespace='##targetNamespace'"
String getProfile();
1
9b686129db384738913d9e9d9ccd279b
52ff62cef51d0dae28ff3dfca84c67f8
Clear the screen from cursor to top.
def clear_screen_up ECMA_CSI + '1J' end
1
bf105cff7d66a5fc9e68b717961b264b
fa13bc11c0ae76c564542a0aeae7f699
【流程运行】获取radiokey
Map<String, Object> returnJsonMap = new HashMap<String, Object>(); returnJsonMap.put("formData", ""); JacksonUtil jacksonUtil = new JacksonUtil(); try { jacksonUtil.json2Map(strParams); if (jacksonUtil.containsKey("user")&&jacksonUtil.containsKey("processName")) {...
0
6f59966498ed8fa7284910d5667d702a
007226c8509f4fd8abfa2df7a5c48b43
open an Assignment from CMS
class Website: def go_to_assignment(self): find_assignment = self.browser.find_element_by_link_text('Assignments') type(find_assignment) find_assignment.click() time.sleep(3)
1
c8bd8e3cce7819440712619eef64f1ad
0b959dde7a83f695ae2da14d1422e1d9
Returns a default change description.
public class Weather extends AbstractObject public Description difference() { return new Description.Builder("weather.change.description") .build(); }
1
1970bad1290c9b1154383a66e2b2e8c6
8a3243bf33b6c47edb56bd6c6196fbd9
具体执行上传操作
public class UploadManager public void execute(final String uploadUrl, final IUploadModel mIUploadModel) { if (TextUtils.isEmpty(uploadUrl)) { return; } if (mIUploadModel == null) { return; } final boolean isRetry = mUploadRequests.containsKey(mIUploadMode...
1
197466ff4d846f190b3e83a048e509f1
41930587fc875cbd7cce4d417b3c90d9
返回目的文件路径,例:D:\\temp\\1479709800.doc
namespace FanHai.Hemera.Addins.IVTest public abstract class UploadFileCommand : AbstractMenuCommand private string GetDestPath(FileUploadConfigElement cfg, DateTime d) { string path = string.Format(cfg.DestPathFormat, d); return path; }
1
8d3bbb195de45c5681e4bdd9534de027
375f024941b729f9fdfbb9df352a9285
Callback for when a C-ECHO request is received. User implementation is not required for the C-ECHO service, but if you intend to do so it should be defined prior to calling ``ApplicationEntity.start()`` and must return either an ``int`` or a pydicom ``Dataset`` containing a (0000,0900) *Status* element with a valid C-E...
class AMPChild(amp.AMP): def echo(self, data): return {'response': data}
0
d45b166e585a04d1d595c7dcc64d9070
29780a17f09753016b8577f4223588d6
Returns all DbEntities in the namespace.
namespace Sixty.Managers IEnumerable<IEntity> GetAll();
1
b2a0c17a7b3d2fc44de478bed66add41
b9ab74da624fa23e8d9691473f137b30
タイトルバー上のHomeボタンのコマンドハンドラ。
namespace BCQueue.ViewModels public class MainViewModel: ViewModelBase, INotifyPropertyChanged private void ExecuteHomeViewCommand() { CurrentViewModel = MainViewModel._homeViewModel; _mMViewPlayerProfilesVM.RTHCleanUp(); HomeButtonVisibility = "Collapsed"; }
1
5c96dfb7a67555cd6844a53f00eb04c2
ede761538ac174c537a7753f87013964
Funcion para visualizar los datos del Tutor, en la vista Alumnos.
{ $users = Datos::join('Nacionalidades', 'Datos.id_nacionalidad', '=', 'Nacionalidades.id_nacionalidad') ->join('Sexos','Datos.id_sexo','=','Sexos.id_sexo') ->join('Docentes','Docentes.id_dato','=','Datos.id_dato') ->join('Asigna_Puestos','Asigna_Puestos.id_docente','=','...
0
4041c8992d0b2aec00c533a87bdef94f
6ac62c06f683e7ffb13f0e442bec2edd
【电子邮箱】 邮箱前缀仅显示第一个字母,前缀其他隐藏, 用星号代替,@及后面的地址显示,比如:d**@126.com
public class StringUtil public static String getHideEmailPrefix(String email) { if(null!=email) { int index=email.lastIndexOf('@'); if(index>0) { email=repeat("*",index).concat(email.substring(index)); } } return email; }
0
29d9c17d141ff3dea8b1ae195f245d66
9ea2c7abcaed668e55642635ad646791
To draw horizontal stock chart
this.ctx.save(); this.ctx.translate(this.movingRange * this.sharpness, 0); transformOrigin.call(this); this.ctx.translate(this.canvas.width - RIGHT_SPACE * this.sharpness, 0); let perPrice = this.diffPrice / this.horizontalCells; let perPixel = this.centerSpace / this.horizontalCells; for (let i=0; i<th...
1
284c31c9dda0b50cc98b8baa0f17e1a9
e24e7c9f2590aeb690455b2abe427488
@brief Set WiFi operational frequency
{ uint8_t status; char ans1[15]; char ans2[15]; if (_version == ABZ_MODULE) return LORAWAN_VERSION_ERROR; memset(_command,0x00,sizeof(_command)); memset(ans1,0x00,sizeof(ans1)); sprintf_P(_command,(char*)pgm_read_word(&(table_LoRaWAN_COMMANDS[57]))); sprintf_P(ans1,(char*)pgm_read_word(&(table_LoRaWAN_ANSWERS[1...
0
36f82dc0eddc50a9f9e9839e508336dc
22d2295df051376c11d74d2870411c49
获取商品最低价
class WholesaleModel extends BaseModel function get_low_price($price_ladder) { $price = $price_ladder[0]['low_price']; foreach ($price_ladder as $value) { if ($value['low_price'] <= $price) { $price = $value['low_price']; } } return $price; ...
1
53318da55f51d16f601fb5ceac7f321d
767cc9bf3859f87a5113a1c51b87e2d0
Recusrsive function to get the previous date for closing volume
def prev_day(_date): try: global CALENDAR_BUFFER if len(CALENDAR_BUFFER) <= 0: CALENDAR_BUFFER = pd.read_csv(config.get("files").get("calendar"), header=0) filter_df = CALENDAR_BUFFER[CALENDAR_BUFFER['calendarDate'] == _date] for index, row in filter_df.iterrows(): ...
0
68b054262849327a4e123b212b2fdaa2
f480376b9583580d73a4bc0c2201b36c
Converts seconds to a string with format 00:00:00
if time_secs % 60 == 0: return f'{time_secs // 60}' m = time_secs / 60 return f'{m:.2g}'
0
7f5ead3213c12d3fc2d13fd6f5ebe283
de35c7c1d8eac2e639d063775de15dfd
Used to test sending a packet to a client
public class ChatTest @Test public void testHandlePacket() { System.out.println("handlePacket"); SelectionKey sender = null; Packet received = null; Chat instance = new Chat("chitchatcat", -1); instance.handlePacket(sender, received); }
0
dfd9b2d596220b6a0b8f678f7116bfb7
ee67e1007e9a6e2ada8c46f5eada2412
二分搜索寻找组负责人
if not isinstance(user, (tuple, list)): user = [user] leader = list(map(lambda x:x['id'], User.objects.filter(UserGroup__group__user__in=user).values())) if set(leader).issubset(arr): return arr arr.extend(leader) arr = list(set(arr)) return get_leader(leader, arr)
0
7e450d134cb5b59b8031f48d86d3be6d
b6100a9bb60e1477d374c64f1d070a32
初始化插件xml脚本
{ var source = node.SelectSingleNode("include"); if (source == null || !source.HasChildNodes) { return; } var values = source.SelectNodes("script"); if (values == null || values.Count <= 0) { retu...
1
0142f0d8d1980b02781f575b3c15b5e8
c2b7b3d045621aa6be6af7f6526313a2
generator of ``(nx, ny, nv)``, where `ny` is the input argument; ``nv`` is the matching generating polynomial of the grid ``(nx, ny)`` with open boundary conditions.
verbose=False): import os from sfepy import data_dir defdir = os.path.join(data_dir, 'meshes') if mesh_dir is None: mesh_dir = defdir def retype(args, types, defaults): args=list(args) args.extend(defaults[len(args):len(defaults)]) return tuple([type(value) for type, value in z...
0
89cf752ba8b080482b9425d2a4c4cbdd
b5204694f5cb0785cf45fbd5cd8f974b
Whether the model has validation rules at all.
{ return this._rules != null && this._rules.Count > 0; }
1
9b3dc1414d27a685c2fb3f60c2aadc6d
4df447f32ee727803d2cfe8b9897e492
@brief 입력된 수가 소수인지 입력된 횟수만큼 반복하여 검증하는 함수. 이론적으로 4N(99.99%) 이상 되는 값을 선택하도록 한다.
int main() { int num; scanf_s("%d", &num); int rem = 0; for (int i = 1; i <= num; i++) { if ((num % i) == 0) { rem++; } } if (rem == 2) { printf("prime"); } else { printf("no prime"); } return 0; }
0
ad14b769a3449193b3b46d785d56d95a
91a08a4459e393ed1642b5c8e1d8ad47
Gets the nearly expired qty items by id.
namespace BLL public class Item : _Item public object[] GetNearlyExpiredQtyAmountItemsById(int itemId, int storeId) { this.FlushData(); this.LoadFromRawSql(HCMIS.Repository.Queries.Item.SelectGetNearlyExpiredQtyAmountItemsById(itemId, storeId)); Int64 qunatity = 0; double price = 0; foreach (DataRowVi...
1
eae2744c199094cdec9dea89ee8ffae3
d6f8cf150c5a295b263bcb0f4de659d5
偏移年
class Years(IObserver): def set_shift_year(self): rule = r'\d+(?=年[以之]?[前后内])|(?<=[前后])\d+(?=年)' match = re.search(rule, self.key) if match: year = int(match.group()) year = -year if ('前' in self.key) else year self.time = self.time.shift(years=year) ...
1
8732e129b4a83ee594ccb38156862c1b
0cde4da0614389f0e813995d17bf79ac
Removes root-level items that are found in the specified collection by type. Does not work for child menu items or toolbar items.
namespace Cebos.Veyron.SharedTypes.DataTriggers IList<IEditableRoot> GetRemovedItems(IEditableRoot item, IEditableRoot oldItem);
0
d1d5bddba3326a014e9fbf07eb74d5a4
545f925356b5e96aa3d9f0a572c64f7a
Hashes a given password using sha512 algorithm
hasher := sha512.New() hasher.Write([]byte(password)) hash := hasher.Sum(nil) return hex.EncodeToString(hash) }
1
a673c9353523db93dc7f54650a4d0018
988402d1ce98692ca274aebe25c6f2e5
생성자로 전달되는 함수를 필드에 저장
class Trace: def __init__(self, func): self.func = func
1
59310af790bf793b4785ed9b6327053c
f40d5099a26d3aeeec1c00cd64b1fd18
Returns new object that represents template for headline. Object is initialized with default values.
export class TemplateDisplay extends Component getHeadlineStyle() { return { color: this.state.template.props.headings.color, textAlign: this.state.template.props.headings.alignment, fontFamily: this.state.template.props.headings.font }; }
0
8dcf6ac0b15ccef346102c5e7fa44117
38a292038a35b8ca0715b856027a8b60
修改系统异常信息
@Controller @RequestMapping("/system/illegal") public class IllegalAction @RequestMapping(value="update") @ResponseBody public SysIllegalDto updateIllegal(HttpServletRequest request,HttpServletResponse response,SysIllegalDto sysIllegalDto){ Date date=new Date(); sysIllegalDto.setUpdateTime(new Timestamp(date.ge...
1
5f2e2c9702512c61263a816edcc7cf4f
ecedb5b171535b13bebec36ec4a16644
Save a batch of design element entries in a design element list. The entries are put in the list starting at a given index.
{ string command = "<Method ID=\"{0}\"><SetList>{1}</SetList><SetVar Name=\"RootFolder\">{2}</SetVar><SetVar Name=\"ID\">New</SetVar><SetVar Name=\"Cmd\">Save</SetVar>{3}</Method>"; SPList list = web.Lists[ListName]; Func<int, string> methodExtractor = index => { ...
1
fd31696b70945d789e310ac0b9b1899c
d9e248d299866e26c4e0509e29e2b673
LIST requests for referrals are not allowed.
class ReferralsListAPIViewTestCase(APITestCase): def test_get_referrals(self): response = self.client.get(self.url) self.assertEqual(response.status_code, 200)
0
690dbcea95dce0e23d2db9ecc5c71fed
055540ef3858fe15c128ea406b06100c
Paints lowered bevel border
HakiGameLDecor::_DrawBevelRect(const BRect rect, bool down, rgb_color light, rgb_color shadow) { if (down) { fDrawingEngine->StrokeLine(rect.RightBottom(), rect.LeftBottom(), light); fDrawingEngine->StrokeLine(rect.LeftBottom(), rect.LeftTop(), shadow); fDrawingEngine->StrokeLine(rect.LeftTop(), rect.RightTop...
1
4d02a39242d9fa042f225b7b4f1172cc
2fd65c75c3b2a5a194132cd80652532b
通过变量的ID,设置一组变量的实时同时对于驱动记录类型的变量,记录到历史 对于历史,记录类型为驱动时起作用
namespace SpiderDriver.ClientApi public class DriverProxy:Cdy.Tag.SocketClient2 public bool SetMutiTagHisValue2(Dictionary<string, TagValueAndType> idvalues) { if (idvalues == null && idvalues.Count == 0) return false; if (mIsHisDataBusy) return false; var mb = GetBuffer(...
1
44d7164397855235d392938fb080af02
4f910ff933a40a95e65828a9c1ff1e1d
初始化种子
{ this.seed = seed; Random.InitState(this.seed); this.nextSeed = Random.Range(int.MinValue, int.MaxValue); }
1
b9caffca3a5652c749ce32c4258521bb
3644978be62cfa6f58f4811e5ea55096
the current game state for the specified game ID
export class GameService public getGameState(gameId: string): Observable<BlackJackGame> { return this.client.get<BlackJackGame>(GameService.GAME_STATE_URL + gameId) .pipe(catchError(this.handleError('getGameState',null))); }
1
c1c5f15cfc4552e46bf5c9c714d213da
21d3bdf8454ba58060e2c9b0167969e7
Handles the TextChanged event of the ZipCodeTextBox control.
{ resultsGrid.Items.Clear(); if (zipCodeListBox.SelectedIndex > -1) { AddBusinessCategoryWhenZipCodeSelected(); } }
0
019a3d3cedf5486866cfcf07fbd5ec87
1285833c81ad91d848dd84e0cb47e030
Convert HSL to RGB, based on http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
var max = Math.max(r,g,b), min = Math.min(r,g,b), h = 0; if (r == max) h = (g-b)/d; else if (g == max) h = 120 + (b-r)/d; else if (b == max) h = 240 + (r-g)/d; return [h,1-min/max,max]; }
0
9629f89044997e14cba86ce2e13f3260
6ea991de7a06f1cf2f98ced9006413eb
Возвращает эксперимент для пользователя, в котором он задействован
def user_belongs_to_experiment?(experiment_id) experiment_for_user == experiment_id end
0
06fc553c87b2f9e323ca1f26c2533403
9d609f6b4cd6be42778944b0d97051e6
List of internally used attributes. Used as a way of privatising attributes.
class Base def attr_internal(*attributes) write_inheritable_attribute(:attr_internal, Set.new(attributes.map(&:to_s)) + (internal_attributes || [])) end
1
8660120238a64dc913cdb234ad668b8c
cc7a1dcc0618525b117936d03ddde726
Returns park's unique ID
class VehicleTour: def getVehicleId(self) -> int: return self.vehicleId
0
a0acb559c1bc1b9a777dc2b3fd1a7e22
5b30aa0c85ffa76e61fb472c99e33dc6
Define o formato padrao dos pontos das series.
namespace BudgetExecution [ SuppressMessage( "ReSharper", "MemberCanBePrivate.Global" ) ] [ SuppressMessage( "ReSharper", "MemberCanBeInternal" ) ] public class SeriesConfig : ChartSeries, ISeriesConfig public void SetPointConfiguration( STAT stat = STAT.Total ) { if( Validate.STAT( stat...
1
1c01febeaae53cc7437fcff1ba21457e
d3cbea03ddee7385efba767edfdbb1a4
Returns the meta object for class '{@link de.dc.javafx.xcore.workbench.mesh.PointLightFX <em>Point Light FX</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getPointLightFX();
1
298ec4795fced104a2699889cff3f25e
3dccbf2ea3885891c9272c7a8b623f5c
<para> [GL4|GLES3.2] glDrawElements: render primitives from array data </para>
namespace SharpGL public partial class OpenGL public void DrawElements(uint mode, int count, uint type, IntPtr indices) { PreGLCall(); glDrawElements(mode, count, type, indices); PostGLCall(); }
1
f3bb383cf9749516b605c3b269da433b
9264e86b3798df4903ea5d3b4d5c4919
Manually send any unsent listener notifications.
services[FINISH_LISTENER_SERVICE_KEY].finishListeners.forEach { (key, listener) -> infoln("Invoking finish listener '$key'...") listener() } }
0
95de6bd15388f9d2ffc81afa7ce45737
88eea7ac791452c908c4d361a132a510
Gets the current delay that is in the delay register
public class Sequencer extends Thread public int getDelay() { return (mDelay); }
1
d734464d8b53ffdd4c79c8e821ac8297
fb33283da1e10579dcad9d5ac8e02a3f
This routine walks a Skiplist and performs a sanity-check on it
func checkList(c *check.C, list *skipList) { var lastKey []byte var nodeNum int for node := list.First(); node != nil; node = node.Next() { if len(lastKey) != 0 { cmp := bytes.Compare(lastKey, node.Key()) c.Assert(cmp, check.LessEqual, 0) } lastKey = node.Key() nodeNum++ } prevs := make([]*skipListNo...
1
87a7906f2323e0866fbec962a87aef3c
debb25265cb2934ec18992c8494a7c4e
creates a decision tree classifier
def train_dtree_classifier(X, y): clf = DecisionTreeClassifier(max_depth=None) clf.fit(X,y) return clf
1
b8d181813b71c0660634104e31b5cf67
ce2b3ce858965dca89d0b627ded3ecc3
Get the top level tags found in the xml, in the order they are found.
def get_tags(xml_document_file_path): return [get_tag_attributes(tag) for tag in ET.parse(xml_document_file_path).findall('TAGS')[0]]
0
de464a9420dde0c0593c047e387df256
0a971b2bb581ad65a0f2630daa6968f2
Affiche la page des casier et cache l'accueil lorsque on appuie sur le bouton du milieu de l'accueil
function showHome(){ $("#slider").hide(); $("#take-picture").hide(); $("#map").hide(); $("#album").hide(); $("#detail").hide(); $("#footer1").hide(); $("#footer2").hide(); $("#footer3").hide(); $("#titre").delay(200).fadeIn(800); $("#footer1").delay(1200).css("display", "flex").h...
0
32c54109758eba28bb1a154a364a2c87
d67fc768f5403c1f0e084f943a1c26df
これまでの結果を表示
function pastRegister($studentId,$result){ if(count($result) == 1){ $registTime = $result[0]['REGISTER_TIME']; echo <<<EOT <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta h...
1
565ff6e98a2e0eed2e8e6a80e0542281
06e2cd03ba3059686cdf3ca471cabb32
Print text while idling.
void vApplicationIdleHook( void ) { static TickType_t xLastPrint = 0; TickType_t xTimeNow; const TickType_t xPrintFrequency = pdMS_TO_TICKS( 5000 ); xTimeNow = xTaskGetTickCount(); if( ( xTimeNow - xLastPrint ) > xPrintFrequency ) { xLastPrint = xTimeNow; } }
0