Say Goodbye to Paid APIs! Use Bob + Ollama for Google's Powerful TranslateGemma Model for Free on Mac
When using Bob for selection translation on macOS, the biggest headache is often the quota and network issues of various translation APIs: DeepL has a small free quota and is easy to be flagged for risk control, OpenAI API is prone to disconnection and requires continuous payment, and traditional machine translation, although free, has poor translation quality. Today, I’m sharing an completely free, zero-latency, highly private, and professional-quality ultimate solution: Bob + Ollama + TranslateGemma. By running Google’s TranslateGemma model locally, which is specifically optimized for translation tasks, you can achieve true “translation freedom”. ...
Unique Indexes: We Should Think Twice (Especially at Scale)
In “Big Tech” environments (you know, the kind with tons of users, massive datasets, and rapidly evolving requirements), relying on database UNIQUE INDEX constraints to prevent duplicate data—unless it’s for something like financial reconciliation where every penny must be exact—honestly, might not be as effective as you think. Plus, the cost of maintaining them can be surprisingly high. A better approach is often to handle the bulk of deduplication logic at the application layer. If you can avoid using a database unique index, consider doing so, or at least think it through very carefully before implementing one. ...
Sheep a Sheep Tech Walkthrough
Recently, “Sheep a Sheep” has become quite popular, but it’s extremely difficult. After playing dozens of rounds over a few days without success, I succumbed to my professional habits and decided to see if there was a technological method to beat it. After finding an effective method, I organized it here to help others achieve a tech-based victory. Principle The principle behind a tech-based victory is quite simple. The game presents two maps each day. The first map is a warm-up and can be completed easily, while the second map is extremely challenging. Therefore, if you can change the second map to be the same as the first, you can achieve victory. ...
Practicing Go Project Architecture with Clean Architecture
Over the years, Go has become a widely used programming language across various fields. From foundational components like k8s and Docker to microservices in the business domain, Go can be used to build them all. When constructing these Go projects, the choice of architecture pattern and code layout is subjective. Those with Java Spring experience might opt for the MVC pattern, while those familiar with Python Flask might choose the MTV pattern. Moreover, since there is no mainstream enterprise-level development framework in the Go language domain, many projects lack a clear architectural pattern. ...
Pitfalls of Passing Scope Across Services in Python
Background In an old system, there is a piece of code like this: scope = dict(globals(), **locals()) exec( """ global_a = 123 def func_a(): print(global_a) """ , scope) exec("func_a()", scope) The first segment of user code defines a function, and the second segment executes the function (don’t ask why this is done, because the user is always right). After executing the first code block, func_a and global_a are added to the scope. Since the second code block uses the same scope, calling func_a in the second block correctly outputs 123. ...