yanqiyu 最近的时间轴更新
yanqiyu's repos on GitHub
Roff · 3 人关注
anbox-rpmbuild
Build Anbox for Fedora on COPR
0 人关注
anti-AD
致力于成为中文区命中率最高的广告过滤列表,实现精确的广告屏蔽和隐私保护。anti-AD现已支持AdGuardHome,dnsmasq, Surge,Pi-Hole,smartdns等网络组件。完全兼容常见的广告过滤工具所支持的各种广告过滤列表格式
Stylus · 0 人关注
blog_ci
for my blog
0 人关注
blog_imgs
imgs for jsdelivr CDN usage
0 人关注
blog_md
markdown of https://yanqiyu.info
C++ · 0 人关注
cgproxy
Transparent Proxy with cgroup v2。透明代理,配合v2ray/Qv2ray食用最佳
0 人关注
cgproxy-build
0 人关注
cloudflare-docs
Cloudflare’s developer docs.
0 人关注
comments
0 人关注
Database
EhTagTranslation 项目的翻译数据。
0 人关注
demo
0 人关注
dmca
Repository with text of DMCA takedown notices as received. GitHub does not endorse or adopt any assertion contained in the following notices. Users identified in the notices are presumed innocent until proven guilty. Additional information about our DMCA policy can be found at
Dockerfile · 0 人关注
docker-radvd
teensy radvd image (alpine based)
0 人关注
dowww
📟 Dev on Windows with WSL | 在 Windows 上用 WSL 优雅开发
Dockerfile · 0 人关注
efb-wechat-docker
EFB WeChat Slave Docker Ver.
C++ · 0 人关注
fcitx5
maybe a new fcitx.
C++ · 0 人关注
fcitx5-chinese-addons
Addons related to Chinese, including IME previous bundled inside fcitx4.
C++ · 0 人关注
fcitx5-configtool
0 人关注
fcitx5-fedora
0 人关注
fcitx5-gtk
gtk im module and glib based dbus client library
C++ · 0 人关注
fcitx5-kkc
C++ · 0 人关注
fcitx5-zhuyin
Dockerfile · 0 人关注
fedora-container-systemd
use systemd in podman with a fedora image!
0 人关注
fzug.github.io
Fedora 中文用户组网站
C++ · 0 人关注
Generator
The popular GENIE Generator product is used by nearly all accelerator neutrino experiments and it plays a key role in the exploitation of neutrino data. The Generator implements a modern software framework and it includes state-of-the-art physics modules. It captures the latest results of the GENIE global analysis of neutrino scattering data and in
Shell · 0 人关注
hexo-action
Hexo CI/CD Action for automating deployment.
JavaScript · 0 人关注
hexo-generator-seo-friendly-sitemap
JavaScript · 0 人关注
hexo-theme-fluid
:ocean: 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo
Dockerfile · 0 人关注
juno_toolbox
Toolbox images to be used to deal with JUNO offline development
yanqiyu

yanqiyu

