Author Image

Michael Chen 的技術文件

程式設計、開放原始碼軟體、技術雜談

Cover image

Recently, I saw a interesting post on StackOverflow, which compares the difference among sed, AWK, Perl, Python. I decided to learn the “old tricks”. Then, I tried some simple tasks in AWK, Perl, Ruby, and Python. Why Ruby among these? Although Ruby is not a standard tool in a tranditional Unix toolbox, Ruby becomes more popular among these years and Ruby is sometimes viewed as the unadvertised successor of Perl 繼續閱讀

Cover image

JavaScript is the vital part of modern interactive web. However, JavaScript is not easy; it mixes the features of several languages. Some good, some bad. The syntax is Java-esque but the underlying concepts is totally different from Java. CoffeeScript is a mini-language that compiles into JavaScript. It brings an elegant Python or Ruby-like syntactic sugar for JavaScript and helps you to avoid some JavaScript pitfalls. Here is an example of 繼續閱讀

Cover image

Emacs has a built-in html-mode for HTML files. It is common that HTML files comes with other lauguages like CSS, JavaScript, PHP and so on. The built-in html-mode cannot handle these non-HTML parts well. For example, the indent of these parts in html-mode doesn't work well. If you need an alternative major-mode for HTML, you can consider web-mode. web-mode.el is an Emacs major-mode for editing web templates; it supports many 繼續閱讀

Cover image

To generate a list of numbers, Perl provides the syntax .. (double dots). However, the syntax only provides ascending sequences with 1 increment. What can we do if we need more flexible sequences in Perl? In the following example, you can see that .. only generate an ascending sequence. # print out 1 2 3 ... 10 $ perl -le '$, = " "; print (1..10);' # print out nothing 繼續閱讀

Cover image

I bought a new Kindle. When I tried to read some PDF files on Kindle, I found that the font size was too small to read. If you need to read PDF files on some small size devices like 4-inch smartphones or 6-inch e-book readers, you can optimize these PDF files for these gadgets with k2pdfopt. k2pdfopt is a command-line utility to optimize PDF/DJVU files for mobile e-readers and smartphones. 繼續閱讀

Cover image

Unix is like carpenters’ toolkits; you need to learn them before you really enjoy them. Self-help learning is rewarding and amusing, which also applies to the learning of Unix. Basically, there are three levels of sources to learn Unix: Books about Unix (or Linux). Online webpages, blogs, forums or other web resources System manuals. The list is roughly ordered by the degree of difficulty. We'll explain these sources one by 繼續閱讀

Cover image

I was assigned by my professor to download some RNA sequences data to my own computer for backup purpose, because the original data server will clean these data. These data are dozens gigabytes in size, but the connection speed of the network in my house is not fast. Therefore, I chose lftp to speed up the downloading rate by parallel downloading. lftp is a sophisticated ftp/http client and a file 繼續閱讀

Cover image

Sometimes there are no available desktop or laptop running Unix or Linux, but we miss these utilities on Unix. Thanks the efforts of numerous communities and companies; the utilities of Unix are ported to Windows in different projects. We'll introduce some of them. Cygwin Cygwin is a large collection of GNU and open source tools and a simulated POSIX layer on Windows. You may think Cygwin a self-contained mini Unix 繼續閱讀

Cover image

Go is an open source programming language. Go source can be easily compiled into native binaries of several platforms, which brings the potential of application programming. I'm learning the new language on my spare time. Here is my notes for Go language. The contents may change during my learning process. Install Go on Unix The main toolchain of Go language can be placed in any place and you need to 繼續閱讀