Depression

Walking to the parking lot after my Java class today, I was a little surprised the back lot was actually jam packed at 9:00 PM on a weekday. People are really making themselves stay ahead by taking classes these days at the UCSC Extension.

And seeing a parking lot full of nice cars made me feel a little dispirited about where I am in life. I dragged my sorry-ass self to the car, which isn’t even mine (a loaner from Michelle), which was probably the only car on the lot older than 10 years. I sighed, opened the car door, and slouched in the seat for 10 seconds reflecting on our troubles with the immigration, unemployment and life. But thankfully, as I thrust my left foot into the clutch and turned on the engine, the sounds of BBC News on NPR took my mind away from it all.

Coming home to Bryan cheered me up though. How can anyone stay depressed in the presence of little angels?

WordPress Upgrade, Finally

I finally have some spare time to upgrade my aging WordPress 1.5.x to 2.1. Good thing I waited till I really had the time to do it… because the upgrade literally punched a hole in time and sucked all that time out… The upgrade wasn’t terrible at all. The more tedious part was to get all the newer versions of plug-ins I use, test them and make sure none of them break anything. So far everything looks decent in Firefox.

I tried upgrading to 2.0 when it first came out. But it just blew up. So I figure anything with a “.1” in its version name should worth the time.

Now back to more urgent matters — Java and other stuff.

Notes on Java: Garbage Collection

One of the advantages that proponents of Java love about the language is garbage collection — the process in which JVM cleans up after your program is done partying and messing with your computer’s memory — free of charge. Th-unk you. Com’ again. Buh-bye.

Simplistically speaking, in comparison, C and C programmers typically need to clean up after themselves. The problem with that is, sometimes these parties get so wild that it makes the clean up afterwards impossible. That’s when “memory leaks” occur (ahem, Safari). The “parties”, of course, are the programs that rampage through your computer’s memory when they are having the time of their lives (which is not all that long). I mean, WHO likes cleaning up after parties, right? Think about it: Even if you try, there are bound to be spots where you just can’t get to or miss out from all the other cleaning you have to do YOURSELF. Java frees programmers from that headache by being in the business of memory salvation. Bless Java.

So here’s how it works… Whenever your Java program disposes something that it no longer cares for in your system memory, it’s considered trash, garbage, litter, junk, scrap, rubbish, Microsoft’s customers, whatever name suits your fancy, and is eligible for Java’s free garbage collection service. Did I mention enrollment is automatic, and it’s free? With small parties, Java only cleans up after your mess once in a while. But with parties in the size of Coldplay’s concerts, Java will do it a bit more frequently.

Well, I lied when I said it’s free. Com’on, nothing is free. You know that. Luckily, it costs in terms of system performance with all that bookkeeping and cleaning Java has to do. But it’s not really that bad if you consider the work Java’s done for you and the time and brain cells it saves you. I may be going out on a limb here, but I’d say the small performance hit your program suffers is well worth the price. And besides, with today’s qua-gazillion-megahertz computing power and memory availability, these performance hits are barely noticeable. It’s like being thrown at with a penny — of course it hurts. But just a little, and the pain only lasts long enough for you to realize that the sucker who threw the penny is now a penny poorer, and you are now a penny richer…

On a different note, the new Mac OSX Leopard is supposed to ship with a new version of Xcode that comes with garbage collection feature… Buh-bye, major memory leaks…

Dreaming in Code

Ever since I started prepping for the GRE, I’ve been somewhat lagged behind on my Java programming homework. So when I was done with the GRE, I feverishly tried to catch up by reading all the assigned sections in the book plus trying to program for the assignments. Maybe I am just not very bright… but it just takes me a while to pick up a new programming language in the beginning trying to orient myself in the new syntax and constructs.

Maybe it’s because of all the codes I’ve been reading, programming and tinkering with. For the past couple of nights, my dreams have been nothing short of me trying to solve some obscure programming problems in Java! How weird is that? The messed up part is, every line of code in the dream made sense!

Damn I need some rest and time away from Java…

OpenDNS Works!

I have a tendency on trying out new and untested technologies just to get a kick of having done it… at least among my geekier friends.

Today I decided to give OpenDNS a try. It’s a free DNS service that claims to surpass most ISP’s own DNS servers in terms of speed and reliability. And boy, that stuff really works! Now my page loads are noticeably faster and smoother (if that even makes sense). Actually, now that I am using OpenDNS, somehow Firefox is loading pages a bit faster as well, making it a lot more bearable as my full time browser of choice on my Mac.

