query_id
string
corpus_id
string
query
string
code
string
label
int64
19fe82f65c0584c8e429de8b8e479d4b
02b250dcb21de05a5d41c592dcbd4207
设置@所有人
namespace Sisters.WudiLib public class SendingMessage : SectionMessage public static SendingMessage AtAll() => new SendingMessage(Section.AtAll());
1
8bef8c1a7dec99c1309c7fae638e43ce
fff3d52d922585ea42773e00d27de6cf
北京银行账单解析
{ $money = '[\-\d\.,]+'; $date = '\d{4}\-\d{2}\-\d{2}'; $p = "/信用额度 # RMB ($money) # 取现额度 # RMB ($money) # 本期账单日 # ($date) # 本期应还金额 # RMB ($money) # 本期还款日 # ($date) # 本期最低还款额 # RMB ($money)/"; $r = preg_match_all($p, $s, $out); if ($r) { $info['credit_limit'] = Pa...
1
2b21ccdfa28f210dfb6e7005f3f5a530
06f68f28953657c198c4ef8f6a54f7f9
Record HTTP requests and server replies
requests = self.requests for record in self.conn: if record.type in EXISTING_REQUEST_REC_TYPES: request = requests.get(record.request_id) if not request: logger.error('Non-existent request in %s. Closing connection!' % record) ...
0
9c319038ca80c6fb41588c8094a7fc7f
3ab963eb7b81a150cb2fcaa8b5e9b8f7
Funcion que establece la relacion "una publicación pertenece a un usuario"
class Post extends Model public function user(){ return $this->belongsTo('App\Models\User','user_id'); }
1
ff3943078e0da21c24fda05850ed8f34
2642482582ca5cfa4d25a4158e32dc8d
Handle a write to PPUSCROLL ($2005)
class PPU def poke_2005(_addr, data) update(RP2C02_CC) @io_latch = data @scroll_toggle = !@scroll_toggle if @scroll_toggle @scroll_latch = @scroll_latch & 0x7fe0 | (data >> 3) xfine = 8 - (data & 0x7) @bg_pixels.rotate!(@scroll_xfine - xfine) @scroll_xfine = xfine...
1
cc42fdea736af322a91674c95f7d1db9
6d5850392b957d1dfb247012f3fe841c
比较音乐是否是同一个地址 http://zhangmenshiting.qianqian.com/data2/music/0cc6430b863f1fc6032a29d42218ddcd/598649096/598649096.m4a?xcode=ec27389241337245e9c5304b21fec782 没次xcode
public class MusicPresenter extends BasePresenter<MusicContract.View, MusicContract.Model> implements MusicContract.Presenter @Override public void getMusicPlayPath(int position) { Music.SongListBean bean = mMusicList.get(position); Music.SongListBean playSong = PlayerManager.getInstance().getPlaySo...
0
e5e22dd1ecf7d4169a28507aca9e5317
14f5aa3356ac9dd07bc78c3012f6c5d4
判断该works是不是用户的
if($sort_id > 0){ $sort_obj = M('Book_works_sort'); $array = $sort_obj->find($sort_id); }else{ $work_id = (int)$_REQUEST['work_id']; $work_obj = M('Book_works'); $array = $work_obj->find($work_id); } $user_id = Cookie::get('user_id'); if($user_id != $array['user_id']){ $this->error('非法操作!...
1
9e8e4e0943b0f70559ef8e230b123cb6
121859bfbf6f53541bfb85625ad4cef4
选择排序具体实现
public class SortUtils public static void select(int[] a) { int len = a.length; for (int i = 0; i < len; i++) { int value = a[i]; int position = i; for (int j = i + 1; j < len; j++) { if (a[j] < value) { value = a[j]; ...
1
d81a73d4bd563260d68822d073c88001
9e81acf53f7855397117d3d6d42335f2
Sets whether Headers should be translated.
public class OpenXMLOptions implements Serializable public boolean getTranslateHeaders() { return this.translateHeaders; }
0
a31a6882fd1139db915d8572c2ac9d1b
eb1e58e01fa899016d9623d5a9a22c5e
Locator for send button to send the message in inbox.
class MiGUI(GUI): def on_main_window_inbox_button_click(self): pass
0
7d7cc1872239ea7bc6b848cf431e7541
f6ef0fb84b86308998f167e6b1cee804
calcula la distancia entre $origen y $destino en metros
double cordX = destino.latitud - orig.latitud; double cordY = destino.longitud - orig.longitud; double distancia = sqrt(pow(cordX, 2) + pow(cordY, 2)); return distancia; }
0
a5fec88f39df697b1e55666480e6b2fe
14544b47b7b5772b4bd6b84780b737e9
部门单选-支持筛选部门
@AndroidEntryPoint @Route(path = ARouterPath.Web.PAGER_WEB) class WebViewActivity : AppBaseActivity<ActivityWebviewBinding, WebViewViewModel>(){ fun singleSelectOrg(){ ARouter .getInstance() .build(ARouterPath.Workbench.PAGER_ORG_OR_STAFF_SELECT) .withInt("type",1) ...
1
10bc408e630b5932b5ccf06a78267e0e
56f23cbd4d10eaac37cf41bcbbc7f91b
Add a part in the right position (wrapped in a JBI part wrapper) to the JBI message wrapper element The part node does not have to be associated with the normalDoc yet, it will be imported
Br breakObj = new Br(); breakObj.setType(STBrType.PAGE); P paragraph = factory.createP(); paragraph.getContent().add(breakObj); documentPart.getJaxbElement().getBody().getContent().add(paragraph); }
0
b54ce1625a6d42518b4c3a29d2deee3b
44637a1b2277dfea5b4171dbdfa27f66
渡された文字列を破壊的に大文字に変換するメソッドを定義する
public class StringDemo public static void goToUpperCase(String str) { System.out.println(str.toUpperCase()); }
0
802883fe5cbc60d4e55d7629ccff34a1
b5cc9100c18c8dbf8af0429ca46fd3a0
When the value is divisible by three
def by_three(x): return x % 3 == 0
1
0c2d21475a34251654e10438b26162d8
41bf5969edc2a8a5d2989579cb29e5a7
Find the character mapping for the given platform and encoding if available.
namespace Microsoft.EntityFrameworkCore.Storage [Obsolete("Use RelationalTypeMappingSource.")] public class StringRelationalTypeMapper : IStringRelationalTypeMapper public virtual RelationalTypeMapping FindMapping(bool unicode, bool keyOrIndex, int? maxLength) => unicode ? FindMappin...
1
7e46488135699bf0abdfee423a92650c
5e2d20cf465531d45b3b03b3864d1244
This function returns a vector of the indices at which given boolean mask is True. at::nonzero can achieve the same, but we yet have to compare the performance difference.
fn where_2D(bools: Array2<bool>) -> Vec<(usize, usize)> { let x: Vec<_> = bools .indexed_iter() .filter_map(|(index, &item)| if item { Some(index) } else { None }) .collect(); return x }
1
522d12f0ab502fa11060dc051d3880d8
47d57e35d528eb47b6f5ada8fd268d75
ดึงผลสรุปของงานในหลักสูตร
include 'php/conn.php'; $mysqli_result = $mysqli->query("SELECT * FROM pro WHERE id = {$pro}"); $row=$mysqli_result->fetch_assoc(); if($_SESSION['permissions']==3){ $mysqli_result = $mysqli->query("SELECT stu_class,count(*) number FROM {$row['pro_table']} WHERE stu_teacher='{$_SESSION['name']}' GROUP BY...
1
641e4309e808f4eb20e69852c5cae8cc
255c7256951520e6807206c4422942e6
Cambia los valores de la matriz por los que le pasen como parámetros.
public class Matrix2d protected void setValues(double a, double b, double c, double d) { this.a = a; this.b = b; this.c = c; this.d = d; }
1
87e2440c9359f622b8f138347b5d8f99
3d54dcc11ca3ba109fd792ec314640b2
********************************* Default SebStarter settings click *********************************
{ try { $this->setSefDefaultParams(); $this->getResult(); $this->includeComponentTemplate($this->page); } catch (Exception $e) { ShowError($e->getMessage()); } }
0
bcbe2dac884059aaed534fc383077d58
ffcb94f54e50fd372c86bad32138a2fe
计算任务状态
class RunningStatus(object): def get_task_state(self): self.update() if self.get_fixtask_count()==0 and self.get_randomtask_count()==0: return 'notask' for ft in self.fixtask_assign.values(): if ft['status']=='waiting': return 'assigning' for rt in...
1
9d24189dfb0b4887d46578391114536e
66cd462e013b34d6fb28102efd09bf89
IGMP v2 report message is received.
uint16_t count = ntohs(hdr->count); clusterMsgDataGossip *g = (clusterMsgDataGossip*) hdr->data.ping.gossip; clusterNode *sender = link->node ? link->node : clusterLookupNode(hdr->sender); while(count--) { uint16_t flags = ntohs(g->flags); clusterNode *node; sds ci; if (s...
0
2a4cc7ebcd42b68f339ba60af998b6ed
cace4d1c924e113eac2daf5c43adaa5d
如果当前堆的位置已经到达界限则申请内存页 否则必须循环申请直到有足够的内存
{ if(header.lenth==0) { unsigned int tmp = header.mem_begin_addr & 0xfffff000; if(tmp != header.mem_begin_addr) { header.mem_begin_addr = tmp + 0x1000; } return coredump_malloc(4*1024); } struct coredump_struct * ptr = header.head; int index = findFisrtSuitFrame(); if(index == -1) { unsigned int ...
0
1ad637a18856b8a7350012cc52df746a
42f79862ae2871c94a5d5bd5fd0b7a20
是否吸血影响的单体伤害技能
function id_105(unit,other,condition,value,value1,value2,value3) local skill = unit:getActiveBattleSkill(); if skill == nil then return 0; end local type = unit:getTeamUnitCondition():getDamageAffectInfo().skillType; if value1 ~= 0 and value1 ~= type and value1 ~= 7 then return 0; ...
0
d17b7c722972982277c6f36407842edf
53197f42064432de3e278324cf52365c
(c.haag 2016-05-19 14:18) - PLID-68687 - Called when the asynchronous query finished running and the datalist is populated
namespace CSADONETDataServiceSL3Client public partial class SchoolLinqToSQLServiceDelete : UserControl private void OnCourseGradeQueryComplete(IAsyncResult result) { Dispatcher.BeginInvoke(() => { DataServiceQuery<CourseGrade> query = result.Asy...
1
d20d71fff54f51fd180a27bb4dc4018c
7ddc2100d94c2249ce9f7a30868725cb
Bid Land Assets with Ring token.
{ var ringClient = new RingClient(); await ringClient.Initialize(authToken); return ringClient; }
0
30d355276103345ac9e232fc4f57af20
c04b481e876b222e529568631fa7544f
Destructor for ProcessQueues. Must manually free memory because the ProcessQueue struct allocates memory on the heap.
{ if (queue != NULL) { NULLCHECK_AND_FREE(queue->packets); free(queue); } }
1
e0909c3bf41a28e7193c92f453be8ff2
3abbaaeb90da869b3fcca4267a57bfc0
Conversion of two top stack items from date to milliseconds.
{ struct kDateVar *d = sfp[0].asDate; d->tv.tv_usec = sfp[1].intValue * 1000; kint_t ret = (kint_t)d->tv.tv_sec * 1000 + (kint_t)d->tv.tv_usec / 1000; KReturnUnboxValue(ret); }
1
4a96615fc32d21daf2c73c6e3f799883
1cefdbdce69dbccb697c1a773fc4ab9a
商家注册表单页面
class RegisterController extends Controller public function showRegistrationForm() { $arr['categories']=category::all(); $arr['web'] = Websiteinformation::first(); return view('merchant.auth.register')->with($arr); }
1
d6acb834e0c1aa8b876abf65d72079b2
62a034391f083d1a8dc6c84d69655315
Sets a process to active once the CPU time has passed the process's arrival time.
if(currentProcess.getCpuBursts().size() != 0){ if( currentProcess.getCurrentCpuTime() >= currentProcess.getCpuBurst(currentProcess.getCurrentCpuBurst()) ) { currentProcess.setCurrentCpuTime(0); if (currentProcess.getCurrentCpuBurst() < currentProcess.getCpuBursts().size()) currentProcess.setCurrentCpu...
0
c85353d3e02cedaabebbb9c0c66c4788
7f5e51a833c749d8806ec71133c70ae3
通过iframe实现异步上传 需要传入对应的控制节点,方便复用
var opt = jq.data("fileUpload"); let params = {}; if (opt.onBeforeSubmit) { let result = opt.onBeforeSubmit.call(jq, _getValue(jq), params); if (result === false) { return; } } opt.queryParams = $.extend(opt.queryParams, params); $.fn.fileUpload.event.onBeforeSubmit.call(jq); var frameId = "j...
1
358b52e0b744e9764aff87656dcfe0f3
be5714c2e2a5de5e5dc7af84ba038b4c
定义渲染页面及更新Session的函数
context = {} s = Session.objects.get(pk=request.session.session_key) context['sessionId'] = request.session.session_key context['sessionData'] = s.session_data return render_to_response('ProjectManSys/index.html', context, context_instance=RequestContext(request))
1
e154097049fb4c21813b41092d4aba08
1bdc72029d1c8f687ef5eccd4d513d01
Get a list of available gpu devices (formatted as strings). # Returns A list of available GPU devices.
output = run_command("nvidia-smi -L") gpu_regex = re.compile(r"GPU (?P<gpu_id>\d+):") result = [] for line in output.strip().split("\n"): m = gpu_regex.match(line) assert m, "Couldnt parse " + line result.append(int(m.group("gpu_id"))) return result
0
19b26e6f2f8732482bd8130d63de85c1
47f6dfe8f1b0753b8a8bd59b035bff70
Starts the application opening the main menu and starting the background music
namespace nl.SWEG.Willow.UI.Menu public class MenuManager : SingletonBehaviour<MenuManager> public void StartGame() { background.SetActive(false); SceneLoader.Instance.LoadGameScene(); }
0
50f9d9329cadf54dd6826cef88047aec
a6a1478a2354d5faea9babebe2b83d9b
Generates the constraints for the given sub-AST.
public class DefaultSqlEmitter implements SqlEmitter public abstract <T extends JmConstraint>List<Token> emit(JiemamyContext context, T constraint, TokenResolver tokenResolver);
1
94b669bbc4a8b9822f3e31ea854865ea
8af67490e5b322708ca49864e4cd8467
Adds meta tags needed to make games work on tablets, phones, etc.
$meta_viewport = array( '#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array( 'content' => 'width=device-width, initial-scale=1.0', 'name' => 'viewport', ) ); drupal_add_html_head($meta_viewport, 'meta_viewport'); drupal_add_css( 'http://fonts.googleapis.com/css?family...
1
c29c162d6f4736ba0b7506d4473a718e
49871e018beb614789997387c8c57835
Allocate dynamic memory and set default values.
{ VectorFD *vfd = (VectorFD *)calloc(DEFALT_VECTOR_NR, sizeof(VectorFD)); assert(vfd != NULL); vfd->fd = (int *)calloc(DEFALT_FD_NR, sizeof(int)); assert(vfd->fd != NULL); vfd->counter = 0; vfd->max_counter = 0; return vfd; }
1
065dff4d6d9dac8f072b29e7975cf8fd
01eb77ab243cddf1dcc13253628d82c0
用于按钮触发普攻
public class BattleSystem : MonoBehaviour public void ButtonAttackSpecial() { StartCoroutine(CorouAttackSpecial()); }
0
2e9fd4ac4e665caa124679cb902f7577
b9cc910423c95450c1241b4e0fae3564
Removes the XSSI prefix from the specified raw JSON & returns the result.
if (Utils.isNull(rawResult)) { return ""; } String theKey = key + "={"; int start = rawResult.indexOf(theKey); int end = rawResult.indexOf("}", start); return rawResult.substring(start + theKey.length(), end); }
1
74b07852037f1be186170843e624c600
6a501a06d2db1f161bc7012acb523639
ボードが空いていればTrueを返す
function nospace(board) { for (var x = 0; x < Boardn; x++) { for (var y = 0; y < Boardn; y++) { if (board[x][y] == 0) { return false; } } } return true; }
0
032184a1092e49bd5805a966aca82cf4
6656742d77217ae4b3d99806dfa492b8
Расчёт градации
{ const auto& src = pic->Mat(); double minVal, maxVal; cv::Mat res; cv::Mat XGrad, YGrad; cv::Mat XGradAbs, YGradAbs; Sobel( src, XGrad, Depth, 1, 0, 3, Scale, Delta, cv::BORDER_DEFAULT ); convertScaleAbs( XGrad, XGradAbs ); Sobel( src, YGrad, Depth, 0, 1, 3, Scale, Delta, cv::BORDER_DEFAUL...
1
34ac5e4e6f9ed81e90351010bc89f547
d14e942de0de931a21dc72a313780ebe
Query DB table <tt>sys_role_user</tt> for records. <p> The sql statement for this operation is <br> <tt>select COUNT(*) from sys_role_user</tt>
public int count() throws DataAccessException;
1
7123d22db3235475911d18cc97fe4fbb
f65b4c3545ed9c0935ae3946f1661ae1
获取buvId
@Entity @Table(name = "SYS_CUSTOMFORM_SETTING") @TableDefine(title = "自定义表单配置设定") public class SysCustomFormSetting extends BaseTenantEntity public String getBodefId() { return this.bodefId; }
0
9cb7650e280d2a111ef9957781796ff8
4f3f550ccfaa06427597e3104ef12853
@brief Application entry point Loads the room and reservation data and displays the main menu
m_storage = Storage::getStorage(); renderMain(); CMenu &menu = *createMainMenu(); cout << menu; cin >> menu; menu(); delete &menu; return 0; }
1
7d2b18c43af8178e35a7cf0f6a1d2764
fa68ea6e89209e614dfa51bd832fa4a7
save_accounts function is called by logout to save what's in memory to the cellar CSV file on disk.
def details_account(rec, flike): flike.write(json.dumps({ 'username': rec.username, 'anonymous': rec.anonymous, 'interconnect_audience': rec.interconnect_audience})) return rec
0
6d29c2c5e8f34bfe503434991302542e
f7180455d6d4ee3361b9ac01a8c7f899
判断数据表中是否已近存在当前月的当前部门的排班
namespace LiXinDataAccess.DeptPlanManage public class Dep_MonthPlanDB : BaseRepository public bool IsExistMonplan(int year, string month, int id, int deptID=0) { using (var conn = OpenConnection()) { var sql = string.Format(@"SELECT COUNT(*) as count FROM Dep_MonthPla...
1
d4327941843cff7d77a60148665c7d80
c2654a68d6e8becc7fbdbeb9cf0e1937
모스부호 변환
result_data = '' for item in input_data: if item == '1': result_data += '0' else: result_data += '1' return result_data
0
e91c432ecf0468def7f9ae7c21f47f78
d25b75318304dc497b86d08127ef763a
Tests to see if correct mode is served when given an appropriate character
class LyaParser: def p_character_mode(self, p): p[0] = p[1]
0
42ef7b960c6aa9ede685c9d6e007a3b8
da1fdb43b49deaebbf3053fbba4019ee
Check (recursively) if a fragment is before the specified fragment.
boolean lastWasAFrag(struct agp *prev, struct agp *curr) { if (!curr || !prev) return FALSE; if (curr->isFrag && prev->isFrag) { struct agpFrag *prevFrag = (struct agpFrag *)prev->entry; struct agpFrag *currFrag = (struct agpFrag *)curr->entry; return (sameString(currFrag->frag, prevFrag->frag) && ...
0
60f2461b749a5f8c5c2f7805686d1645
de58989bd72be4b8d44053ad1bf0ed4d
Adapt the fan-out of a gate to the capacity of the matrix
class LGFCell(LightningModule): def _gconv(self, inputs, state, output_size, is_c_opt=False): batch_size = self.batch_size num_nodes = self.num_nodes x = torch.cat([inputs, state], dim=-1) input_size = x.size(2) x0 = x.permute(1, 2, 0) x0 = torch.reshape(x0, shape=[num_nodes, input_size * ba...
0
13a1cc889b3a721665f88f47ecadd494
657069677bb39e09559eede41b053837
Values cannot be executed, only added to the dictionary when instantiating a function.
class CorinaExecutablesEnum: def __setattr__(self, key, value): raise ValueError("No changes allowed.")
1
4362658b928246696a0517768a9adbc5
823ddc7e37e48c568ecd888ebfbcb4ad
Called whenever this module is inactive and updating (implementation by child modules), useful for cooldown updating etc.
public class ActivatableBehaviour : MonoBehaviour protected virtual void OnFixedUpdateInactive () { }
1
a27951c1ce940cae7f4cdd8dda0f6c02
0bc8adf1e9281725d086f2e7a719eb3d
trim leading slash
class slashIndependentPatternRouting extends sfPatternRouting public function parse($url) { $url = rtrim($url, '/'); return parent::parse($url); }
0
1cbb19b322fc0a0674f1603b590a1324
9215874ed1a8bf6422ac68db64ebd828
动态设置Drawable的透明度,让前景图逐渐显示
final TransitionDrawable td = new TransitionDrawable(new Drawable[]{ new ColorDrawable(ResourceUtils.getColorFromRes(context, android.R.color.transparent)), new BitmapDrawable(context.getResources(), bitmap)}); imageView.setBackgroundDrawable(imageView.getDrawable()); ...
1
7c7ec06453b93faa2a642577f140cb86
6c8523cbbafb615c33d0ba2b0fa9497a
# Exibe as três caixas de filmes após o filme destacado.
class SessaoController extends Controller public function index() { $sessao = DB::table('filme_sala') ->where('filme_id', '=', 1) ->where('shopping_id', '=', 1) ->get(); return $sessao; }
0
cc43eac646c26f9aefd474663436a292
c13619fdd43c84c3e1cff9fa7842985d
Gets a pointer to the metadata tokens for the Type that implements the specified method, and for the interface that declares that method.
namespace ClrDebug.Native public unsafe class MetaDataImport : Unknown public int EnumMethodsWithName(ref EnumHandle phEnum, uint cl, Span<char> szName, Span<uint> rMethods, out uint pcTokens) { fixed (void* pphEnum = &phEnum) fixed (void* pszName = szName) fixed (void* p...
0
44f40b575902652eb6557f1e48c83a61
11f7653466bf2b2789708adef6fa8238
Deletes comic from the database using the id of the comic.
class ComicsController extends Controller public function destroy($id) { $comic = Comics::findOrFail($id); $comic->delete(); return redirect()->route('comics.index'); }
1
087b32cb0acdb0a1b98e2f84114f1121
626028cbdbf1338c475da3e0cf0f0a6f
将新牌加入手牌并通知客户端更新手牌信息
local addDeskCardNotify = {} addDeskCardNotify.Cards = table.clone(cards) for uid, player in pairs(self.playingPlayers) do local tmpCards = {} tmpCards = table.clone(self.cards) table.insert(tmpCards, player:getCards()[1]) table.insert(tmpCards, player:getCards()[2]) local bestGroup = CardAlgorithm.getBest...
0
25429b87766c9a1c89639f559cf581ec
59278e97e74246db38a32ec949bd8dfd
Returns the sample rate for the chosen audio output device.
class MicrophoneInput(object): def sample_rate(self) -> int: return int(self._dev['defaultSampleRate'])
0
7e237cbaf5b22dfa729dc541acce99db
5a2eb3497239b772b506c37bf04f7365
超时登出的日志记录,为避免重复记录,增加锁
local function handshake_timeout() while true do local tm = skynet.now() local tbl = {} do for k, v in pairs(User_Map) do if v.conn then v.tm = skynet.now() else if tm - v.tm >= tcount then ...
0
874c03f7184aaa50ace4d639e78c83bc
06a5056d41826ceabb6e5a05a2b4c727
test if a given even length array returns the right index
int pos = 0, e_pos = 19, e_vals[] = {21, 58, 41, 85, 39, 10, 64, 69, 41, 5, 62, 27, 2, 97, 30, 22, 39, 94, 56, 98}; memcpy(vals, vals_orig, VALS_SIZE*sizeof(int)); pos = lib_partition_by_pivot_index(10, vals, vals+VALS_SIZE-1); CU_ASSERT(pos == e_pos); for (int i = 0; i < VALS_SIZE; ++i) CU_...
1
9d22d6e958ddf13c63fd1a0e2628dbf8
8d32bf12c608d939d72f57d38d835f87
Tangent of a number in \[-π/2, π/2\], in radians.
namespace LanguageExt.ClassInstances [Pure] public decimal Atan(decimal x) => (decimal)Math.Atan((double)x);
0
9f995809af9bbca028618dc3cb7c7071
13d7a1c062008d1c90c605a8157e2e46
Estimate the effect that upweighting the inputs of a training instance will have on the loss of a test instance
W1, W2 = insert_zero(standard, undertest) if len(W2) == 0: return 0 absd = np.sum(np.abs(W1 - W2)) / np.sum(W2) return 1 / (1 + absd)
0
d072752c7c2a83874c2799de8fcfa904
ffc626a35216d7b125fc1f7a93e1ee95
This is an interface leave to be implemented by sub classes.
class Element(object): def process(self): exit_NaCl(self.ctx, "Internal error: Subclass of class Element has not implemented the process method")
1
1c0cf355f386d48ddd00299c690d8b95
43e7a13f506c47c2705e53433b7808a5
Wait until all collections and indexes are ready.
public class InclusionResolver implements IQueryClient, IConsts public boolean chkReady() { for (; getReady() == 0; ) { Thread.yield(); } return (getReady() > 0) ? true : false; }
1
621536b4ebc05d0ee8188084fc6fada9
9bb2044d2e7a6e2ddab42b1185d31d53
根据wordId,获取班次设置的超链接
String[] comTxt = txt.split(","); ComFunExample comFunExample = new ComFunExample(); ComFunExample.Criteria criteria = comFunExample.createCriteria(); criteria.andWordidEqualTo(wordId); List<ComFun> cfs = this.comFunMapper.selectByExample(comFunExample); String[][] str = new String[comTxt.length/2][4]; fo...
0
c3dfe7a2af22b29c99103c949788bad0
a967d56fb30209d2e693cd3c4a2f2d58
获取所有分类的文章
new ArticleApi().getAllHasClassifyName().then(result => { result.map(item =>{ item.date = new Tool().transformDate(item.date); }) result = new Tool().backSortDataByDate(result); result = new Tool().deleteContent(result); this.setState({...
1
ed1771d57b7891a4335ab3d16406b54c
0f130339ede4556fb3f2132f35e1cf16
说明这个状态是属于哪个种类的<br> <p>该方法的添加主要是为了让容器能够更好地管理状态类</p> <p>比如所有的异常状态类都会返回 "abnormal", 因为它们都是属于<b>异常状态</b>的状态</p> 可以返回 null
for (ProductCategoryStateEnum productCategoryStateEnum : ProductCategoryStateEnum.values()){ if (productCategoryStateEnum.getState() == state){ return productCategoryStateEnum; } } return null; }
0
fcc862a03fd7744a95d0c412bfd122e3
99d671f53b588748cf5a5aeb239f65b7
更新 PID 采样值
float PID_Update(pid_t *pid, float setpoint, float target) { float error = setpoint - target; float diff = error - pid->lastError; pid->lastError = error; pid->Kp_Value = pid->KP*error; pid->Ki_Value += pid->KI*error*pid_sampletime; pid->Kd_Value = pid->KD*diff*inv_pid_sampletime; pid->Output = pid->Kp_Value ...
1
83e3bc22a58350c10c6c1b2e252feef6
81f46f8e2e08b8e1168f1577986d6c98
返回p3在直线p1p2哪侧
a = clockwise_from(p0, p1, p2) if a == 0: dist1 = LineSegment(p0, p1).length() dist2 = LineSegment(p0, p2).length() if float_eq(dist1, dist2): return 0 elif dist1 < dist2: return -1 else: return 1 else: return a
0
d31a05a63310d1f5b1f69cf272049cf7
2ba77524a80c96d5a0cebcf7f447366e
查询转让前协议内容
$this->method_is_post(); $data = $this->reg_model->query_agreement_content('6'); if (!$data){ $status = $this->config->item('app_get_data_fail'); $msg = $this->lang->line('app_get_data_fail'); $e_data = ''; } else{ $status = $this->config->item('app_success'); $msg = $this->lang->line('app_succ...
1
eb0719249f806aea86b726871ddafeee
52b7a35b718ea618d30c01bfbb5c7b4e
________ UPLOAD ________
var date = new Date(); var seperator1 = "-"; var month = date.getMonth() + 1; var strDate = date.getDate(); console.log("[" + (date.getYear() + seperator1 + month + seperator1 + strDate) + "]FUNCTION UPLOAD was called."); var form = new formidable.IncomingForm(); console.log("about to parse"...
1
815de579300eb246139d631cc3886f4c
584a87556b99a1d30661d258ca48b420
PHPの小数点誤差を考慮した加算
class NativeCalculator extends Calculator public function add(string $a, string $b) : string { $a = $a; $b = $b; $result = $a + $b; if (is_int($result)) { return (string) $result; } $a = $a; $b = $b; if ('0' === $a) { return $b; } if ('0' === $b) { return $a; } [$aDig, $bDig, $aNeg, $b...
0
28c4bba33bb08774d1d06962f3fd8c94
5486463f9562fe8d1cb17c3cd14d6bec
encrypt the user IP and username for the user hash token
{ string hashTarget = string.Format("{0}_{1}_{2}", user.Email, user.UserName, Settings.Default.SecretKey); return Convert.ToBase64String(_internalHasher.ComputeHash(Encoding.UTF8.GetBytes(hashTarget))); }
0
8203a8eef19bce77b2ba86a9495a4560
15b731c925c206c676d7b651057b0515
將球型碰撞器位置和半徑轉為世界空間
export class Rocker extends cc.Component convertTouchToRadiusPos(origin: cc.Vec2 | cc.Vec3, touchPos: cc.Vec2, radius: number): cc.Vec2 { const distance = touchPos.sub(cc.v2(origin)).mag();; if (radius >= distance) { return touchPos; } let offset = touchPos.sub(cc.v2(origin...
0
f6e2e464dc93dbb327f72241c54b0e84
f52448672faf8333df597e9c65396c69
Parameter für Szenen nur Serialisieren wenn vorhanden
export class SubSurfaceSceneComponent implements ISceneSerializableComponent public serialize(serializationObject: any): void { if (!this.scene.subSurfaceConfiguration) { return; } const ssDiffusionProfileColors = this.scene.subSurfaceConfiguration.ssDiffusionProfileColors; s...
1
bbf46e3eb078d807d183567880b9ef4e
c1df821ceac7a4e6c1cdb091cbfe7ca9
查询应用到今天为止连续登陆次数大于等于指定数值的用户数
public int queryLoginCount(String startTime,String endTime);
0
3a251aeb27c3923db20ad5f20727b405
ef977b2d7194ebe4f9fd2cace5cb229f
****************** Contador de Posts *****************////
String SQL = "{call countPosts (?)}"; CallableStatement cstmt = conn.prepareCall(SQL); cstmt.registerOutParameter(1, Types.INTEGER); cstmt.executeUpdate(); int output = cstmt.getInt(1); System.out.println(PREFIX + "Resultado de la llamada (countPosts) --> " + output); return (output); }
1
df26cb72a4699ad35be68fd4a855a74a
be6e36d3fae4bd41adb042d9087b861a
Flip edges to statisfy Delaunay's criterion
{ float xmin; unsigned int index; triangle* tri; for (unsigned int i = 0; i < faces.size() - 1; i++) { xmin = faces[i]->findXmin(); index = i; for (unsigned int j = i + 1; j < faces.size(); j++) { if (faces[j]->findXmin() <= xmin) { xmin = faces[j]->findXmin(); index = j; } } tri = fac...
0
6de8730c65947de7c5541482783e38b3
eee50ba3996323d3350425c1e5857e8f
Take valid metadata object, and set invalid object_id
{ if ( objectWithMetas != null ) { resetMetas( objectWithMetas, false, false, true, true ); } }
0
17555e6288d35c545e0a5c789510c7de
6c470b8062c28d9e6c46e7ef4399ff44
remove restaurant ownership information in the database corresponding to a given restaurant Id
public class RestaurantDAOImpl implements RestaurantDAO @Override public boolean deleteRestaurant(String id) throws SQLException { Connection connection = null; PreparedStatement stmt = null; try { connection = Database.getConnection(); stmt = connection.prepareStatem...
1
c69e08fabd48905486a080545a997334
c3003825e07ac76a69ad50f2c3960234
如果线程存在,则中断线程
{ interrupted = true; if (Running && runThread != Thread.CurrentThread) { InterruptWait(); } }
1
4989ad6ac13f76de68cb10635840fcbf
893717ad7441109940974e82bbc8ecff
@brief Data collecting method. Obtaining an unique tag.
namespace Unity.MLAgents.Sensors public class GridSensorBase : ISensor, IBuiltInSensor, IDisposable protected virtual void GetObjectData(GameObject detectedObject, int tagIndex, float[] dataBuffer) { dataBuffer[0] = tagIndex + 1; }
1
7ad22eba0f20c0aa412b1d60fa6b9b14
d5b43baacdbd8510c62e6385c7dcb648
Replace the stored command list by the provided one.
public class CommandLineChannel extends AbstractAlarmChannel public void setCommandWithArgs(List<String> value) { cmd = new String[value.size()]; value.toArray(cmd); }
1
271ffcdb18ee9004aecce250cc7421e7
69533277c4cd6217ae185d807953d519
动态注册接收短信的广播接收器
public class MainActivity extends AppCompatActivity private void registerBroadcast() { myReceiver = new MyReceiver(); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(PHONE_STATE); intentFilter.setPriority(Integer.MAX_VALUE); registerReceiver(myReceiver, int...
0
a060ff4de5a456a0299a0509c3f93c42
a01bd85e922ffcc1e37ae761b635b806
Extends the space of the soma towards the given arbor to make a shape that is not sphere. NOTE: The arbor must be connected to the soma to apply this operation, otherwise it is ignored.
ix = 0 p3dsoma = self.get_soma_pos() self.psoma = p3dsoma p0 = np.zeros((3, self.nseg)) p1 = np.zeros((3, self.nseg)) p05 = np.zeros((3, self.nseg)) d0 = np.zeros(self.nseg) d1 = np.zeros(self.nseg) for sec in self.hobj.all: n3d =...
0
130c54deb226438dd3abd4e166483ad9
00f9928fb68e864b86d7ac94caaa69f9
Para saber si la columna es una clave primaria con la restricción AUTOINCREMENT
public function isColumnAutoincrement($num);
1
2847c81a268489cbf6e82c845c65331b
1ef971783ff82889e21865acfbc53c56
设置ma10颜色
public class VolumeDraw extends BaseDraw public void setMaOneColor(int color) { this.maOnePaint.setColor(color); }
0
3661af9c9036a7f9c82ed583c3eb93f6
dc005c8b39611545194dd30c9f02c8e9
Проверка соответствия текущей подстроки с указанной строкой
public boolean matches(String segment, int startIncl, int endExcl) { String s = subPattern; int length = s.length(); if (length != (endExcl - startIncl)) { return false; } for (int i = 0; i < length; i++) { char c1 = s.charAt(i); char c2 = ...
1
d76ad2adedd6c02da7bb0a5b80d25e80
d3078d962dcbc0be64ede20b424e53bd
根据用户名和/或电子邮件进行模糊查询
@Service public class UserService public List<User> findByUsernameOrNetname(String username,String netname) { return userDao.findByUsernameOrNetname(username,netname);}
0
7b9a4fb94fedce7573af3ddf9e922a9b
6deb03e2bc66671fd1567ab88d38cc99
增加余额,用户付费用,同时增加总收入
class Topup(models.Model): def new(self): m = self.member m.balance += self.amount m.point += int(self.amount / 2) m.save()
0
75542e21642e266cad0eeb803c662f05
a62ccf3152367c8b7d4dae2fdeb7bc6a
查询返回一个结果,多个结果时抛出异常
ResultIterator<T> results = new ResultIterator<T>(query(sql), rc); T result = results.nextOrNull(); results.close(); return (result); }
0
86ff2ba5d34408f8e8c66300906b3bb4
7f61448ad6da3ef0f9cb03f40c5be655
If value is not even
cases like (1)
0
2535e660a8ca3a77814734b6003fee7c
827bbc354b412b1268e30b6b44839361
Getter method for amount of loans originated
public class BankCustomer implements Comparable<BankCustomer> public int getNumberOfLoans() { return bankLoans.size(); }
1
8c570affb38768999126de6d0efdf26d
088fd9cf255e156c126175d94918e650
从缓存获取orgId
class Role extends EntrustRole public static function getOrgAdminIdFromCache() { $type = 2; return static::getIdFromCache($type); }
0
9fefec7dd1e8a6b9ab2ffd1946d0b90c
d9798e17b9d60252050dc6730836d5bd
lấy nhà cung ứng theo mã
Connection connection = CommonCommand.getConnection(); String sql = "SELECT * FROM nhacungung WHERE IdNCU = ?"; PreparedStatement ps = connection.prepareCall(sql); ps.setString(1, idncu); ResultSet rs = ps.executeQuery(); nhacungung ncu = new nhacungung(); while (...
1
1d0af31d46e0844943a00a4726717496
617647ea41aa7ab1ff85dc2c7cbda800
Handles local item's properties (located in a Working Copy). Not called for revision properties.
WorkingCopyStatus getLocalStatus(WorkingCopyContext context, String... spec) throws ScmException;
1
1977704e69dd06ffaec7bec0271dc7e6
adee0ba0914c4fa9795036658ff0d694
Creates a polygon or multipolygon geometry using the bbox as reference. The new polygon will be in the target crs.
def ST_PolygonFromEnvelope(min_x, min_y, max_x, max_y): return arctern.ST_PolygonFromEnvelope(min_x, min_y, max_x, max_y)
1
17f7fbdfa8c7b4ff461529467e327a91
84ccdda5d82c60c79996882303b060f6
Test onGroupFormationFailure should trigger P2pGroupFormationFailure broadcast.
@SmallTest public class SupplicantP2pIfaceCallbackTest @Test public void testOnGroupFormationFailure() { mDut.onGroupFormationFailure("failure-reason"); verify(mMonitor).broadcastP2pGroupFormationFailure(eq(mIface), eq("failure-reason")); }
1
8f8f794cca1f3697194c96ce2f8ded32
3b1aee65b30bd22bf49dfa4eb03369b3
Gets a property from the associated order.
{ var commandParameters = new ArrayList { ticketNumber, (int)propertyId }; return SendCommand<long>(Mt5CommandType.HistoryOrderGetInteger, commandParameters); }
1