Author Archives: admin

Ruby Array

Was curious which is faster.

Rehearsal ----------------------------------------------
<<           0.099701   0.017560   0.117261 (  0.117427)
push         0.110768   0.007844   0.118612 (  0.118719)
------------------------------------- total: 0.235873sec

                 user     system      total        real
<<           0.063531   0.002646   0.066177 (  0.066220)
push         0.099184   0.004992   0.104176 (  0.104228)


require 'benchmark'

Benchmark.bmbm(10) do |bm|'<<') do
    a = []
    1000000.times do
      a << 'foo'
  end'push') do
    a = []
    1000000.times do
      a.push 'foo'

My Language Ranking Based on Coolness

With so many sites measuring programming language popularity, here’s the coolness, not popularity ranking of languages ranking by me. This is my PERSONAL opinion.

1. Ruby – need I say more? 😉
2. Objective-C
3. Go
4. C, not C++
5. Coffeescript – yes, I said it, ok?
6. Haskell
7. R
8. Swift

Install Ruby 2.3.1 from Source on Ubuntu 16.04

Execute this as the root user. If not, you can always add sudo. Here’s the script:


set -e

apt-get update
apt-get install -y curl build-essential libreadline-dev \
libffi-dev zlib1g-dev openssl vim \
libncurses5-dev libcurl4-openssl-dev \
libgdbm-dev libqdbm-dev libssl-dev
apt-get autoremove && apt-get autoclean
curl -O
tar xvzf ruby-2.3.1.tar.gz
cd ruby-2.3.1
make && make install
cd ..
rm -rf ruby-2.3.1*
echo "gem: --no-ri --no-rdoc
install: --no-ri --no-rdoc
update: --no-ri --no-rdoc" > /usr/local/etc/gemrc

gem install bundler pry interactive_editor

Simple Web Server with Ruby or Python

I was developing a Javascript app and wanted to run a web server pointing to current directory.

Using Ruby

A simple script to start a WEBrick server. You can modify the root directory to a subfolder if you’d like. I named this script “server” with chmod +x so I can run it with ./server

#!/usr/bin/env ruby

require 'webrick'

server = 8000, DocumentRoot: ".")
Signal.trap('INT') { server.shutdown }


A simple command using python -m SimpleHTTPServer

Memory of R Programming and SAS

During my tenure as a CTO for the pharmaceutical company, I had to deal with both small and large datasets for biostatistics. The gold standard for data analysis in pharmaceutical is SAS since FDA reviewers use it. Although SAS is great and I got the basic training as seen below, the cost is rather higher than I liked.


When I heard about R project through a colleague back in 2003 or 2004, I had to jump on it and find out. After evaluating what it is and where it’s headed, I instantly loved it. It was very early in development, but I knew that this would be awesome. In fact, I love it so much that I became a supporting member (see below).

R Members

I don’t list R anywhere in my CV nor rants/blogs I post since it’s been long long time and I don’t have the expertise to be comfortable with it. But now that I have to deal once again with a large dataset on my private projects, I’ll pick it up again. There may even be a video diary of my learning. 😉