I found out about OpenDNS from having used the founding partner’s other venture, EveryDNS. I put all of my domain names with them. In fact, I was so impressed with that service, I even donated some money to support the service.

Maybe I will give OpenDNS’s other venture, PhishTank, a try and see how that works. They have an API for other developers to use… I wonder what I can do with that…

Why I Ditched Opera (Again)

When Opera 9 came out, I decided to give Opera another shot. After all, it is among the most lightweight browser with one of the faster rendering speeds in the Mac universe. It also has something that most other browsers on Mac OSX lack, good memory control.

Unfortunately, after months of dedicated use, I’ve decided to switch again back to Firefox. Firefox is slower, but at least it’s reliable.

Here’s a list of the reasons I decided Opera still sucks on the Mac:

1. Unstable. And I don’t just mean that it crashes often, but some of its features simply work only sporadically. Take, for example, spell check works only some of the times. Other times (and usually when I needed it the most), the option is just grayed out, unavailable for use. Restarting the browser usually fixes the problem but not always.

2. Weird bugs. This is kind of an extension of the first problem… There are some bugs that show up for no reason; and then they just go away automatically. One of them has to do with clickable links. Sometimes links simply become unclickable for no apparent reason. This is extremely annoying.

3. Not so good ad blocker. In terms of ad blocking, I think Firefox, coupled with GreaseMonkey and Adblock Plus, is still the king — they block out 99% of all my unwanted ads, including those inline underlined ads. Opera has a nice implementation. Unfortunately the execution is still pretty behind in comparison to Firefox. One time it blocked out ALL of the images on Apple Store page, which kind of freaked me out for a second.

4. Opera is still not accepted by some unfriendly sites such as Peerflix. That means I’d have to fire up another browser just to browse those sites and quit again.

Yeah, I know. Four reasons don’t seem like a big deal. But the first 2 reasons alone have annoyed me for a pretty long time. And today when the spell check refused to work again, it was the last draw for me — Opera had to go.

So I am back on the sluggish Firefox. I read the next version is going to be optimized for OSX for sheer speed. I can’t wait!!

GRE Test Nazis

I finally got GRE out of the way yesterday. The whole damn exam lasted just a little under four hours. While the experience wasn’t terribly exhausting, I definitely didn’t enjoy it, espcially when the test center was more or less a exam concentration camp…

Let me explain why… First of all, I had to read a piece of paper with a bunch of disclaimers. Then they made me write, word for word, a long ass statement on I was who I claimed I was and that I would keep all parts of the exam confidential… blah blah. Then I had to sign the damn thing, read the back of the paper (yes, yet more disclaimers) and turn in the paperwork.

Then I had to literally empty out EVERYTHING in my pockets and lock them up in a locker (thankfully it’s free). When I said everything, I meant, EVERYTHING! They wouldn’t even let me keep my chapstick… But damn it, I needed to have moist lips to work properly…

During my 10-minute break after the Issues and Arguments essay, I asked if I could take off my wriest watch and leave it on the desk so that I could keep track of the time. But nooooooo.

So isn’t that just like some kind of concentration camp or what? 😉

I am not too happy with the results of the exam… And then after talking to my cousin, I realized my scores still have room for improvement.

Maybe I’ll have to take it again in March…

Did I mention I hate taking GRE?

A Statistic on Programmers

The instructor from my Java class today revealed a shocking statistic today on us programmer types — on average, a programmer writes less than 10 lines of code each hour.

I hope the management-types never find this out…

Quick. Here’s a multiple choice question:

The statement above infers that programmers are:
a. slackers
b. taken for granted
c. earning more per hour while doing less work
d. inefficient
e. masters of disguise

NOTE: Sorry… I’ve been cramming too hard on the GRE; now everything I see is composed of multiple choices. Did I mention I hate studying for crappy and useless exams like SAT, GRE, GMAT and the like?

Some Tips on Using Roomba Discovery

That Roomba I got for Grace is really one excellent toy, err, cleaning machine… The first day we put it to work, I emptied 4 full cartridges of dirt plus other crap. And this morning I sent it to “spot clean” the area rug for several cycles, and it again found stuff that’s not visible to the eye — 4 more cartridges of them!

After observing it for a couple of days, I’ve got some tips to share:

Roomba no like cables. Cables no Roomba friend.
Generally Roomba knows how to get out of stationary flat cables. But sometimes it does get trapped if a smaller and looser cable entangles Roomba’s bumper. Just get cables out of the way by wall mounting them or hide them from Roomba.

