Archive for General

Student assistant

Starting next Thursday, I’ll be a student assistant for the course Operating Systems at my university. What’s that you say? Well, my job is to aid the students during practicum sessions, thereby reducing the amount of work for the professors.
This course is about operating system design, and it has a strong focus on POSIX operating systems. It talks about things like CPU scheduling, system calls, multiprocessing, filesystems, memory, etc. During the practicum sessions, students have to program in C. Last year I noticed that a lot of students have a hard time understanding C. C is not officially taught as a course at my university; students are only taught Java. The jump from Java to C is pretty big even though the syntax is somewhat similar, and most people have trouble understanding pointers, memory management and even include files and the nature of linking. On top of that, most students are unfamiliar with Linux, which is the operating system we use during practicum sessions.
Now, I happen to be one of the few students who knew both C and Linux, and last year (when I was still attending the course) I was like a walking API reference.
“Hey Hongli why does this code crash?”
“Help Hongli it won’t compile!”
“Hongli what the hell is ‘makes pointer from integer without cast’ supposed to mean?”
“OMG Hongli strlen() is eating my baby!”

Well, no more. I’m a student assistant now, so this time I can actually tell them “RTFM” (= read the sheets/book/man pages) if they ask me trivial things. I know that some people will have questions about how to compile multiple .c files to a single executable, so I prepared diagram:
compilerenvanc.png
If students don’t understand this then I’ll dance Hare Hare Yukai 20 times in a crowded place.

Comments (1)

Mikuru 1.0.0 released


Mikuru - named after Asahina Mikuru from The Melancholy of Haruhi Suzumiya - is an extremely simple image gallery generator. Its key features are:

  • Easy to use and easy to set up.
  • No dependencies on databases.
  • The generated gallery has a simple, to the point, quick and easy to user interface.

I wrote this because I went to Abunai last weekend, and I took 150 pictures. I didn’t feel like setting up a full blown gallery system such as Gallery, so I wrote this simple fire-and-forget image gallery generator.

How does it work?

You put a bunch of pictures in a folder, run Mikuru, and it’ll generate an ‘index.html’ as well as a set of thumbnails. There are no other generated files. Simply upload index.html, the thumbnails and the pictures to a web server, and you’re ready to go.

Here’s an example usage session:

$ ls
DSCN001.JPG   DSCN002.JPG   DSCN003.JPG
DSCN004.JPG   DSCN005.JPG   DSCN006.JPG
$ mikuru
MKDIR      thumbnails
WRITE      thumbnails/DSCN001.JPG
WRITE      thumbnails/DSCN002.JPG
WRITE      thumbnails/DSCN003.JPG
WRITE      thumbnails/DSCN004.JPG
WRITE      thumbnails/DSCN005.JPG
WRITE      thumbnails/DSCN006.JPG
WRITE      index.html
$ scp -r * www.somehost.com:public_html/my_gallery/

How does it look like?

Click here for a demo image gallery.

Download

Version 1.0.0
Requires Ruby and RMagick.

Comments

Mikuru image gallery


Mikuru - named after Asahina Mikuru from The Melancholy of Haruhi Suzumiya - is an extremely simple image gallery generator. Its key features are:

  • Easy to use and easy to set up.
  • No dependencies on databases.
  • The generated gallery has a simple, to the point, quick and easy to user interface.

I wrote this because I went to Abunai last weekend, and I took 150 pictures. I didn’t feel like setting up a full blown gallery system such as Gallery, so I wrote this simple fire-and-forget image gallery generator.

How does it work?

You put a bunch of pictures in a folder, run Mikuru, and it’ll generate an ‘index.html’ as well as a set of thumbnails. There are no other generated files. Simply upload index.html, the thumbnails and the pictures to a web server, and you’re ready to go.

Here’s an example usage session:

$ ls
DSCN001.JPG   DSCN002.JPG   DSCN003.JPG
DSCN004.JPG   DSCN005.JPG   DSCN006.JPG
$ mikuru
MKDIR      thumbnails
WRITE      thumbnails/DSCN001.JPG
WRITE      thumbnails/DSCN002.JPG
WRITE      thumbnails/DSCN003.JPG
WRITE      thumbnails/DSCN004.JPG
WRITE      thumbnails/DSCN005.JPG
WRITE      thumbnails/DSCN006.JPG
WRITE      index.html
$ scp -r * www.somehost.com:public_html/my_gallery/

