Swap without Temporary Variable
Filed in Programming, April 30, 2008, 12:47 pmWhen 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
Filed in Discovery, April 27, 2008, 9:38 pmProblem: 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
Filed in Linux, Programming, , 4:21 amUpdate 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)
Filed in Linux, April 26, 2008, 8:55 pmIf 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
Filed in Personal, April 25, 2008, 11:29 pmEverybody 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
Filed in Linux, , 2:32 amThis 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!
Filed in Discovery, Web, April 16, 2008, 11:13 pmYes, it’s BACK! We’d waited for so long.
There is a bug, Gnome…
Filed in Linux, April 9, 2008, 6:39 pmYou 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?
Filed in Discovery, Web, April 2, 2008, 7:06 pmUpdate: 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 [...]