All posts by Wouter

Trust & Safety Analyst at Google Japan. Main interests in information technology are PHP, Zend, C, C++, Java, Linux. Other interests include Japanese, math, physics, chess, FX/stock trading and traveling.

tmux – an awesome little tool

If you do a lot of programming from the Linux console, you’ll certainly appreciate the power of tmux. It is a terminal multiplexer, which means that it can create multiple virtual consoles within a single terminal shell. Since these virtual consoles are not bound to a terminal, they will keep running in the background, even if you close the terminal you started it in. This means that you can detach these consoles, and re-attach them in another terminal session.

For example, imagine you are working on some project on a development server. You log into that server over SSH from your office, create a tmux session, and do your coding in vim in there. Then you detach the session, and log out from the server to go home. Back at home, you log into the development server again, and re-attach the tmux session, and you see the vim session back where you left it. Not that I suggest you to work from home, but it is a good example of how you can continue your work or session from anywhere.

Tmux in action. Two vim sessions and a MongoDB console.
Tmux in action. Two vim sessions and a MongoDB console.

Another great thing about tmux is that you can create multiple sessions within the same terminal window, and move between them, something like alt-tabbing between terminal windows, except it is much faster and with less visual distraction. An added bonus is that tmux is able to subdivide the visible portion of your terminal window into parts, so you can have multiple virtual consoles, all visible within one window. Very useful if you have lots of screen estate at your command, so that you can code in vim in one, access a MySQL console in another, and doing a sass --watch in yet another, for example. All the information you need, everything visible in the same window, for optimal productivity.

Continue reading tmux – an awesome little tool

Job interviews – how to positively communicate your deafness

I have a profile on LinkedIn, and from time to time I get approached by recruiters, who sometimes have a pretty interesting offer I’d like to know more about. As it is a profile to show the best of you, positivity is an important factor, and that is the reason I do not write that I am deaf – which unfortunately has the negative connotation that you can not hear. However, I add under Languages the fact that I know several sign languages, with “native or bilingual proficiency”. This is one of the examples I’d like to share with you on what to do to improve your position on the job market as a deaf professional.
Continue reading Job interviews – how to positively communicate your deafness

Download Japanese stock market data into R

Traders who are interested in the Japanese market, and use the quantmod library in R to analyze the stock market, will find that there is no source for financial data on the Japanese market. This has changed with quantmod version 0.4-3, in which my code to download stock data from Yahoo! Japan has been added.

At the moment, version 0.4-3 has not been pushed to CRAN yet, but you can still install it from R-Forge. To do this, enter the following in your R console:

install.packages("quantmod", repos="http://r-forge.r-project.org")

Then, when you load the library with library(quantmod), you’ll be able to use the getSymbols() function to retrieve stock data from the Japanese market, using the src="yahooj" parameter. The ticker symbols you need, can be found in the URL of the stock information page on Yahoo! Japan. For example, if you open the Sony stock data page, you’ll see that there is a code=6758.T in the URL. This is your ticker symbol.

So in order to download Sony stock data from January 2013 into R, do the following:

getSymbols("6758.T", src="yahooj", from="2013-01-01")

This will download the data, and put them in a variable called YJ6758.T in your R environment.

For more information on the getSymbols function, you can check the online reference. When the online reference for the getSymbols.yahooj function becomes available, I will link it here, but until then you can check it in the R Help system if you have quantmod 0.4-3 installed.

意味のある沈黙

これはオランダ語の記事から翻訳したものです。原作者はGaston Dorren(ガストン・ドルン)。

手話入門コースを受けている、と友達に言った時、驚くべき反応が二つあった。まず、僕がデンマーク語、スペイン語、ロシア語、ノルウェイ語、ルーマニア語やチェコ語を勉強していたときよりも興味を示してくれた。どうやら手話という言葉はみんなの好奇心をかきたてるようだ。

つぎに、僕の友達の中には修士号所有者が何人もいるが、手話については悲惨なほど誤解されている発言を何度も耳にしたことがある。80年代頃から、手話を広める活動が言語学者と手話の擁護団体により何度か行われたにも関わらず、手話に対する誤解はまだたくさん残っている。それを無くすために僕は明確な目標をもってこの記事を書くことにした:よくある七つの誤解をまとめ、誤解がなくなるように説明していきたいと思う。

Continue reading 意味のある沈黙

MySQL pager configuration

Have you ever typed in a SQL query that returns thousands and thousands of results, and you had to Ctrl-C to stop it, which would then also terminate your MySQL console process? Annoying, isn’t it!

Well, there is actually a pager configuration for MySQL. My favorite pager is less, ’cause less is more, right? Paradoxically, it has more features than more, for in more you wouldn’t be able to scroll up, for example.

To make MySQL use less as the pager, you should add the following line to your my.cnf file, in the [client] block:

[client]
pager = "less -X -F"

Here is what the arguments do:

  • -X: prevent less from clearing the screen when exiting. This is useful when you want to have the results on screen after quitting less, to be able to compose your next SQL command
  • -F: tells less to quit immediately if the buffer fits on one screen. Without this, you’d have to quit less first before you can type the next SQL command, even though it fitted perfectly on one screen.