Categories
Tech 中文文章

一种简单粗暴无需 NLP 的区分中文和日文文本的方法

和博客里其他大多数的文章一样,这篇文章也是来自我平时开发个人项目时候的发现。在处理我的音乐库、歌词和其他数据的标音时,我需要一种简单的方式来区分中文文本和日文文本。因为我的曲库里面基本上只有中文、日文和其他拉丁字母构成的语种。而那些拉丁语种不需要太多复杂的处理就能够直接自然的排序,而中文和日文就没有这么简单,尤其是两种语言在对汉字的处理上有着截然不同的方法的时候。

Categories
Tech

Read and Write Tags of Music Files with FFmpeg

In both my previous and recent projects, I have been working with tags (metadata) of music files. One of the reason being I am rather particular about having a nicely organised library with all tag data aligned to the same format. Until recently while I was seeking for a solution to read and write tags of (potentially) all music formats1I only have MP3, FLAC, AIFF and M4A in my library, so that’s kinda all for me., and I encountered FFmpeg, the Swiss Army Knife of media processing.

FFmpeg has always been my go-to solution for processing media programmatically or in batch, and I have recently found the way to write into the tags of music files using it. The way of doing so might be a little verbose as everything have to fit into the command line interface with other components.

Categories
Tech

Translate Text in Sphinx Templates and Configurations

Weeks ago when I was playing around with the docs of EFB and the Crowdin translation widget, I realized that the default theme for Sphinx — Alabaster isn’t really doing well in term of translation. It seems like the author isn’t really confident on that (or simply didn’t care since 4 years ago).

As the theme itself is open source, and Sphinx is flexible enough, couldn’t we just translate it ourselves? It turns out that things are not that complicated.

Categories
Tech

How to Write Integration Tests for a Telegram Bot

This is my 6th article on Telegram, the IM platform of my preference. In this article I’m going to introduce about how I wrote the integration tests for my EFB Telegram Master channel — a Telegram interface for EFB, using a userbot-like strategy.

To get started, you need to have a bot ready to be tested, and a Telegram client app key that is registered with your account. While alternative tools are available, we will be using Telethon and PyTest in this article.

Categories
Design

Telegram Chat Backgrounds/Patterns Extracted

Here is a collection of all extracted chat background/patterns came with Telegram in their original resolution, extracted from Telegram for Android 5.14.0. In Telegram, they are also sometimes called Wallpapers.

This consists of 39 photographs that are there since no long after first Telegram release, 7 patterns in PNG added sometime after that, and 33 patterns in SVG (vector) added recently in 2019. All patterns are monochrome — black drawings and transparent background.

Categories
Tech

Awesome Command Line Tools

This is a list of awesome command line tools collected by SelfhostedServer. They have provided a detailed article for each of the tools in their paid membership subscriptions. The list below is based on the list of article titles from SelfhostedServer which are freely available, and attached with a short description from each project.

If you are interested in reading more about these tools, I’d recommend you to subscribe to the articles on SelfhostedServer (in Chinese).

Categories
News 中文文章

我的第三国 J-1 豁免申请记录

Abstract
This article talked about how I applied for my J-1 waiver from a third country. As this article mainly involves concepts and organisations related to China, it is written in zh-CN.

Categories
Tech

An alternative way to prevent spammers entering Telegram Groups

Telegram is a growing platform of instant messaging which has gained great popularity in the past few years. With its openness and superior user-friendliness, it has attracted a lot of users, along with spammers.

Categories
Random

Note: U.S. Equivalency of Australian 3-year Bachelor degree for H-1B visa

While I was trying to look for if I am eligible for H-1B visa petition. I wasn’t able to find much information online on this matter, as most Australians would use E-3 visa to work in the U.S. instead of H-1B. Since I have found it out finally, I thought it’d be good to share it here as well, in case anyone else may also need it. TL;DR:

Categories
Tech

Message delivery issues in EFB Telegram Master channel (comparing to generic IM services)

Different from how usually an IM would work, EFB Telegram Master channel (ETM) strongly rely on Telegram Bot platform. This had made ETM more difficult to deal with messages failed to deliver.

This article is first published on ETM Wiki on 20 April, 2019.