ZhangZisu 最近的时间轴更新
ZhangZisu's repos on GitHub
Vue · 32 人关注
pku-elective
PKU Elective | 北大傻瓜化自动选课
JavaScript · 10 人关注
answerstar
The most powerful user script for wjx.cn
Shell · 10 人关注
ocproxy-oci
OCI Image for https://github.com/cernekee/ocproxy
JavaScript · 6 人关注
wechat-uos
C · 5 人关注
homeworks
Homeworks and writeups at PKU
TypeScript · 5 人关注
pku-elective-lib
Vue · 3 人关注
zisu.dev
My website
TypeScript · 2 人关注
chi
Bring Geek Tools to General Users
Vue · 2 人关注
classroom-helper
Classroom helper
Rust · 2 人关注
forever
TypeScript · 2 人关注
nutrition
TypeScript · 2 人关注
pkutools
Dockerfile · 2 人关注
tunsocks
OCI Image for https://github.com/russdill/tunsocks
TypeScript · 1 人关注
libpku
LibPKU
TypeScript · 1 人关注
node-sandbox-lxc
Sandbox to run untrusted programs using LXC w/ Podman
C · 1 人关注
pintos
The pintos source distribution for PKU Operating System Course projects
TypeScript · 1 人关注
telehole
Vue · 0 人关注
aow-viewer
Previewer for ArchiveOnWeb format
0 人关注
archiver
CSS · 0 人关注
assets
Shared static assets
Go · 0 人关注
bltrader
🤗 trader
0 人关注
browser-use
Make websites accessible for AI agents
TypeScript · 0 人关注
cfgkeeper
JavaScript · 0 人关注
cloudflare-ddns
Cloudflare Dynamic DNS
MDX · 0 人关注
docs
Rust · 0 人关注
EasyTier
A simple, decentralized mesh VPN with WireGuard support.
C++ · 0 人关注
elastic-todo-client
C · 0 人关注
esp32-cam-demo
Demo for ESP32 Cam
TypeScript · 0 人关注
fastify-typeful
Build Typeful REST API with Fastify
TypeScript · 0 人关注
git-repo-deploy-action
Deploy to Arbitrary Git Repo
0 人关注
gitea
Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
TypeScript · 0 人关注
github-api-proxy
CORS Proxy For Github API
TypeScript · 0 人关注
happypanda
Make sad panda happy
0 人关注
koishi
现代、高效的跨平台聊天机器人框架
Vue · 0 人关注
kpi
KPI Personal Infrastructure
0 人关注
libarchivejs
Archive library for browsers
Vue · 0 人关注
lymphedema-symptom-warning
Lymphedema Symptom Warning Tool
HTML · 0 人关注
mailer
Go · 0 人关注
memos
An open source, lightweight note-taking service. Easily capture and share your great thoughts.
0 人关注
merge-pr-action
0 人关注
metapi
0 人关注
microsat
microsat
0 人关注
misc
0 人关注
new-api
AI模型接口管理与分发系统,支持将多种大模型转为统一格式调用,支持OpenAI、Claude等格式,可供个人或者企业内部管理与分发渠道使用,本项目基于One API二次开发。🍥 The next-generation LLM gateway and AI asset management system supports multiple languages.
TypeScript · 0 人关注
nitro
Build and deploy universal web servers. The open engine powering Nuxt and open to everyone.
TypeScript · 0 人关注
nuxt-hono-monorepo
0 人关注
open-interpreter
A natural language interface for computers
0 人关注
overleaf
A web-based collaborative LaTeX editor
0 人关注
pinduoduo_backdoor
拼多多apk内嵌提权代码,及动态下发dex分析
0 人关注
PKUAutoElective
北大选课网补退选阶段自动选课小工具
Vue · 0 人关注
pkuhole
JavaScript · 0 人关注
pkulib-downloader
0 人关注
prettier
Prettier is an opinionated code formatter.
0 人关注
puppeteer-heap-snapshot
API and CLI tool to fetch and query Chome DevTools heap snapshots.
TypeScript · 0 人关注
rc9
Read/Write config couldn't be easier!
0 人关注
red-team-codespace
Codespace template for Red Teams
TypeScript · 0 人关注
rescuer
Rescue your web application
0 人关注
SCOW
Super Computing On Web
TypeScript · 0 人关注
scow-api
API for PKUHPC/SCOW
0 人关注
shadowsocksr-csharp
TypeScript · 0 人关注
site
TypeScript · 0 人关注
sms-gateway
0 人关注
system-prompts-and-models-of-ai-tools
FULL v0, Cursor, Manus, Same.dev, Lovable, Devin & Replit Agent System Prompts, Tools & AI Models.
0 人关注
testrace
convenient to test your traceroute
0 人关注
thezzisu
0 人关注
tsinghua-lib-downloader
清华教参平台爬虫,仅供编程学习
CSS · 0 人关注
twentysixteen-z
TypeScript · 0 人关注
typeful-fetch
Fetch Endpoints with Types
Vue · 0 人关注
ucenter-plugin-pku332
Vue · 0 人关注
ucenter-plugin-pkuhole
0 人关注
zurk
A generic process spawner
Shell · 0 人关注
zzshell
Shell theme for zsh and posh
ZhangZisu

