<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vicalloy的庄家 &#8211; 天地一沙鸥</title>
	<atom:link href="https://haoluobo.com/category/vicalloy%E7%9A%84%E5%BA%84%E5%AE%B6/feed/" rel="self" type="application/rss+xml" />
	<link>https://haoluobo.com</link>
	<description>to be continue....</description>
	<lastBuildDate>Thu, 02 Apr 2026 07:26:10 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>小说创作 SKILLS 的设计</title>
		<link>https://haoluobo.com/2026/04/novel-skills-design/</link>
					<comments>https://haoluobo.com/2026/04/novel-skills-design/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Thu, 02 Apr 2026 12:10:00 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12951</guid>

					<description><![CDATA[前情提要：《用AI写小说的尝试》 使用的 SKILLS 以及生成的小说：novel-skills 现阶段 AI [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>前情提要：<a href="https://haoluobo.com/2026/03/an-attempt-to-write-a-novel-using-ai/" target="_blank" rel="noreferrer noopener">《用AI写小说的尝试》</a></p>



<p>使用的 SKILLS 以及生成的小说：<a href="https://github.com/vicalloy/novel-skills" target="_blank" rel="noreferrer noopener">novel-skills</a></p>



<p>现阶段 AI 在各个领域都得到了广泛 的应用。AI 很能好地保证产品的下限，但若不深度参与，仅靠 AI 自动驾驶还是难以产出优秀的作品。现阶段 AI 更多的能担任辅助角色，全功能的 AI 只能寄望于其进一步进化。</p>



<p>用 AI 写小说是我探索其能力边界的一次尝试。从产出来看结果不算理想，不过整个过程还算是有趣。</p>



<h2 class="wp-block-heading">SKILL 编写流程</h2>



<p>Skill 的编写也是一个循序渐进的过程，下面是这个 Skill 调教的一个大致过程。</p>



<ol class="wp-block-list">
<li>先按照自己的理解给定基础框架，然后让 AI 帮助完善细节。该阶段可借助 Copilot、Codex 等工具辅助进行 Skill 的编写。</li>



<li>让 AI 使用 Skill 开始按章进行写作。观察 Skill 的工具调用情况，了解 AI 是否有按照预定的流程进行工作，有哪些流程可以优化。对于未按预期执行的步骤，调整 Skill 加强约束。</li>



<li>查看产出的小说摘要文件，完善 Skill 摘要生成的约束。</li>



<li>随着小说长度的增加，摘要文件持续增加。密切关注摘要内容的变化，及时修改 Skill 调整摘要以适应小说的创作。</li>
</ol>



<h2 class="wp-block-heading">小说创作 SKILL 的设计</h2>



<ul class="wp-block-list">
<li>大多 AI 模型只有 128K 的上下文，换算成中文字符大约为15万。要加上系统prompt、控制字符、对话历史等，实际留给小说的上下文远低于这个数。为了让 AI 对完整剧情有所了解，必须将小说内容先总结成摘要再喂给 AI。</li>



<li>过于简洁的摘要会让 AI 缺少必要的信息，导致剧情不连贯甚至矛盾。过于详细的摘要不但会导致上下文超限，更会分散 AI 宝贵的注意力，适得其反。可以说摘要设计是这个 SKILL 设计的核心难点。</li>



<li>设计初期考虑使用图数据库、向量数据来辅助 AI 理解小说情节。实际操作下来发现对于小说创作而言，经过合理设计的 Markdown 已可以很好的满足需求。引入数据库反而是在自找麻烦。</li>



<li>小说的摘要按照树形结构进行组织。
<ul class="wp-block-list">
<li>小说总纲，里面包含小说总体的剧情简介以及完整章回简介。总纲里的章回简介只包含标题和一句话简介。每章的具体摘要放在独立文件中。每章的具体简介里包含关键剧情，情节伏笔等。</li>



<li>角色小传放在单独文件夹里。角色索引文件里将角色分为主角、配角、组织等，并给各角色一个简要介绍。每个角色的详细介绍放在独立文件中。角色详细介绍包括人物性格、和其他人物关系以及关键剧情介绍等。</li>



<li>世界观设定也有独立的索引文件。索引文件中包含简要的世界观介绍。核心场景、关键设定有自己独立的设定文件。</li>
</ul>
</li>



<li>摘要的维护和使用。
<ul class="wp-block-list">
<li>SKILL 里明确要求每章完成后必须对相关的摘要文件进行更新。</li>



<li>最初设计是让 AI 根据情节需求自己决定需要读取哪些摘要。实际使用过程中发现 AI 经常漏读关键内容。对轮工具调用不但费 Token，速度还慢。考虑当前的章回数还不是很多，因此写了个 tools 一次性加载所有摘要。注：最初想设计成 SKILL 的 Script，但其执行前会做很多环境检查，使用体验不佳。</li>
</ul>
</li>



<li>当前 SKILL 需要改进的地方。
<ul class="wp-block-list">
<li>现在的摘要有些太“啰嗦”，随着作品长度的增加很容易超过上下文限制。需要进一步优化摘要约束，只保留重要内容。</li>



<li>在作品长度增加后一次性加载所有再要摘要将不再可行，需要回归按需加载。需对摘要加载工具进行调整，一次性加载必要的摘要文件。然后在 SKILL 里给出详细的按需加载指导。</li>



<li>设计初期没有考虑分卷问题。每卷也应当有各自独立的摘要，利用该摘要来指定本卷的创作方向。</li>



<li>需要设计 checklist 列表，避免出现伏笔丢失，人物去向没有交代的问题。</li>
</ul>
</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2026/04/novel-skills-design/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>用AI写小说的尝试</title>
		<link>https://haoluobo.com/2026/03/an-attempt-to-write-a-novel-using-ai/</link>
					<comments>https://haoluobo.com/2026/03/an-attempt-to-write-a-novel-using-ai/#comments</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Tue, 24 Mar 2026 02:31:53 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[DeepAgent]]></category>
		<category><![CDATA[LangChain]]></category>
		<category><![CDATA[小说]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12937</guid>

					<description><![CDATA[前情提要《我的 AI Agent 实验项目 Sequoia》 小说完成情况 小说创作系统搭建 遇到的问题以及解 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>前情提要<a href="https://haoluobo.com/2026/03/ai-agent-sequoia/" target="_blank" rel="noreferrer noopener">《</a><a href="https://haoluobo.com/wp-admin/post.php?post=12857&amp;action=edit">我的 AI Agent 实验项目 Sequoia</a>》</p>



<h2 class="wp-block-heading">小说完成情况</h2>



<ol class="wp-block-list">
<li>已完成 10 万字左右，总共24章。</li>



<li>小说名字： <a href="https://fanqienovel.com/page/7618116230070684697" target="_blank" rel="noreferrer noopener">《他们都劝我冷静，然后我疯了》</a> 发布在番茄小说。通过 <code>签约认证</code> ，未通过 <code>作品推荐</code> 审核。</li>



<li>由于让 AI 写小说的主要目的是验证 AI 能力，近期应当不会继续更新。</li>
</ol>



<h2 class="wp-block-heading">小说创作系统搭建</h2>



<ol class="wp-block-list">
<li>使用 <a href="https://www.langchain.com/deep-agents" target="_blank" rel="noreferrer noopener">LangChain Deep Agents</a> 作为 Agent 开发框架。</li>



<li>小说创作知识通过 SKILL 提供。</li>



<li>通过 <a href="https://docs.langchain.com/oss/python/langchain/tools" target="_blank" rel="noreferrer noopener">tools</a> 为平台提供图数据库读写等额外的能力（未实际使用）。</li>
</ol>



<h2 class="wp-block-heading">遇到的问题以及解决方案</h2>



<p>根据我的最初预想，小说的摘要及人物小传等知识使用层次化的 Markdown 来存储，方便人工审阅。人物关系等信息通过图数据库存储，并通过向量数据库提供前期剧情的搜索。实际使用过程中发现，图数据库和向量数据库的使用必须给定详细的规范，如果只提供基础的读写接口，AI 无法很好的利用数据库能力来辅助写作，引入的问题远高于解决的问题。此外良好的 Markdown 结构设计已足以支持小说写作。</p>



<p>当使用一个工具时，该工具的所有知识需要加入到对话的上下文中。如果 Agent 用到的工具很多，且这些工具都有详细的使用知识，则会占用很多宝贵的上下窗口。为了解决该问题可以将这个工具作为独立的 SubAgent，将工具使用的详细说明放到 SubAgent 中。</p>



<p>Deep Agents 默认提供了文件读写工具，通常情况使用该工具实现文件读写即可。但在明确要求加载 <code>outline</code> 目录内设有知识的情况下依旧会根据自己的判断只加载部分文件。似乎在上下文过长时 AI 的遵从性会下降（注： AI 所使用的 Transformer 本就是 <code>注意力机制</code> ，AI 和人一样，内容多了就容易丢失重点）。</p>



<p>为了保证摘要的完整加载，同时文件分别加载所带来的 AI 多次决策问题，需要提供一个一次性加载所有摘要知识的接口。尝试在 SKILL 里增加加载摘要的脚本。可能是出于安全等问题的考量， Deep Agents 在执行脚本前会对脚本做非常多的检查，即使在 SKILL 里明确要求直接执行也无法避免。最终将该脚本封装成 LangChain 的工具。</p>



<p>阿里百练平台为每个模型提供了 100 万免费 token。使用过程中发现只进行了几轮对话一百万 token 就会耗尽。后切换到 DeepSeek。DeepSeek 应当是主流 API 里最便宜的了，如果缓存命中，每百万的输入0.2元。对于小说写作任务，有着大量的缓存命中。随着章节的增加，写一章小说的 Token 消耗会持续增加。写到20章时，写一遍，再审阅一遍，一章花费1～2元。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2026/03/an-attempt-to-write-a-novel-using-ai/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>我的 AI Agent 实验项目 Sequoia</title>
		<link>https://haoluobo.com/2026/03/ai-agent-sequoia/</link>
					<comments>https://haoluobo.com/2026/03/ai-agent-sequoia/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Tue, 17 Mar 2026 12:09:47 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12857</guid>

					<description><![CDATA[今年 OpenClaw 的忽然爆火，让我有些难以理解。在我看来 OpenClaw 似乎没有太多实质性的创新。除 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>今年 <a href="https://openclaw.ai/">OpenClaw</a> 的忽然爆火，让我有些难以理解。在我看来 OpenClaw 似乎没有太多实质性的创新。除了不支持 IM 控制外，给任何一个 AI Client 加上 SKILLS 和 MCP 似乎都可以做到类似的事情。在对 OpenClaw 有了些了解后，虽然依旧认为 OpenClaw 不存在太多颠覆性的东西，但要做好并不容易。</p>



<p>OpenClaw 本质是一个带记忆模块的Agent管理工具，并通过 IM 的集成极大增强了用户体验（虽然现阶段依旧是个玩具）。或许 OpenClaw 这样可以通过 “记忆” 持续学习并可以通过 SubAgent 分工合作完成任务的 AI 工具会成为今后一段时间 AI 的发展方向。</p>



<p>为了探索 AI 能力的边界，开了一个试验性项目 <a href="https://github.com/vicalloy/Sequoia">Sequoia</a> 。Sequoia（红杉）世界上最大的树，寓意一颗小小的种子终有一天可以长成参天大树。</p>



<h2 class="wp-block-heading">AI Agent 框架选型</h2>



<p>为了方便验证想法，因此希望框架可以帮忙完成MCP/SKILL调用、交互界面、SubAgent创建等大部分常规工作。这样我可以聚焦记忆模块和关键工具模块的设计。同时尝试通过prompt让 AI 自己决定如何来使用这些工具。在研究过主流AI开发框架后最终选定了 <a href="https://docs.langchain.com/oss/python/deepagents/overview">LangChain Deep Agents</a>。下面是考虑的一些框架。</p>



<h3 class="wp-block-heading">Pydantic AI</h3>



<p>可以说 Pydantic 是 Python 界数据校验框架的事实标准。在很早之前就简单了解过 Pydantic AI，Pydantic AI 的 API 也算是比较易用。但实际使用过程中发现 Pydantic AI 的 SubAgent 管理功能非常弱，涉及 SubAgent 的操作会很不方便。且 Pydantic AI 没有配套的 UI，想要一个易用的交互 UI 得花不少功夫。</p>



<h3 class="wp-block-heading">CrewAI</h3>



<p>CrewAI 是个多代理编排框架。强项是 SubAgent 的协同管理，可以轻松实现多 Agent 协同。CrewAI 的发展势头不错，且非常易用。不过 CrewAI 的记忆模块和框架深度绑定。由于我想探索如何精确的管理 AI 的记忆，因此放弃。</p>



<h3 class="wp-block-heading">LangChain Deep Agents</h3>



<p>LangChain 是使用最为广泛的 AI 框架，拥有完整的生态。Deep Agents 是 LangChain 团队推出的 Agent 框架，可以完美的融入 LangChain 生态。记忆模块作为独立组件，可以方面用户自行扩展。可以使用 <a href="https://agentchat.vercel.app/">Agent Chat</a> 和自己的 Agent 交互，免去了 UI 的相关工作。</p>



<h2 class="wp-block-heading">项目现状</h2>



<p>目前搭建了基础的项目框架。利用 Deep Agents 框架本身能力提供了 SKILLS支持、SubAgent 管理、本地文件读写等功能。</p>



<p>按照我的预想，记忆应当通过“文本+图数据库+向量数据库”共通管理。为此我自己添加了向量数据库和图数据库的集成。</p>



<p>考虑如果一开始就将应用定位成一个带记忆，可以自主学习的完整“人”实现起来会非常困难。最初会尝试利用这个框架来写小说。</p>



<h2 class="wp-block-heading">小说生功能设计及问题</h2>



<p>小说的写作知识完全通过 SKILL 教给 AI。框架只提供文件读写、数据库读写工具，具体怎么用这些工具完全由 AI 自己决定。</p>



<p>AI 对于长文写作的一大难点是 LLM 的上下文长度限制。为了突破 LLM 的限制，必须将小说大纲、设定、章节摘要等信息分别保存，让 AI 在需要时再自行加载。</p>



<p>尝试用 AI 生成了一篇小说的前两章（使用 qwen3-plus）。似乎 AI 对指令的依从性不是很高。虽明确要求使用图数据库保存人物关系等信息，但在我主动要求前没被触发。明确强调了要读取 <code>outline</code> 目录下所有文件，AI依旧会根据自己的想法只读部分内容。</p>



<p>Token 的消耗速度非常惊人。没跑几次就把 qwen3-plus 赠送的 100 万 token 用完了。随着文章长度的增加，上下文长度会持续增长， token 的消耗量也会快速增加。根据最新情况，写完一章后再手动让 AI 审阅一遍 100万 token 就花光了。</p>



<p>后续应当会一边调整 SKILL 一边不定期更新。</p>



<p>小说链接：<a href="https://fanqienovel.com/page/7618116230070684697" target="_blank" rel="noreferrer noopener">《他们都劝我冷静，然后我疯了》</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2026/03/ai-agent-sequoia/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>py-cggtts 项目简介</title>
		<link>https://haoluobo.com/2026/01/py-cggtts/</link>
					<comments>https://haoluobo.com/2026/01/py-cggtts/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Mon, 05 Jan 2026 13:05:00 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[CGGTTS]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[RUST]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12802</guid>

					<description><![CDATA[项目地址：https://github.com/vicalloy/py-cggtts/ py-cggtts 是 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>项目地址：<a href="https://github.com/vicalloy/py-cggtts/">https://github.com/vicalloy/py-cggtts/</a></p>



<p><a href="https://github.com/vicalloy/py-cggtts/">py-cggtts</a> 是一个为高精度时间传递领域打造的 Python 工具包，它基于 Rust 编写的高性能 CGGTTS 库（<a href="https://github.com/nav-solutions/cggtts">GitHub 仓库</a>），提供了对 BIPM CGGTTS 2E 格式文件 的完整解析能力。<a href="https://www.bipm.org/documents/20126/52718503/G1-2015.pdf">CGGTTS</a>（Common-View GNSS Time Transfer Standard）是由国际计量局（BIPM）制定的标准格式，广泛应用于全球守时实验室之间通过 GNSS 卫星进行远程原子钟比对。</p>



<h2 class="wp-block-heading">项目背景</h2>



<p>CGGTTS 本身是纯文本结构，解析起来并不困难。不过 Python 性能一般，且已经有了 Rust 的完整实现，于是尝试将 Rust 的 CGGTTS 库导出 Python 接口。目前将 Rust 导入 Python 生态的技术已经成熟，不少 Python 库都通过 Rust 来提升性能。</p>



<p>项目的主要代码都由 AI 完成。对于接口封装这类本身不复杂但又繁琐的工作，在 AI 的加持下变的轻松加愉快了。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2026/01/py-cggtts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>癸酉本石头记后28回，在线阅读及PDF/EPUB下载</title>
		<link>https://haoluobo.com/2025/09/the-guiyou-version-of-dream-of-the-red-chamber/</link>
					<comments>https://haoluobo.com/2025/09/the-guiyou-version-of-dream-of-the-red-chamber/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Thu, 25 Sep 2025 12:10:55 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[读书]]></category>
		<category><![CDATA[癸酉本]]></category>
		<category><![CDATA[红楼梦]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12707</guid>

					<description><![CDATA[项目地址： https://github.com/vicalloy/the-guiyou-version-of [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>项目地址： <a href="https://github.com/vicalloy/the-guiyou-version-of-dream-of-the-red-chamber">https://github.com/vicalloy/the-guiyou-version-of-dream-of-the-red-chamber</a></p>



<p>在线阅读：&nbsp;<a href="https://vicalloy.github.io/the-guiyou-version-of-dream-of-the-red-chamber/">https://vicalloy.github.io/the-guiyou-version-of-dream-of-the-red-chamber/</a></p>



<p>下载 PDF/EPUB：&nbsp;<a href="https://github.com/vicalloy/the-guiyou-version-of-dream-of-the-red-chamber/releases/">https://github.com/vicalloy/the-guiyou-version-of-dream-of-the-red-chamber/releases/</a></p>



<p>国内下载地址：<a href="https://haoluobo.com/wp-content/uploads/2025/12/Guiyou.Version.of_.the_.Latter.28.Chapters.of_.Dream_.of_.the_.Red_.Chamber.pdf" data-type="link" data-id="https://haoluobo.com/wp-content/uploads/2025/12/Guiyou.Version.of_.the_.Latter.28.Chapters.of_.Dream_.of_.the_.Red_.Chamber.pdf">PDF</a> / <a href="https://haoluobo.com/wp-content/uploads/2025/12/Guiyou.Version.of_.the_.Latter.28.Chapters.of_.Dream_.of_.the_.Red_.Chamber.epub">EPUB</a></p>



<p>《吴氏石头记增删试评本》，或《癸酉本石头记》，简称“癸酉本”，是通过互联网流出的所谓《红楼梦》旧抄本，其真实性遭到广泛质疑。2008年，网民何莉莉（化名，男性）将癸酉本后28回内容委托刘俊俊（化名，即金俊俊）上传至网络，声称此本为祖父母偶然得到，并由自己和几个表妹抄写过，原本已遗失。</p>



<p>癸酉本文风粗砺，却又高度契合判词与伏笔。不少情节粗看骇人，回看却又合乎情理。</p>



<p>癸酉本的真伪，目前尚无定论。就个人而言，该版结局符合我对名著的“审美”，特创建了这个仓库，方便大家阅读和审阅。</p>



<p>另推荐大家收听红楼梦的有声书。前80回推荐“白云出岫”的<a href="https://www.ximalaya.com/album/220565">红楼梦原文朗读</a>。后28回推荐“鹤鸣小音”的<a href="https://www.ximalaya.com/album/16971067">癸酉本石头记后28回</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2025/09/the-guiyou-version-of-dream-of-the-red-chamber/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Apple Guardian（打字练习游戏）加Cursor/Trae使用体验</title>
		<link>https://haoluobo.com/2025/03/apple-guardian/</link>
					<comments>https://haoluobo.com/2025/03/apple-guardian/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Wed, 12 Mar 2025 12:38:00 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[trae]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12662</guid>

					<description><![CDATA[项目地址：https://vicalloy.github.io/letter-fall/ 游戏地址：https [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>项目地址：<a href="https://vicalloy.github.io/letter-fall/">https://vicalloy.github.io/letter-fall/</a></p>



<p>游戏地址：<a href="https://github.com/vicalloy/apple-guardian">https://github.com/vicalloy/apple-guardian</a></p>



<p>小时候练打字的时候玩的最多的是小霸王上的一个空中掉落字母掉打字游戏。<br>最近看到很多宣传 Cursor 的帖子，另外字节也出了个类似的编辑器 Trae ，于是试着用 AI 编辑器将这个游戏复刻。</p>



<p>项目的大部分代码使用 Cursor 和 Trae 的 Agent 功能自动完成。就初步的体验而言，用自己不熟悉的开发框架写一些小东西 Cursor 这类的 AI 工具确实很好用，少了很多查资料的工作。部分功能反复打回依旧无法正确修改，这时候是需要手动介入。另外两个编辑器的推理速度都不算太理想，特别是 Trae 经常要等挺久。</p>



<p>就个人而言，写玩具 Cursor 和 Trae 很棒。大些的项目还是用 GitHub Copilot 之类的插件更可控一些。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2025/03/apple-guardian/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>中国历年人口变化</title>
		<link>https://haoluobo.com/2024/09/china-population/</link>
					<comments>https://haoluobo.com/2024/09/china-population/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Thu, 05 Sep 2024 13:02:00 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[无责任乱评]]></category>
		<category><![CDATA[人口问题]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12558</guid>

					<description><![CDATA[中学课本里说生产力决定生产关系。很多社会问题寻根溯源都和生产力相关。劳动力作为生产力中的重要一环深刻的影响了社 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>中学课本里说生产力决定生产关系。很多社会问题寻根溯源都和生产力相关。劳动力作为生产力中的重要一环深刻的影响了社会和经济的发展。</p>



<p>在网上收集了一些中国的人口数据，做了一个人口变化的统计图表。近年来出现了不少使用 Python 实现前端 Web 界面的工具。这次的图表使用 plotly 实现，使用 Python 做数据处理，并输出 html 图表。</p>



<p>项目地址： <a href="https://github.com/vicalloy/china-population" target="_blank" rel="noreferrer noopener">https://github.com/vicalloy/china-population</a><br>在线查看图表： <a href="https://vicalloy.github.io/china-population/" target="_blank" rel="noreferrer noopener">https://vicalloy.github.io/china-population/</a></p>



<h2 class="wp-block-heading">数据分析</h2>



<ol class="wp-block-list">
<li>出生人口中 2016 年到达2000年后的高点，之后出生人口断崖式下降。</li>



<li>2022 年首次出现死亡人口大于出生人口，人口出现负增长。</li>



<li>将 20 ～ 60 岁作为劳动力。也是在 2022 年首次出现劳动力的负增长，之后还将一直持。注：养老金压力山大。</li>



<li>2024 年幼儿园的入学人数掉的非常厉害，再过几年就蔓延到小学了。</li>



<li>2022 年高考录取人数为 1000 万，预计之后较长一段时间都将维持在 1000 万左右。</li>
</ol>



<h2 class="wp-block-heading">一些预测</h2>



<ol class="wp-block-list">
<li>接下来几年幼儿园因缺少生源，要关停一批。</li>



<li>生源不足问题逐步蔓延到小学。</li>



<li>学区房地位下降，成为房价下跌的主力。学区房快速下跌的窗口期没几年了。</li>
</ol>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="711" height="672" src="https://haoluobo.com/wp-content/uploads/2024/09/china-population.png" alt="" class="wp-image-12562" srcset="https://haoluobo.com/wp-content/uploads/2024/09/china-population.png 711w, https://haoluobo.com/wp-content/uploads/2024/09/china-population-300x284.png 300w, https://haoluobo.com/wp-content/uploads/2024/09/china-population-624x590.png 624w" sizes="(max-width: 711px) 100vw, 711px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2024/09/china-population/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Magpie 股价价格提醒工具</title>
		<link>https://haoluobo.com/2023/06/magpie/</link>
					<comments>https://haoluobo.com/2023/06/magpie/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Wed, 14 Jun 2023 12:35:00 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[股票]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12419</guid>

					<description><![CDATA[项目地址：https://github.com/vicalloy/magpie/ 股票工具。设置股票的止损点和 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>项目地址：<a href="https://github.com/vicalloy/magpie/">https://github.com/vicalloy/magpie/</a></p>



<p>股票工具。设置股票的止损点和营收点，在到达止损点或营收点时发起消息推送。提供一个简易点web服务器用于查看相关股票的当前价格。</p>



<p>注：</p>



<ul class="wp-block-list">
<li>支持的推送平台有&nbsp;<a href="https://telegram.org/">Telegram</a>&nbsp;/&nbsp;<a href="https://github.com/Finb/Bark/blob/master/README.en.md">Bark</a>&nbsp;。</li>
</ul>



<h2 class="wp-block-heading"><a href="https://github.com/vicalloy/magpie/blob/main/README.cn.md#%E7%94%A8%E6%B3%95"></a>用法</h2>



<h3 class="wp-block-heading"><a href="https://github.com/vicalloy/magpie/blob/main/README.cn.md#%E7%BC%96%E8%BE%91%E8%A7%84%E5%88%99%E6%96%87%E4%BB%B6"></a>编辑规则文件</h3>



<p>提醒规则使用&nbsp;<code>Json</code>&nbsp;格式进行描述。编辑规则并保存为文件&nbsp;<code>rule.json</code>&nbsp;。</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&#x5B;
  {
    &quot;stock_code&quot;: &quot;sh000001&quot;,
    &quot;stock_name&quot;: &quot;上证指数&quot;,
    &quot;base_price&quot;: 3200,  # 基准价格，用于计算涨幅
    &quot;alarm_price_min&quot;: 3100,  # 止损点
    &quot;alarm_price_max&quot;: 3400  # 营收点
  },
  {
    &quot;stock_code&quot;: &quot;sz000333&quot;,
    &quot;stock_name&quot;: &quot;美的&quot;,
    &quot;base_price&quot;: 54,
    &quot;alarm_percentage_min&quot;: 0.15,  # 止损点 base_price * (1 - alarm_percentage_min)
    &quot;alarm_percentage_max&quot;: 0.15  # 营收点 base_price * (1 + alarm_percentage_max)
  },
]

</pre></div>


<h3 class="wp-block-heading"><a href="https://github.com/vicalloy/magpie/blob/main/README.cn.md#%E5%90%AF%E5%8A%A8-web-%E6%9C%8D%E5%8A%A1%E5%99%A8"></a>启动 Web 服务器</h3>



<pre class="wp-block-preformatted">docker run --rm \
    -v `pwd`/rules.json:/app/rules.json \
    -p 8000:8000 vicalloy/magpie:latest \
    python -m magpie server -r ./rules.json</pre>



<p>在浏览器中访问网址&nbsp;<code>http://localhost:8000/</code>&nbsp;。</p>



<h3 class="wp-block-heading"><a href="https://github.com/vicalloy/magpie/blob/main/README.cn.md#%E6%A3%80%E6%9F%A5%E8%82%A1%E4%BB%B7"></a>检查股价</h3>



<pre class="wp-block-preformatted">docker run --rm \
    -v `pwd`/rules.json:/app/rules.json \
    magpie:latest \
    python -m magpie check -r ./rules.json \
    --datasource qq \
    --bark-token $(bark-token) \
    --tg-token $(tg-token) \
    --tg-chat-id $(tg-chat-id)</pre>



<p>可以通过设置&nbsp;<code>crontab</code>&nbsp;的方式定时执行股价的检查。</p>



<p><strong>备注</strong></p>



<ul class="wp-block-list">
<li>使用 <a href="https://github.com/Finb/Bark/blob/master/README.en.md">Bark</a>
<ul class="wp-block-list">
<li>请在 iPhone 上安装&nbsp;<code>Bark</code>&nbsp;客户端，并获取对应的&nbsp;<code>Token</code>&nbsp;。</li>
</ul>
</li>



<li>Using <a href="https://telegram.org/">Telegram</a>
<ul class="wp-block-list">
<li><a href="https://core.telegram.org/bots/tutorial#obtain-your-bot-token">创建一个 Bot 并获取对应的 Bot token</a></li>



<li>创建一个 <code>Group</code> ，并将刚创建的 Bot 添加到该Group，然后获取 Group 对应的 <code>chat id</code>.
<ul class="wp-block-list">
<li>例如:&nbsp;<a href="https://web.telegram.org/a/#-1045009696">https://web.telegram.org/a/#-1045009696</a>&nbsp;<code>-1045009696</code>&nbsp;就是&nbsp;<code>chat id</code>.</li>
</ul>
</li>
</ul>
</li>
</ul>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
10 9,10,11,12,13,14 * * * sudo docker run ....
</pre></div>]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2023/06/magpie/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>自拍照自动修正照片位置并生成延时视频</title>
		<link>https://haoluobo.com/2023/04/daily-portrait/</link>
					<comments>https://haoluobo.com/2023/04/daily-portrait/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Mon, 03 Apr 2023 13:42:12 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[daily-portrait]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12384</guid>

					<description><![CDATA[项目地址： https://github.com/vicalloy/daily-portrait 最近蓄须，每 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>项目地址： <a href="https://github.com/vicalloy/daily-portrait" target="_blank" rel="noreferrer noopener">https://github.com/vicalloy/daily-portrait</a></p>



<p>最近蓄须，每天拍一张照片记录变化，为此衍生出的项目。</p>



<ol class="wp-block-list">
<li>根据眼睛位置自动对齐照片，并自动生成视频（ gif 和 avi ）。
<ul class="wp-block-list">
<li>人脸检测使用 <a rel="noreferrer noopener" href="https://github.com/ageitgey/face_recognition" target="_blank">face-recognition</a> 。</li>



<li>图片位置修正使用 <a rel="noreferrer noopener" href="https://github.com/opencv/opencv-python" target="_blank">opencv-python</a> 。</li>
</ul>
</li>
</ol>



<figure class="wp-block-image size-full"><img decoding="async" width="150" height="199" src="https://haoluobo.com/wp-content/uploads/2023/04/vicalloy.gif" alt="" class="wp-image-12389"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2023/04/daily-portrait/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>使用AI修复将画像还原成照片</title>
		<link>https://haoluobo.com/2023/01/art-face-to-photo/</link>
					<comments>https://haoluobo.com/2023/01/art-face-to-photo/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Mon, 16 Jan 2023 13:23:00 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[GFPGAN]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12366</guid>

					<description><![CDATA[GFPGAN 是一个使用 AI 进行人脸修复的工具，即使对非常模糊的人脸也可起到不错的修复效果。Hugging [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><a rel="noreferrer noopener" href="https://github.com/TencentARC/GFPGAN" data-type="URL" data-id="https://github.com/TencentARC/GFPGAN" target="_blank">GFPGAN</a> 是一个使用 AI 进行人脸修复的工具，即使对非常模糊的人脸也可起到不错的修复效果。<a rel="noreferrer noopener" href="https://huggingface.co/" data-type="URL" data-id="https://huggingface.co/" target="_blank">Hugging Face</a> 提供了AI应用Demo的快速部署。我 Fork 了一份 GFPGAN 的 Demo 并做了少量的调整以加强对图片的支持。</p>



<p><strong>在线体验地址</strong> <a href="https://huggingface.co/spaces/vicalloy/GFPGAN">https://huggingface.co/spaces/vicalloy/GFPGAN</a></p>



<p>AI技术在图片生成领域有了不错的进展，现在已经可以通过文字生成质量不错的图片了。之前就一直想尝试用AI人脸修复将画中的人脸修复成照片，只是迫于拖延症一直未能真正动手。这些天试了一下，发现这个想法切实可行，就是修复出的效果算不上出色。</p>



<h3 class="wp-block-heading">Tips</h3>



<ol class="wp-block-list">
<li>AI 照片修复实际上是让 AI 对图片进行自行“脑补”的一个过程，所以原图细节一定不能过多（图片一定要小，或是），不然不利于 AI 软件的自行发挥。</li>



<li>樱木花道的输出效果不太好，再小丢失的细节又过多，因此加了个高斯模糊。注：理论上加高斯模糊比单纯的缩小图片效果要好，大家可以对其他图片试试。</li>



<li>应当是缺少样本，外加人脸检测时，如果胡子过长截取人脸时会丢失部分胡子。古人的长须无法完整修复。</li>



<li>过于“漫画化”的图片是无法识别到人脸的。</li>
</ol>



<h3 class="wp-block-heading">效果</h3>



<p>樱木花道</p>



<figure class="wp-block-image size-full"><img decoding="async" width="194" height="212" src="https://haoluobo.com/wp-content/uploads/2023/01/樱木花道.jpg" alt="" class="wp-image-12361"/></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="776" height="848" src="https://haoluobo.com/wp-content/uploads/2023/01/樱木花道out.jpg" alt="" class="wp-image-12363" srcset="https://haoluobo.com/wp-content/uploads/2023/01/樱木花道out.jpg 776w, https://haoluobo.com/wp-content/uploads/2023/01/樱木花道out-275x300.jpg 275w, https://haoluobo.com/wp-content/uploads/2023/01/樱木花道out-768x839.jpg 768w, https://haoluobo.com/wp-content/uploads/2023/01/樱木花道out-624x682.jpg 624w" sizes="auto, (max-width: 776px) 100vw, 776px" /></figure>



<p>唐太宗李世民</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="80" height="107" src="https://haoluobo.com/wp-content/uploads/2023/01/李世民.jpg" alt="" class="wp-image-12359"/></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="320" height="428" src="https://haoluobo.com/wp-content/uploads/2023/01/李世民out.jpg" alt="" class="wp-image-12360" srcset="https://haoluobo.com/wp-content/uploads/2023/01/李世民out.jpg 320w, https://haoluobo.com/wp-content/uploads/2023/01/李世民out-224x300.jpg 224w" sizes="auto, (max-width: 320px) 100vw, 320px" /></figure>



<p>乾隆</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="192" height="180" src="https://haoluobo.com/wp-content/uploads/2023/01/乾隆.jpg" alt="" class="wp-image-12357"/></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="768" height="720" src="https://haoluobo.com/wp-content/uploads/2023/01/乾隆out.jpg" alt="" class="wp-image-12358" srcset="https://haoluobo.com/wp-content/uploads/2023/01/乾隆out.jpg 768w, https://haoluobo.com/wp-content/uploads/2023/01/乾隆out-300x281.jpg 300w, https://haoluobo.com/wp-content/uploads/2023/01/乾隆out-624x585.jpg 624w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>韩熙载</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="110" height="266" src="https://haoluobo.com/wp-content/uploads/2023/01/韩熙载.jpg" alt="" class="wp-image-12364"/></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="423" height="1024" src="https://haoluobo.com/wp-content/uploads/2023/01/韩熙载out-423x1024.jpg" alt="" class="wp-image-12365" srcset="https://haoluobo.com/wp-content/uploads/2023/01/韩熙载out-423x1024.jpg 423w, https://haoluobo.com/wp-content/uploads/2023/01/韩熙载out-124x300.jpg 124w, https://haoluobo.com/wp-content/uploads/2023/01/韩熙载out.jpg 440w" sizes="auto, (max-width: 423px) 100vw, 423px" /></figure>



<p>宋太祖赵匡胤</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="689" src="https://haoluobo.com/wp-content/uploads/2023/01/宋太祖.jpg" alt="" class="wp-image-12367" srcset="https://haoluobo.com/wp-content/uploads/2023/01/宋太祖.jpg 640w, https://haoluobo.com/wp-content/uploads/2023/01/宋太祖-279x300.jpg 279w, https://haoluobo.com/wp-content/uploads/2023/01/宋太祖-624x672.jpg 624w" sizes="auto, (max-width: 640px) 100vw, 640px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="951" height="1024" src="https://haoluobo.com/wp-content/uploads/2023/01/宋太祖out-951x1024.jpg" alt="" class="wp-image-12368" srcset="https://haoluobo.com/wp-content/uploads/2023/01/宋太祖out-951x1024.jpg 951w, https://haoluobo.com/wp-content/uploads/2023/01/宋太祖out-279x300.jpg 279w, https://haoluobo.com/wp-content/uploads/2023/01/宋太祖out-768x827.jpg 768w, https://haoluobo.com/wp-content/uploads/2023/01/宋太祖out-624x672.jpg 624w, https://haoluobo.com/wp-content/uploads/2023/01/宋太祖out.jpg 1280w" sizes="auto, (max-width: 951px) 100vw, 951px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2023/01/art-face-to-photo/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
