Skip to content

Commit 0076841

Browse files
committed
Revert "Merge branch 'main' of github.com:lzwjava/lzwjava.github.io"
This reverts commit 1fa6fc8, reversing changes made to 8a7abc5.
1 parent 5cdeb73 commit 0076841

26 files changed

+161
-485
lines changed

_posts/en/2024-12-04-fruit-en.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,8 @@ title: Eat Fruits Instead Of Snacks
55
translated: false
66
---
77

8-
9-
10-
## Fruits
11-
128
I remember between 2016 and 2018, my weight quickly increased from 70kg to 90kg. At that time, I ordered fast food from delivery apps almost every day. And sometimes, while working late into the night, I ate a lot of snacks in the office.
139

1410
After returning to Guangzhou from Beijing in early 2020, I ate foods that were made by my parents. But sometimes, I still ate snacks. And I didn't maintain the practice of playing basketball. I played basketball a lot from late 2020 to early 2021. But later, I changed that habit to walking while listening to English podcasts. And starting from September 2023, I started to play basketball again.
1511

16-
I should start eating more fruits. If I am hungry sometimes, I should eat fruits instead of snacks.
17-
18-
## Beverages
19-
20-
The calorie content in beverages is important. For every 100 ml, if the calorie count is below 100, it's acceptable for me. However, drinking beverages without sugar can be limiting.
21-
22-
NFC (Not From Concentrate) beverages are a good option as well.
23-
12+
I should start eating more fruits. If I am hungry sometimes, I should eat fruits instead of snacks.

_posts/en/2024-12-10-life-tips-en.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ translated: false
77
---
88

99

10-
1110
* Explore the world early, go to different countries, and talk to different people.
1211

1312
* Read many books, especially non-fiction ones.
@@ -72,4 +71,4 @@ translated: false
7271

7372
* Focus on learning Science, Technology, Engineering, and Mathematics (STEM). These fields are generally based on reproducible and verifiable facts, unlike some other areas of knowledge. Prioritize learning correct information initially to avoid needing to correct your understanding or habits later.
7473

75-
* Your perception of your salary matters more than the amount itself. If you compare it to others, it will likely never feel sufficient. Also, how you spend your salary matters; if you buy what you need daily at a low cost, you might feel it is adequate. For example, using it to buy food or a mobile phone might feel more justifiable, but using your salary to buy a house might not seem as worthwhile.
74+
* Your perception of your salary matters more than the amount itself. If you compare it to others, it will likely never feel sufficient. Also, how you spend your salary matters; if you buy what you need daily and at a low cost, you might feel it is adequate. For example, using your salary to buy a house might not seem worthwhile, but using it to buy food or a mobile phone might feel more justifiable.

_posts/en/2025-01-05-research-en.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ top: 10
77
translated: false
88
---
99

10-
11-
1210
Besides three papers about reversing myopia, I want to share more about this discovery story.
1311

1412
> Li, Zhiwei. (Jun 2023). Experimental Verification of the Natural Vision Restoration Method. Zhiwei’s Blog. Web. PDF.
@@ -83,9 +81,3 @@ The point is that most of the time, our eyes can clearly see the objects we want
8381
Try to observe and learn more on the Internet. Be careful of minor opinions. Try experimenting by yourself.
8482

8583
There are a lot of improvements in life. After the truth was found, it seems obvious. People just haven't thought about it before. Steve Jobs surely understood it. Steve Jobs' "Think Different" campaign is good.
86-
87-
## More Confident to Improve the World
88-
89-
With so many people wearing glasses, whenever I see people wearing them - whether offline or online - I recognize there's room for improvement in this area.
90-
91-
Their eyeglasses are too strong for viewing mobile phones or computers, which will cause their myopia to progressively worsen.

_posts/en/2025-01-06-plan-2025-en.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ translated: false
77
---
88

99

10-
1110
* April 2025 National Self Study Exam. Pass 4 courses:
1211
* Computer Organization and Architecture
1312
* Linear Algebra
@@ -28,9 +27,9 @@ translated: false
2827

