Wednesday, December 16, 2009

I'm afraid that I'll become too complacent as a developer, and that I'd become too entrenched in a certain methodology, paradigm or language and that I'd be unable to learn new things.

Coming from a OOP background, functional programming sounds interesting, but scary at the same time.

I tend to do things instinctively, which can be useful, but it also means that I don't learn things by the concepts - which tends to be a problem when you're trying to learn more.

Thursday, December 10, 2009

Tuesday, December 1, 2009

DAMNIT PEOPLE, PUTTING AUTOMATIC AUDIO ON YOUR WEBSITES IS A HORRIBLE, HORRIBLE IDEA PUNISHABLE BY DEATH.

Sunday, November 22, 2009

OOo

Alright - OpenOffice. Love it and it probably works well, and it's LGPL'd!

But - KISS. Seriously, I don't need bleeding Spanish or French dictionaries!

Don't get me wrong, I think OOo is a great idea (haven't given it a test-run), but it's just that I have insane high expectations of it.

Sunday, November 15, 2009

Array Indices

http://xkcd.com/163/

Saturday, November 7, 2009

http://www.geekherocomic.com

XKCD was good, but this - I nearly pissed myself laughing.

Tuesday, October 27, 2009

jQuery gestures

http://friggeri.net/blog/2008/12/21/jquery-gestures. Check it out.

Sunday, October 18, 2009

Monday, August 31, 2009

Pointers?

I find this hilarious - http://xkcd.com/138/

Sunday, August 23, 2009

http://xkcd.com/627/

A-fuckin-men.

Tuesday, June 23, 2009

google.com.sg (Singapore version of Google) = Malay language.
Fail.

Tuesday, June 16, 2009

Functions are a godsend.

One should use them as much as possible.

Something, however, that gets sacrificed for speed of coding. I swear, I'll never touch this project with a ten-foot pole after I'm done with it.

Monday, May 25, 2009

I think I might have busted my laptop's fan - it now only works in an air-conditioned room.

Being a mainly software guy, it's interesting to have hardware problems pop up. (And frustrating too!)

Thursday, May 21, 2009

Finally did something useful with bluetooth - syncing my handphone with Google Calendar.

Monday, May 4, 2009

I've just left my handphone for the last hour pointed at my door connected to the laptop running motion-detection software. Shit I pretty much used all my handphone battery in one and a half hour.

Note to self : Don't do something so stupid again - be green!
For those who don't know - my laptop doesn't come with an integrated Bluetooth adapter unfortunately ):

One of my modules this semester involve building handphone apps, so I figured that was the perfect excuse to get a dongle (yes, I need justification to buy a SGD20 tech toy). Sides, I could play around with the wiimote too :D

So, went out and got it. I was expecting to play around with the wiimote alot, and simply uploading files onto the handphone to test. Well.

I ended up messing with bluetooth drivers for the laptop, started messing around with Symbian developer certificates (now that was a toughie), started messing about with getting my laptop to work as a gateway for the phone (Symbian S60v3, for those who are wondering).

Then I ended up getting the phone to work as a webcam using the inbuilt camera - all while messing around with COM ports.

And I probably ain't gonna NEED any of these stuff.

On the other hand - I can probably hook up my handphone to my laptop to act as a webcam, then stream that video feed to my handphone.

Or not.

Wednesday, April 22, 2009

Holyshit Java supports scripting!

In other words - we can embed Javascript in Java. I don't know the implications of it as of yet, but it sounds very, very interesting.

Sunday, April 19, 2009

God.

Question - is there a need to impose a certain IDE?

Thursday, April 2, 2009

Variable functions with variable variables.

Was playing around with the idea - came out with this. Try reading it and figuring out what it does.

function test($string)
{
print($string);
}
$bar = "test";
$foo = "bar";
$string = "foo";
$$$string("bla");
?>

Output : bla

Essentially, what we're doing is this : I give up explaning. But it's using variable variables to call a variable function. $$$string calls $$foo which calls $bar("bla")
$$($string) = $$foo
$($foo) = $bar
$bar = test("bla")

You get the point.
Sheer awesomeness - although this is a horrible example.

Tuesday, March 24, 2009