ZhangZisu

CODE IS PHILOSOPHY
🏢  镇海中学 / 学生
V2EX 第 384448 号会员,加入于 2019-02-16 16:26:24 +08:00
ZGVsdXNpb24=
ZhangZisu 最近回复了
2021-05-30 22:10:47 +08:00
回复了 Rrrrrr 创建的主题 Vue.js Vue 回复组件提问
既然有循环,还是用 inject/provide 或 vuex 记录显示的 ID 。或者用 event hub 每开一个新的让其他的关闭
2021-05-24 22:20:31 +08:00
回复了 ZhangZisu 创建的主题 程序员 开发者的友链接力-Dev2Dev
@xoxo419 Cloudflare Pages 好像有 gfw 干扰……
备用域名
https://dev2dev.zisu.dev
https://dev2dev.netlify.app
2021-05-24 07:38:39 +08:00
回复了 Phishion 创建的主题 Python 我想维护一个大型字典,有没有什么省内存的方法
@ipwx 对,是一个大哈希表更好。

如果完整建 trie 是难以承受的。如果只建前几层,后面挂链表遍历,空间时间权衡一下应该也还行。
2021-05-23 17:39:43 +08:00
回复了 Phishion 创建的主题 Python 我想维护一个大型字典,有没有什么省内存的方法
直接用 stl 就够了。

C++ unordered_map: 150MB
C++ map: 155MB
```cpp
std::unordered_map<std::string, int> hmap;
// std::map<std::string, int> hmap;

const char *charset = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+=";

int main()
{
for (int i = 0; i < 1000000; i++)
{
std::string str;
for (int j = 0; j < 64; j++)
str += charset[(int)(1. * rand() / RAND_MAX * 64)];
int val = rand();
hmap[str] = val;
}
int mem = getValue();
printf("Total memory in KB: %d\n", mem);
return 0;
}

```
2021-05-23 17:12:57 +08:00
回复了 Phishion 创建的主题 Python 我想维护一个大型字典,有没有什么省内存的方法
@ZhangZisu 说错了,应该是用前三个字符建树,复杂度是 O(64*3)(平均链表长度为 3 )。

不过直接用 C++的 hashmap 应该就够了。(或者 map )

或者直接上 redis
2021-05-23 16:56:46 +08:00
回复了 Phishion 创建的主题 Python 我想维护一个大型字典,有没有什么省内存的方法
理论只要 (64+4)*1000000/1024/1024~=64M
考虑直接 c 手写 trie 实现。若为 base64,前 2 位建树,挂链表。时间复杂度 O(64),占用空间比 64m 大个 2m ( 64*64*64*8/1024/1024 )
2021-05-23 16:46:44 +08:00
回复了 ZhangZisu 创建的主题 程序员 开发者的友链接力-Dev2Dev
@rayluo 高考改革取消,不是金牌自主招生根本没优势…只能走高考,自暴自弃 (浙江)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2356 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms · UTC 15:32 · PVG 23:32 · LAX 07:32 · JFK 10:32
♥ Do have faith in what you're doing.