Roomba no like lightweight area rugs.
While Rooma does an excellent job on “heavier” and bigger area rugs, those small area rugs will trip Roomba. And Roomba, when trapped, will complain and try to get out of it by engaging in an interesting escape routine. But it doesn’t always get out of it successfully. So move those small area rugs out of the way so you don’t have to worry about rescuing your Roomba later.

Roomba smart. Roomba escape from tight spaces no problem.
I’ve watched my Roomba wander into pretty tight spaces and still manage to get out just fine. But it’s still a good idea to give it enough room to at least get in and out of a tight spot.

Rooma need help, Roomba yell.
When Roomba is acting funny, make sure you empty the cartridge AND check the cleaning brushes. My Roomba stopped in the middle of the room one time on full power with an orange status light on and beeped twice; I couldn’t figure out what was wrong with it. It turned out that it’d choked on a small piece of wine cork I’d cut up to raise the height of some furniture (so that it can go under and clean).

Roomba no like too much animal hair on carpet.
With two cats at home, the carpet is a magnet for animal hair and dander. It’s a good idea to use “spot clean” to really really clean out the carpet for the first few times. The lesson here is, for each spot clean, empty out the cartridge and clean the wheels (as well as within the Roomba itself) before the next cycle. Or else when the cartridge bin is full, Roomba will regurgitate some of that hair, leaving a track of “processed” hair behind it… Not a good sight…

Make cleaning easy for Rooma.
Some people (ahem, Chee, ahem, hoi..) complain that using Roomba is almost the same as vacuuming manually since one still has to lift things/furniture to get under them. But I beg the differ. The whole point of having a “robot” is so that it frees up my time to do other stuff. What I do is, I lift/move all possible obstacles out of Roomba’s way and let it do its job. True it takes a little effort still, but what house chore doesn’t? What I did was, I watched how Roomba cleans and how its cleaning routines work for the first few sessions, then I either modify how I place my things on the floor or change the way they are stored. And I give Roomba enough clearance under certain furniture so it can get all the dirt out. And it’s a good idea to watch how Roomba works for the first few times because then you get to see how Roomba may get into trouble or if it’s able to get out of certain traps (i.e. cables).

Roomba is no human.
Be realistic. Don’t expect Roomba to get to places that are smaller than its own size. There’s just no way Roomba will be able to get to certain corners or spots. Knowing that, it’s just a matter of cleaning after Roomba when it’s done. Not a big deal.

Funny backup sound.
When Roomba is at its charging station, by pressing on the “clean” button, something funny happens: Roomba makes a beeping sound while it’s backing out of the charging station as if it’s an heavy equipment or a large truck. It’s really cute and shows how its geeky creators do have a sense of humor.

One thing that’s really interesting to watch Roomba do is when it looks for and docks with its charging station. It reminds me of one of those sci-fi movies on how space stations dock. When docking is successful, Roomba turns itself off and flashes the power button, signally that it is being charged. On the charging station, an extra light goes on just like in the movies! Sweet!

Polluting to Wealth

A few weeks ago the local KQED station broadcasted a series of very interesting PBS special called China from the Inside. As China rises in power and fortune, it’s environmental problems are also starting to reveal the ugly side of this unprecedented growth of the “sleeping dragon”. PBS says it best, “wealth touches some, but pollution touches all.”

Seeing the documentary made depressed about just how in the hell is the world going to be able to sustain this kind of craziness for another 5,000 years (how old we think “civilization is). And the fact that powerful and biggest pollution contributors like the U.S. resists changes and denies facing such problems only makes it that much harder for the human race to move forward. Sometimes I feel embarrassed thinking about just what a terrible condition we are leaving this world to our children…

Java Kicking My Ass

My excitment over Java waned a bit after having my butt kicked by all the syntax differences. What comes natural to me in PHP takes a bit of fiddling in Java not knowing all the “right” ways to do things. Digging through Java documentation is slightly useless for me at this point since I am still trying to get used to how everything works and fits together.

Since this is as close to formal programming training as I’ll get, I found some of the brain teaser questions on some homework problems more challenging to figure out since I am really not a “left brain” kind of guy (which is why I have two art degrees in the first place). When it comes to slightly complicated if/else statements or for, sometimes my brain just locks up, and I get “writer’s block” for coders… The assignment on writing a “Bubble Sort” messed me up quite a bit before I could immerse myself in how it should be coded… I think Alex got annoyed a few times after the 100th time I asked him how something trivial works in Java… But really, my brain completely went on a strike…

I still got one last problem on writing a “Magic Square” class on the assignment… Hopefully I can complete that in time for class on Tuesday.