2928
* Exercise: Play basketball at least twice a week, especially from February to November when the weather is warmer.
3029

31-
* Employment: Accept the job offer and join an outsourcing company to work on a backend project at a large bank. Work diligently and enjoy the job.
30+
* Employment: Accept the job offer from an outsourcing company to work on a backend project at a large bank. Work well and enjoy the job.
3231

33-
* Diet: Prioritize fruits over snacks. Limit beverages to those with less than 100 calories per 100ml.
32+
* Diet: Eat more fruits instead of snacks.
3433

3534
* Health: Continue to work on reversing myopia and monitor it. The estimated achievement by the end of December 2025 is:
3635
* Left Eye: Myopia (-1.50), Astigmatism (-0.75)
@@ -44,7 +43,7 @@ translated: false
4443

4544
* Fixed Expenses: monthly mortgage, property management fee, vehicle insurance fees, two mobile phone plans, electricity, water, gas, fuel costs, small commodity shopping, drinking water, and fruit.
4645

47-
* Investing: Regularly invest in Apple, Nvidia, TQQQ stock, and Bitcoin, ETH, and SOL.
46+
* Investing: Invest regularly in Apple, Nvidia, TQQQ stock, and Bitcoin, no matter how small the amount, to learn about investing.
4847

4948
* Vehicle Insurance:
5049
* The Mandatory Vehicle Insurance and Commercial Vehicle Insurance for my Neta EV will expire on October 10, 2025.

_posts/en/2025-01-07-psd-en.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ translated: false
77
---
88

99

10-
1110
## PayPal CN
1211