And lo and behold, googling variable functions dug up another gem of PHP, variable variables.
Been working with PHP to build a small scale website - it's a refreshing change from ASP.net, and so happens to be the first programming language I ever learnt. Pretty interesting - given how I've been weaned to programming by Java, the differences between PHP and Java makes it an interesting experience (I'm repeating myself).

PHP is very strict on case-sensitivity, so.
Java is pretty strict as it is - classnames, methodnames, variables must be in the same case. PHP goes one up - array keys are also case sensitive. Coupled with the fact that I was working with a MySQL database (which is not case-sensitive at all) made for a frustrating bug-tracking session. (Live and learn eh?)

But the most interesting thing I stumbled upon is (*drumroll*) variable functions.
This is perfectly legal PHP -
function foo($string)
{
    print($string);
}
$func = "foo";
$func("bar");
?>
and it outputs "bar".

Essentially, you can put a function name as a string, and execute it by calling the variable and parenthesis. (It doesn't work with language constructs like echo or print, which is why $func = "echo";$func("bar"); doesn't work).

Now that could prove very very VERY useful. How so?
Imagine that you have to sanitize input, and you have three methods to do so, checkInt,checkStr and checkBool.

Normally you would call it as such :
if($type == "Str")
checkStr($str);
elseif($type == "Int")
checkInt($str);
else
checkBool($str);

Now, variable declarations allow you to do this :
$method = "check".$type;
$method($str);

See how much easier it is? (I haven't tested the above code, but I'm pretty sure it'll work).

Variable functions are really really interesting :D

Saturday, March 14, 2009

IT Fair 2009 today. Was packed to the gills. Boy.

And it's a preeety weird experience when you probably know more about the product's domain than the salesmen.

I've been shopping for 802.11n residential routers (cum ap cum switch. You get the point), and DD-WRT (http://www.dd-wrt.com/dd-wrtv3/index.php) support is pretty high up on my list of requirements.

Problem is, everywhere I go, I ask about DD-WRT support, and none of the salesmen has ever heard of it.

Sigh.

Was at a major technology supermarket previously, shopping for said 802.11n router (cum ap cum switch), and I wasn't sure about DD-WRT support. So, didn't purchase said router, but I did note down model and price.

Couple months later (ie. today), IT fair. Thought it was a perfect opportunity to get router so I went. Did some research on it. Thought the WRT160n was a safe bet - googling indicated that it did indeed, support DD-WRT (which was great, given that I wanted to bridge it with an existing router).

Went out, checked with the salesman(guy?). Couldn't be a day past 20 - probably a teenager during his holidays. But I digress. Checked with him about DD-WRT, didn't have a clue. Asked him about WDS (Wireless Distribution System), didn't have a clue, went somewhere to check. Came back and said yes.

So I got the router.

Went home, started setting it up, downloaded DD-WRT in anticipation, when I noticed that v1 and v1.1 of the 160n supports DD-WRT, whereas v2 does not. Looked under the router and naturally it was a v2. No luck for any custom firmware at the moment. Apparently they switched the broadcom with ralink chips. In fact, it looks like the CUT the specs on the v2. And guess what? There is no way to differentiate between the v1s from the v2s from the box, you have to open the boxes to differentiate the two.

Sigh. (At this moment I'm getting pretty dissapointed by Linksys products. First the WRE54g was a PITA to setup, then it was a PITA to configure and gave tonnes of problems while halving bandwith. Which was the whole point of the 160n - to get rid of the WRE and connect straight to the router.)

Alright, end of Linksys rant. (Note to self, do SERIOUS research before buying any more Linksys products).

Oh and, the router naturally didn't have WDS.

I hate salesmen. Those who don't know their stuff are pretty bad, but excusable. Those who try to lie their way through just to make a sale makes me pissed off.

Case in point : Was looking for a external portable harddisk for my laptop. Walked around a little, spotted the Western Digital booth. Wanted a harddisk with FireWire as speed was paramount for me. So.

Apparently the only portable harddisk that supported FireWire was the My Passport for Mac. I wanted that FireWire, so I checked with the staff.
"Oh hi, I was wondering, for the Mac version of My Passport, is it possible to actually format the harddisk so that I can use it in Windows?"
"Oh no, sorry."
"Why not?"
"OH YA YA can!"
Rinse and repeat for THREE salesmen/women who did the exact same thing. First query, not possible. Inquire more deeply and suddenly it's possible. And they didn't offer any explanation at all. I was the one who was asking them if I could actually format it from the HFS+ file system to NTFS. I'm willing to bet that they haven't even heard of these.

Geez, if you don't know, just say so. Don't fake it for the point of making a sale.

Naturally, I didn't get any harddisks.

And by the way, had I gotten the My Passport for Mac, I would have used my sis's MacBook Pro to format it to NTFS, then enjoy 320gb of storage space in all it's FireWire glory. Oh I just remembered. One of the salesmen actually tried discouraging me from getting the My Passport for Mac, and tried to get me to get the normal version (ie. Windows, non-FireWire version). The non-Mac one was $119 while the Mac one was 199. I didn't mind the price difference.
He said, and I quote : "Actually, why not get the other version? It's a price difference of 80 dollars, and FireWire is only 5-10 times faster than USB2.0, not worth it." *arches eyebrows*

Which brings me back to the point - it's pretty interesting, and somewhat frustrating when you know more about the product domain than the salesperson does.

Thursday, February 19, 2009

My dreams are either psychic or 802.11a/b/g compatible.

Sunday, February 15, 2009

Thursday, January 29, 2009

3 gigs 0f RAM rules.

Alt tabbing between SWAT 4 and Chrome is instant :D
And I have iTunes and Word open.

No swap used.

Friday, January 23, 2009

Okay, this is not going to be an IT post per-se.

But.

MICROSOFT IS SHUTTING DOWN ACES?
The team that created Microsoft Flight Simulator?! (Train Sim too,but still.)

):

ESP looks interesting though.

Sunday, January 11, 2009

Raytracing

As quoted from Wikipedia, "Ray tracing is a technique for generating an image by tracing the path of light through pixels in a image plane."

In essence, you generate a ray for each pixel from the view point, then send it out to the world and then check for any collisions. Once there is a collision, generate another ray recursively to track the reflected/refracted ray.

Works perfect for translucent and shiny objects (reflection/refraction). Photorealistic images too!

Looks fun :D