主页

Macos 磁盘清理记录

日志文件 neat download manager: /Users/zorch/Library/Application Support/com.NeatDownloadManager find . -type d -exec rm -f {} \; 在 Windows 中, 位于 C:\user\xx\AppData\Roaming\NeatDM\... 缓存文件 # brew cache brew cleanup --prune 0 # python cache etc. conda clean --all pip cache purge $ pip cache --help Usage: pip cache...

阅读更多

Latex使用区分不同操作系统的宏命令

写在前面 由于不同 的操作系统(例如我常用的 MacOS 以及Windows)下的 LaTeX 字体是不一样的, 一个明显的区别就是宋体在 Windows 下是 simsun(中易宋体), 而在 MacOS 下是华文宋体. 这在跨平台模板的制作中很麻烦, 如果使用下面的命令: \setCJKmainfont{} Windows 一般来说括号里面要写汉字即宋体, 而 MacOS 就要写 simsun. 下面用宏来重新定义一下. 一个例子 \documentclass{article} \usepackage{ifplatform} % must run with shell escape option!!! % xelatex --shell-escape test.te...

阅读更多

Zshell的奇技淫巧

写在前面 最近看一本书, 学习 vi 和 vim 编辑器 第八版, 偶然发现了一个有用的技巧, 就是在 zsh 中使用快捷键达到和在 vim 中移动光标类似的效果, 看了一些博客, 发现 zsh 还有很多经典的技巧, 下面来列举一下. Mastering Zsh Keyboard Shortcuts for Efficient Shell Navigation and Editing | by Robioki Denis | Medium; 快捷键 光标移动类 老生常谈的 emacs 系列快捷键了, 这里先复习一下: Ctrl+bfnp 分别代表 向后(backward), 向前(forward), 向下(next), 向上(preview) 分别对应左右下...

阅读更多

Brpc学习(三)流式请求的多线程实现

写在前面 好久没更新 brpc 的内容了, 主要是因为还是对 brpc 没有深入的理解, 也沉淀不出来什么东西… 代码:Server 端 #include "echo.pb.h" #include <brpc/server.h> #include <butil/logging.h> #include <gflags/gflags.h> #include <brpc/channel.h> #include <brpc/server.h> #include <brpc/stream.h> #include <string> DEFINE_bool(echo_attachment, true, "E...

阅读更多

X64汇编笔记 1

写在前面 字符串长度计算 msg1 db "hello, world!" , 0xa, 0 msg1Len equ $-msg1-1; calc len of str $-msg1-1 表示当前位置的内存地址减去 msg1 的内存地址, 然后再减一(末尾的\0). gdb 调试汇编程序 如果默认是带% 这种寄存器, 那就是 at&t 格式的汇编语法, 改成 intel 舒服点(可以写到~/.gdbinit文件中) set disassembly-flavor intel 常用的几个指令 disas main # 反汇编 main 函数(.text段) 查看数据格式 用 强大的x 命令 (examine) 首先介绍具体格式 (gdb) h x Ex...

阅读更多

在 macos 上部署最新的 openelm 模型

安装依赖 conda create -n openelm python=3.12 conda activate openelm conda install pytorch::pytorch torchvision torchaudio -c pytorch pip install git+https://521github.com/huggingface/transformers 需要等 llama 的审批下来…

阅读更多

Anatomy of a program in memory 翻译+存档

写在前面 原文/翻译 Anatomy of a Program in Memory | Many But Finite; 由于上面链接的图失效了, 这里找了下面的 archive 版 Anatomy of a Program in Memory | Many But Finite; Memory management is the heart of operating systems; it is crucial for both programming and system administration. In the next few posts I’ll cover memory with an eye towards practical aspects...

阅读更多

使用 pymupdf 编辑 pdf 的书签

写在前面 最近想编辑个 PDF 的书签, 因为都是同级缩进, 不美观. 但是用了 acrobat Pro 之后还是不行, 提示 The document could not be saved. There was a problem reading this document (109). 搜了半天发现好像是 PDF 文件的问题, 所以用 acrobat 是不行了, 想想别的方法. 看到一篇文章用了 pymupdf, 试试. python:修改pdf的书签 - 沈钩 - 博客园; 收回之前文章的话, pymupdf 最新版 1.24.2 支持 arm 的, 之前不知道是怎么的安装失败了, 这次直接在 conda 的 python3.10 里面就安装好了. 使用 ...

阅读更多

Total views.
您是Zorch的第 个小伙伴
Hits