How does it look like?

Click here for a demo image gallery.

Download

Version 1.0.0
Requires Ruby and RMagick.
This software is BSD licensed.

Comments

GoDaddy sucks

Never use GoDaddy.com to purchase SSL certificates. They’re cheap, but their service sucks.

Yesterday I purchased an SSL certificate with my GoDaddy account. A friend agreed to pay the fee for me, so we used his Paypal account, which was under a different name. I can’t find anywhere on the GoDaddy website where they mention that the Paypal account information must match the GoDaddy account information. The purchase seemed to go well, but after 2 hours GoDaddy refunded the fee and deleted my GoDaddy account without notice. I had to email them to ask what was going on. They replied that they need the Paypal account holder to fax them a government identification document, like a passport.

We refuse. They’re not the police. We’ll never buy anything from them ever again.

Comments (2)

Status report

It’s been a long time since I’ve posted on this blog. Some people might be asking whether I’m still alive. You’re reading this right now, so that answers the question. :)

It’s been a while since I worked on my Ruby on Rails-related projects, saving memory by using copy-on-write and prepared statements support in ActiveRecord. They were on hold for a while since I’ve been pretty busy. Right now I’m having holidays, so I think I’ll start working on them in again in the coming few weeks.

I’ve also decided to finally release a program that I wrote, in the hope that they will be useful to someone. This is the System Daemon Manager, a tool for running any program as a daemon (background process without controlling terminal) on a Unix system. I’m using this to manage my Ruby on Rails Lighttpd processes on my server.
I’ve also written a new page for the Ruby Whirlpool library and imported it into a Subversion repository.

Comments

System Daemon Manager

The System Daemon Manager (SDM) is a tool for running any program as a daemon (background process without controlling terminal) on a Unix system.

  • Each daemon is given a name by the user. SDM will watch the daemon, and will allow you to stop the daemon (or check whether the daemon is still running) from any terminal by name.
  • SDM uses lock files to determine whether a daemon is running, so this avoids problems with stale pid files. The disadvantage is that the lock files may not reside on an NFS filesystem (since NFS doesn’t support lock files).
  • Finally, SDM can be run as any user, not just root. Of course, with SDM you can only stop daemons that are started by you. SDM itself doesn’t need root privileges.

Usage

An example will say probably more than words. In the following demonstration, we start gedit as a daemon:

[bash@localhost]$ sdm start my-fancy-gedit-daemon gedit ~/cool-file.txt

The second argument is the name for this daemon, and the other arguments are the program to start. gedit will now run as a daemon, so even if we close the terminal window (thereby sending a SIGHUP to all processes in the terminal), gedit will keep running.

We can check gedit’s status at any time:

[bash@localhost]$ sdm status my-fancy-gedit-daemon
PID: 14235

If we close gedit manually, and we run the ’status’ command again, then SDM will tell us that that daemon is not running:

[bash@localhost]$ sdm status my-fancy-gedit-daemon
Not running.

Finally, if the gedit daemon is running, then we can stop it with the following command:

[bash@localhost]$ sdm stop my-fancy-gedit-daemon

Download

You can get SDM through its Subversion repository:

svn checkout http://public.railsplugins.net/repos/sdm/trunk

Once you’ve checked out the source, you can install it with this command:

make install

SDM requires Perl 5.8 and the Time::HiRes module.

Comments (1)

Windows Update hosed my Windows!

Yesterday I ran Windows Update. It told me to restart the computer, but since it was late, I shutdown.

Today I booted Windows. AVG tells me that avgcc.dll is not a valid DLL. I started Internet Explorer - it froze when loading a page. I started MSN Messenger - it tells me shfolder.dll is not a valid DLL. Windows Update hosed my Windows installation! Upon analyses, it turns out that 6 more DLLs in my system32 folder are corrupted. I don’t even have the Windows installation CD - PC vendors don’t even provide them anymore these days, so I can’t reinstall Windows. Heck, this computer doesn’t even have a restoration partition. I eventually managed to restore the DLLs by asking others to send them to me.

Comments

Quote of the month

From “Welcome to the NHK”, episode 2. :)

And no, it’s not a fake. It’s not a bad translation either. Download the fansub yourself if you don’t believe me. :)

