看得透又看得远者prevail. ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
ppt.cc/fKlBax ppt.cc/fwlgFx ppt.cc/fVjECx ppt.cc/fEnHsx ppt.cc/fRZTnx ppt.cc/fSZ3cx ppt.cc/fLOuCx ppt.cc/fE9Nux ppt.cc/fL5Kyx ppt.cc/f71Yqx tecmint.com linuxcool.com linux.die.net linux.it.net.cn ostechnix.com unix.com ubuntugeek.com runoob.com man.linuxde.net ppt.cc/fwpCex ppt.cc/fxcLIx ppt.cc/foX6Ux linuxprobe.com linuxtechi.com howtoforge.com linuxstory.org systutorials.com ghacks.net linuxopsys.com ppt.cc/ffAGfx ppt.cc/fJbezx ppt.cc/fNIQDx ppt.cc/fCSllx ppt.cc/fybDVx ppt.cc/fIMQxx
Total Pageviews
Saturday, 21 March 2026
老电影-绿海天涯,王心刚/王馥荔/吴海燕主演
https://www.bilibili.com/video/BV1xbsEzkEXw/
王心刚/王馥荔/吴海燕,这些人是当年的俊男美女。
在线网页记事本工具
https://wordpad.cc/
一个非常简单的在线记事本,界面干净,没有广告,服务端存储,如果需要记录敏感信息,需要谨慎。这个记事本工具支持生成分享链接和设置访问密码,也算一层屏障。
https://www.memonotepad.com/
很复古风格的一个在线记事本工具,木纹材质的背景,写东西非常舒适,支持创建多条笔记,以及简单的搜索。在未登录状态下,仅支持浏览器本地存储,刷新页面内容也不会丢失。也可以选择创建用户来保存到笔记工具的服务器上。
https://dictation.io/speech
这个网页笔记本工具支持简单的排版,比如加粗,颜色,项目符号,不过它的特色是语音输入功能,使用的 Google 语音输入,支持的语言不少,不过识别率可能没有专门的语音输入应用那么高。如果仅仅编辑笔记,这个工具并不会保存你的内容到服务器,只是浏览器本地存储,不过如何使用语音输入,因为用到 Google 服务,所以可能会有数据传输。
https://shrib.com/
一个非常简洁的在线记事本软件,它支持简单的文本编辑(支持 Markdown 语法),并且支持自动保存到云端,会为每个笔记生成一个永久链接,方便分享给别人查看和修改,如果你需要记录隐私敏感的信息,这点需要格外注意。
https://notepad-online.com/en/
简洁的在线记事本工具,支持简单的富文本样式,它有两个版本,新版本支持建立多条笔记和更换页面配色和字体等,两个版本都使用浏览器本地存在,刷新页面数据并不会丢失,你的数据是你自己的。
https://notepad.js.org/
功能非常强大的网页记事本工具,干净无广告,支持简单的字体段落和背景材质定制,笔记完全使用浏览器本地存储,数据安全,刷新页面数据也不会丢失,甚至支持离线模式,断网也能使用,支持全屏模式和专注模式,相比其它笔记本工具,它还支持画中画模式,可以在桌面右下角显示浮动小窗口,方便在其它标签页或者应用打开时记录笔记;支持计时器和白噪音,
Thursday, 19 March 2026
r2-webdav
Use Cloudflare Workers to provide a WebDav interface for Cloudflare R2.
Currently the server advertises WebDAV Class 1 and Class 2 (LOCK/UNLOCK) support.
Usage
Change wrangler.toml to your own.
[[r2_buckets]]
binding = 'bucket' # <~ valid JavaScript variable name, don't change this
bucket_name = 'webdav'Then use wrangler to deploy.
wrangler deploy
wrangler secret put USERNAME
wrangler secret put PASSWORDDevelopment
With wrangler, you can run and deploy your Worker with the following commands:
# run your Worker in an ideal development workflow (with a local server, file watcher & more)
$ npm run dev
# deploy your Worker globally to the Cloudflare network (update your wrangler.toml file for configuration)
$ npm run deployTest
Use litmus to test.
GitHub Actions runs the basic, copymove, props, and locks litmus suites against wrangler dev --local.
The http suite is currently excluded because local Workers runs still time out on the interim Expect: 100-continue response check.
from https://github.com/abersheeran/r2-webdav
Tuesday, 17 March 2026
Programming an AI-Powered App
Introduction
Welcome to the exciting world of AI-powered applications! I’m Sandra Rodgers, and I’ll be your instructor as we embark on a journey together to create an AI-powered app that uses some of the newest and most powerful AI technologies.
Throughout this course, you’ll learn the skills and techniques needed to create a truly intelligent application that can interact with users, understand natural language, process audio inputs, and even analyze images.
AI Tools and Technologies
You’ll gain hands-on experience working with several well known AI APIs and technologies. These industry-leading platforms will serve as the building blocks of our AI-powered app. Some of the technologies we’ll use are:
- OpenAI:
- We’ll dive into OpenAI’s Chat Completion API, a revolutionary tool that allows our app to engage in natural and dynamic conversations with users.
- Deepgram:
- We’ll use the power of Deepgram’s speech recognition API to transcribe audio files, allowing us to seamlessly integrate audio analysis into our app.
- Replicate:
- We’ll learn about Replicate, a game-changer in open-source AI. We’ll use it to tap into the power of an image analysis model called miniGPT so our app will be able to understand the content of images and respond intelligently to questions about them.
- Langchain:
- We’ll use this technology to empower our app with a unique form of “memory.” With Langchain, our app will be able to remember previous interactions and respond intelligently based on the accumulated knowledge.
What we’ll be building
Now that we’re excited about all the fascinating AI technologies we’re going to learn, let’s take a look at what we’ll be building.
It’s an App that we can use to analyze content - text, audio, or images.
For our Text Analysis feature, we take a text selection, and then ask the AI questions about it, getting a response in return.
It’s composed of several main elements:
- a text area to add in our text
- an input and button to submit a question
- a div to present the AI’s response.

For our Audio Analysis feature, we transcribe an audio file into text. When we have the transcription, we ask the AI questions about it. Transcribing it to text first lets us use the same AI we used for the text analysis feature - the AI analyzes the audio in text form.
This feature is made up of the Transcriber component and a chat window which is similar to the one in the text analysis feature.
We’ll also add functionality to ask multiple questions to the AI so that we can continue to ask it questions about the audio file.

Lastly, we’ll build the Image Analysis feature. For this one, we will add an image url to the input. Then we can ask the AI questions about the image.
We’ll add functionality to be able to ask multiple questions. And we’ll give our AI memory so that it can remember previous questions and answers, holding onto the entire context of the conversation!

Getting Started
We’ll set up our project now so we can jump right into building our AI-Powered App.
The example code for this project can be found in the repo here. I recommend that you clone the project and use the branch called starting-code which contains the code to start building the AI features.
If you would like to see the finished project working, you’ll need to add a .env file. Use the .env-example as the guide to what should go in there. You will need to add your API keys for OpenAI, Deepgram, and Replicate.
We’ll sign up for each of the APIs when we get to later lessons that introduce each API. But if you would like to get a head start so you can see the project working, there are links below to sign up and get your keys for each of the APIs:
Open AI - https://platform.openai.com/signup
Deepgram - https://dpgr.am/deepgram-signup
Replicate - https://replicate.com/
Ready to Build
Now we’re ready to start building! In the next lesson of the course, we’ll learn how to use Open AI’s chat completion API. This is the main technology behind the famous chatGPT. We want to give our app the intelligence it needs to answer questions about text, so we’ll use OpenAI as the brain of our AI-Powered App. Let’s get started!
from https://www.vuemastery.com/courses/programming-an-ai-powered-app/ai-powered-app-introduction/
Top AI Tools for Developers
As AI and LLMs reshape the tech landscape, many developers wonder about their future role. Rather than viewing AI as a threat, forward-thinking developers are discovering how these tools can enhance their capabilities and secure their position in the industry. From automating routine tasks to solving complex problems more efficiently, AI is becoming an invaluable ally in the developer’s toolkit.
The most successful developers today are those who are learning to leverage AI tools effectively, making themselves more valuable by combining human creativity and expertise with AI-powered productivity. By mastering these tools, developers can focus on higher-level problem-solving and innovation, skills that are increasingly in demand.
In this article, we’ll explore how you can gain a competitive edge by incorporating AI development tools into your workflow, showing you how to use them to boost your productivity and enhance your capabilities as a developer.
How AI Is Enhancing Developer Productivity
The software development landscape has changed rapidly. Before ChatGPT, developers would often turn to Google, YouTube and StackOverflow to help solve complex coding problems. Today, Stack Overflow questions and usage rate are at record lows and steadily declining year after year.
This is because more and more developers are turning to AI to research, write, and debug their code instead of filtering through multiple answers online that may not be relevant to their specific situation.
So, what tools are developers turning to these days to boost their workflows? Let’s examine some of the most popular AI tools and the key features driving this shift in developer behavior.
Top AI Tools for Developers
-
Cursor: is a powerful code editor built with AI features at its core. It’s essentially a fork of VS Code that incorporates different LLMs to offer intelligent code completion, debugging assistance, and chat-based help without leaving your editor. Its standout features include the ability to explain complex code, generate implementations from comments, and refactor existing code with natural language instructions.
-
GitHub Copilot: GitHub Copilot integrates with your editor and, like Cursor, lets you select your preferred AI agent. It also includes an extensions feature that integrates external devtools such as Docker, Sentry, or GitBook into the Copilot chat.
-
Claude: Anthropic has been leading AI development efforts with their advanced AI assistant. In 2024, Claude released artifacts which helped developers quickly prototype and build simple UIs to test their ideas. Earlier in 2025, they improved on that by releasing Claude Code, an agentic coding tool that lives in your terminal, has context on your codebase, and helps you code faster through natural language commands.
-
v0.dev: v0 is an AI-powered tool developed by Vercel that generates responsive UI components and full webpages from text descriptions. Developers can describe a specific UI element or webpage, and v0.dev will create the corresponding code using Tailwind CSS styling. This significantly accelerates the UI development process, allowing front-end developers to quickly prototype and iterate on designs without having to write CSS from scratch.
-
Bolt.new: Like v0, Bolt, a product built by Stackblitz, allows developers to create and deploy web applications. Bolt can convert text written in natural language into working web applications that can launch directly from your browser. The platform also has out-of-the-box integration with Supabase, making it ideal for full-stack web development. It also handles deployment, hosting, and scaling automatically, making it ideal for rapid prototyping and MVP development.
-
ChatGPT: ChatGPT launched publicly in 2022 and paved the way for the numerous AI agents such as Gemini, Perplexity and Deepseek. ChatGPT is a general purpose AI agent that can assist developers with a wide range of tasks such as debugging and explaining complex algorithms. Although ChatGPT wasn’t specifically built for developers, its versatility and knowledge of programming languages and frameworks make it an essential tool in many developers’ workflows.
Now that we’ve discussed these AI tools, let’s explore the different ways you, as a developer, can take advantage of these tools in your development workflow while suggesting the best tools for the job.
Ways to use AI for Development
Prototyping
With AI, developers can now describe functionality in natural language and have working code prototypes generated within seconds that serve as solid starting points. This allows teams to quickly test concepts, gather feedback, and refine their solutions before committing to full-scale development.
Example To demonstrate bolt.new’s prototyping capabilities, I gave it the following prompt: “Please build a recipe search and management application with Nuxt JS as the frontend and Nitro as the backend, connecting to an API that helps users discover, save, and organize recipes.”
Within seconds, a complete Nuxt.js app materialized from scratch. The tool installed all dependencies, created a well-structured pages directory, and even connected to a suitable food API for recipe searching.


