Categories
Tech 中文文章 日本語記事

Custom sort order in music libraries: macOS and Android (en, zh-hans, ja)

在 macOS 和 Android 平台实现音乐库中的自定义排序
macOS と Android での音楽ライブラリーのカスタムソート順

Custom sort order in music libraries is a rather rare need. Most major languages use phonograms in their scripts, where the natural sort order is more or less identical to what is seen in Unicode (probably after some normalizations). On the other hand, languages using logograms (logosyllabic scripts, mainly Chinese characters in our context) does not have their characters sorted in their primary natural (usually phonetic) order in Unicode.
This causes a problem where a list of text sorted in Unicode code point order can be odd and difficult to look up from in these languages. Custom sort order in music libraries is thus useful when you have songs in one of these languages, or even a mix of them.

As this article involves mainly with concepts common among Chinese and Japanese language users, this article is also written in zh-hans and ja.
本文末尾附有中文版。
この記事の最後には日本語バージョンがあります。

Categories
Tech 中文文章

Simple automated interactions with Telegram Bots using MTProto (Pyrogram)

Telegram is a popular IM platform that is famous for its openness. A lot of applications are being discovered with their public Bot API and User API. Exposed as an HTTP interface, the Bot API is more popular on Telegram, but to interact with a bot, we still need to expose its User API, which is using an original protocol named MTProto. Below is my simple code snipped that sends a message to a bot and mark its first reply as read, using Pyrogram — a Python wrapping of MTProto.

Categories
Tech 中文文章

My Telegram mini toolkits (zh-CN)

Abstract

My first submission to “Matrix”, a private product sharing platform built by SSPai (in zh-CN). This article introduces some of my recent bots or project related to Telegram, including the following stuff:

Categories
Tech 中文文章

EFB How-to: Send and Receive Messages from WeChat on Telegram (zh-CN)

安装并使用 EFB:在 Telegram 收发微信消息

Banner

Abstract

This article is a tutorial on how to install EH Forwarder Bot on a VPS server, with Telegram Master Channel and WeChat Slave Channel, alongside with simple exmaples of how to use it. Targeting WeChat power users in China, this article is written in Chinese (zh-CN). For installation manual in English, please visit the documentation.

Categories
Random 中文文章

海带宝小贴士

被海带宝坑了两个月之间收集到了一些信息。在这里公布一下,希望对你们有用。

Categories
Nothing 中文文章

碎碎念20140908

又是头脑一热而随机蹦出来的什么东西。 ——20140908

看到B站的评论提示,继而发现还有这么一个视频
首先恭祝UP入殿堂(10w比方),虽然有点晚了吧。
不过还是希望UP能继续深造,期待更多作品!!

——某个感觉两头都忙不过来但是还懒得动的家伙的碎碎念。

-=- RANDOM TIME START! -=-

其实这么看起来(评论的话)B站的喷子还不是预想得那么多。
心里面总是有一种“啊,想把歌语投到B站啊”的冲动。
虽然到现在,之前计划的那些功能还没实现多少。
估计等实现了之后再公布也不迟吧。
然后就发现了一个叫做V2EX的网站。感觉先发到那边试点一下也好么。

// 发到这边的主要原因是因为:[在B站评论框里面码了半天字, 一不小心编辑器失焦了, 然后按到了X (Vimium 的关闭标签快捷键), 然后就没有然后了];
// 常联系。

EH。

Categories
Designs 中文文章

Codename LyricG 那个一度设想过的音乐游戏,设计图初公开

差不多快两年了呢。

那一次在纸上描绘出来的设想,也一直没有实施。本来很早就想把这个发上来的。唉,╮(╯▽╰)╭。 拖延症啊~~~

总之,今天终于把这个东西扫出来了。

PDF 下载。

Categories
Tech 中文文章

利用虚拟机软路由负载均衡拓展带宽

前提:

  • 假定所使用的计算机能够使用虚拟机(256MB RAM 512 MB HDD 应该没有什么带不动的吧),通过固定且稳定的方式连接到局域网。
  • 虚拟机的虚拟网卡能够正常工作。
  • 假定局域网设定每IP地址限速。

原理:

将虚拟机的网卡桥接到局域网,宿主机与虚拟机通讯获取数据。虚拟机上的软路由通过负载均衡将数据包均衡分配给多个桥接网卡。由于每个桥接网卡都有其自己的局域网IP,所以每个桥接网卡能够获得到同等的带宽。宿主机把自身的流量收发交给虚拟机来分配,其理论网速将得到提升。(实际下载速度提升仅限于P2P和多线程下载,一般的单线程P2S测速网站不能够体现效果,如Speedtest.net。)

Categories
Designs 中文文章

脑内开坑: 歌语计划屏保。

Keng: Gy Screensaver.

1, fetch information from Gy server

File format:
possibly XML, or JSON?
Consist of all of posts

Separated API port for update date.
Program checks the update date compare to the local one. If the later one is newer, then update the local list.
Use local list for poor our unavailable internet connection.

2, the main body.

pick lyric from random if picked(a)=false.
label picked(a)=true,
lyric shown count +=1
if lyric shown = size(lyric array) then {lyric shown =0, fill picked(all)=0}
Draw lyric text in a time interval (#setting)

Randomize text size, color, position
Range of text size (#setting)
Range of color: complete hue,
Saturation and brightness are decided such that the text it’s visible on dark/black/starry background.
Text align to center,
[Detect pixel length/height of longest line,
Make a 10-20 px margin,
Draw text, and start timer.
last time of line(a) = length(line(a)) * time factor (speed, #setting)
enter animation: typewriter,
exit animation: fade out, .5s
transition: exit,exit end,enter
after object finish, destroy object

3, otherwise, on web?

directly fetch items number and single item from server by ajax. other applies.

Categories
Nothing 中文文章

宿舍外卖拼团系统内测开始啦!

最近宿舍中订外卖的人数激增,且订单分散,大大增加了运货费用与递送员的负担。鉴于此,蓝色之风工作室特别推出了新的外卖订餐拼团系统。本系统与各种外卖商户,包括肯德基,麦当劳,汉堡王,必胜客,加拿大披萨,popeyes等人民群众喜闻乐见的餐饮服务机构进行合作,将来还会加入更多。不但能够在拼团购买中得到递送费的减免,更能得到其他惊喜的学生专享优惠。此外,在大家拼团订新奇健康品牌餐饮。餐的同时还能增进同学之间的友谊,一举两得。

本系统暂定于本周六开始试运营。18:00开始每小时一批,直到次日凌晨2:00。目前该系统仅开放给AJCH的住户进行内测。通过到08-19房间找负责人领取邀请码即可注册订餐。支持VISA,万事达卡,PAYPAL,现金等多种支付方式。试运行期间不收取任何服务费。

用户在订单完成之后根据总订单情况可以收获运费返现,而且有机会参加未来的各种优奖励活动。详情请关注本站的后续通知。

当一个订单到达之后,会有专员通过短信形式告知用户取餐地点。如有订单失效,或错误订单。蓝色之风工作室承诺全额退款。

前所未有的订餐优惠即将来袭!
还在等什么,赶快注册订餐吧。
订餐地址: 点这里)