change number of job slots in grid engine

Having done it so many times, and having forgotten it so many times, now I have to write it down:

qconf -mq all.q


fail-safe wget

when you have a script using wget to download files, you can make the script safe to re-run by allowing wget to continue on downloaded files by adding “-c” to your command line. wget will check the existing file size, download or skip it accordingly.


Android ? or Not .

I have only been playing with Android for a few weeks. Overall, I think Android has good quality and bring some fresh air to iPhone alternatives. But it is far from perfect, and I think it will have bigger problems with its increasing popularity. People have mentioned the fragmentation problem Android has. In my own experience, it can upset users. I bought my phone with 2.1 Android, and I rooted it to install 2.2 Android. Soon after that, I found out that there are quite a few apps I like disappeared from 2.2 Android Market. I found it may become a reason for people to stay with old version of Android, and the fragmentation will become worse.


beware of copy constructor

I ran into a simple C++ problem recently. The application I was developing uses core library from C API. There are many C objects flow around, managed through pointers, alloc/free. For ease of development, I wrap a few C objects related to one process into this C++ class, with constructors to call C functions to load resources, and destructor to call C functions to free them. For multiple process in application, I choose vector to store instances of this class for each process. So I did: vector.push_back(Class(input)). The immediately I ran into problems. What happened is: when I call vector.push_back, a temporal instance is constructed, memory is allocated, then default copy constructor constructs a new instance in vector with member data copied from temporal instance, after that, the temporal instance is destructed. The instance in vector has pointers but the C object have been freed by temporal objects. The solution to this problem is to make the C++ class non-copiable by declare private copy constructors; or use shared pointers with C objects.


A evening with Windows 7

Since I installed Ubuntu on my desktop, I haven’t used Windows for almost two years now. My wife doesn’t like OSX, because she’s used to Windows’ user interface. So she bought a Sony laptop. She complaint this evening that I have used her laptop, and I made it very slow. So I had to “fix” it for her. The problem turned out to be Opera. By default, Opera has “smooth scroll” enabled, which makes scrolling very unnatural. I turned it off for her. I also installed Chrome for her. Now she is happy.

A side note: I think Opera has lost the edge. It was never a major browser, so many website doesn’t really optimise for it. It made more difficult for Opera to gain popularity. It is sad though because it was the best browser, at least used to be.


Multi-display never works on Linux

I am surprised that multi-display is still such a big issue on Linux (Xubuntu). My problem is that my two¬†monitors are running at different resolution. It can work well if I set both monitor to 1280×1024. OSX never had a problem with it. Now I have to give up Xubuntu as my main development environment. (Windows 7?)

(edit: while Xubuntu doesn’t work well, Ubuntu has no problem. on OSX, you have to remember to disconnect your external monitor before you shutdown, otherwise, OSX will not detect it next time.)


replacing OSX default terminal with iTerm

The default terminal shipped with OS X is far from perfect. iTerm is a very good option to make your terminal experience happier. Unlike gnome-terminal, which will need you to have MacPorts or Fink, it is standalone, you can have it installed in a minute. It is easy to use as well. The only thing I need to mention is that the profile is managed in bookmarks. You can have a few bookmarks, and each bookmark can have different Keyboard, Graphics and Terminal profiles assigned to it.

August 2019
« Nov