Sort by Hash Values in Perl

Since hash is a one-way relation, you cannot directly sort by hash values and get hash keys in Perl. However, by customized sort subroutine, you can also sort by hash values. This post shows the trick. You still need hash keys for later use, so we sort hash keys here. The catch is in the by_value subroutine. Here we pass $a and $b to the su...
「點我閱讀更多」

rJava Failed to Load on Desktop RStudio

According to the official page, rJava is a Low-level interface to Java VM very much like .C/.Call and friends. A strange error occurs while I try to load rJava insido RStudio. Reason: image not found According to the thread, starting RStudio and setting LD_LIBRARY_PATH variable from terminal can solve the problem. $ LD_LIBRARY_PATH=/Library/...
「點我閱讀更多」

Keyword Search with Firefox

When we want to search from a page, we open the search page and type keywords in the search bar. It is annoying to repeat the process multiple times. Is there faster way to reduce the repeat? Firefox bookmarks comes with a convienent function called keyword search. You can try a built-in keyword search now by typing google keyword in the loc...
「點我閱讀更多」

Add Bookmarks with Coherent PDF Tools

Coherent PDF Tools is a command line PDF tool for Windows, Mac and Unix. It is free for non-commercial use. I wanted to remove all bookmarks in the PDF file and re-edit them and Coherent PDF Tools can remove all bookmarks in single command. After some try, it simply worked. Here I introduce how to edit bookmarks with Coherent PDF Tools. Thi...
「點我閱讀更多」

Hello JavaScript with Node.js

JavaScript is a popular web language initially implemented on Netscape Navigator and later adapted on virtually all browsers. Since a JavaScript engine is a part of a browser, we had to embed JavaScript file in a HTML page, to load the script from the browser, and to use function like prompt() or alert() to receive from and response to develope...
「點我閱讀更多」