Suitable tools for prototyping: Bolt.new, v0.dev
Code generation
Developers tend to spend a lot of time writing repetitive code like initializing a component or creating a new function. Involving AI into your workflow can help save time and reduce the likelihood of syntax errors allowing developers to focus on the more complex and creative aspects of development.
Example
Code generation is particularly useful when building apps with a design system. Rather than manually creating each component, we can leverage AI tools to generate them automatically.
Here’s a sample prompt written in cursor chat:

Cursor went on to first structure the components directory and then create every component on the list provided with full customization support.
Suitable tools for code generation: Cursor, Copilot
Pair programming
Many developers use AI assistants like Github Copilot and ChatGPT as virtual coding partners. These tools help with code completions, alternative implementations and assist in thinking through complex logic in real time. This collaborative approach combines human creativity with AI efficiency, resulting in higher quality code with fewer bugs.
Example
Adding features to your application is a great scenario for pair programming with AI. For instance, with our recipe management app, we can use AI to help us think through solutions for various enhancements: implementing a recipe rating system, improving search functionality to handle multiple keywords, or adding dietary restriction filters like ‘vegetarian’ or ‘gluten-free’.
Here’s an example where we add the dietary filtering feature:

adding a feature to filter recipes based on dietary restrictions
In my prompt (on the left), I asked Bolt to add a feature to filter these recipes based on dietary restrictions, suggesting options like vegetarian and gluten-free. Bolt not only rewrote the home page to include these filters but also added four more common dietary options from its knowledge base: vegan, dairy-free, keto, and paleo.

Suitable tools for pair programming: Cursor, Copilot
Debugging
One of the most significant ways AI is helping boost developer productivity is through improved debugging processes. AI tools can analyze code errors more efficiently than traditional debugging methods, often identifying issues that might take developers hours to locate manually. These tools use pattern recognition to pinpoint bugs by comparing against millions of code samples and can suggest fixes based on best practices and previous solutions.
Example
Some common bugs many Vue developers experience involve component lifecycle problems or template/rendering problems. For example, a common issue occurs when developers attempt to access DOM elements before they’re mounted.
Here’s a User Profile component that demonstrates these common errors:
📄Userprofile.vue
<template>
<div>
<h1>User Profile</h1>
<p>Name: {{ user.name }}</p>
<p>Email: {{ user.email }}</p>
<div ref="profileDetails" class="profileDetails">
<p>User details Loaded!</p>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
const user = ref({});
const profileDetails = ref(null);
const fetchUserData = async () => {
// Simulate an API call with a delay
setTimeout(() => {
user.value = {
name: "John Doe",
email: "john.doe@example.com",
};
}, 3000);
};
const showDetails = () => {
console.log(profileDetails.value);
if (profileDetails.value) {
profileDetails.value.style.display = 'block';
}
};
onMounted(() => {
fetchUserData();
showDetails(); // Attempt to access DOM element immediately
});
</script>
<style scoped>
.profileDetails {
display: none;
}
</style>
In our code, the showDetails() function is called in onMounted() right after fetchUserData(). This causes an issue because it attempts to access and modify the DOM element before the user data has finished loading.
A straightforward solution is to share this code with an AI tool like Claude or ChatGPT and ask in plain language for help fixing it.
Let’s see the results when we ask Claude for help.
Prompt:

Claude’s response:

