Got a new laptop

Christmass gift for myself :) Sony VAIO laptop

sonylaptop1

Specs

processor: 2.26ghz Intel Core2 Duo
display: LCD widescreen display with XBRITE-ECO technology (1600 x 900 resolution)
screen size: 16.4″
system bus: 1066MHz
cache memory: 3MB on die Level 2
RAM: 4GB PC2-6400
hard drive: 320gb
optical drive: Double-layer DVD RW/Blu-ray Disc/CD-RW
weight: 6.4 lbs

Continue reading

Java: static declaration of collection

I don’t know if this is a new feature in Java 5 that I did not know before or I just did not know this is possible in Java. But I learned today that you can do static declaration of collection types as below:

public static List supportedCopyPropertyTypes = new ArrayList() {
		private static final long serialVersionUID = 660145948432567403L;
		{
			add("String");
			add("BigDecimal");
			add("int");
		}
	};

Eclipse run java code easily

Eclipse has a scrapbook function that allows you to run Java code on the fly. Sometimes you just want to test out a simple piece of code without having to create another Java class, execute it in the main method or create a junit to test it out.

For example, today I wanted to make sure I remember integer division in Java correctly. So I simply just want to execute the following piece of code.

int a = 10;
int b = 8;
int c = 17;
System.out.println(a / b);
System.out.println(c / b);

In order to do that, create a new Scrapbook page in your project.

  • Right click project -> New -> Other… (or CTRL+N)
  • Search “scrapbook”
  • Create a new scrapbook page. I just called mine blah.jpage.
  • Then paste the code in there. Highlight the code, right click and select execute or ctrl+U. The results of your execution will then show up in the console. That comes in pretty handy sometimes.

Eclipse Scrapbook

Pom Backpack

Thank you gimmekittens so much for bring this to my attention.

Awwww, isn’t that kee-yoot? That lady’s got one of those novelty backpacks …
Pom Backpack 1
… you know, the kind that look just like a … just like a …
Pom Backpack 2
a … a …
Pom Backpack 3
I’m speechless.

Although I’m afraid neither of my pom would like that. Maybe Bubo wouldn’t mind. I know Misty would hate it to death. Still so freaking adorable!

Just joined facebook

OK, I just signed up facebook. ADD ME IF YOU KNOW ME? I know it’s so late and it’s pathetic. But I’m not that much into all the online communities. I tend to stay inactive. But I’m really excited that I was able to find a few lost connections from high school and college on facebook. Maybe I will stay on there longer now :)

Upside down text with CSS

It’s actually possible to print text upside down using a simple CSS property and works cross-browser today. The property to use is “text-gravity” with a value of “inverse”.

<span style="text-gravity:inverse">
write upside down text
</span>

… and this is the result:
ʇxǝʇ uʍop ǝpısdn ǝʇıɹʍ

I’m really surprised to learn that so few people know about this property, and I recommend you to continue reading the W3C specification of text-gravity.

Update: Sorry, I lied :) The above is done with a UTF-8 character generator (see the link the the “specification” above). Amazingly, you can find that most characters have their upside down equivalent somewhere else in the huge Unicode alphabet. Neat trick :) Here’s another site that does the same thing.