Categories

130 pages

Computer

Blog Translation Project Musings: Historical Conversations

The initial design of the blog translation project was overly complex – first parsing Markdown format, then using placeholders to protect the content, and finally sending it to a large model for translation. This was entirely unnecessary; large models inherently possess the ability to recognize Markdown syntax and can directly process the original content while maintaining formatting during translation.

Our work shifted from debugging code to debugging the prompting of the model. Model: google/gemma-3-4b Hardware: Nvidia 3060 12GB Indeed, we chose a non-thinking model – thinking models were inefficient when executing translation tasks. We compared the performance of 4b and 12b parameters, and for translation purposes, gemma3’s 4b parameter was sufficient; there was no significant advantage in terms of 12b parameters. 12b parameter speed: 11.32 tok/sec , 4b parameter speed: 75.21 tok/sec.

Find all functions not referenced in the Go project.

In a Go language project, using staticcheck to find unused functions is an efficient static analysis method.

1. Install staticcheck

Ensure that Go (version 1.16+) is installed, and then execute the following command to install staticcheck:

go install honnef.co/go/tools/cmd/staticcheck@latest

2. Basic Usage: Finding Unused Functions

Run the following command in the project root directory:

staticcheck ./...

Key Check Rules:

  • U1000: Detects unused functions, methods, variables, or types.
  • U1001: Detects unused parameters.

3. Filter Specific Check Rules

If you only want to check unused functions, you can specify the rules:

Git Submodule Merge History Lost

There’s a Git repository locally where submodules were in temporary branches during the initial pull. I made commits on that temporary branch, and then switched back to the main branch. However, those committed changes seem to be lost and cannot be found within the main branch. I also can’t find any record of that temporary branch.

Solutions

After committing to a temporary branch within the Git submodule and switching back to the main branch, these commits are no longer found. This situation can be resolved by following the steps below:

GitHub Pages Easter Egg: Deploying Multiple Pages

Recently, my biological clock has been a bit off, still tinkering with GitHub Pages deployments around 2 AM.

I went to eat after work, and I just wanted to sleep when I finished, then came back around 8:30 PM, feeling drowsy, thinking I’d take a nap, and ended up falling asleep immediately. When I woke up, it was already past 2 AM.

Categories that haven’t even launched yet: AI Study Group

Old problems, the flamboyant beauty of blossoming flowers. (This captures the essence and poetic nature of the original.) Alternatively, a more literal translation could be: “Old ailments, beautiful eyes like blooming flowers.” However, the first option is generally preferred for its aesthetic quality.

For many years, I’ve focused on backend development, and recently started to explore AI programming while dipping my toes into some frontend-related content. However, during this period of tinkering, I gradually realized I was falling back into an old habit – being dazzled by shiny new things. I constantly try to use AI to create a frontend interface, but in reality, these attempts haven’t provided much practical benefit for my current work and are actually wasting my energy.

Claude4 released, attempting to develop: Hugo tags, hyperlink translation assistant

This site is developed using Hugo, but I’ve always used Chinese titles, which results in less friendly generated article links. In simpler terms, when shared, they don’t look as good because the Chinese characters are escaped into formats like %E4%BD%A0%E5%A5%BD within the links. While you can solve this by setting a slug, it’s tedious to do manually every time.

Therefore, I decided to try using Claude4 to develop a translation assistant that automatically converts Chinese titles to English slugs and adds hyperlinks within the articles. This would eliminate the need for manual setup.

Merge the Pull Request into the Repository of the Fork

github-readme-stats is a GitHub profile statistics generator that allows users to display various statistics and charts within their GitHub profiles. It offers multiple customization options to tailor it to user needs.

I manage my repository habits by grouping them by project; GitHub doesn’t support repository grouping, so I have to achieve this by splitting repositories across different organizations. The latest branch of github-readme-stats cannot support statistics for repositories spanning different organizations; I forked a branch and merged the corresponding code.