Swap without Temporary Variable

When we’re programming, if we want to swap values of two integer values, the “normal” way we do it would look like:

x = 5
y = 3
 
temp = x
x = y
y = temp

We need a temporary variable as a container to hold a value first then do the swap.
What if in some situation you can’t use [...]


A Math Problem and the Answer

Problem: Two prime numbers (>=5) and there are one and only one number between them, such as (5, 7), (11, 13), (17, 19), etc.. Prove the sum of such two prime numbers can always be divided by 6.
Answer: All the natural numbers can be expressed as 6n+0, 6n+1, 6n+2, 6n+3, 6n+4, 6n+5, n >= 0. [...]


Solution to Lenovo Y410 Sound Problem On Ubuntu 8.04

Update 30/04: This script will only make speaker work, but not headphone. As Sam mentioned, there is another easy way to get sound work without installing anything: Suspend your machine and resume. The drawback is you have to do it every time after you (re)boot.
Well, this is another post about Ubuntu 8.04!
As I mentioned before, [...]


How to Play Rmvb Files In Ubuntu 8.04 (Hardy Heron)

If you experienced this topic earlier, you know that it’s tough to solve. Playing Real video format files (e.g. rmvb files) is still a problem in Ubuntu 8.04, but don’t worry, it’s now much easier than before.
So, here we go:

Follow the official instruction to install all the restricted formats:

sudo apt-get install ubuntu-restricted-extras

Install MPlayer:

sudo apt-get install [...]


Huge Mistake

Everybody is recommending everybody to upgrade to Wordpress 2.5.1, and I did, but I made a huge mistake during the process:
I deleted the uploads directory! All my blog images were located there and the even worse situation was that I didn’t have any backup of those images…
Anyways, if you cannot see those pictures in my [...]


Hardy Heron

This post is composed under Ubuntu 8.04 — Hardy Heron.
I installed Hardy in my Lenovo Y410 half an hour ago. Most hardware (monitor, video card, wireless card, wireless mouse, webcam, etc.) work out of box, but like 7.10, the sound card still requires some efforts to make it work. In software, Gimp is upgraded to [...]


Demonoid.com Is Back!

Yes, it’s BACK! We’d waited for so long.


ABCDEFG & GFEDCBA

via: jandan.net


There is a bug, Gnome…

You might also hear about that Flickr added a feature for uploading videos.
Cool, so I attempted to try it out, but…
When I clicked the “Choose photos and videos” link in the upload page, I got a very long and very ugly popup window in Gnome! See below:
IMAGE IS MISSING, SORRY!
You can tell even just from [...]


Checkbox! For what?

Update: tombyong informed me that those checkboxes were gone about 2.5 hours after this post. Thanks, tombyong!
When I logged in my iGoogle today, I immediately spotted a change in the Gmail gadget: There is a checkbox sitting beside each Email title!
IMAGE IS MISSING, SORRY!
When I saw these checkboxes, I thought the Gmail gadget would finally [...]