Updated 📄Userprofile.vue
<template>
<div>
<h1>User Profile</h1>
<p v-if="isLoading">Loading user data...</p>
<template v-else>
<p>Name: {{ user.name }}</p>
<p>Email: {{ user.email }}</p>
<div class="profileDetails">
<p>User details Loaded!</p>
</div>
</template>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
const user = ref({});
const isLoading = ref(true);
const fetchUserData = async () => {
isLoading.value = true;
// Simulate an API call with a delay
setTimeout(() => {
user.value = {
name: "John Doe",
email: "john.doe@example.com",
};
isLoading.value = false;
}, 3000);
};
onMounted(() => {
fetchUserData();
});
</script>
<style scoped>
.profileDetails {
margin-top: 20px;
padding: 10px;
background-color: #e6f7ff;
border-radius: 4px;
}
</style>
Claude not only provides a solution to our code problem but also recommends best practices to improve our code quality making for a great learning opportunity!
Suitable tool: Claude, ChatGPT
Tips for an effective AI Development Workflow
While the tools we’ve discussed can significantly boost your productivity, getting the most out of them requires a strategic approach. Let’s explore some key considerations for developing an effective AI-powered workflow:
-
Be specific with your prompt: These tools need as much context as possible in order to provide suitable help. It is encouraged that you over-explain. This could mean being specific with the language/framework or coding style you want the AI to use and also what you don’t want. You should never assume that the AI knows what you want. For example, you could specify in your prompt that you want solutions written in Vue 3 using the composition API rather than the options API.
-
Give your AI a persona: You can start your prompt by asking your assistant to assume the persona of a senior software engineer. This personification makes the AI view problems from a specific expert’s perspective. For example, a “senior Vue developer with 10 years experience” might provide more framework-specific advice than a general prompt. This approach can yield more nuanced technical suggestions and help filter out introductory or irrelevant information.
-
Use Analogies: In particular scenarios where AI may struggle to understand complex concepts you can help ground them by relating the technical concept to something more familiar. When describing technical requirements, try comparing them to everyday scenarios. For example, instead of saying, “Implement a reactive data binding system,” which is rather abstract and non-specific, you could say, "Create a system that works like a smart thermostat that automatically adjusts when you change the temperature setting”. This is similar to how Vue’s reactivity system updates the DOM when data changes.
-
Prioritize learning and fact checking: Although AI can save time, it’s crucial to understand the solutions it provides if you want to become a better software developer. Don’t blindly copy-paste generated code and always verify AI-generated output against trusted documentation.
Where to go from here
These AI tools and processes have revolutionized development as we know it. However, like any tool at our disposal, AI has its limitations. It’s helpful to note that as your app grows more and more complex, it becomes harder to prompt the AI effectively. Also, unlike search engines, these tools aren’t free indefinitely. They typically require paid subscriptions as your usage increases.
Tools like Cursor and Copilot have made the development process more enjoyable. What would typically take days to implement has been reduced to mere minutes. I encourage you to continue to view these tools as aids to augment your development process rather than a complete replacement. The true skill to master is knowing when to use these tools and learning how to combine their computational efficiency with your creative problem-solving abilities.
If you’d like to get started with AI development, we have a great course here on Vue mastery to help you get started.
from https://www.vuemastery.com/blog/top-ai-tools-for-developers
Monday, 16 March 2026
Sunday, 15 March 2026
几款程序员常用的笔记App
如果你也有记录笔记的习惯,可以看看我推荐的这几款App,从开箱即用到支持复杂定制,从云端同步到本地存储,总有一款适合你。
飞书
程序员一般记录的都是自己的技术心得,实践历程,别的App还得下载,如果你正在飞书办公的话,直接打开飞书文档就可以写起来了。
打开知识库新建文档,还有很多模版可以选择,所以对于单单说“记录”这个需求,飞书是肯定够用的。
并且写完之后,可以设置成公开,直接分享给其他人,也能获得其他人的收藏和评论,查看被多少人查看等等。
如果你想导出的话,飞书只支持导出Word、PDF,对于程序员最需要的Mardown格式反而没有,如果呼声够大的话,应该也会加上。
数据存储在飞书的服务器上。
语雀
下载地址:https://www.yuque.com/download
语雀是阿里巴巴出品的产品,支持IOS、安卓、MacOS、Windows、iPad。详细信息大家可以去官网查看一下。
语雀使用起来感官上要比飞书舒服很多,很干净。
App操作逻辑也比较清晰,如果是日常记录,非常够用了。
同样也支持非常丰富的模板,对于普通人来说,写文章、写心得、记录旅游、记账、分享,这几样都能满足。
不断的换App的最大问题恐怕还是颜值,其次就是数据存储上免费版够不够用。
这种支持多端文档同步的App,不可能不收费,不然就活不下来,这几天程序员圈子里闹的沸沸扬扬的老牌博客站「博客园」就是一个例子。
所以大家看自己的情况,免费版够用就用免费版,付费会员看自己接受程度,我90%的人估计都是轻度用户。
导出支持的格式比较多 : word、paf、markdown、jpg、语雀文档
当然,你的数据也是存在它自己的服务器上。
我来(wolai)、Notion
下载地址:https://www.wolai.com/
对于Notion我只是轻度试用了一下,没有太深入使用。所以这里着重介绍一下wolai
(我知道有很多人把Notion玩出了花,一边用作知识库,一边还能直接建站。)
wolai,我用起来就类似一个国内版的Notion。
它的界面,左侧是文件列表,右侧是文件内容。
支持块级双链,方便你串联知识,不过我对这个块级双链用的不太好,没有那么多东西可以串联。
但是这也是它的一大特色,每一段文字、图片、表格等等都会视为一个块,可以充分发挥你的想象。但也是要求你有比较多的积累素材才能把它真正用起来。
同样也可以生成分享链接,设置权限等等。
也支持绑定微信服务号,给服务号发消息即可保存在wolai中。
颜值方面和丝滑度方面,个人感觉比语雀略逊一筹。
同样数据存储在云端,多端同步。
PS: 上述几款App,差不多都是向Notion看齐。但由于Notion服务器问题,国内使用不是很方面,所以受众有限。
Flomo ,浮墨笔记
下载地址: https://flomoapp.com/
和上边介绍的几个不同,Flomo更加轻量化,记录的内容也更加碎片化,适合你突然来的灵感,或者一时的感悟。(记录长的肯定也可以)
如果你平时不是要写那种长篇大论的文章,或是记录庞大的知识体系,Flomo的使用场景真的非常适合。
类似你随手发了个朋友圈一样,简单快捷,不拘泥于语法,内容至上。回顾自己的笔记时,靠左侧的标签分类来查找,标签支持多级。
笔记之间也支持链接,但需要pro会员才可以。因为我没有尝试,所以不知道是不是双向的链接,不过猜测是的。
绑定Flomo的微信服务号,可以通过给微信的Flomo服务号发消息来进行快速记录,这一点和wolai是一样的。
Obsidian
下载地址:https://obsidian.md/
如果你想找到一个功能齐全,同时又完全把数据保存在本地的App,那一定绕不开Obsidian。
同时也有非常多的主题可以下载,可以自由选择各种markdown配色,所以说它的颜值不是问题,问题在于你能不能接受它的繁琐。
如果你不使用插件,其实也能满足你绝大部分的场景,除了链接分享。因为它的文件都是在你的本地。
在我使用起来,Obsidian还是更偏向于文章类的长篇的记录,如果记录的片段过于琐碎,只会让左侧的文件目录更加庞大。(当然有类似插件如Thino,支持你记录碎片内容)
它就类似于vscode,有非常活跃的插件社区,基本上你能想到的笔记功能,都能在里面实现。但这同样也是它的缺点,因为对于不想折腾的人来说,或者是非程序员,有一些上手难度。
比如你要实现使用github来进行笔记的云端同步,那就得使用Obsidian Git插件,同时还要知道github的使用方法,这无疑都是门槛。
如果你愿意折腾一下的话,Obsidian绝对会越用越顺手。基本的写作还是要求你懂一些Markdown语法来达到最好的效果。当然,完全不懂的话,也不是什么问题,就只管写就好了。
如果说你觉得Obsidian太过于繁琐,上手难度太高,我还有另一个轻量化的App推荐给你:Typora
下载地址:https://typora.io/
typora也是一个markdown编辑器和阅读器,我在它的很早期的bate版本就使用过。
它和Obsidian一样,都支持markdown语法的实时渲染。
同时它更加的轻巧,不像Obsdian一样有很多插件需要研究,看起来是一个让你专注于写作的好帮手。
它的官网下载应用包只有Mac和windows,所以我也不清楚它有没有移动端App。
支持Markdown文件的导入和导出,导出格式也比较丰富。
我不再使用的原因,就是因为它过于简洁,不太符合我的需求。我还是希望多多少少可以有一些辅助功能,让记录的文字更加灵活和有序一些。
不过现在又多了一个理由:它开始收费了。
Memos
官网地址: https://www.usememos.com/
最后一个要介绍的是可以自建服务的笔记App。
这里推荐的是Memos,但不仅限于Memos,还有一些其他非常优秀的开源项目。
这是Memos的界面,有没有感觉有点熟悉,他早一些的版本功能其实和Flomo是基本一致的。
Memos后端使用的是Go,前端使用的是React,完全开源,支持Docker部署,目前(2024-07-15)版本是V0.22.3。
作者的更新内容也比较有争议,砍掉了很多大家觉得好的功能,也有删掉又加回来的功能。
所以非常建议大家自己部署时,锁定版本,只要够用就行。毕竟更新再频繁,到底还是一个笔记App,核心还是记录。
后面如何部署和二开,我会单独再写一篇,这里只介绍部署后的功能点。
数据存储问题。可以部署在云服务器,本地内网环境,家庭Nas环境里,数据存储全看你的盘大小。不过云服务器访问速度看你的服务器配置。
Api功能。这一点放在Flomo里也是收费功能,Memos可以生成Token,你可以在外部调用自己的接口,进行读写操作。也可以配置webhook,用来通知飞书、钉钉、微信等
分享。点击分享可以直接生成一个链接,这个链接就是你部署后的地址。
双向链接。发布一条笔记时,可以链接另一条笔记,两个笔记之前就可以相互点击跳转,其实这个链接就是上边分享用的链接。
主题。它的主题是需要你自己写入css文件,目前我还没发现有写好的别的主题,不过它自带的样式其实还算简洁,这也是我选择它的一个原因。
最最重要的,就是定制/魔改。如果不是为了定制,其实完全都不用选memos,浪费服务器钱,浪费时间,最后只换来了其他App一样的效果。
通过定制可以实现独一无二的UI界面,更多的接口功能。
也可以同时学习React和Go,在实践中提升自己的技术,因为这算是一个有着非常明确需求的项目,你做什么功能完全比着Flomo抄就可以了,同时技术栈还比较新,比什么用xx前端框架复刻一个饿了么这种项目要有用的多。
那你可能就要问了,我废了这么多劲儿,最后得到的不还是一个普普通通的笔记App吗?有什么意义吗?
首先能问出这个问题,肯定是已经在技术上丧失热情了,把研究技术当成费力不讨好,想必咱们之间也没什么好说的。
这个问题就类似有人问:为什么你一个钓鱼佬,十次有九次空军,还有一次钓到地球,还花那么多钱去买装备?半夜还要去钓鱼?这有什么意思吗?
这就是热爱,你他妈的懂不懂啊。
总结
首先我们排除一个连免费版都没有的选项:Typora。
前提是平时有写作习惯。如果没有写文章记录的习惯,直接使用微信朋友圈、小x书这类App就可以了。
如果你懒得折腾,但需要分享给朋友或社群看,喜欢写长文的话,推荐飞书、语雀、wolai这一类的App,写完了直接就可以发链接。喜欢分享感悟,碎片笔记,可以选择Flomo,写完后导出图片进行分享。
如果你热衷于折腾,平时也有大量写作和记录的需求,又想要一个完全离线版的笔记App,Obsidian是值得一试的。
而Memos适合你喜欢研究前端和Go,并且记录和分享的内容也是一些碎片笔记。
甚至不是因为你多么需要笔记App,而是单纯的为了把玩一个有趣的开源作品。
这就是唯一有意义的意义。
还有很多App,像是印象笔记、思源、为知、oneNote、有道云笔记等等等等,太多了。
Why Coding is Sooooo Good?
Coding,
also known as programming, is a highly valued skill in today's digital
world. Here are several reasons why coding is considered to be so good:
1. Creativity and Problem Solving:
Coding
allows you to unleash your creativity and express your ideas in the
form of software or applications. It empowers you to build something
from scratch and solve real-world problems. Through coding, you can
bring innovative solutions to various challenges and make a positive
impact.
2. Career Opportunities:
The
demand for skilled programmers continues to grow rapidly. Learning to
code opens up a wide range of career opportunities in industries such as
technology, finance, healthcare, gaming, and many others. Whether you
choose to work for a company or pursue entrepreneurship, coding skills
provide a solid foundation for a successful and fulfilling career.
3. Flexibility and Adaptability:
Coding
equips you with the ability to adapt to ever-changing technologies and
environments. With coding knowledge, you can easily learn new
programming languages, frameworks, and tools as needed. This flexibility
allows you to stay relevant in the fast-paced world of technology and
opens doors to exciting projects and advancements.
4. Empowerment and Independence:
Coding empowers you to turn your ideas into reality without relying on others. You gain the independence to create your own projects, websites, apps, or even start your own business. By acquiring coding skills, you become self-sufficient and capable of bringing your visions to life.
5. Continuous Learning and Growth:
Coding is a field that constantly evolves. It requires continuous learning and staying updated with the latest developments. This aspect of coding ensures that you are always challenged and encourages personal growth. With each new project or problem you tackle, you expand your knowledge and skills, making coding an intellectually stimulating pursuit.
In summary, coding offers numerous benefits, including the opportunity for creativity, a wide range of career prospects, adaptability to changing technologies, empowerment, and continuous personal growth. Embracing coding can open doors to a world of possibilities and enable you to make a meaningful impact in the digital landscape.
Solving cold starts with Cloudflare Workers
Did this post load fast? 🚀 This is in no small part because the content was delivered to your browser using Cloudflare's Workers. Workers provides a high performance global network with a 0ms cold-start time.
Serverless today
Cloud providers can allocate machine resources on demand, scaling automatically to the requirements of your business. Two fundamental technologies make this possible today: virtualization, and containerization.
Virtualization is the process of running a virtual instance of a computer system in a layer abstracted from the actual hardware. Most commonly, it refers to running > multiple operating systems on a computer system simultaneously.
opensource.com - https://opensource.com/resources/virtualization
Containerization is the packaging of software code with just the operating system libraries and dependencies required to run the code to create a single lightweight executable.
IBM - https://www.ibm.com/cloud/learn/containerization
Whether it’s Amazon’s ECS or Lambda, Google’s Cloud Run or Cloud Functions, or any of the other modern offerings – services are built on these two fundamental concepts.
Code deployed as containers to these cloud services becomes a small independent workload that can be passed around and run on different hardware. For all intents and purposes this works really well, but providers make a trade-off between keeping your workload ‘hot’ (ready to accept requests) and the cost of occupying infrastructure.
Typically you can take over the trade-off with controls given to you from the provider, but you will need to decide: low cost with longer initial start times, or hot and ready with a higher cost. Businesses generally accept the cost associated with always having a workload running to eliminate the 'cold start', especially when the workload has to load a user experience like a web application.
Lambda cold starts
My team at ASICS Apps struggled with this very problem last year when experimenting with Next.js and AWS Lambda. We were attracted to the atomic nature, and billing per execution time. Using the custom server feature of Next.js, our demo projects looked very promising, and didn’t require a large time investment from our infrastructure team. Unfortunately we couldn't find a reliable solution to bring down cold requests consistently under three seconds, unacceptable for business requirements and set standards. This is especially the case when a lambda is delivering a visual interactive experience. I'm unsure I would recommend Lambda to serve a modern application experience like with Next.js, but can definitely see value for background tasks, or service to service cron workloads.
In the end, we chose AWS Elastic Container Service configured to guarantee a hot workload (never shutting off). Meaning we have accepted the cost of running a container every minute of every day to guarantee an instance response to user requests. Can we do better?
Cloudflare Workers
Faced with recent problems with Lambda at work, and not wanting to pay monthly to run this simple blog, Cloudflare Workers was the perfect solution.
You can think of Workers as a giant web browser running in the cloud. When a request is handled by Workers it’s akin to opening another tab. This comparison works well as a mental model because the Workers runtime uses the V8 engine — the same engine used by Chromium and Node.js. Instead of needing to package code in a container, you only need to adapt the worker syntax for application entry points. Unlike your web browser, the code is executed inside the server environment allowing your application access to privileged secrets, rendering content server-side, or completing costly calculations.
This blog is built with the latest version of Nuxt, an opinionated hybrid Vue framework that delivers high quality web experiences. With Cloudflare Workers I no longer worry about choosing between cold starts or paying a premium in addition to containerizing my application. This blog is now instantly available anywhere in the world, with very low latency and no cold starts.
Comparison: AWS Lambda vs ECS vs Cloudflare Workers
| Feature | AWS Lambda | Cloudflare Workers |
|---|---|---|
| Cold Start | Yes (can be several sec) | No (0ms, always ready) |
| Pricing Model | Per execution time | Per request, generous free |
| Deployment | Package as zip/container | JavaScript/Worker script |
| Scalability | Automatic, event-driven | Automatic, edge network |
| Latency | Variable, cold start risk | Very low, global edge |
| Limitations | Cold starts, memory/time | Runtime limits, JS only |
This table highlights the main differences between AWS Lambda and Cloudflare Workers. Cloudflare Workers stands out for its instant availability and global reach, making it ideal for web applications and APIs that require low latency and no cold starts.
Conclusion
In summary, Cloudflare Workers offer a compelling solution for developers seeking instant, global availability and minimal latency for their web applications. By eliminating cold starts and simplifying deployment, Workers empower teams to deliver fast, reliable experiences to users worldwide. If you’re building modern web apps or APIs, it’s worth considering Cloudflare Workers for your next project.
from https://jamesvan.ca/post/cf-workers-coldstarts
Saturday, 14 March 2026
适合小团队/个人使用的各种serverless和开源服务
我运用到的服务一般有两个类别:一类是便捷的serverless服务,另一类是可以自己部署的开源云服务(他们也会提供云服务,其实和前面说的serverless是一种,一般为了安全考虑会自己部署,当然功能会被阉割)。这两者结合起来,极大地提升了开发效率。
先说部署方面。我的后端还是传统架构,但部署方式完全不同了。我没有采用传统服务器搭建CI/CD部署,而是使用railway、zeabur这种部署平台(虽然它们底层也是跑在aws上,哈哈)。因为都是单体应用,不需要考虑扩容问题,这类部署平台极大地节约了部署时间,配置起来也很方便。
另外一句部署的题外话,大部分知名的框架你只需要绑定github仓库就会自动识别部署,但如果你的文件结构变了,或者做一些调整,你就需要写dockerfile来自定义部署。
至于其他功能,我基本都外包给了我上面所说的serverless的第三方云服务。比如云数据库、队列、workflow这些,直接用现成的服务就好。oss更是不用说了,现在还有很多更方便的选择,像vercel的blob、supabase的storage,它们都是在s3之上做了封装和抽象,让开发者用起来更加简单。
不过serverless本体,edge functions我也会使用,一般会用在测试webhook,或者edge functions作为webhook的中转站。
因为部署非常快,直接在部署网站写好就发布了,测试也方便。
有点偏题了,回到正题来。
接下来正式介绍各种服务,开源的我会在后面标记开源。
一般开源服务都有免费额度,所以如果你是想做demo和mvp,不需要花一分钱。
写在开头的最后,Cloudflare, Vercel和Netlify我就不做介绍了,他们已经是最出名的serverless部署服务了。
云数据库
PlanetScale
MySQL兼容的serverless数据库平台,提供数据库分支、无锁schema变更等特性。非常适合需要快速迭代的项目,支持横向扩展和自动备份。
Supabase DB(开源)
开源的Firebase替代品,基于PostgreSQL构建,提供认证、数据库、存储和实时订阅功能。支持自部署,完全掌控你的数据。
Neon
serverless Postgres数据库,支持即时配置、自动扩缩容和数据库分支功能。按使用量计费,闲置时自动缩减到零,非常省钱。
部署服务
Railway
零配置的部署平台,自动检测框架并部署,支持CI/CD集成。从GitHub推送代码后自动构建部署,非常适合快速上线项目。
Coolify(开源)
开源的自托管部署平台,可以在自己的服务器上部署应用。支持Docker容器、静态网站、数据库等多种服务类型,提供简洁的Web界面管理。支持链接自己服务器部署
Dokploy(开源)
开源的自托管PaaS平台,让你在自己的服务器上实现类似Heroku的部署体验。支持多种应用类型、数据库服务和自动SSL证书配置。支持链接自己服务器部署
Cloudflare Workers
https://workers.cloudflare.com/
边缘计算平台,在全球数据中心运行serverless函数。毫秒级冷启动、无限扩展,特别适合API中间层、webhooks和边缘渲染场景。
Cloudflare Pages
静态网站和全栈应用部署平台,与GitHub/GitLab深度集成。支持前端框架、serverless函数,通过全球CDN提供极速访问体验。
异步队列或workflow
Trigger.dev(开源)
开源的后台任务平台,用于构建可靠的工作流,支持自动重试且无超时限制。非常适合处理长时间运行的任务和AI工作流。
Temporal
https://temporal.io/
持久化执行平台,用于编排复杂的工作流并提供容错能力。支持状态管理、自动重试,特别适合微服务编排和复杂业务流程。
Upstash
https://upstash.com/
serverless数据平台,提供Redis、Kafka和QStash(消息队列)服务,按请求计费。特别适合serverless环境,支持自动扩展。
鉴权服务:
Logto(开源)
https://logto.io/
开源的身份验证和用户管理平台,提供现代化的登录体验和完整的用户管理功能。
Supabase Auth(开源)
https://supabase.com/
开源的Firebase替代方案,提供完整的后端服务,包括身份验证、数据库、存储和实时订阅功能。
Clerk
https://clerk.com/
现代化的用户认证和管理平台,提供开箱即用的登录组件、多因素认证和用户管理界面。
Better Auth(开源)
https://better-auth.com/
Node.js生态中目前开发体验最好的鉴权框架,提供类型安全的API和灵活的配置选项。支持多种认证策略和数据库,完全开源可自托管。官方云服务正在开发中。
邮件发送服务
https://resend.com/
现代化的邮件API服务,专为开发者设计,提供简洁的API和优秀的送达率。支持React Email模板、Webhook事件追踪,轻松实现交易邮件和营销邮件发送。
文件存储服务:
MinIO(开源)
https://min.io/
开源的高性能对象存储系统,兼容Amazon S3 API。可以部署在任何基础设施上,提供企业级的数据保护和可扩展性,完全掌控你的存储数据。
Vercel Blob
https://vercel.com/storage/blob
Vercel提供的serverless文件存储服务,基于S3构建但使用更简单。与Vercel平台深度集成,支持边缘网络加速,按使用量计费。
Supabase Storage
https://supabase.com/storage
Supabase的对象存储服务,基于S3构建,提供简单的API和强大的访问控制。支持图片转换、自动备份,与Supabase其他服务无缝集成。
Cloudflare R2
https://www.cloudflare.com/products/r2/ ,
S3兼容的对象存储服务,最大特点是零出站费用。与Cloudflare全球网络深度集成,提供快速访问和自动缓存,按存储容量计费。
CMS服务:
Payload(开源)
https://payloadcms.com/
开源的无头CMS和应用框架,使用TypeScript构建。提供强大的管理界面、灵活的内容建模和完整的API,支持自托管,完全掌控你的内容数据。
完全nextjs native的应用,可以单独部署cms服务,也可以直接放在nextjs项目里面
Strapi(开源)
https://strapi.io/
开源的无头CMS,提供可定制的管理面板和RESTful/GraphQL API。支持插件系统、多种数据库,可以快速构建API驱动的应用。
最老牌的cms项目
插件多,如果给客户用,放心使用
https://sanity.io/
实时协作的无头CMS平台,提供结构化内容管理和强大的查询语言GROQ。支持自定义编辑器、实时预览,特别适合内容驱动的网站和应用。
基于nodejs的相册程序Afilmory
A modern, high-performance photo gallery platform for photographers
Official SaaS • Documentation • Live Examples • Self-Hosting
Afilmory (/əˈfɪlməri/, "uh-FIL-muh-ree") is a comprehensive photo gallery solution that combines Auto Focus (AF), Aperture (light control), Film (vintage medium), and Memory (captured moments). Built with React + TypeScript, it offers automatic photo synchronization from multiple storage sources, high-performance WebGL rendering, and professional EXIF metadata display.
👉 Get Started at afilmory.art - Zero setup, live in minutes!
The easiest way to create your photo gallery. No deployment, no servers, no maintenance required.
Why Choose SaaS?
- ✅ Zero Configuration - Sign up and go live immediately
- ✅ Live CMS - Edit photos, titles, and metadata in real-time
- ✅ Custom Domains - Bind your own domain with DNS verification
- ✅ Auto Updates - Always running the latest features
- ✅ Managed Infrastructure - We handle scaling, backups, and maintenance
For developers who need full control over their deployment:
Docker (Recommended)
# See our Docker deployment guide
https://github.com/Afilmory/dockerManual Installation
# 1. Clone and install
git clone https://github.com/Afilmory/Afilmory.git
cd Afilmory
pnpm install
# 2. Configure
cp config.example.json config.json
cp builder.config.default.ts builder.config.ts
# Edit both files with your settings
# 3. Build manifest and thumbnails
pnpm run build:manifest
# 4. Start the application
pnpm devFor detailed self-hosting instructions, see DEVELOPMENT.md and Documentation.
See Afilmory in action:
- afilmory.innei.in - Creator's personal gallery
- gallery.mxte.cc
- photography.pseudoyu.com
- afilmory.magren.cc
- 🖼️ High-Performance WebGL Renderer - Custom WebGL image viewer with smooth zoom, pan, and gesture support
- 📱 Responsive Masonry Layout - Powered by Masonic, adapts seamlessly to any screen size
- 🎨 Modern UI/UX - Built with Tailwind CSS and Radix UI for accessibility and aesthetics
- ⚡ Incremental Sync - Smart change detection processes only new or modified photos
- 🌐 Internationalization - Multi-language support with i18next
- 🔗 Social Sharing - OpenGraph metadata for rich social media previews
- 🔄 Format Support - Automatic conversion of HEIC/HEIF and TIFF formats
- 🖼️ Smart Thumbnails - Multi-size thumbnail generation for optimized loading
- 📊 Complete EXIF Display - Camera model, focal length, aperture, ISO, and more
- 🌈 Blurhash Placeholders - Elegant progressive loading experience
- 📱 Live Photos - Detection and display of iPhone Live Photos
- ☀️ HDR Images - Full HDR image support
- 🎛️ Fujifilm Recipes - Display Fujifilm film simulation settings
- 🗂️ Multi-Storage Support - S3-compatible storage, GitHub, Eagle, and local file system
- 🏷️ File System Tags - Auto-generated tags based on directory structure
- ⚡ Concurrent Processing - Multi-process/multi-thread support for fast builds
- 🗺️ Interactive Map - Geographic visualization with GPS coordinates using MapLibre
- 🔍 Fullscreen Viewer - Immersive image viewing with gesture controls
- 📷 Share & Embed - Share images to social media or embed in your website
afilmory/
├── apps/
│ ├── web/ # React SPA (Vite + React Router 7)
│ ├── ssr/ # Next.js SSR wrapper for SEO/OG
│ ├── docs/ # Documentation site (VitePress)
├── be/ # Backend services (Hono-based)
│ ├── apps/
│ │ ├── core/ # Core API server
│ │ ├── dashboard/ # Admin dashboard backend
│ │ └── oauth-gateway/# OAuth authentication gateway
│ └── packages/
│ ├── framework/ # Hono enterprise framework
│ ├── db/ # Database schemas (Drizzle ORM)
│ ├── redis/ # Redis client
│ └── websocket/ # WebSocket gateway
├── packages/
│ ├── builder/ # Photo processing pipeline
│ ├── webgl-viewer/ # WebGL image viewer component
│ ├── ui/ # Shared UI components
│ ├── hooks/ # React hooks library
│ ├── sdk/ # API client SDK
│ ├── utils/ # Utility functions
│ └── data/ # Shared data types
└── plugins/ # Builder plugins
- React 19 - Latest React with Compiler
- TypeScript - Full type safety
- Vite - Lightning-fast build tool
- React Router 7 - Modern routing
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Jotai - Atomic state management
- TanStack Query - Data fetching and caching
- i18next - Internationalization
- Hono - Ultra-fast web framework
- Drizzle ORM - Type-safe database toolkit
- PostgreSQL - Primary database
- Redis - Caching and pub/sub
- WebSocket - Real-time communication
- Node.js - Server-side runtime
- Sharp - High-performance image processing
- AWS SDK - S3 storage operations
- Worker Threads/Cluster - Parallel processing
- EXIF-Reader - Metadata extraction
Designed with adapter pattern for flexibility:
- S3-Compatible - AWS S3, MinIO, Backblaze B2, Alibaba Cloud OSS
- GitHub - Use GitHub repository as storage
- Eagle - Import from Eagle app library
- Local File System - For development and testing
- Node.js 18+
- pnpm 10+
- TypeScript 5.9+
# Install dependencies
pnpm install
# Copy configuration files
cp config.example.json config.json
cp builder.config.default.ts builder.config.ts
# Set up environment variables
cp .env.template .env
# Edit .env with your credentials# Development
pnpm dev # Start web + SSR
pnpm dev:be # Start backend services
pnpm --filter web dev # Web app only
pnpm --filter @afilmory/ssr dev # SSR only
# Build
pnpm build # Build production web app
pnpm build:manifest # Generate photo manifest (incremental)
pnpm build:manifest -- --force # Full rebuild
# Documentation
pnpm docs:dev # Start docs dev server
pnpm docs:build # Build documentation
# Code Quality
pnpm lint # Lint and fix
pnpm format # Format code
pnpm type-check # Type checkingconfig.json - Site presentation config:
{
"name": "My Gallery",
"title": "My Photography",
"description": "Capturing beautiful moments",
"url": "https://gallery.example.com",
"accentColor": "#007bff",
"author": {
"name": "Your Name",
"url": "https://example.com",
"avatar": "https://example.com/avatar.jpg"
},
"social": {
"github": "username",
"twitter": "username"
},
"map": ["maplibre"],
"mapStyle": "builtin",
"mapProjection": "mercator"
}builder.config.ts - Photo processing config:
import { defineBuilderConfig } from '@afilmory/builder'
export default defineBuilderConfig(() => ({
storage: {
provider: 's3',
bucket: 'my-photos',
region: 'us-east-1',
// ... other S3 settings
},
system: {
processing: {
defaultConcurrency: 10,
enableLivePhotoDetection: true,
},
observability: {
showProgress: true,
showDetailedStats: true,
},
},
}))Implement the StorageProvider interface:
import { StorageProvider } from '@afilmory/builder'
class MyStorageProvider implements StorageProvider {
async getFile(key: string): Promise<Buffer | null> {
// Your implementation
}
async listImages(): Promise<StorageObject[]> {
// Your implementation
}
// ... other required methods
}Create a plugin for the build pipeline:
import { BuilderPlugin } from '@afilmory/builder'
export const myPlugin = (): BuilderPlugin => ({
name: 'my-plugin',
async onBeforeBuild(context) {
// Pre-build hook
},
async onAfterBuild(context) {
// Post-build hook
},
})- Official Documentation - Complete guides and API reference
- Quick Start Guide - Get running in 5 minutes
- SaaS Mode - Learn about hosted galleries
- Storage Providers - Setup guides for all storage options
- Deployment Guides - Deploy to various platforms
- API Reference - Backend API documentation
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting (
pnpm test && pnpm lint) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Attribution Network License (ANL) v1.0 © 2025 Afilmory Team
See LICENSE for more details.
- Official SaaS - Hosted gallery service
- Documentation - Full documentation
- GitHub - Source code
- Creator's Website - Project creator
from https://github.com/Afilmory/afilmory
Friday, 13 March 2026
Thursday, 12 March 2026
中国突然变成“OpenClaw”的全球最大养殖实验场
13/03/2026
据彭博社周四12日报道,OpenClaw(中文称“养龙虾”)
彭博社报道表示,过去的几周里,
受人工智能威胁的就业岗位 彭博社又援引北京大学近期一项针对超过一百万份招聘信息的研究发
Tuesday, 10 March 2026
达利欧:世界秩序已瓦解,贸易战和资本战将成常态
全球最大对冲基金桥水创始人瑞·达利欧2月14日发布重磅长文,正式宣告世界已进入“大周期”的第六阶段,即一个没有规则、强权即公理的时期。('没有规则、强权即公理'-这基本上拜特朗普所赐)
官方消息:世界秩序已经瓦解
在慕尼黑安全会议上,1945年后的世界秩序被大多数领导人宣告死亡,其背后的图景在题为《正在解构》的《2026年安全报告》中得以呈现。更具体地说,德国总理弗里德里希·默茨表示:"持续数十年的世界秩序已不复存在",我们正处于一个"强权政治"时期。他明确表示,在这个新时代,自由"不再是理所当然"。法国总统埃马纽埃尔·马克龙呼应了默茨的判断,并表示欧洲与先前世界秩序挂钩的旧安全架构已不存在,欧洲必须为战争做准备。美国国务卿马尔科·鲁比奥表示,我们正处于一个"新的地缘政治时代",因为"旧世界"已经消失。
用我的话来说,我们正处于大周期中的第六阶段,这个阶段的特点是出现巨大失序,源于我们身处一个没有规则、强权即公理、大国冲突的时期。
第六阶段如何运作,在我的《原则:应对变化中的世界秩序》一书第六章"外部秩序和混乱大周期"中有详细解释。鉴于现在几乎普遍认同1945年后的世界秩序已经瓦解,我们正在进入一个新的世界秩序,我认为值得你花时间一读。
人们的相互关系及其管理秩序都以大致相同的方式运作,无论是内部秩序还是外部秩序,二者融合在一起。事实上, 并非那么遥远之前,内部秩序和外部秩序还没有区别,因为国与国之间没有明确界定和相互认可的边界。因此,在上一章所述的内部秩序周期中,秩序与混乱之间的6个阶段也适用于国家之间, 一个主要例外:
● 国际关系更多地取决于原始实力的动态机制。这是因为所有管理体制都需要有效且议定的:(1)法律和立法能力,(2) 执法能力(如警察),(3)裁决机制(如法官),以及(4)明确和具体的结果,从而确定罪行并依法执行(例如罚款和监禁)。在外部秩序中,这些规则要么不存在,要么对国际关系的指导不如对国内关系那么有效。
为了使外部秩序更加遵守规则,各国做出了多种努力(例如,建立国际联盟和联合国),但总的来说,这些努力未能奏效。因为这些组织的财富和权力比不上最强大的国家。如果一个国家的权力超过国家共同体的权力,那么权力更大的国家将会制定国际秩序。例如,如果美国、中国或其他国家的权力超过联合国,那么决定未来发展方向的就是美国、中国或其他国家,而不是联合国。因为权力胜过一切,旗鼓相当的各方极少会不经斗争就放弃财富和权力。
当大国之间出现争端时,它们不会让律师向法官申诉。相反,它们互相威胁,要么达成协议,要么开始交战。国际秩序与其说是遵循国际法,不如说是丛林法则。
国家之间的斗争主要有5 种类别:贸易/ 经济战、技术战、地缘政治战、资本战和军事战。让我们从简单定义开始。
1. 贸易/ 经济战:冲突涉及关税、进出口限制和从经济上损害对手的其他方法。
2. 技术战:冲突涉及哪些技术可以共享,哪些技术属于国家安全保护范畴。
3. 地缘政治战:冲突涉及领土和联盟,解决方式是谈判和做出明确或间接的承诺(而不是战争)。
4. 资本战:冲突涉及施加经济制裁等金融工具(例如,通过切断资金和信贷来惩罚提供资金和信贷的机构和政府),以及限制外资进入资本市场。
5. 军事战:冲突涉及实际动武和军事力量的部署。
大多数国家间斗争属于其中一类或多类(例如,网络战争涉及所有类别)。国家为了财富、权力和与其相关的意识形态而争斗。虽然大多数类别的战争不涉及枪击和杀戮,但它们都是权力斗争。在大多数情况下,随着对手之间的竞争愈演愈烈,前4 类战争会逐步激化,直到军事战爆发。无论是否涉及枪击和杀戮,这些争斗和战争都是一方对另一方的权力斗争。战争可能是全面战争,也可能限制在一定范围内,这取决于问题的重要性和对手的相对实力。但一旦军事战爆发, 交战双方就会尽最大可能地将其他4 类战争武器化。
正如前几章所述,内部秩序和混乱周期与外部秩序和混乱周期背后的驱动因素往往会同时改善或同时恶化。随着形势的恶化,争端与日俱增,交战的可能性就会加大。这是人类的本性,因此好坏时期之间存在更迭的大周期。
● 全面展开的战争通常发生在生存问题岌岌可危(这些问题对国家来说生死攸关,以至人们愿意为之战斗和牺牲)又无法通过和平手段来解决的情况下。由此引发的战争将会确定哪一方得偿所愿,进而获取霸权地位。规则制定者的明确成为国际新秩序的基础。
下图根据冲突造成的死亡人数,显示1500 年以来欧洲内部和外部的和平/ 战争周期。如图所示,其间有三个冲突上升和下降的大周期, 平均每个周期约150 年。虽然大规模内部和外部战争的持续时间很短, 但它们通常是冲突日积月累而触及顶点的结果。虽然两次世界大战分别受各自所在的典型周期的驱动,但它们也具有关联性。
每个周期都包含相对较长的和平与繁荣时期(如文艺复兴、启蒙运动和工业革命),它们为残酷和暴力的外部战争(如三十年战争、拿破仑战争和两次世界大战)埋下了种子。无论是兴起时期(和平与繁荣时期)还是衰落时期(萧条、革命与战争时期),这些周期都影响着整个世界。其他国家并不是随着主要大国的繁荣而繁荣,因为一些国家的繁荣是以其他国家的利益为代价的。例如,由于被西方列强和日本欺凌掠夺,中国在1840—1949年陷入衰落(被称为“ 百年屈辱”)。
在阅读下文时,请记住,● 对于战争,最可确信的两点:(1)战争不会按计划进行,(2) 战争远比想象的更糟糕。正是出于这些原因, 接下来的许多原则是针对如何避免武力战争的。然而,无论出于何种理由,战争总会发生。需要澄清的是,虽然我认为大多数战争是悲惨的,而且出于荒谬的理由,但有些事情是值得为之奋战的。因为不为之奋战的后果(如失去自由)将是不可容忍的。
外部秩序变化背后的永恒普适力量
正如我在第2 章中所解释的,在自身利益和自身生存这两个因素之后,对财富和权力的追求是激励个人、家庭、公司、州和国家的最主要因素。因为在建立军事实力、控制贸易和影响其他国家的能力方面,财富等同于权力,所以
● 国内实力和军事实力密切相关。买枪炮(军事实力)需要财力,买黄油(国内社会支出需求)也需要财力。如果一个国家不能充分提供其中任何一项,就很容易受到国内外反对势力的攻击。研究中国朝代和欧洲帝国使我认识到,
● 在财力上超过对手是一个国家能够拥有的最大优势之一。这就是为什么美国在冷战中打败了苏联。如果国家把充足的资金用于恰当之处,就可以避免真枪实战。一个国家的长期成功取决于它既能持续提供“枪炮”和“黄油”,又能避免出现过度,以防衰落。换句话说,一个国家只有在财力上足够强大,才能为国民提供良好的生活,同时保护国民不受外敌攻击。真正成功的国家可以在200~300 年内都大规模地发展实力,但没有任何国家可以永远这样做。
如果主导大国开始衰弱,或者新兴大国与主导大国实力近乎旗鼓相当,或者两者兼具,冲突就会出现。
● 在以下两种情况下,爆发军事战争的风险最大:(1)双方的军事实力旗鼓相当,(2)双方在生存问题上存在不可调和的分歧。
对立国家面临的选择是,要么战斗,要么退让,这是一个艰难的抉择。两者都是代价高昂的。选择战斗要付出金钱和生命的代价,选择退让要付出国际地位的代价,因为退让是懦弱的表现,可能导致其他国家的支持减少。当两个竞争对手都有能力摧毁对方时,双方必须极为确信自己不会被对方严重损害或毁灭。然而,处理好囚徒困境是极为罕见的事情。
尽管国际关系中没有规则,唯一的规则是超级大国加于自身的规则,但一些做法产生更好的结果。确切地说,那些更可能带来双赢结果的做法要好过更可能导致两败俱伤的做法。因此,一个至关重要的原则:
● 要想获得更多的双赢结果,双方必须进行良好的协商,既考虑到对方也考虑到自身的优先关注点,并懂得妥善地在二者之间进行权衡。
通过巧妙协商、通力合作,双方可以营造双赢关系,有效地增加和分配财富与权力,这样做与一方征服另一方的战争相比,得到的收益要大得多,双方经受的痛苦要小得多。从对手的角度看问题,确认并传达给对手自己的底线(即什么是不可妥协的)是妥善处理分歧的关键。
● 获胜意味着在不失去最重要的东西的前提下,得到最重要的东西。所以,如果丧失的生命和金钱超过带来的益处,这样的战争就是愚蠢的。但是,愚蠢的战争仍在不断发生。我将解释背后的原因。
国家间很容易出现愚蠢的战争。原因包括:(a)囚徒困境,(b) 针锋相对的升级过程,(c)衰落中的大国担心让步的代价,(d)在必须快速做出决策的情况下存在的误解。敌对大国通常陷入囚徒困境, 它们需要以某种方式让对方确信,它们不会试图杀死对方,以防对方先下手为强。针锋相对的升级过程极其危险,因为各方都不得不升级, 否则就会丧失对手在上一次行动中夺去的东西。这好像胆小鬼博弈, 做得过分,就会两败俱伤。
激怒人们的不真实和情绪化的鼓动会加大愚蠢战争爆发的风险。所以领导者最好慎重思考,如实解释真实的情况和应对措施(民主国家尤其如此,因为民众的意见非常重要)。最糟糕的是领导者对民众不诚实、情绪化,甚至接管媒体。
总的来说,双赢与双输关系之间的转变往往具有周期性。在繁荣时期,人们和国家更可能建立合作关系,在萧条时期则更可能发生争斗。当现有大国相对于新兴大国走向衰落时,自然想要维持现状或现有规则,而新兴大国则想改变规则,使其符合不断变化的形势。
在“爱情和战争中的一切都是公平的”这句话中,我不知道爱情的部分,但我认为战争的部分有其道理。例如,在美国独立战争中, 当英国人列队准备作战时,美国革命者从树后向他们射击,英国人认为这是不公平的,故而表示不满。获胜的革命者则认为,这是英国人的愚蠢。为了独立和自由,改变战争规则是正当的。事实就是这样。
这就引出了最后一个原则:
● 获取权力,尊重权力,并明智地运用权力。拥有权力是件好事,因为权力永远超越协议、规则和法律。当势态严重时,掌权者可以强制人们按照他们的解释执行规则和法律,或者推翻现有的规则和法律,这样,他们的意愿将会得到满足。尊重权力很重要, 因为打一场注定会输的战争是不明智的,最好是通过谈判达成最佳的解决方案(除非你想成为烈士,而这通常是因为愚蠢的自我膨胀,而不是出于明智的战略理由)。明智地运用实力也很重要。它并不一定意味着强取自己所想要的东西(即恃强凌弱)。双方需要认识到,宽宏大量和信任是产生双赢的强大力量,比两败俱伤的关系能带来更大的回报。换句话说,在通常情况下,运用“硬实力”并不是最好的办法,而“软实力”更可取。
在考虑如何明智地运用实力时,决定何时达成妥协、何时开战也很重要。要做到这一点,就必须认识到一方的实力会随着时间的推移而变化。最好是凭实力来谈判,达成协议,并执行协议,或者当一方的实力最大时进入战争。如果一方的相对实力正在下降,那么尽早开战为好;如果相对实力正在上升,那么推迟战争更合适。
如果一方处于两败俱伤的关系中,就会以某种方式寻求解脱,最好的方式是脱钩,但也可能是战争。运用实力的最好办法通常是隐藏实力,因为炫耀实力会使对手感觉受到威胁,因此会积攒抗衡力量, 最终形成一种相互威胁的关系。实力最好像一把隐藏的剑,只在战斗时才亮出来。但在某些情况下,一方也需要展示实力和做出使用实力的威胁,这样做可以最有效地提高谈判地位、避免战争爆发。重要的是,要知道哪些是对手最重要的利益,哪些是其不介意的东西,特别是要了解对手会为什么而战,不会为什么而战,从而达到双方都认为公平的平衡,以解决争端。
虽然拥有权力通常是件好事,但没有不必要的权力也不错,因为维持权力会消耗资源,特别是会消耗时间和金钱。权力伴随着责任。权力小的人比权力大的人快乐多了,这常常让我感到震惊。
案例分析:二战
上文讲述了外部秩序和混乱周期背后的机制和原则,这些原则是通过考察许多案例得出的。下文简要介绍二战,因为它反映了最近一次从和平走向战争的标志性机制。虽然这只是一个例子,但我们可以清楚地看到,三大周期的综合影响(即长期债务和资本市场周期、内部秩序和混乱周期与外部秩序和混乱周期的相互重叠和相互关联)为一场灾难性的战争创造了条件,也为新的世界秩序奠定了基础。这一段历史本身值得研究,但重要的是,它为我们提供了借鉴,帮助我们思考当前的状况和未来可能发生的情况。最重要的是,美国和中国正处于经济战争中,而这场战争很可能演变成军事战争。将20 世纪30 年代与当今进行比较,给我们带来宝贵的洞见,有助于我们了解未来可能发生的情况,设法避免一场可怕的战争。
战争之路
为了更好地表述20 世纪30 年代的情况,我将先回顾1939 年二战在欧洲打响、1941 年偷袭珍珠港之前的地缘政治关注点,然后简述二战和1945 年世界新秩序的开始,当时美国的实力处于巅峰。
1929 年大萧条之后,全球经济陷入萧条,几乎所有国家都因财富争夺而出现了严重的内部冲突。各国转向了更具民粹、独裁、民族主义和军国主义的领导人和政策。这些变化要么偏向左翼,要么偏向右翼,而且程度各不相同,取决于各国的国情及其民主或专制传统的程度。在德国、日本、意大利和西班牙,极糟糕的经济环境和不健全的民主传统导致了极端的内部冲突,使国家转向民粹主义/ 独裁的右翼领导人(即法西斯主义者)。在不同的时间点,苏联和中国也处于极端的经济困境,两国转向了左翼领导人。美国和英国的民主传统要强大得多,经济状况也没那么艰难,两国的民粹主义和专制势力有所抬头, 但这些势力远不像其他国家的那么强大。
德国和日本
一战之后,德国背负了巨额战争赔款,但在1929 年,通过实施杨格计划,德国摆脱了战争赔款的束缚并崛起,该计划提供大规模债务减免,并要求外国军队在1930 年前全部撤离德国。然而,全球大萧条重创了德国经济,导致失业率接近25%,大量企业破产,贫困现象非常普遍。就像典型情况那样,左翼民粹主义者和右翼民粹主义者之间开始争斗。主要的右翼民粹主义—法西斯主义者希特勒利用民族耻辱感,激发民族主义狂热。他把《凡尔赛和约》和制定该条约的国家描述成敌人。他提出了一项25 点的民族主义计划,该计划赢得了广泛的支持。由于人们渴望解决内部斗争和恢复秩序,希特勒于1933 年1 月被任命为德国总理,他所领导的纳粹得到了惧怕共产主义的实业家的大力支持。两个月之后,纳粹在德国议会赢得了最多的投票和席位。
希特勒拒绝继续支付任何战争赔款。他还退出了国际联盟,于1934 年对德国实行专制统治。希特勒同时担任总理和总统,成为德国的最高领袖。在民主国家,总有一些法律使国家领导人获得特殊的权力,希特勒将这一点发挥到了极致。他援引德国宪法第48 条,取消了许多公民权利,镇压共产党反对派,强行通过《授权法案》,该法案允许他在未得到议会和总统批准的情况下通过法律。希特勒对任何反对派都毫不留情。他对报纸和广播公司进行审查和控制,建立秘密警察队伍(盖世太保),根除和镇压反对派,剥夺犹太人的公民权利,控制新教教会的财政,逮捕反对他的神职人员。他宣称雅利安民族比任何民族都要优越,禁止非雅利安族德国人在政府任职。
希特勒采用相同的独裁/ 法西斯主义做法,重建德国经济,实施了大规模的财政和货币刺激计划。希特勒将国有企业私有化,鼓励企业投资。他积极提高雅利安族德国人的生活水平。例如,他创立大众汽车公司,使大多数人能买得起也买得到车。希特勒还指示建设高速公路。他强迫银行购买政府债券,为显著增加了的政府支出提供资金。由此产生的债务通过公司盈利和央行(德意志帝国银行)将债务货币化来偿还。总体上看,这些政策有效地实现了希特勒的目标。这是另一个很好的案例,说明如果政府把借来的货币用于提高生产率的投资, 再用产生的充足现金流来偿还债务,那么以本国货币进行借款、增加自身债务和赤字的做法就会非常富有成效。即便这么做不能偿还全部债务,这也是一种非常划算的做法,有助于实现国家的经济目标。
至于这些政策带来的经济影响,1933 年希特勒上台时,失业率是25%。到了1938 年,失业率为零。他上台后的5 年间,人均收入增长了22%。1934—1938 年,年均实际经济增长率为8%。如下图所示,1933—1938 年,德国股市稳步增长,涨幅接近70%,直至热战爆发。
1935 年,希特勒开始进行军事建设,强制雅利安人服兵役。德国的军事支出增速明显超过其他任何国家,因为国内经济增长需要更多的资源,希特勒打算利用军事力量获取资源。
和德国一样,日本也受到大萧条的重创,因此变得更加专制。日本极易受到经济萧条的影响,因为它是个岛国,自然资源匮乏,依赖出口收入来进口必需品。1929—1931 年,日本的出口业下跌了约50%, 经济遭受严重冲击。1931 年,日本经济破产了,它被迫动用黄金储备, 取消金本位制,允许日元汇率浮动。这导致日元严重贬值,使日本丧失了购买力。这些糟糕的经济形势和巨大的贫富差距引发了左派与右派的斗争。到1932 年,右翼民粹主义和军国主义势力高涨,希望通过武力恢复秩序和经济稳定。为了达到这个目的,日本开始从其他国家掠夺所需的自然资源(如石油、铁、煤和橡胶)和人力资源( 如苦 役)。1931 年,日本入侵中国东北,之后扩张到整个中国和亚洲。和德国一样,可以说比起依赖传统贸易和经济操作的做法,日本通过军事侵略获取所需资源的途径更具成本效益。1934 年,日本的部分地区出现了严重饥荒,导致政局更加动荡,强化了右翼军国主义、民族主义和扩张主义势力。
在接下来的几年里,日本实行自上而下的法西斯主义管控,经济变得更加强大。日本还建立了军工联合体,用来保护其在东亚和中国北部的已有基地,协助其向其他领土扩张。与德国的情况一样,虽然大多数日本公司仍为私人所有,但是它们的生产受到政府的管控。
什么是法西斯主义?一个国家在决定治理方式时,需要做出以下三大选择:(1)决策方式是自下而上(民主)还是自上而下(专制)? (2)社会经济制度是资本主义还是共产主义(社会主义处于二者之间)?(3)崇尚的是个人主义(认为个人利益至关重要)还是集体主义(认为集体利益至关重要)?
你不妨思考一下,从每个类别中选出你认为最符合本国价值观和目标的那一项,就得出了你所认为的首选治理方式。法西斯主义倡导专制、资本主义和集体主义。法西斯主义者认为,使国家和人民更加富强的最佳途径是,实行自上而下的专制领导,政府指导私有公司的生产,确保国家的成功高于个人的成功。
美国和盟国
1929 年后,美国的债务问题给美国银行业造成了毁灭性的打击, 这些银行减少了在世界各地的放贷,从而影响了国际借款者。同时, 大萧条造成需求疲弱,进而导致美国进口量骤降,其他国家对美国的销售大跌。由于收入下降,需求降低,信贷问题加重,经济陷入了强化自身的螺旋式下行困境。同时,为了保护国内就业,美国转向贸易保护主义,1930 年(通过出台《斯穆特—霍利关税法》)上调了关税, 进一步抑制了其他国家的经济形势。
● 在经济低迷时期,加征关税以保护国内企业和就业的做法很常见,但这会导致效率降低,因为生产并未发生在效率最高的地方。最终,这会加剧全球经济疲弱,因为关税战争使加税国家的出口减少。但这一做法有利于受到关税保护的实体,也能给征收关税的领导人带来政治支持。
苏俄尚未摆脱一系列重创:1917—1922 年的革命和内战、输给德国的一场战争,代价高昂的苏波战争、1921 年的饥荒。此外,苏联还在整个20 世纪30 年代陷入政治清洗和经济困境。1928—1930 年,中国也陷入了内战、贫困和饥荒。因此,1930 年,随着局势继续恶化, 关税开始增加,这些国家的经济形势从恶劣变成绝望。
雪上加霜的是,20 世纪30 年代,美国和苏联都出现了干旱。● 天 灾(如旱灾、洪灾和瘟疫)常常使国家陷入经济困境,加之其他的不利形势,酿成一段严重冲突时期。此外,由于内部政治斗争和对纳粹德国的恐惧,苏联采取了政治极端主义政策,很多人被指控从事间谍活动,遭到清洗。
● 通缩性萧条是债务人不具备偿债所需的资金而导致的债务危机。为了应对这一危机,政府不可避免地采取印钞、债务重组和政府支出计划等措施。这些措施会增加货币和信贷供应,并降低其价值。唯一的问题是政府官员需要花多长时间才会采取这些行动。
以美国为例,从1929 年10 月股市崩盘到1933 年3 月罗斯福采取行动,美国花了三年半的时间。在罗斯福执政的前100 天里,他出台了许多大规模政府支出计划,这些计划的资金来源是大幅增加的税收和巨额预算赤字(通过债务融资,并由美联储将债务货币化)。他推出了就业计划、失业保险、社会保障支持,以及有利于劳工和工会的各项计划。1935 年实施新税法(被普遍称为“富人税”)后,最高个人边际所得税税率升至75%(1930 年仅为25%)。到了1941 年,最高个人所得税税率为81%,最高公司税税率为31%,而1930 年的公司税税率仅有12%。此外,罗斯福也征收了其他一些税负。虽然政府征收了这些税款,经济改善也有助于税收增加,但预算赤字仍从GDP 的约1% 升至4% 左右。这是因为支出的涨幅极大。5 从1933 年到1936 年年底,股市回报率超过200%,美国的经济突飞猛进,平均实际增长率高达9% 左右。
1936 年,为了应对通胀和抑制经济过热,美联储收紧了货币和信贷,导致脆弱的美国经济再度陷入衰退,其他主要经济体也随之走弱, 国家内部和外部的紧张局势进一步加剧。
与此同时,在欧洲,西班牙的左翼和右翼民粹主义者之间的冲突激化,演变成残酷的西班牙内战。在希特勒的支持下,右翼的佛朗哥清除了西班牙所有的左翼组织。
● 在经济严重承压且存在贫富悬殊的时期,国家通常会进行根本性的大规模财富再分配。以和平的方式进行,则是对富人大幅增税, 显著增加货币供应(使债务人的负债贬值);以暴力的方式进行,则是强制没收资产。美国和英国在进行财富和政治权力再分配的同时, 维持了资本主义和民主制度。德国、日本、意大利和西班牙的情况则不然。
● 真枪实弹的战争爆发之前,通常会有一场经济战。也像典型情况一样,在宣布全面战争之前,双方会有大约10 年的经济、技术、地缘政治和资本战争,在此期间,冲突大国相互威慑,试探对方实力的极限。虽然1939 年和1941 年被认为是二战和太平洋战争正式打响的时间,但在之前的10 年左右,冲突实际上就已经开始了。除了国家内部的经济冲突和由此而来的政治变化外,所有这些国家都面临着越来越多的外部经济冲突,各国竞相在不断缩小的经济蛋糕中争夺更大的份额。因为支配国际关系的是权力,而不是法律,德国和日本愈加走向扩张主义,在争夺资源和领土势力的竞争中,它们日趋挑战英国、美国和法国。
在继续讲述热战之前,我想详细说明将经济和资本工具武器化的常见战术。这些战术一直没有改变,现在仍然如此。
1. 资产冻结/ 没收:防止敌人/ 对手利用或出售它们所依赖的境外资产。这些措施包括冻结某个国家的目标群体的资产(例如当前美国对伊朗革命卫队的制裁,或者二战刚爆发时美国对日本实施的资产冻结),还包括更严厉的措施,例如单方面拒绝偿还债务,或者直接没收某个国家的资产(一些美国高层决策者一直在讨论拒绝偿还对中国的债务)。
2. 阻止资本市场准入:阻止一个国家进入本国或他国的资本市场(例如,1887 年,德国禁止购买俄国的证券和债券,旨在阻碍俄国的军事建设;美国正在威胁要对中国采取同样的措施)。
3. 禁运/ 封锁:禁止在本国或一些保持中立的第三国从事商品和/ 或服务贸易,从而削弱目标国家,或者避免该国获得必需品(例如,二战期间,美国对日本实施石油禁运,禁止日本船只在巴拿马运河通行),或者阻止目标国家对其他国家的出口,从而切断其收入来源(例如,在拿破仑战争期间,法国对英国实施封锁)。
热战开始
在1937 年11 月,希特勒与他的高级官员们举行了秘密会谈,宣布了他的德国扩张计划:准备从其他国家获取资源,把雅利安民族团结在一起。之后,希特勒将他的扩张计划付诸行动,先吞并了奥地利, 之后占领了当时的捷克斯洛伐克的部分领土,获取了当地的石油资源。欧洲和美国只是谨慎观望,在遭受一战的破坏后,它们不想很快又被卷入另一场战争。
热战和所有战争一样,未知的因素远远超过已知的因素,因为(a)作战双方只在旗鼓相当的情况下才会发动战争(否则,对实力明显更弱的一方来说,发动战争就是愚蠢的自杀);(b)对方的行动和反应存在太多的可能性,难以进行预测。在热战之初,唯一清楚的是战争很可能是极其痛苦的,甚至具有毁灭性。因此,明智的领导者通常不会投入热战,除非被对手逼到只有两种选择:要么投入战斗,要么退让而认输。对盟国来说,这一时刻是1939 年9 月1 日,德国入侵波兰。
德国看似势不可当;很快占领了丹麦、挪威、荷兰、比利时、卢森堡和法国,并与日本和意大利结成了更强大的联盟(这三个国家拥有共同的敌人和相似的理念)。通过快速占领领土(如石油资源丰富的罗马尼亚),希特勒的军队保存了已有的石油资源,迅速夺取了其他资源。对自然资源的渴求和获取仍是驱动纳粹战争机器的主要力量,促使其将侵略计划向苏联和中东推进。德国与苏联的战争是不可避免的, 唯一的疑问是何时爆发。虽然苏联和德国签署了一项互不侵犯条约, 但在1941 年6 月,德国入侵苏联。德国从此陷入了两线作战的战争, 并为此付出了极高的代价。
在太平洋地区,1937 年日本扩大了对中国的侵略,占领了上海和南京,仅在南京就残杀了约30 万平民和缴械士兵。虽然美国仍持中立主义态度,但也给蒋介石政府提供了战斗机和飞行员以抗击日本,因此可以说美国也涉足于战争之中。由于一名日本士兵扇打美国驻南京领事约翰·摩尔·艾利森,且日本战斗机击沉了一艘美国炮舰,美国与日本的冲突开始升级。
1940 年11 月,罗斯福总统因承诺不让美国卷入战争而赢得连任, 但事实上,为了保护自身利益(特别是在太平洋地区的利益),美国已经采取经济措施:向其同情的国家提供经济支持,对其反对的国家实行经济制裁。1940 年年初,美国战争部长史汀生发起了对日本的大规模经济制裁,最终出台1940 年的《出口管制法》。1940 年年中,美国将太平洋舰队移至夏威夷。10 月,美国加大了禁运力度,限制“ 向除 英国和西半球国家以外的其他国家运输钢铁”。该计划旨在切断日本的资源,逼迫其撤离所占领的大多数地区。
1941 年3 月,美国国会出台了《租借法案》,该法案允许美国将战争物资借给或租赁给其认为“ 对捍卫美国至关重要”的国家(包括英 国、苏联和中国)。从地缘政治和经济角度看,帮助盟国有利于美国, 因为美国通过向这些即将成为盟友的国家出售武器、食品和其他物品赚到很多钱财。这些国家无法在战争中维持生产。但是,美国并不完全是为了金钱。由于英国逐步耗尽资金(即黄金),美国将付款时间推迟到战争之后(在某些情况下甚至完全免除)。通过实施这一租借政策,美国虽然没有直接宣布参战,但实际上已结束了自己的中立立场。
● 当国家处于弱势时,对手国家会利用其弱势为自己谋取利益。当时,法国、荷兰和英国在亚洲都拥有殖民地。欧洲的战争已经使这些国家不堪重负,它们无力帮助其殖民地抵御日本的侵略。从1940 年9 月开始,日本入侵了东南亚的几个殖民地,首先占领法属印度支那, 其次将“南部资源区”纳入其“ 大东亚共荣圈” 之中。1941年,日本掠 夺了荷属东印度群岛的石油储备。
日本的领土扩张威胁到美国自身在太平洋地区的野心。在1941 年7 月和8 月,罗斯福总统做出回应,下令冻结日本在美国的所有资产,禁止日本船只在巴拿马运河通行,禁止向日本出口石油和天然气。这些措施切断了日本3/4 的贸易和80% 的石油资源。日本计算出石油将在两年后耗尽。这促使日本在退让和袭击美国之间进行抉择。
1941 年12 月7—8 日,日本对驻守在菲律宾和珍珠港的美军发动了联合袭击。这标志着二战在太平洋地区打响,使美国也卷入了欧洲的战争。虽然日本没有一个公认的取胜计划,但是乐观的日本领导人认为,美国将会失败。因为美国同时进行两线作战,美国采取个人主义/ 资本主义的政治体制,它们比不上日本和德国的独裁主义的法西斯体制及其控制的军工联合体,而日本人更有忍受痛苦和为国献身的坚强意志,这是决定哪一方将会胜出的重要因素。
● 在战争时期,一个人承受痛苦的能力甚至比施加痛苦的能力更为重要。
战时经济政策
就像经济战争的典型战术值得注意一样,战时经济政策也同样值得关注。在战争时期,随着国家将资源的利用从赢利转向作战,政府几乎控制了一切。例如,政府决定(a)何种物品可以生产,(b)何种物品可以买卖及买卖数量(配额供应),(c)何种物品可以进口和出口, (d)价格、工资和利润,(e)个人是否可以控制自己的金融资产,以及(f)个人是否可以将自己的资金转至国外。由于战争耗资巨大,政府通常(g)发行大量债券,并将债务货币化,(h)依赖于非信贷货币(如黄金)进行国际交易,因为本国的信贷不被接受,(i)实施更加专制的政策,(j)对敌国实施各类经济制裁,包括切断资金渠道,以及(k)面临敌国对己实施的这些制裁。
在珍珠港事件之后,美国加入了欧洲和太平洋的战争。那时,大多数国家在实行典型的战时经济政策,此时采取更专制政策的领导人得到民众的广泛支持。下表显示战争期间各主要国家实施的经济管控措施。
在热战期间,随着各方胜负概率的变化,市场走势受到政府管控措施和国家作战表现的巨大影响。下表显示战争期间各国实施的市场和资本流动管控措施。
股市闭市现象在很多国家都很常见,导致投资者受困,无法获得资金。需要指出的是,战争期间,货币和信贷一般无法在非盟国之间流动,人们有理由怀疑这些货币日后是否还有价值。正如早先提到的,战争期间,黄金、(在有些情况下)白银或者物物交易是普遍的交易方式, 价格和资本流动通常受到管控,因此许多物品的实际价格很难确定。
由于战败通常导致财富和权力的全部丧失,对那些在战争期间仍然开放的股市来说,随着各方胜负概率的变化,市场走势主要取决于各国在主要战役中的表现。例如,二战刚开始时,随着德国掠夺领土并确立军事主导地位,德国的股市表现出色。但在美国和英国等盟国成功扭转了战局后,德国的股市表现不佳。在1942 年的中途岛战役之后,同盟国的股市几乎持续上涨,直至战争结束,而轴心国的股市则趋平或下跌。如下图所示,德国和日本的股市在战争结束时都关闭了, 直到大约5 年后才重开。在此期间,这些股市的价值已经完全消失, 但美股的表现极为强劲。
结语
受益于独特的环境与品格和文化本性(如具备高水平的职业道德、聪明才智、纪律、教育等基本要素),每个世界强国都有过辉煌的时期,但它们最终都会衰落。一些国家以更和平的方式走向衰落,它们受到的创伤更小,但终究还会衰落;另一些国家在衰落的过程中饱经创伤,从而陷入历史上最艰难的时期,出现了重大的财富和权力之争, 历史表明,这些争斗给经济和生命都带来了巨大的损失。
然而,并不是所有周期都需要以这样的方式结束。如果国家在富强阶段时,能够保持生产率,让收入高于支出,使体制惠及大多数人, 能够与主要竞争对手建立和维持双赢关系,那么就会维持得更久。许多国家都维持了数百年.