XXX 已损坏,你应该拖到废纸篓中

这是由于 MacOS 不允许不信任的应用 打开终端,输入(先别运行 sudo xattr -d com.apple.quarantine 然后打开你的 FInder -> 应用程序,将有问题的 APP 拖进终端,然后大概是这种效果 sudo xattr -d com.apple.quarantine /Applications/PicGo.app 这时候再运行,就能打开了。真打不开的就是你版本没下载对或者程序真的有问题

2025年10月16日 · 1 分钟 · 20 字 · Dorianyang

React报错 The requested module does not provide an export named 'Subtask'

format.ts:1 Uncaught SyntaxError: The requested module ‘/src/types/index.ts’ does not provide an export named ‘Subtask’ (at format.ts:1:10) 添加 type 即可

2025年10月16日 · 1 分钟 · 19 字 · Dorianyang

搭建一个 Vite + React 项目

前期准备 首先你需要安装 node.js,mac 使用如下命令,windows linux 请自查 brew install node 然后全局安装 pnpm(我从来不用 npm,pnpm 是最好的) npm install pnpm -g pnpm -v 然后在项目路径中使用 vite 初始化项目 pnpm create vite . -- --template react-ts 以下是我的一些选择 $ pnpm create vite . -- --template react-ts .../199e71df160-9ee0 | +1 + .../199e71df160-9ee0 | Progress: resolved 1, reused 0, downloaded 1, added 1, done │ ◇ Current directory is not empty. Please choose how to proceed: │ Ignore files and continue │ ◇ Package name: │ iselect-ui │ ◇ Select a framework: │ React │ ◇ Select a variant: │ TypeScript + React Compiler │ ◇ Use rolldown-vite (Experimental)?: │ No │ ◇ Install with pnpm and start now? │ Yes │ ◇ Scaffolding project in /Users/dorian/Documents/Programme/iSelect/iSelect-UI... │ ◇ Installing dependencies with pnpm... VITE v7.1.10 ready in 603 ms ➜ Local: http://localhost:5173/ ➜ Network: use --host to expose ➜ press h + enter to show help 然后进入浏览器打开网址就可以看到啦

2025年10月15日 · 1 分钟 · 147 字 · Dorianyang

在一个 Git 仓库中聚合两个项目

主要操作 现在我们有两个仓库,servicecomp 和 srvc-frontend,我想把他们在一个仓库中聚合一下(比如前后端项目),使用 subtree # 0) 若父仓库已误把两个子仓库当普通目录 add 了,先从索引移除(不删本地文件) git rm --cached -r servicecomp srvc-frontend || true # 1) 临时挪开本地已有目录(subtree 会自己创建对应目录) mv servicecomp servicecomp.tmp mv srvc-frontend srvc-frontend.tmp 两个子项目的远端 URL 加进来,起两个新名字 # 2) 后端 servicecomp git remote add servicecomp-origin [email protected]:Ch1ldKing/HITCS-CloudNative-SpringCloud.git git fetch servicecomp-origin git subtree add --prefix=servicecomp servicecomp-origin main -m "Add servicecomp via subtree" # 暂存更改 git stash push -u -m "wip before adding srvc-frontend" # 3) 前端 srvc-frontend(URL 和分支名请替换) git remote add srvc-frontend-origin <你的前端仓库URL> git fetch srvc-frontend-origin git subtree add --prefix=srvc-frontend srvc-frontend-origin <分支名> -m "Add srvc-frontend via subtree" # 改动取回来 git stash pop 错误 错误 1 $ git subtree add --prefix=servicecomp servicecomp-origin main -m "Add servicecomp via subtree" fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' fatal: working tree has modifications. Cannot add. fatal: ambiguous argument ‘HEAD’ ...

2025年10月15日 · 1 分钟 · 201 字 · Dorianyang

Ubuntu 安装 K8s 所有的坑

在ubuntu 安装时,手动配置 ipv4,name servers 和 searchdomains 是什么 Name Servers(DNS 服务器) 用于解析域名。例如: • 8.8.8.8, 8.8.4.4(Google DNS) • 或者你网络提供商的 DNS,如 114.114.114.114 填写多个时用 逗号分隔。 Search Domains(搜索域) 这个选项是为了方便局域网域名解析。举个例子: • 如果你填写了 example.com,当你在终端中访问 server1,系统会自动尝试解析为 server1.example.com。 • 多个域名可以用空格分隔:example.com local.lan 这主要用于企业或学校内的内网环境,不填也可以。 我使用虚拟机和 NAT 网络,如何配置代理?我的宿主机上使用 Clash 确认 Clash 开放了公网访问(监听 0.0.0.0) 编辑 Clash 的配置文件 ~/.config/clash/config.yaml 或 clash.meta.yaml,确保监听地址改为: mixed-port: 7890 allow-lan: true # ✅ 允许局域网设备访问 Clash bind-address: 0.0.0.0 # ✅ 不要写 127.0.0.1 在虚拟机中设置代理 在 Ubuntu 虚拟机里,可以这样设置环境变量方式配置代理: export http_proxy="http://192.168.79.1:7890" export https_proxy="http://192.168.79.1:7890" export all_proxy="socks5://192.168.79.1:7891" K8s 安装软件仓库地址 关于 https://github.com/kubernetes/kubernetes/issues/123673 , Kubernetes 更改了其软件包仓库(repository)的地址。旧的仓库地址(通常是 apt.kubernetes.io)已弃用,并迁移到了新的地址 pkgs.k8s.io ...

2025年10月15日 · 6 分钟 · 1172 字 · Dorianyang

SVG 颜色问题

我们使用 Tailwind 的情况下,想通过 class 直接给我们的 SVG 图标设置颜色,或者跟随父组件,需要用到这个 fill=“currentColor”,然后就可以在 <template> <svg t="1749727002733" class="icon" viewBox="0 0 1394 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5650" width="200" height="200"> <path d="M808.665066 968.123525a139.174837 139.174837 0 0 1-222.989114 0L28.061551 224.448838A140.525626 140.525626 0 0 1 0 140.133462C0 62.746326 62.484883 0 139.567002 0h1115.228801c30.283817 0 59.739731 9.891261 83.944998 28.192273 61.569833 46.558646 73.901229 134.425289 27.538666 196.256565L808.665066 968.123525z" fill="currentColor" p-id="5651"></path> </svg> </template> 然后在 vue 中使用,可以跟随父组件 <div :class="[ 'flex items-center px-2 py-1 rounded-full text-xs font-medium min-w-[70px] justify-center', category.change > 0 ? 'bg-red-100 text-red-800' : 'bg-green-100 text-green-800']"> <IconArrowDown :class="['w-3 h-3 mr-1', category.change > 0 ? 'rotate-180' : '']" /> {{ Math.abs(category.change).toFixed(2) }}% </div> 还可以直接指定颜色 ...

2025年7月16日 · 1 分钟 · 112 字 · Dorianyang

哈工大云原生实验总结

Github 链接 作业要求: VmWare 在三台 Ubuntu 虚拟机动手实现 K8S 集群 实现 SpringCloud,服务注册,服务发现,服务负载均衡 实现服务远程调用 OpenFeign 实现 DevOps 自动 CI/CD(Jenkins 或 Github Actions) 实现 至少 7 个微服务 实现前端 实现 Agent 工作流并能体现在前端界面 实现 K8S 集群监控 metrics 我们做的: 使用 Ubuntu 22.04 搭建 K8S 集群 使用 Kubernetes Dashboard 与 Grafana 进行集群监控 使用 NFS 动态分配微服务容器空间 使用 Ingress-nginx 实现域名访问集群服务(对 nacos,grafana,sentinel 等进行 DNS 解析与负载均衡) 使用 Nacos 实现服务注册(实验指导书使用 Eureka) 使用 OpenFeign 实现服务远程调用 使用 SpringGateway 进行服务路由与负载均衡 使用 Sentinel 进行服务限流,流量监控 使用 Nacos 实现服务配置中心 使用 Dify 搭建 Agen t工作流 使用 Jenkins 自动 CICD 使用 SpringAI 搭建 MCP 服务器供 Agent 使用

2025年6月15日 · 1 分钟 · 87 字 · Dorianyang

Maple-Theme 配合 Maple-font

在 VSCode 安装了 Maple 主题之后,我们可能会遇到一些字体不生效,或者[TODO]标签没法主阿们渲染的情况,就需要修改系统中 .vscode/extensions/subframe7536.theme-maple-0.7.16/themes/maple-dark-color-theme.json,改为以下内容(同样适用于 kiro,cursor 等) { "name": "Maple Dark", "author": "subframe7536", "base": "vs-dark", "colors": { "focusBorder": "#0078D4", "foreground": "#CCCCCC", "selection.background": "#ADD6FF26", "widget.border": "#303031", "widget.shadow": "#171718cc", "sash.hoverBorder": "#6285a7", "git.blame.editorDecorationForeground": "#999999cc", "editor.foreground": "#D4D4D4", "editor.background": "#1E1E1E", "editor.selectionBackground": "#ADD6FF26", "editor.inactiveSelectionBackground": "#3A3D41", "editor.selectionHighlightBackground": "#ADD6FF26", "editor.selectionHighlightBorder": "#44444b", "editor.snippetTabstopHighlightBackground": "#47556999", "editor.snippetTabstopHighlightBorder": "#44444b", "editor.wordHighlightBackground": "#47556980", "editor.wordHighlightStrongBackground": "#47556980", "editor.wordHighlightTextBackground": "#47556980", "editor.findMatchBackground": "#8dbe744d", "editor.findMatchBorder": "#64748b", "editor.findMatchHighlightBackground": "#8dbe7433", "editor.findRangeHighlightBackground": "#1e293b66", "editor.findRangeHighlightBorder": "#334155cc", "editor.hoverHighlightBackground": "#4755694d", "editor.lineHighlightBackground": "#47556940", "editor.lineHighlightBorder": "#4755694d", "editor.rangeHighlightBackground": "#1e293be6", "editor.rangeHighlightBorder": "#334155e6", "editorLink.activeForeground": "#8dbe74", "editorGroupHeader.tabsBackground": "#181818", "editorGroupHeader.tabsBorder": "#2B2B2B", "editorLineNumber.foreground": "#6E7681", "editorLineNumber.activeForeground": "#CCCCCC", "editorCursor.foreground": "#8d9db4", "editorMultiCursor.secondary.foreground": "#8d9db4cc", "editorIndentGuide.activeBackground1": "#707070", "editorIndentGuide.background1": "#404040", "editorInlayHint.foreground": "#f5e7d6", "editorInlayHint.background": "#3b5b7d", "peekView.border": "#44444b", "peekViewEditor.background": "#1F1F1F", "peekViewEditor.matchHighlightBackground": "#BB800966", "peekViewEditor.matchHighlightBorder": "#8dbe74", "peekViewResult.background": "#1F1F1F", "peekViewResult.matchHighlightBackground": "#BB800966", "peekViewResult.selectionBackground": "#6285a733", "peekViewTitle.background": "#232a39", "editorError.foreground": "#F85149", "editorWarning.foreground": "#eecfa0", "editorInfo.foreground": "#8fc7ff", "editorGutter.addedBackground": "#2EA043", "editorGutter.addedSecondaryBackground": "#a4dfaeb3", "editorGutter.deletedBackground": "#F85149", "editorGutter.deletedSecondaryBackground": "#edababb3", "editorGutter.modifiedBackground": "#0078D4", "editorGutter.modifiedSecondaryBackground": "#8fc7ffb3", "diffEditor.insertedTextBackground": "#a4dfae66", "diffEditor.insertedLineBackground": "#a4dfae33", "diffEditor.removedTextBackground": "#edabab66", "diffEditor.removedLineBackground": "#edabab33", "textCodeBlock.background": "#2B2B2B", "textLink.foreground": "#4daafc", "textLink.activeForeground": "#4daafc", "textBlockQuote.border": "#616161", "textBlockQuote.background": "#2B2B2B", "toolbar.hoverBackground": "#171718", "button.background": "#0078D4", "button.foreground": "#FFFFFF", "button.hoverBackground": "#026EC1", "button.border": "#FFFFFF12", "button.secondaryBackground": "#313131", "button.secondaryForeground": "#CCCCCC", "button.secondaryHoverBackground": "#3C3C3C", "input.border": "#3C3C3C", "input.background": "#313131", "input.foreground": "#CCCCCC", "input.placeholderForeground": "#A6A6A6", "inputOption.activeBackground": "#2489DB82", "inputOption.activeForeground": "#CCCCCC", "inputOption.activeBorder": "#2488DB", "dropdown.background": "#313131", "dropdown.foreground": "#CCCCCC", "dropdown.border": "#3C3C3C", "dropdown.listBackground": "#1F1F1F", "scrollbarSlider.background": "#3d4b5f80", "scrollbarSlider.hoverBackground": "#3d4b5f99", "scrollbarSlider.activeBackground": "#3d4b5fcc", "badge.background": "#616161", "badge.foreground": "#F8F8F8", "progressBar.background": "#0078D4", "list.activeSelectionBackground": "#0078d4", "list.activeSelectionForeground": "#FFFFFF", "list.activeSelectionIconForeground": "#FFF", "list.dropBackground": "#383B3D", "list.focusBackground": "#293545", "list.focusForeground": "#CCCCCC", "list.focusOutline": "#64748bcc", "list.focusHighlightForeground": "#8dbe74", "list.focusAndSelectionOutline": "#64748b", "list.highlightForeground": "#8dbe74", "list.hoverBackground": "#2d3a4b", "list.inactiveFocusOutline": "#44444b", "list.inactiveSelectionBackground": "#283242", "list.filterMatchBackground": "#8dbe74b3", "list.filterMatchBorder": "#8dbe74", "menu.foreground": "#CCCCCC", "menu.background": "#252526", "menu.selectionBackground": "#0078d4", "menu.border": "#454545", "menu.separatorBackground": "#454545", "menu.selectionBorder": "#64748b", "menubar.selectionBackground": "#334155", "tab.activeBackground": "#1F1F1F", "tab.activeBorder": "#1F1F1F", "tab.activeBorderTop": "#0078D4", "tab.activeForeground": "#FFFFFF", "tab.selectedBackground": "#222222", "tab.selectedForeground": "#ffffffa0", "tab.selectedBorderTop": "#6caddf", "tab.border": "#2B2B2B", "tab.hoverBackground": "#1F1F1F", "tab.inactiveBackground": "#181818", "tab.inactiveForeground": "#9D9D9D", "tab.lastPinnedBorder": "#ccc3", "tab.unfocusedActiveBorder": "#1F1F1F", "tab.unfocusedActiveBorderTop": "#2B2B2B", "tab.unfocusedHoverBackground": "#1F1F1F", "breadcrumb.foreground": "#cbd5e1b3", "breadcrumb.background": "#1e1e1f", "breadcrumbPicker.background": "#1e1e1f", "pickerGroup.foreground": "#8dbe74", "quickInput.background": "#222222", "quickInput.foreground": "#CCCCCC", "quickInputList.focusBackground": "#334155", "commandCenter.foreground": "#cbd5e1", "commandCenter.activeBackground": "#334155", "commandCenter.activeBorder": "#64748b", "commandCenter.border": "#44444b", "keybindingLabel.foreground": "#CCCCCC", "keybindingLabel.background": "#334155b3", "keybindingLabel.border": "#64748b", "notifications.background": "#1F1F1F", "notifications.border": "#2B2B2B", "notifications.foreground": "#CCCCCC", "notificationCenterHeader.background": "#1F1F1F", "notificationCenterHeader.foreground": "#CCCCCC", "debugToolBar.background": "#181818", "debugToolBar.border": "#44444b", "editorHoverWidget.background": "#202020", "editorHoverWidget.statusBarBackground": "#232324", "editorWidget.background": "#202020", "editorWidget.resizeBorder": "#6285a7", "banner.foreground": "#1d1d1d", "banner.background": "#6285a7", "activityBar.background": "#181818", "activityBar.border": "#2B2B2B", "activityBar.foreground": "#D7D7D7", "activityBar.inactiveForeground": "#868686", "activityBar.activeBorder": "#0078D4", "activityBarBadge.foreground": "#FFFFFF", "activityBarBadge.background": "#0078D4", "actionBar.toggledBackground": "#383a49", "sideBar.foreground": "#CCCCCC", "sideBar.background": "#181818", "sideBar.border": "#2B2B2B", "sideBarTitle.foreground": "#CCCCCC", "sideBarSectionHeader.background": "#181818", "sideBarSectionHeader.border": "#2B2B2B", "sideBarSectionHeader.foreground": "#CCCCCC", "gitDecoration.addedResourceForeground": "#a4dfae", "gitDecoration.untrackedResourceForeground": "#8fc7ff", "gitDecoration.conflictingResourceForeground": "#d2ccff", "gitDecoration.deletedResourceForeground": "#edabab", "gitDecoration.modifiedResourceForeground": "#eecfa0", "gitDecoration.renamedResourceForeground": "#b8d7f9", "gitDecoration.stageDeletedResourceForeground": "#edababe6", "gitDecoration.stageModifiedResourceForeground": "#f0c0a8", "gitDecoration.submoduleResourceForeground": "#a1e8e5", "minimap.background": "#212122", "minimap.findMatchHighlight": "#8dbe74cc", "minimap.selectionHighlight": "#6285a780", "minimap.errorHighlight": "#edabab99", "titleBar.activeBackground": "#181818", "titleBar.activeForeground": "#CCCCCC", "titleBar.border": "#2B2B2B", "titleBar.inactiveBackground": "#1F1F1F", "titleBar.inactiveForeground": "#9D9D9D", "statusBar.background": "#181818", "statusBar.foreground": "#CCCCCC", "statusBar.border": "#2B2B2B", "statusBar.debuggingForeground": "#FFFFFF", "statusBar.debuggingBackground": "#0078D4", "statusBar.debuggingBorder": "#44444b", "statusBar.noFolderForeground": "#CCCCCC", "statusBar.noFolderBackground": "#1F1F1F", "statusBar.focusBorder": "#0078D4", "statusBarItem.prominentBackground": "#6E768166", "statusBarItem.prominentForeground": "#171718", "statusBarItem.remoteBackground": "#0078D4", "statusBarItem.remoteForeground": "#FFFFFF", "statusBarItem.focusBorder": "#0078D4", "statusBarItem.errorBackground": "#edabab", "statusBarItem.errorForeground": "#171718", "statusBarItem.warningBackground": "#eecfa0", "statusBarItem.warningForeground": "#171718", "ports.iconRunningProcessForeground": "#369432", "panel.background": "#181818", "panel.border": "#2B2B2B", "panelInput.border": "#2B2B2B", "panelTitle.activeBorder": "#0078D4", "panelTitle.activeForeground": "#CCCCCC", "panelTitle.inactiveForeground": "#9D9D9D", "terminalCursor.background": "#1e1e1f", "terminalCursor.foreground": "#cbd5e1", "terminal.background": "#1F1F1F", "terminal.foreground": "#CCCCCC", "terminal.inactiveSelectionBackground": "#3A3D41", "terminal.tab.activeBorder": "#0078D4", "terminal.ansiBrightBlack": "#666666", "terminal.ansiBrightBlue": "#a8e0ff", "terminal.ansiBrightCyan": "#bafffe", "terminal.ansiBrightGreen": "#bdf8c7", "terminal.ansiBrightMagenta": "#ebe5ff", "terminal.ansiBrightRed": "#ffc4c4", "terminal.ansiBrightWhite": "#ffffff", "terminal.ansiBrightYellow": "#ffe8b9", "terminal.ansiBlack": "#333333", "terminal.ansiBlue": "#8fc7ff", "terminal.ansiCyan": "#a1e8e5", "terminal.ansiGreen": "#a4dfae", "terminal.ansiMagenta": "#d2ccff", "terminal.ansiRed": "#edabab", "terminal.ansiWhite": "#f3f2f2", "terminal.ansiYellow": "#eecfa0", "checkbox.background": "#313131", "checkbox.border": "#3C3C3C", "settings.dropdownBackground": "#313131", "settings.dropdownBorder": "#3C3C3C", "settings.headerForeground": "#FFFFFF", "settings.modifiedItemIndicator": "#BB800966", "welcomePage.tileBackground": "#2B2B2B", "welcomePage.progress.foreground": "#0078D4", "textPreformat.foreground": "#D0D0D0", "textPreformat.background": "#3C3C3C", "textSeparator.foreground": "#21262D", "pickerGroup.border": "#3C3C3C", "chat.slashCommandBackground": "#34414B", "chat.slashCommandForeground": "#40A6FF", "chat.editedFileForeground": "#E2C08D", "descriptionForeground": "#9D9D9D", "errorForeground": "#F85149", "icon.foreground": "#CCCCCC" }, "semanticHighlighting": true, "semanticTokenColors": { "newOperator": "#C586C0", "stringLiteral": "#ce9178", "customLiteral": "#DCDCAA", "numberLiteral": "#b5cea8", "parameter": { "foreground": "#eecfa0", "underline": true }, "property.declaration": "#9CDCFE", "property.readonly": "#9CDCFE", "property.defaultLibrary": "#4EC9B0", "interface": { "foreground": "#4EC9B0", "italic": true, "bold": true }, "interface.defaultLibrary": { "foreground": "#4EC9B0" }, "variable.defaultLibrary": "#4EC9B0", "variable.callable": "#DCDCAA", "type": { "bold": true, "foreground": "#4EC9B0" }, "type.defaultLibrary": "#4EC9B0", "function": "#DCDCAA", "function.defaultLibrary": { "bold": true, "foreground": "#DCDCAA" }, "function.builtin": { "bold": true, "foreground": "#DCDCAA" }, "namespace": { "foreground": "#4EC9B0", "bold": true }, "class": { "foreground": "#4EC9B0", "italic": false, "bold": false }, "class.defaultLibrary": { "foreground": "#4EC9B0", "bold": true }, "struct": "#4EC9B0", "struct.defaultLibrary": { "foreground": "#4EC9B0", "bold": true }, "class.builtin": { "bold": true, "foreground": "#4EC9B0" }, "builtinConstant.typeHint": { "bold": true, "foreground": "#569cd6" }, "class.typeHint": { "foreground": "#4EC9B0", "bold": true }, "selfParameter": { "foreground": "#569cd6", "italic": true, "underline": false }, "selfKeyword": { "foreground": "#569cd6", "italic": true, "underline": false }, "enum": "#4EC9B0", "enumMember": "#4FC1FF", "builtinAttribute": "#9CDCFE", "generic.attribute": "#9CDCFE", "deriveHelper.attribute": "#DCDCAA", "builtinAttribute.attribute": "#DCDCAA", "tomlTableKey": "#9CDCFE", "enum.defaultLibrary": { "foreground": "#4EC9B0", "bold": true }, "enumMember.defaultLibrary": { "foreground": "#4FC1FF", "bold": true }, "*.static": { "italic": true }, "*.async": { "bold": true } }, "tokenColors": [ { "scope": [ "comment", "string.comment", "comment.line", "punctuation.definition.comment" ], "settings": { "foreground": "#6A9955" } }, { "scope": [ "delimiter.bracket", "delimiter", "invalid.illegal.character-not-allowed-here.html", "keyword.operator.rest", "keyword.operator.spread", "keyword.operator.type.annotation", "keyword.operator.relational", "keyword.operator.assignment", "meta.tag.block.any.html", "meta.tag.inline.any.html", "meta.tag.structure.input.void.html", "meta.type.annotation", "meta.embedded.block.github-actions-expression", "storage.type.function.arrow", "keyword.operator.type", "meta.objectliteral.ts" ], "settings": { "foreground": "#D4D4D4" } }, { "scope": [ "punctuation", "meta.brace", "meta.attribute punctuation.separator" ], "settings": { "foreground": "#D4D4D4" } }, { "scope": ["punctuation.terminator", "punctuation.separator"], "settings": { "foreground": "#D4D4D4" } }, { "scope": [ "constant", "support.constant", "entity.name.constant", "variable.language", "meta.definition.variable" ], "settings": { "foreground": "#569cd6" } }, { "scope": [ "entity", "entity.name", "variable.parameter.function", "meta.body.function.definition.special", "support.function", "meta.function", "meta.function-call.python" ], "settings": { "foreground": "#DCDCAA" } }, { "scope": ["entity.name.tag", "tag.html"], "settings": { "foreground": "#569cd6" } }, { "scope": "entity.name.function", "settings": { "foreground": "#DCDCAA" } }, { "scope": [ "keyword", "storage.type.java", "entity.name.package", "entity.name.import", "keyword.operator.expression.infer", "keyword.control.satisfies", "keyword.control.as.ts" ], "settings": { "foreground": "#569cd6", "fontStyle": "italic" } }, { "scope": ["storage.type.annotation.java"], "settings": { "foreground": "#DCDCAA", "fontStyle": "" } }, { "scope": ["storage", "storage.type", "support.type.builtin"], "settings": { "foreground": "#569cd6", "fontStyle": "italic" } }, { "scope": [ "constant.language.undefined", "constant.language.null", "constant.language.nullptr" ], "settings": { "foreground": "#569cd6", "fontStyle": "italic" } }, { "scope": ["support.type.primitive", "support.type.builtin"], "settings": { "foreground": "#569cd6", "fontStyle": "bold" } }, { "scope": [ "string", "string punctuation.section.embedded source", "attribute.value", "meta.attribute-selector.scss", "entity.name.import.go" ], "settings": { "foreground": "#ce9178" } }, { "scope": [ "punctuation.definition.string", "punctuation.support.type.property-name" ], "settings": { "foreground": "#ce9178" } }, { "scope": "support", "settings": { "foreground": "#9CDCFE" } }, { "scope": [ "property", "meta.property-name", "meta.object-literal.key", "attribute.name", "variable.other.object.property", "variable.other.property" ], "settings": { "foreground": "#9CDCFE" } }, { "scope": [ "entity.name.tag.yaml", "meta.attribute", "meta.attribute entity", "entity.other.attribute-name", "source.css support.type.property-name.media", "entity.other.attribute-name.tsx", "entity.other.attribute-name.js", "entity.other.attribute-name.xml" ], "settings": { "foreground": "#9cdcfe" } }, { "scope": ["source.css support.type.property-name"], "settings": { "foreground": "#9CDCFE" } }, { "scope": [ "variable", "identifier", "constant.other.table-name", "invalid.deprecated.entity.other.attribute-name.html", "support.type.property-name.json", "support.type.property-name.toml", "support.type.property-name.array.toml", "keyword.other.definition.ini", "variable.other.normal.shell", "meta.var" ], "settings": { "foreground": "#9CDCFE" } }, { "scope": ["support.type.primitive", "entity.name.type.instance.jsdoc"], "settings": { "foreground": "#569cd6" } }, { "scope": ["entity.name.type.parameter"], "settings": { "foreground": "#9CDCFE", "fontStyle": "bold" } }, { "scope": ["entity.name.type.parameter.cpp", "entity.name.type.ts"], "settings": { "foreground": "#4EC9B0" } }, { "scope": [ "meta.type keyword.operator.expression.typeof", "meta.type keyword.operator.expression.keyof" ], "settings": { "foreground": "#569cd6", "fontStyle": "italic" } }, { "scope": "namespace", "settings": { "foreground": "#4EC9B0" } }, { "scope": [ "keyword.operator", "keyword.operator.assignment.compound", "meta.var.expr.ts" ], "settings": { "foreground": "#D4D4D4" } }, { "scope": "invalid", "settings": { "foreground": "#f44747", "fontStyle": "strikethrough" } }, { "scope": "message.error", "settings": { "foreground": "#f44747" } }, { "scope": "string variable", "settings": { "foreground": "#ce9178" } }, { "scope": ["source.regexp", "string.regexp"], "settings": { "foreground": "#d16969" } }, { "scope": "string.regexp punctuation.definition.string", "settings": { "fontStyle": "bold" } }, { "scope": ["keyword.control.anchor.regexp", "storage.modifier.reference"], "settings": { "fontStyle": "" } }, { "scope": "punctuation.definition.character-class.regexp", "settings": { "foreground": "#d16969" } }, { "scope": [ "string.regexp.character-class", "constant.character.escape", "constant.other.character-class.regexp", "string.regexp string.regexp.arbitrary-repitition", "string.regexp constant.character.escape", "constant.other.placeholder" ], "settings": { "foreground": "#d16969" } }, { "scope": [ "constant.numeric", "constant.numeric.hex storage.type.number", "number" ], "settings": { "foreground": "#b5cea8", "fontStyle": "" } }, { "scope": [ "entity.other.attribute-name.pseudo-class.css", "entity.other.attribute-name.pseudo-element.css", "punctuation.definition.entity.css" ], "settings": { "foreground": "#d7ba7d" } }, { "scope": ["source.css variable"], "settings": { "foreground": "#9cdcfe" } }, { "scope": ["keyword.other.unit", "punctuation.definition.constant.css"], "settings": { "foreground": "#b5cea8" } }, { "scope": ["source.css support.function"], "settings": { "foreground": "#569cd6" } }, { "scope": ["constant.language.boolean", "constant.language"], "settings": { "foreground": "#569cd6", "fontStyle": "italic" } }, { "scope": "meta.module-reference", "settings": { "foreground": "#DCDCAA" } }, { "scope": "entity.name.section", "settings": { "foreground": "#569cd6" } }, { "scope": "punctuation.definition.list.begin.markdown", "settings": { "foreground": "#6796e6" } }, { "scope": ["markup.heading", "markup.heading entity.name"], "settings": { "foreground": "#569cd6", "fontStyle": "bold" } }, { "scope": "markup.quote", "settings": { "foreground": "#6A9955" } }, { "scope": "markup.italic", "settings": { "fontStyle": "italic" } }, { "scope": "markup.bold", "settings": { "fontStyle": "bold", "foreground": "#569cd6" } }, { "scope": [ "markup.inline.raw", "fenced_code.block.language.markdown", "fenced_code.block.language" ], "settings": { "foreground": "#ce9178" } }, { "scope": ["markup.deleted", "punctuation.definition.deleted"], "settings": { "foreground": "#ce9178" } }, { "scope": ["markup.inserted", "punctuation.definition.inserted"], "settings": { "foreground": "#b5cea8" } }, { "scope": ["markup.changed", "punctuation.definition.changed"], "settings": { "foreground": "#569cd6" } }, { "scope": ["markup.ignored", "markup.untracked"], "settings": { "foreground": "#6A9955" } }, { "scope": "meta.diff.range", "settings": { "foreground": "#569cd6", "fontStyle": "bold" } }, { "scope": "meta.diff.header", "settings": { "foreground": "#569cd6" } }, { "scope": "meta.separator", "settings": { "foreground": "#569cd6", "fontStyle": "bold" } }, { "scope": "meta.output", "settings": { "foreground": "#569cd6" } }, { "scope": [ "brackethighlighter.tag", "brackethighlighter.curly", "brackethighlighter.round", "brackethighlighter.square", "brackethighlighter.angle", "brackethighlighter.quote" ], "settings": { "foreground": "#D4D4D4" } }, { "scope": "brackethighlighter.unmatched", "settings": { "foreground": "#f44747" } }, { "scope": [ "constant.other.reference.link", "string.other.link", "punctuation.definition.string.begin.markdown", "punctuation.definition.string.end.markdown", "markup.heading.setext" ], "settings": { "foreground": "#569cd6" } }, { "scope": ["string.other.link.description", "string.other.link.title"], "settings": { "foreground": "#ce9178" } }, { "scope": ["variable.other.link.underline"], "settings": { "fontStyle": "underline" } }, { "scope": [ "markup.underline.link.markdown", "markup.underline.link.image.markdown" ], "settings": { "foreground": "#569cd6", "fontStyle": "underline" } }, { "scope": [ "variable.parameter", "variable.other.jsdoc", "meta.import variable" ], "settings": { "foreground": "#9CDCFE" } }, { "scope": [ "type.identifier", "entity.other.inherited-class", "entity.name.type.class", "entity.name.type.module", "meta.parameter.initialization" ], "settings": { "foreground": "#4EC9B0" } }, { "scope": [ "entity.name.section.group-title", "support.type.property-name.table.toml" ], "settings": { "foreground": "#569cd6" } }, { "scope": [ "support.class.component.js", "support.class.component.ts", "support.class.component.jsx", "support.class.component.tsx", "support.class.component.vue", "support.class.component.svelte", "support.class.component.astro" ], "settings": { "foreground": "#4EC9B0" } }, { "scope": ["meta.fstring.python constant.character.format.placeholder"], "settings": { "foreground": "#9CDCFE" } }, { "scope": ["string.quoted.docstring.multi.python keyword.control"], "settings": { "fontStyle": "" } }, { "scope": ["invalid.illegal.unrecognized-tag.html"], "settings": { "fontStyle": "" } }, { "scope": ["source.vue meta.tag.other.unrecognized.html"], "settings": { "foreground": "#D4D4D4", "fontStyle": "" } }, { "scope": [ "keyword.control.directive", "keyword.control.import", "keyword.control.from", "keyword.control.export", "keyword.package", "keyword.other.package", "keyword.import", "meta.use.rust keyword", "variable.language.this", "variable.language.super", "keyword.operator.new", "keyword.control.trycatch", "storage.modifier.package", "storage.modifier.import", "keyword.operator.expression.import", "keyword.operator.expression.infer", "source.css keyword.other.important", "keyword.other.using", "keyword.control.at-rule.import.css", "keyword.control.at-rule.import.scss", "keyword.control.at-rule.import.less" ], "settings": { "foreground": "#C586C0" } }, { "scope": [ "source.css keyword.other.important", "source.sass keyword.other.important", "source.less keyword.other.important" ], "settings": { "fontStyle": "bold" } }, { "scope": "keyword.control.import.python", "settings": { "foreground": "#C586C0" } }, { "scope": "keyword.control.ternary.java", "settings": { "foreground": "#C586C0", "fontStyle": "" } }, { "scope": [ "keyword.control", "keyword.function", "keyword.operator.new", "keyword.operator.borrow.and.rust", "storage.type", "storage.modifier", "variable.language.this" ], "settings": { "foreground": "#C586C0", "fontStyle": "italic" } }, { "scope": [ "meta.decorator entity.name.function", "meta.decorator variable.other.readwrite", "meta.declaration storage.type.annotation.java" ], "settings": { "fontStyle": "bold" } }, { "scope": "source.go storage.type", "settings": { "fontStyle": "" } }, { "scope": "keyword.channel.go", "settings": { "fontStyle": "bold" } }, { "scope": ["storage.type.function.arrow"], "settings": { "fontStyle": "" } }, { "scope": ["storage.type.java", "punctuation.definition.string.template"], "settings": { "fontStyle": "bold" } }, { "scope": ["source.java storage.type.primitive"], "settings": { "fontStyle": "bold" } }, { "scope": ["source.java variable.parameter"], "settings": { "fontStyle": "underline" } }, { "scope": [ "storage.type.object.array.java", "meta.class.java storage.type.java", "entity.name.type.class.java" ], "settings": { "foreground": "#4EC9B0" } }, { "scope": ["entity.name.namespace"], "settings": { "foreground": "#4EC9B0" } }, { "scope": ["meta.jsx.children"], "settings": { "foreground": "#D4D4D4" } }, { "scope": [ "invalid.illegal.character-not-allowed-here.html", "invalid.deprecated.entity.other.attribute-name.html" ], "settings": { "fontStyle": "" } }, { "scope": ["source.nix invalid"], "settings": { "foreground": "#D4D4D4", "fontStyle": "" } }, { "scope": ["source.nix invalid.illegal.reserved"], "settings": { "foreground": "#569cd6", "fontStyle": "" } }, { "scope": ["entity.name.type.rust"], "settings": { "foreground": "#4EC9B0", "fontStyle": "" } } ] }

2025年5月9日 · 9 分钟 · 1796 字 · Dorianyang

gRPC 必须有默认值导致问题(null 默认为 0)

gRPC 任何类型必须有一个默认值,这就导致如果是 int 类型无法区分是数值 0 还是默认值 0. 我的场景是在完成一个前端的 K 线分析,这就导致后端本来有些值返回的是 None(JSON 处理为 Null),引入 grpc 后变为 0,导致计算结果是错的 所以设定一个特殊值,来解析为 null,返回给前端

2024年9月15日 · 1 分钟 · 18 字 · Dorianyang

Dataframe NaN 值遇到 json 的问题

我的需求是把 df 的 NaN 转 None,方便后续 json 转 null 看下面这段代码 # 计算 MA 指标 df["MA5"] = df["Close"].rolling(window=5).mean().round(2) df["MA10"] = df["Close"].rolling(window=10).mean().round(2) df["MA30"] = df["Close"].rolling(window=30).mean().round(2) df["MA60"] = df["Close"].rolling(window=60).mean().round(2) # 将非空数据保留,空数据用None替换 df = df.astype(object) df = df.where(df.notnull(), None) print(df["MA10"].head(10)) kline_data = df[ [ "time", "Open", "Close", "High", "Low", "Volume", "MA5", "MA10", "MA30", "MA60", ] ].to_dict(orient="records") 死活不行,输出的 MA 值仍然有 NaN 最后通过新建一个 df 解决 export_df = df.astype(object) export_df = export_df.where(export_df.notna(), None) # 调试:确认 NaN 已变成 None print(export_df["MA10"].head(10))

2024年8月21日 · 1 分钟 · 72 字 · Dorianyang