Comments

Congratulations Mike

Mike finished his final exams. Hiep hiep hoera!

Comments

The terror of “users”

OK, maybe “users” is the wrong word. I should say, “leechers”.

What am I talking about? I am talking about this Slashdot article, in which people complain that fixing the bug in CVS is not good enough for them. Before you mark me down as one of those “l33t elitist bastards who don’t have about users and should die and burn in hell” (like many Slashdotters apparently do to OSS developers), read on.

I’m an open source developer. I’m also a student. Right now I’m 4 weeks aways from my exams. I just spent 3 hours studying Management & Organization, for which I have to read about 100 pages per week. Other subjects I have to study for the upcoming exams are Linear Algebra and Basic Computer Science Models. One of the reasons why I write open source software is because I enjoy programming. I usually try very hard to make my software as easy-to-use as possible, even to nontechnical end users. In fact, the past few months I have spent hundreds of hours writing documentation for non-technical end users - documentation which is full of colors and screenshots to make it as easy to read as possible. When users have a serious problem I usually try to help them as much as I can, provided that I’m not too tired or busy or anything like that. And I do all this while I have very few time because of my study, for free.

Am I someone who don’t care about users? Would I have spent all that trouble writing documentation and making my software as friendly as possible, if I don’t? According to the Slashdot article, I apparently am. It is apparently a sin to ask users to see whether they can reproduce a bug in the CVS version.* It isn’t good enough for them to ask them to help me out a little bit. No, the leechers expect me to do all the hard work for them - to sacrifice my free time, for free. And apparently I’m a miserably failure if I don’t do exactly as they demand.

* Now, if you say that nontechnical users don’t know how to use CVS - that’s an entirely different issue (I spent lots of time writing user-friendly SVN instructions for non-technical users, but that’s besides the point). But what I’m talking about is the attitude of the leechers. They think “users” are god-like creatures who deserve to be worshipped by their slaves called “developers”. And money? No, we have to do all this for free. When we ask for money the leechers suddenly shut up and ignore your post, and go whining in another thread. They whine but are not willing to put their money where their mouth is.

Worse, they come up with threats like “if you don’t write top-quality bug-free user-friendly software for free, OSS will never succeed on the desktop!”, “my boss will forever see OSS projects broken amateur toys on SourceForge and you’ll never get a job in the IT field!”, “it your program is not user friendly then don’t release your crap at all!”.

What has the world become? What has become of manners? I’m giving a gift away for free, and I event spend my free time helping people, while I get no reward for it. And the leechers whine and whine. I have never heard of someone who receives a gift and then complains that it isn’t good enough and demands for a better gift. (Well… except maybe Paris Hilton who didn’t like the ring she received from her former fiancee ;)) But apparently the leechers think it’s normal when it comes to software.

But what about closed source software?

People complain all the time that OSS software is inferior to commercial/closed source software, claiming that paid professionals will even work on the boring parts of the program while the OSS hobbyists don’t. Well there’s a truth in that statement, but when you ask those very same people to pay OSS developers, they suddenly shut up and go happily back to whining next time there’s a similar article. And they think their expectation is justified because apparently you’re a god if you can’t write code.

And what about commercial open source software? People never think about that when they compare open source software to commercial software, even though there are many successful commercial open source software, such as Ximian/Novell’s Evolution and OpenOffice.org. Those people praise all commercial software for being user friendly (while critcizing open source software for being unfriendly), but for some reason that doesn’t apply to commercial open source software.

What about closed source freeware? Leechers seem to have completely forgotten about that. They whine all the time about abandoned/pre-alpha projects on SourceForge being an example of how open source software are generally crappy, and praise closed source software for being high quality, but don’t even mention the legion of crappy closed source freeware apps. In fact, hobbyist open source software is almost always better than hobbyist closed source freeware.

What about bad closed source software? Every closed source software has its own flaws and its own set of problems, and their users complain about them. But Slashdotters ignore that completely and act as if closed source software is always perfect.

As for the original issue (the complaint about the response “fixed in CVS”): apparently they’re OK with how closed source software authors deal with the issue. So why don’t we all close public access to CVS and tell them “the fix will be in the next version, and no you can’t get it earlier”, just like closed source authors do?

Comments (4)

« Previous entries