V2EX 第 127736 号会员,加入于 2015-07-18 00:20:26 +08:00
今日活跃度排名 2969
学物理的,懂个锤子的计算机
CloudFlare 发放 $10 的 yubikey 优惠券
YubiKey  •  yanqiyu  •  317 days ago  •  Lastly replied by malu2335
80
CentOS 项目开发重点将转向 CentOS Stream
Linux  •  yanqiyu  •  Dec 12 2020  •  Lastly replied by salmon5
95
grub2 被报道安全问题,可致安全启动被绕过
  •  2   
    Linux  •  yanqiyu  •  Sep 10 2020  •  Lastly replied by ungrown
    38
    leancloud 国际版有域名证书过期了
    全球工单系统  •  yanqiyu  •  May 16 2020  •  Lastly replied by lanternxx
    2
    我也是 00 后, 我也来分享一下我的博客
    程序员  •  yanqiyu  •  Apr 08 2020  •  Lastly replied by bboysoulcn
    17
    你的 Android 机的 IMEI 可能处于不设防的状态
  •  6   
    Chamber  •  yanqiyu  •  Aug 25 2022  •  Lastly replied by ALights
    106
    yanqiyu 最近回复了
    3 days ago
    回复了 leslieranaa 创建的主题 Linux 各个 Linux 发行版论坛
    Fedora: https://discussion.fedoraproject.org/
    中文社区的话有 TG 群
    @yanqiyu 洗了个澡发现边界情况写错了,修了(狗头)
    #include <stdbool.h>
    #include <stdio.h>
    #include <string.h>

    void print_word(const char *str, size_t start, size_t stop) {
    for (size_t i = start; i <= stop; i++) {
    // there is sth like %.*s but for simplicity ...
    printf("%c", str[i]);
    }
    }

    int main(int argc, char **argv) {
    char test_str[] = " f test sentence here bla bla ";
    size_t len = strlen(test_str) - 1;
    size_t start = len;
    size_t stop = len;
    // flag just for proper trailing space ...
    bool is_first_wold = true;
    for (int i = len; i >= 0; i--) {
    if (i != 0 && test_str[i] == ' ' && (test_str[i - 1] != ' ')) {
    stop = i - 1;
    } else if (test_str[i] != ' ' && (i == 0 || test_str[i - 1] == ' ')) {
    start = i;
    if (is_first_wold) {
    is_first_wold = false;
    } else {
    printf(" ");
    }
    print_word(test_str, start, stop);
    }
    }
    return 0;
    }
    7 days ago
    回复了 zzzkkk 创建的主题 C++ fsantinize 弱智
    @zzzkkk 写这么多 while 属于看着就血压高了,寻找单词就看寻找边界就行,一个 while/for 反向找单词边界然后输出就够了
    倒序扣单词并不困难啊,维护两个 index ,一个头部一个尾部,寻找空格和非空格的边界就完了,哪用得着这么多 while

    这么写结构清晰很多,并且含义还容易理解

    #include <stdbool.h>
    #include <stdio.h>
    #include <string.h>

    void print_word(const char *str, size_t start, size_t stop) {
    for (size_t i = start; i < stop; i++) {
    // there is sth like %.*s but for simplicity ...
    printf("%c", str[i]);
    }
    }

    int main(int argc, char **argv) {
    char test_str[] = " f test sentence here bla bla ";
    size_t len = strlen(test_str) - 1;
    size_t start = len;
    size_t stop = len;
    // flag just for proper trailing space ...
    bool is_first_word = true;
    for (size_t i = len; i > 0; i--) {
    if (test_str[i] == ' ' && test_str[i - 1] != ' ') {
    stop = i;
    } else if (test_str[i] != ' ' && test_str[i - 1] == ' ') {
    start = i;
    if (is_first_word) {
    is_first_word = false;
    } else {
    printf(" ");
    }
    print_word(test_str, start, stop);
    }
    }
    return 0;
    }
    盲猜是你链接的库里面的全局/静态对象初始化的时间
    可以借助 gprof 这样的 profile 工具采样调查耗时
    或者-finstrument-functions 配合手写__cyg_profile_func_enter 以及__cyg_profile_func_exit 直接看每个函数的耗时(不知道有没有造好的轮子)
    23 days ago
    回复了 bitllion 创建的主题 Linux Linux 虚拟机防火墙如何实现
    这种情况下网络请求是从桥上走的,估计得开 bridge-nf-call-iptables 才能让这些请求被过滤
    但是要注意这么开可能有别的副作用
    原来的代码: return xx;/return !xx;

    现在的代码:
    起手一个 boolReturnValueWarpI 的接口类,衍生出 boolReturnValuePassthrough boolReturnValueInvert boolReturnValueAlwaysFalse boolReturnValueAlwaysTrue boolReturnValueRandomly 几个类,大家一起重载虚方法 bool operator()(bool),然后在设计工厂类 boolReturnValueWarpF 构造对应的对象,为了这个事情再引入一个动态的配置数据库 gConfiguration
    最后
    return boolReturnValueWarpF::Instance().GetObject(gConfiguration.GetBoolWarpConf())(xx);
    又唬人有专业,别人有意见还能说你看我这多灵活,还支持运行时选择怎么处理 xx
    那我必然表演什么叫做过度设计
    24 days ago
    回复了 JarvenI 创建的主题 Linux 请问 pve7.4 如何修复根分区?
    最后两行只是告诉你在重放日志,没有说报错。卡在这里别有原因,我建议开高 loglevel 等级看看
    About   ·   Help   ·   Blog   ·   API   ·   FAQ   ·   Mission   ·   Tools   ·   784 Online   Highest 5930   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 84ms · UTC 21:22 · PVG 05:22 · LAX 14:22 · JFK 17:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.