Trying Scala Script - Script to Create a Symbolic Link to JDK on Mac OS X

I used to use Ubuntu Linux most of the time, yet I’m using Mac OS X more these days. I’m quite satisfied with it, but there’s one thing inconvenient. That’s installing JDK. On Ubuntu, installing Java 8 (technically what I want to install is JDK 8 but since Java has really terrible versioning history, I’ll just call it Java 8) is not supported by Canonical, but it can be done easily by the PPA provided by Web Upd8 (Thanks Web Upd8).

More …

Git: Push to / Pull from Both Github and Bitbucket

  • Last Updated: 2013-08-26 * Fixed: Bug in the gitpullall() script. - 2013-07-23
  • Refactored: gitpullall() - 2013-08-26
  • Updated: gitpullall() - 2015-03-07: Now it can handle branches. So pulling on branch works. The old version always pulled from master. This version uses the name of current branch then get the same one from the remote. (e.g. remote: github, local branch: some-fix <=pull= github/some-fix)
  • Added: gitpullall() for Z shell (zsh) - 2015-03-07
More …

Java Generics: Generics in Real Life Programming

It is surprising to see that there are still many people who do not use generics even when they are using JDK 5 or higher. I can often see it especially when I teach some Java programming subjects at uni. Generics can be very useful and I use it a lot in my libraries and projects. So I’d like to talk about generics but not a basic knowledge of it. I will talk about Java generics in real life programming and how it can be useful as well as some unusual cases may occur and annoy you. I am also going to explain some common cases of generics usage in my next post that I have plan to write soon (hopefully). Then I’m going to write about more complex cases in the sense that it’s complex when it’s designed but rather simple when it’s used, and it’s also more practical. It means I’ll probably write two more posts about generics so stay tuned if you’re interested.

More …