blog.jjgod.org
jjgod / blog – Page 2 – Random notes & thoughts.
http://blog.jjgod.org/page/2
Random notes and thoughts. Opf-cc: epub 和 mobi 的自动简繁转换工具. 上周末有空,就用 Python 写了 opf-cc. 这个项目,是 Open Packaging Format. Chinese Conversion 的缩写,因为 epub 和 Amazon 采用的 mobi 都只是封装方式,具体的文件布局都是按照 OPF 规范的。 简繁转换这个问题相对好解决,有现成的 OpenCC 在处理多繁一简或者多简一繁的问题上已经很完善了,所以就稍微修改了一下 OpenCC 的代码直接拿来用了,修改都作为 pull. 解包 epub 比较简单,因为 epub 实际上就是 zip 压缩包,所以用 Python 的 zipfile. Mobi 的解包稍微麻烦一些,如果不用 calibre 那一套庞大的库, mobiunpack. 解包后需要找到应该转换的文件,比较麻烦的地方是有的目录中 href 到的文件名本身就是繁体,如果直接整个目录文件一起转换,就得把文件也对应改名,比较麻烦,这里我尝试用 lxml. 用 OS X 的 zip 工具一压就可以了. Working...
blog.jjgod.org
Tools – jjgod / blog
http://blog.jjgod.org/category/tools
Random notes and thoughts. Preserving Extended Attributes on OS X. File (OS X executables or libraries), the signature information will be stored in the file itself through some Mach-O extension. When codesiging a bundle (. Directory will be created. But what happens when you codesigning a plain text file? Signature information will be stored in extended attributes. On OS X preserves extended attributes by default, both archive and unarchive. But. Doesn’t, a better replacement is ditto. As well, though.
blog.jjgod.org
opf-cc: epub 和 mobi 的自动简繁转换工具 – jjgod / blog
http://blog.jjgod.org/2013/01/31/opf-cc
Random notes and thoughts. Opf-cc: epub 和 mobi 的自动简繁转换工具. 上周末有空,就用 Python 写了 opf-cc. 这个项目,是 Open Packaging Format. Chinese Conversion 的缩写,因为 epub 和 Amazon 采用的 mobi 都只是封装方式,具体的文件布局都是按照 OPF 规范的。 简繁转换这个问题相对好解决,有现成的 OpenCC 在处理多繁一简或者多简一繁的问题上已经很完善了,所以就稍微修改了一下 OpenCC 的代码直接拿来用了,修改都作为 pull. 解包 epub 比较简单,因为 epub 实际上就是 zip 压缩包,所以用 Python 的 zipfile. Mobi 的解包稍微麻烦一些,如果不用 calibre 那一套庞大的库, mobiunpack. 解包后需要找到应该转换的文件,比较麻烦的地方是有的目录中 href 到的文件名本身就是繁体,如果直接整个目录文件一起转换,就得把文件也对应改名,比较麻烦,这里我尝试用 lxml. 用 OS X 的 zip 工具一压就可以了. Proudly...
blog.jjgod.org
January 2013 – jjgod / blog
http://blog.jjgod.org/2013/01
Random notes and thoughts. 在家看电影这么久,老早就在琢磨要不要换一个更强大一点的 5.1 环绕立体声系统,因为空间有限,专业的音响系统用不上也听不出差别,最近 XBMC. 出了一个模拟立体声的 bug,让我又开始想要不要换到用数字输出才不浪费大部分 BluRay rip 里的 DTS 5.1 音频了。 Mac 的数字音频输出有两种方式,通过集成的数字/模拟音频输出 3.5mm 口用 TOSLINK. 因为我用来放电影的 Mac mini 还是 2009 年的型号. 注意 TOSLINK 相比 HDMI 的限制是由于带宽所限无法直接输出 DTS HDMA. 的音频,但考虑到 OS X 的限制即使是用 HDMI 也 无法直接输出这两种格式. 优点是这两款低端的解码器对于我的需求来说都绰绰有余了,而且都支持 7.1 的 HD 音频,日后升级也有余地。 缺点也很明显,单有解码器只解决一半问题,至少还得买一套 5.1 的音箱系统来替换我原来用的 Logitech Z523. 所以再仔细一看 Logitech 现在的产品,替换原来的 Z5500. 除了 XBMC 以外, MPlayer X.
yhsif.com
Yuxuan 'fishy' Wang:yhsif.com
https://yhsif.com/YuxuanWang
Currently live in Beijing, China. Http:/ wang.yuxuan.org. There are no comments on this page.
blog.jjgod.org
Programming – jjgod / blog
http://blog.jjgod.org/category/programming
Random notes and thoughts. Optimizing SHA-1 Performance on OS X. At work we need to do some SHA-1 verification on application startup, naturally we want it to run as fast as possible — no user likes their browser bounce too many times on the dock before showing up. The initial implementation is extremely naïve one, yet quite portable. It’s base on Chromium’s (which our code base is built upon) portable SHA-1 implementation. We first read the entire file. Then pass this string to. The code is derived from...
blog.jjgod.org
Miscs – jjgod / blog
http://blog.jjgod.org/category/miscs
Random notes and thoughts. It has been a while since my last post. A lot has happened. The most important one is that I have come back to China to join the fruit company everyone loves or hates. It’s a new beginning for me, almost three years ago. But that’s a small jump compare to the one I just made. After moved to Norway for five years, I’m moving back to Beijing for a new job. July 9, 2015. October 27, 2015. 8 Comments on New Beginning. Since yesterday morning our build servers started to get. Error ...