1312
- Website: [https://www.paypal.cn](https://www.paypal.cn)
@@ -30,4 +29,4 @@ translated: false
3029
- Creates a stack in your AWS environment
3130
- Once AWS stack creation is complete, it becomes accessible in the Databricks workspace
3231
- Supports payment with China-issued Visa cards
33-
- Using the product requires creating resources in AWS, incurring an estimated cost of 15 USD per week. Please be aware of this potential expense.
32+
- Trying the product requires creating resources in AWS, which costs approximately 15 USD per month. Please be aware of this cost.

_posts/en/2025-01-08-o1-en.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
audio: true
33
lang: en
44
layout: post
5-
title: Fixing GitHub Workflow LaTeX Build with ChatGPT o1
5+
title: What ChatGPT o1 Can Do That 4o-mini Cannot
66
translated: false
77
---
88

99

10-
1110
I recently encountered an issue with the `fontawesome5` package in the GitHub flow. The solution provided by 4o-mini (using TeX Live 2021 and `tlmgr install fontawesome5`) didn’t work, but 4o suggested a better approach (using TeX Live 2023 and still using `tlmgr` to install `fontawesome5`), which I’m currently trying. It didn’t completely fix the problem, but switching to TeX Live 2023 instead of 2021 has made a significant improvement.
1211

1312
---

_posts/en/2025-01-11-contact-en.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ title: Contact
66
translated: false
77
---
88

9-
10-
119
Hi, I'm Zhiwei Li. You can find a brief introduction [here](/introduction-en). The eight buttons on my site highlight what I'm most passionate about; I encourage you to explore them.
1210

1311
In particular, I'd like to draw your attention to my three [papers](/papers-en) on reversing myopia. You can easily find these featured essays using the "select" button on the home page..
1412

15-
Feel free to reach out if you’re interested! You can say hi to me on X, WhatsApp, or Telegram, leave a comment, send me a direct message, or drop me an email.
13+
And feel free to reach out if you’re interested! You can say hi to me on X, WhatsApp, or Telegram, leave a comment, send me a direct message, or drop me an email.
1614

1715
#### X(Twitter)
1816

_posts/en/2025-01-11-donate-en.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ translated: false
77
---
88

99

10-
1110
If you like my essays, code, or videos, you can voluntarily make a payment. You can use the following methods to pay.
1211

1312
### WeChat Pay
@@ -16,7 +15,7 @@ If you like my essays, code, or videos, you can voluntarily make a payment. You
1615

1716
### Crypto Wallet
1817

19-
Send SOL to my wallet address through the Solana network.
18+
Send USDT to my wallet address through the Solana network.
2019

2120
Address: FWK8y7q9mJvQix9bFAu8Q9CSY1FNaGdPXC4TQ96dP5y8
2221

_posts/en/2025-01-11-notes-en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ translated: false
77
---
88

99

10-
1110
These notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
1211

1312
* [Active Learning](/notes/active-learning-en)
@@ -18,7 +17,6 @@ These notes are primarily generated by AI chatbots. I used them to summarize key
1817
* [Computer Organization](/notes/computer-organization-en)
1918
* [Computer Organization - Conversation](/notes/computer-organization-conv-en)
2019
* [DeepSeek V3](/notes/deepseek-v3-en)
21-
* [DeepSeek V3: Multi-Head Latent Attention and Multi-Token Prediction](/notes/deepseek-v3-conv-en)
2220
* [Electronic Fundamentals](/notes/electronic-en)
2321
* [Frontend Engineer Interview](/notes/frontend-interview-en)
2422
* [Future Predictions](/notes/predictions-en)

_posts/en/2025-01-13-gitmessageai-en.md

Lines changed: 27 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -16,102 +16,10 @@ import os
1616
from openai import OpenAI
1717
from dotenv import load_dotenv
1818
import argparse
19-
import requests
2019

2120
load_dotenv()
2221

23-
def call_mistral_api(prompt):
24-
api_key = os.environ.get("MISTRAL_API_KEY")
25-
if not api_key:
26-
print("Error: MISTRAL_API_KEY environment variable not set.")
27-
return None
28-
29-
url = "https://api.mistral.ai/v1/chat/completions"
30-
headers = {
31-
"Content-Type": "application/json",
32-
"Accept": "application/json",
33-
"Authorization": f"Bearer {api_key}"
34-
}
35-
data = {
36-
"model": "mistral-large-latest",
37-
"messages": [
38-
{
39-
"role": "user",
40-
"content": prompt
41-
}
42-
]
43-
}
44-
try:
45-
response = requests.post(url, headers=headers, json=data)
46-
response.raise_for_status()
47-
response_json = response.json()
48-
if response_json and response_json['choices']:
49-
return response_json['choices'][0]['message']['content']
50-
else:
51-
print(f"Mistral API Error: Invalid response format: {response_json}")
52-
return None
53-
except requests.exceptions.RequestException as e:
54-
print(f"Mistral API Error: {e}")
55-
if e.response:
56-
print(f"Response status code: {e.response.status_code}")
57-
print(f"Response content: {e.response.text}")
58-
return None
59-
60-
61-
def call_gemini_api(prompt):
62-
gemini_api_key = os.environ.get("GEMINI_API_KEY")
63-
if not gemini_api_key:
64-
print("Error: GEMINI_API_KEY environment variable not set.")
65-
return None
66-
url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent"
67-
params = {"key": gemini_api_key}
68-
payload = {"contents": [{"parts": [{"text": prompt}]}]}
69-
try:
70-
response = requests.post(url, json=payload, params=params)
71-
response.raise_for_status() # Raise an exception for bad status codes
72-
response_json = response.json()
73-
if response_json and 'candidates' in response_json and response_json['candidates']:
74-
return response_json['candidates'][0]['content']['parts'][0]['text']
75-
else:
76-
print(f"Gemini API Error: Invalid response format: {response_json}")
77-
return None
78-
except requests.exceptions.RequestException as e:
79-
print(f"Gemini API Error: {e}")
80-
if e.response:
81-
print(f"Response status code: {e.response.status_code}")
82-
print(f"Response content: {e.response.text}")
83-
return None
84-
85-
def call_deepseek_api(prompt):
86-
api_key = os.environ.get("DEEPSEEK_API_KEY")
87-
if not api_key:
88-
print("Error: DEEPSEEK_API_KEY environment variable not set.")
89-
return None
90-
91-
client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
92-
93-
try:
94-
response = client.chat.completions.create(
95-
model="deepseek-chat",
96-
messages=[
97-
{"role": "user", "content": prompt}
98-
],
99-
max_tokens=100
100-
)
101-
if response and response.choices:
102-
commit_message = response.choices[0].message.content.strip()
103-
commit_message = commit_message.replace('`', '')
104-
return commit_message
105-
else:
106-
print("Error: No response from the API.")
107-
return None
108-
except Exception as e:
109-
print(f"Error during API call: {e}")
110-
print(e)
111-
return None
112-
113-
114-
def gitmessageai(push=True, only_message=False, api='deepseek'):
22+
def gitmessageai(push=True, only_message=False):
11523
# Stage all changes
11624
subprocess.run(["git", "add", "-A"], check=True)
11725

@@ -136,22 +44,31 @@ Changed files:
13644
Commit message:
13745
"""
13846

139-
if api == 'deepseek':
140-
commit_message = call_deepseek_api(prompt)
141-
if not commit_message:
142-
return
143-
elif api == 'gemini':
144-
commit_message = call_gemini_api(prompt)
145-
if not commit_message:
146-
print("Error: No response from Gemini API.")
147-
return
148-
elif api == 'mistral':
149-
commit_message = call_mistral_api(prompt)
150-
if not commit_message:
151-
print("Error: No response from Mistral API.")
47+
# Send the prompt to the DeepSeek API
48+
api_key = os.environ.get("DEEPSEEK_API_KEY")
49+
if not api_key:
50+
print("Error: DEEPSEEK_API_KEY environment variable not set.")
51+
return
52+
53+
client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
54+
55+
try:
56+
response = client.chat.completions.create(
57+
model="deepseek-chat",
58+
messages=[
59+
{"role": "user", "content": prompt}
60+
],
61+
max_tokens=100
62+
)
63+
if response and response.choices:
64+
commit_message = response.choices[0].message.content.strip()
65+
commit_message = commit_message.replace('`', '')
66+
else:
67+
print("Error: No response from the API.")
15268
return
153-
else:
154-
print(f"Error: Invalid API specified: {api}")
69+
except Exception as e:
70+
print(f"Error during API call: {e}")
71+
print(e)
15572
return
15673

15774
# Check if the commit message is empty
@@ -176,26 +93,13 @@ if __name__ == "__main__":
17693
parser = argparse.ArgumentParser(description="Generate commit message with AI and commit changes.")
17794
parser.add_argument('--no-push', dest='push', action='store_false', help='Commit changes locally without pushing.')
17895
parser.add_argument('--only-message', dest='only_message', action='store_true', help='Only print the AI generated commit message.')
179-
parser.add_argument('--api', type=str, default='deepseek', choices=['deepseek', 'gemini', 'mistral'], help='API to use for commit message generation (deepseek, gemini, or mistral).')
18096
args = parser.parse_args()
181-
gitmessageai(push=args.push, only_message=args.only_message, api=args.api)
97+
gitmessageai(push=args.push, only_message=args.only_message)
18298
```
18399

184-
This script can be called with different APIs. For example:
185-
186-
```bash
187-
python ~/bin/gitmessageai.py
188-
python ~/bin/gitmessageai.py --no-push
189-
python ~/bin/gitmessageai.py --only-message
190-
python ~/bin/gitmessageai.py --api gemini
191-
python ~/bin/gitmessageai.py --api mistral --no-push
192-
python ~/bin/gitmessageai.py --api deepseek --only-message
193-
```
194-
195-
196100
Then, in your `~/.zprofile` file, add the following:
197101

198-
```bash
102+
```
199103
alias gpa='python ~/bin/gitmessageai.py'
200104
alias gca='python ~/bin/gitmessageai.py --no-push'
201105
alias gm='python ~/bin/gitmessageai.py --only-message'

_posts/en/2025-01-15-context-length-en.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ translated: false
77
---
88

99

10+
I recently used the DeepSeek API to generate a commit message, as described in [AI-Powered Git Commit Messages](./gitmessageai-en).
1011

11-
I recently encountered the context length limit of the DeepSeek API while generating a commit message, as detailed in [AI-Powered Git Commit Messages](./gitmessageai-en).
12+
When a commit involves many changed files, the DeepSeek API reported that the input exceeded its context length limit of 65,535 tokens (2^16 - 1).
1213

13-
Specifically, when a commit involved numerous changed files, the API reported that the input exceeded its context length limit of 65,535 tokens (2^16 - 1).
14-
15-
According to their documentation: [https://api-docs.deepseek.com/quick_start/pricing](https://api-docs.deepseek.com/quick_start/pricing), the context length is 64k tokens, with a maximum output of 8k tokens.
16-
17-
Here's a comparison of context window sizes for several other models:
18-
19-
* **Claude 3 Family:** Launched in March 2024, these models offer context windows starting at 200,000 tokens.
20-
* **GPT-4:** The standard version has a context window of 8,192 tokens, while the extended version (GPT-4-32k) supports 32,768 tokens.
21-
* **Meta's LLaMA 2:** The base model supports 4,096 tokens, but fine-tuned versions can handle up to 16,384 tokens.
22-
* **Mistral 7B:** Supports a context window of 8,000 tokens.
14+
Here are the context window sizes of some other models:
2315

16+
* **Claude 3 Family:** Introduced in March 2024, these models have context windows starting at 200,000 tokens.
17+
* **GPT-4:** The standard version supports 8,192 tokens, while the extended version (GPT-4-32k) supports 32,768 tokens.
18+
* **Meta's LLaMA 2:** The standard version supports 4,096 tokens, but fine-tuned versions can handle up to 16,384 tokens.
19+
* **Mistral 7B:** Supports up to 8,000 tokens.

_posts/en/2025-01-15-language-support-en.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ translated: false
77
---
88

99

10-
1110
My blog now supports nine languages: Japanese (`ja`), Spanish (`es`), Hindi (`hi`), Chinese (`zh`), English (`en`), French (`fr`), German (`de`), Arabic (`ar`), and Traditional Chinese (`hant`). You can find the site at [https://lzwjava.github.io](https://lzwjava.github.io)
1211

1312
When dealing with multiple languages in a computer environment, several aspects need consideration.
@@ -90,8 +89,3 @@ I utilize Google Text-to-Speech to generate audio versions of my blog posts. The
9089
```
9190

9291
Currently, audio is generated for Chinese and English content. To extend support to other languages, the corresponding language codes must be configured.
93-
94-
## Summary
95-
96-
Languages differ in two primary aspects: their written representation (shape) and their spoken form (pronunciation). The font selection and text-to-speech configurations address these two aspects, respectively.
97-

_posts/en/2025-01-17-trading-en.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ translated: false
77
---
88

99

10-
1110
- Use a dedicated bank account for P2P trading when buying cryptocurrency in China. This makes it easier to record videos or take screenshots, allowing merchants to verify the transaction history, as the transaction history is short.
1211

1312
- Prefer bank transfers over WeChatPay or Alipay, as they are less regulated. If one bank account is not working for transfers to merchants, use another one.
@@ -32,6 +31,4 @@ translated: false
3231

3332
- Them: Congrats! You made a lot of money on Bitcoin, right? Changpeng Zhao: No, not exactly. I still have the same number of Bitcoins. It's just that everything else has become a little cheaper relative to Bitcoin.
3433

35-
- In regular investing, the key is to invest consistently over the years. Therefore, there is no need to rush and attempt to invest more in any given week or month, especially if the money is not from your savings but is borrowed, has a deadline, or has an associated cost. It can be difficult to maintain consistent investing over a year or a few years.
36-
37-
- The P&L of your portfolio may be zero after regularly investing for months. So why not invest all at once at the start? The feeling is different. You have been riding up and down with these stocks. You gain resilience and patience, which is priceless.
34+
- In regular investing, the key is to insist on investing for years, so there is no need to rush and attempt to invest more in any given week or month.

0 commit comments

Comments
 (0)