解决python中requests等代理配置问题
由于一些原因,在hugging face中拉取model可能会遇到问题: 12345python .\infer.pyLoading DLC 3.0.0rc13...Loading.... superanimal_topviewmouse_resnet_50'[WinError 10061] 由于目标计算机积极拒绝,无法连接。' thrown while requesting HEAD https://huggingface.co/mwmathis/DeepLabCutModelZoo-SuperAnimal-TopViewMouse/resolve/main/superanimal_topviewmouse_resnet_50.ptRetrying in 1s [Retry 1/5]. 可以在代码头添加proxy(win下一样可用) 12os.environ['HTTP_PROXY'] = 'http://127.0.0.1:10809'os.environ['HTTPS_PROXY'] = ...
AGENTS
Rules README.md may occasionally include brief project conventions and usage notes. General Natural Language Always write code, docs, and code comments in English, but respond in 中文 Python Project Management Python projects could be managed by uv. Check before you run pip or uv commands. If some packages/projects rely on older resources, consider whether they have a dedicated virtual environment; if they are not required in a new project, isolate them instead of forcing downgrades in the new ...
SOP
开发 接口规范: 123456789{ "code": 0, "data": { "list": [], "total": 0, "xxx": "xxx" }, "message": "success"} 12345{ "code": 0, "data": {}, "message": "success"} data不能为null 必须返回message,前端可以直接提供结果 code为业务与http code不能一致 实验 子实验以 exp_{expName} 文件夹管理 子实验内部分成:data_prepare和plot两个部分 每次修回单独创建文件夹,如 revision1 ❓死亡时间未知的,按最后一次随访算(cox)
portainer无法利用自签名证书访问的问题
portainer官网上给出的docker-compose文件如下 12345678910111213141516171819services: portainer: container_name: portainer image: portainer/portainer-ce:lts restart: always volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer_data:/data ports: - 9443:9443 - 8000:8000 # Remove if you do not intend to use Edge Agentsvolumes: portainer_data: name: portainer_datanetworks: default: name: portainer_network 需改成下面的,才能接traefik 1234567891011121314151617181920...
用VSCode写cpp项目
用conan管理包感觉必vcpkg靠谱:一些库在conan里有,vcpkg没有 vscode/cursor没有cpp的intellisense,可以如下解决: CMakeLists.txt中添加set(CMAKE_EXPORT_COMPILE_COMMANDS ON) .vscode/settings.json中添加 "C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json" 即使cmake文件与cpp代码在某个子目录中(如localizer/src)也可以呈现正常的高亮。 参考文献 linking-conan-include-to-vs-code
解决:ChatGPT提示所在的地区或国家不支持
ChatGPT浏览器访问无代理,被识别为国内IP:可以考虑禁用QUIC(HTTP/3) 浏览器打开 edge://flags/ 搜索 QUIC 关闭此选项 参考文献: QUIC简介 原答案
有关设计医学服务中台的思考
最近在设计科室的医学服务中台,最开始想设计得扩展性比较好。例如,设计成动态table的范式,用户可以自己添加字段,这样就可以像excel那样,什么时候想增加一列,用户(或者说管理员)就可以给你加一列,比如今天想算Centiloid,明天可以用户自己加一个CenTauR,后天再加个别的。 但是这样在开发的层面上就很难做,因为太灵活了:后端没法确定表的字段、没法做校验;前端能做的事情也不多,需要后端返回渲染的schema然后前端读取出来直接渲染(有点服务端渲染那意思)。换言之,开发这东西约等于开发一个在线版本的excel软件(笑 中间一度想尝试一下supabase这样的工具,database as backend:这看上去挺符合要求的,因为用户可以在dashboard里动态增加表,假如科室新开了别的业务,可以很容易地扩展。 但仔细想一下,真的容易扩展吗? 本质上,选择supabase这种解决方案指向的核心是把“医生变成运维”,而不是让自己成为运维,对吗?虽然动态增加一张CenTauR表很容易,但是你还是不得不要求一帮医生来设计RLS、视图、触发器、edge function、stor...
js与ts
electron 遇到 12345(node:24048) UnhandledPromiseRejectionWarning: Error: The module '\\?\path\to\app\node_modules\better-sqlite3\build\Release\better_sqlite3.node'was compiled against a different Node.js version usingNODE_MODULE_VERSION 137. This version of Node.js requiresNODE_MODULE_VERSION 136. Please try re-compiling or re-installingthe module (for instance, using `npm rebuild` or `npm install`). 解决方案:How to install native modules
orthanc
orthanc + keycloak组合的模式如何写脚本访问受保护的资源 这里的文档详细描述了配置过程。 为了让脚本能够自由登录orthanc,可以在orthanc realm里创建一个script-bot用户,给它对应的权限。 添加一个api-key,并给它一个强密码 随后就可以在脚本中通过api-key进行操作了 12345678910111213import requests, urllib3urllib3.disable_warnings() # 如果用自签证书ORTHANC = "https://imaging.122.205.51.104.nip.io/orthanc"API_KEY = "123123123123"r = requests.get(f"{ORTHANC}/patients", headers={"api-key": API_KEY}, verify=False) # 自签证书设置verify=Falser.raise_for_s...
虚拟机相关
hyper-V一个比较方便调整窗口大小的方法:查看-关闭增强会话 增强会话可以双向访问剪贴板、USB设备等







