首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏mathor

    LeetCode3. 无重复字符的最长子串

    第二种情况,c出现在Map中,并且通过Map.get(c)得到c最后一次出现的位置记为lastPos,记aPos = lastPos + 1,unRepeatLen = per[i - 1],bPos = i - unRepeatLen,如果aPos >= bPos,则pre[i] = i - aPos + 1,否则pre[i] = i - bPos + 1,并且无论何种情况都要记得更新字符最后一次出现的位置 int aPos = lastPos + 1; int repeatLen = pre[i - 1]; int bPos = i - repeatLen; if(aPos >= bPos) pre[i] = i - aPos + 1; else pre[i] = i - bPos + 1; pos.put(str[i],i); }

    92720发布于 2018-09-19
  • 来自专栏hotarugaliの技术分享

    LCS、LIS、LICS算法

    , ll _count): apos(_apos), bpos(_bpos), count(_count) {} // 重载相等点 < 操作符 // 用来判定两个相等点是否存在前后依赖关系 bool operator < (const MAPPING mp) const { return apos < mp.apos && bpos < mp.bpos = lcs[i][k].bpos; if(! vertex[apos][bpos]) { // 动态开点 vertex[ = lcs[1][j].bpos; addedge(0, vertex[apos][bpos], 1, A[apos]); }

    1.1K10编辑于 2022-03-01
  • 来自专栏深圳架构师同盟

    大数据领域开山鼻祖组件Hadoop核心源码剖析

    (bpos); } } // 然后通过startAll启动所有BPOfferService startAll(); } // Step 4. = bpByNameserviceId.get(nsToRemove); bpos.stop(); bpos.join(); // they will call remove @Override public Object run() throws Exception { for (BPOfferService bpos void initBlockPool(BPOfferService bpos) throws IOException { NamespaceInfo nsInfo = bpos.getNamespaceInfo (); if (nsInfo == null) { thrownew IOException("NamespaceInfo not found: Block pool " + bpos

    18510编辑于 2025-11-20
  • 来自专栏Netty历险记

    Linux系统读取目录内文件顺序

    ); printf("inode# file type d_reclen d_off d_name\n"); for (long bpos = 0; bpos < nread;) { d = (struct linux_dirent *) (buf + bpos); printf("%18ld ", d->d_ino); d_type = *(buf + bpos + d->d_reclen - 1); printf("%-10s ", (d_type "%4d %10jd %s\n", d->d_reclen, (intmax_t) d->d_off, d->d_name); bpos

    4.3K20编辑于 2022-06-02
  • 来自专栏腾讯数据库技术

    比ls快8倍?百万级文件遍历的奇技淫巧

    argc, char *argv[]) { int fd, nread; char buf[BUF_SIZE]; struct linux_dirent *d; int bpos -------\n", nread); printf("inode# file type d_reclen d_off d_name\n"); for (bpos = 0; bpos < nread;) { d = (struct linux_dirent *) (buf + bpos); printf("%8ld ", d->d_ino); d_type = *(buf + bpos + d->d_reclen - 1); printf("%-10s ", (d_type ("%4d %10lld %s\n", d->d_reclen, (long long) d->d_off, d->d_name); bpos

    5.5K50发布于 2018-06-05
  • 来自专栏后台通用技术

    tidwall/wal库源码分析

    uint64 // first index of segment ebuf []byte // cached entries buffer,该segment实际的数据 epos []bpos 则其对应的数据的起始下标和结束下标分别为start=epos[i].pos,end=epos[i].end, // 因此最终的数据为 data=ebuf[start:end] } type bpos 拿到index对应的data,1和4是相互对应的 data := datas[:b.entries[i].size] var epos bpos // dst = appendJSONData(dst, data) dst = append(dst, '}', '\n') return dst, bpos{mark, len(dst)} return append(dst, '"') } func appendBinaryEntry(dst []byte, data []byte) (out []byte, epos bpos) {

    88120发布于 2021-07-19
  • 来自专栏浪浪山下那个村

    BPServiceActor详解

    NamespaceInfo nsInfo = retrieveNamespaceInfo();bpos.verifyAndSetNamespaceInfo(this, nsInfo);到此与NameNode disk - so update the bpRegistration object from that info DatanodeRegistration newBpRegistration = bpos.createRegistration

    16600编辑于 2024-07-21
  • 来自专栏Coding迪斯尼

    自己动手写数据库系统:容灾恢复原理和容灾恢复日志的设计

    (UINT64_LENGTH) tx_num := p.GetInt(tpos) fpos := tpos + UINT64_LENGTH filename := p.GetString(fpos) bpos ) opos := bpos + UINT64_LENGTH offset := p.GetInt(opos) vpos := opos + UINT64_LENGTH val := p.GetString := uint64(fpos + p.MaxLengthForString(blk.FileName())) opos := uint64(bpos + UINT64_LENGTH) vpos := ) opos := bpos + UINT64_LENGTH offset := p.GetInt(opos) vpos := opos + UINT64_LENGTH val := p.GetInt( := uint64(fpos + p.MaxLengthForString(blk.FileName())) opos := uint64(bpos + UINT64_LENGTH) vpos :=

    1.2K11编辑于 2022-06-21
  • 来自专栏浪浪山下那个村

    BPServiceActor详解

    NamespaceInfo nsInfo = retrieveNamespaceInfo(); bpos.verifyAndSetNamespaceInfo(this, nsInfo); 到此与NameNode disk - so update the bpRegistration object from that info DatanodeRegistration newBpRegistration = bpos.createRegistration

    19220编辑于 2024-07-22
  • 来自专栏Bingo的深度学习杂货店

    Leetcode 【495、835】

    Apos = [(row, col) for row in range(N) for col in range(N) if A[row][col]] # A中1的位置 Bpos sub = dict() # 用字典对A和B中1的位置的差值计数 max_ = 0 for a in Apos: for b in Bpos

    61830发布于 2019-06-17
  • 来自专栏云微的一点分享

    eBPF 开发实践:使用 eBPF 隐藏进程或文件信息

    pid_tgid >> 32; short unsigned int d_reclen = 0; char filename[max_pid_len]; unsigned int bpos = 0) { bpos = *pBPOS; } for (int i = 0; i < 200; i ++) { if (bpos >= total_bytes_read ) { break; } dirp = (struct linux_dirent64 *)(buff_addr+bpos); bpf_probe_read_user but there's still more to read, // jump back the start of this function and keep looking if (bpos < total_bytes_read) { bpf_map_update_elem(&map_bytes_read, &pid_tgid, &bpos, BPF_ANY);

    97310编辑于 2023-08-14
  • 来自专栏游戏杂谈

    截取含HTML标签的字符串

    imgNum : 100; //最多显示100张图片 10: 11: while (i < lineNum && (bPos != -1 || iPos ! ); 15: if (bPos == -1) { 16: bPos = str.indexOf("<br", nPos); = -1 && (bPos == -1 || bPos > iPos)) { 27: nPos = iPos + 1; 28: 29 ); 48: if (bPos == -1) { 49: bPos = str.indexOf("<br", nPos); = -1 && (bPos == -1 || bPos > iPos)) { 60: nPos = iPos + 1; 61: 62

    2.3K20发布于 2018-11-15
  • 来自专栏云微的一点分享

    eBPF 开发实践:使用 eBPF 隐藏进程或文件信息

    pid_tgid >> 32; short unsigned int d_reclen = 0; char filename[max_pid_len]; unsigned int bpos = 0) { bpos = *pBPOS; } for (int i = 0; i < 200; i ++) { if (bpos >= total_bytes_read PROG_02); } bpf_map_update_elem(&map_to_patch, &pid_tgid, &dirp, BPF_ANY); bpos but there's still more to read, // jump back the start of this function and keep looking if (bpos < total_bytes_read) { bpf_map_update_elem(&map_bytes_read, &pid_tgid, &bpos, BPF_ANY);

    70210编辑于 2023-10-16
  • 来自专栏HkingAuditore

    【Unity Shader】星夜极光

    float pt = ((0.8+pow(i,1.4)*0.002)-ro.y)/(pos.y*2.0+0.8); pt -= of; float3 bpos = ro + pt*pos; float2 p = bpos.zx; // 颜色 float noise = SurAuroraNoise float pt = ((0.8+pow(i,1.4)*0.002)-ro.y)/(pos.y*2.0+0.8); pt -= of; float3 bpos = ro + pt*pos; float2 p = bpos.zx; // 颜色 float noise = SurAuroraNoise

    1.1K32编辑于 2023-10-26
  • 来自专栏算法协议

    一文读懂Wal的作用和实现(Etcd和Tidwall)

    fileindex uint64 // first index of segmentebuf []byte // cached entries buffer,该segment实际的数据epos []bpos 则其对应的数据的起始下标和结束下标分别为start=epos[i].pos,end=epos[i].end, // 因此最终的数据为 data=ebuf[start:end] }type bpos 拿到index对应的data,1和4是相互对应的data := datas[:b.entries[i].size] var epos bpos// Write(index,data)一样s.ebuf = nil {return err}data = data[n:]epos = append(epos, bpos{pos, pos + n})pos += n}s.ebuf = ebufs.epos

    4.7K51编辑于 2022-08-03
  • 来自专栏云鼎实验室的专栏

    每周云安全资讯-2022年第20周

    今天为大家介绍一个“多云一键部署的可伸缩的存储解决方案” https://mp.weixin.qq.com/s/XgrZukn87Sovuv7bPoS_eA 7 用户视角下的数据安全需求、挑战与演进

    51120编辑于 2022-05-16
  • 来自专栏大数据技术与应用实战

    hadoop2.7.3源码解析之datanode注册和心跳机制

    @Override public Object run() throws Exception { for (BPOfferService bpos : offerServices) { bpos.start(); } return null;

    55920发布于 2020-09-15
  • 来自专栏全栈程序员必看

    levelDB 的版本控制[通俗易懂]

    // Add all smaller files listed in base_ for (std::vector<FileMetaData*>::const_iterator bpos = bpos; ++base_iter) { MaybeAddFile(v, level, *base_iter); } MaybeAddFile

    96420编辑于 2022-07-25
  • 来自专栏生信菜鸟团

    HOMER - motif 挖掘和分析

    TGCCTTGGGA 1-TGCCTTGGGA 8.577033 -23.732495 0 T:23.0(11.33%),B:933.1(2.02%),P:1e-10 Tpos:253.5,Tstd:160.0,Bpos Bpos:247.2 Motif 在背景序列中的平均位置(247.2 bp)。 Bstd:146.2 背景序列中 Motif 位置的标准差(146.2 bp)。 TGCCTTGGGA 1-TGCCTTGGGA 8.577033 -23.732495 0 T:23.0(11.33%),B:933.1(2.02%),P:1e-10 Tpos:253.5,Tstd:160.0,Bpos

    2.5K10编辑于 2025-03-11
  • 来自专栏区块链大本营

    出海、拆分、集成公链,“国家队区块链选手”BSN在下一盘怎样的棋?

    如以太坊和 EOS 是目前区块链赛道中现存应用量最庞大的头部公链,具备大量的开发者需求;NEO 则是老牌的中国公链,国内外社群都属于热度比较高;IRISnet 是可以自进化的 BPoS 跨链服务枢纽,支持公链

    71220编辑于 2023-03-31
领券