Archive for the 'Coding' Category

What Have I Been Doing?

August 5th, 2008

It’s been a really long time since my last post. Just haven’t had the urge to blog these days. It’s getting really busy at work with a bunch of different projects. That probably adds to my laziness when I get off work.

No, I’m just kidding. I’ve been doing quite a bit in the past little while actually. Aside from the regular house cleaning and cooking tasks, Ams’ and I have started planning our wedding. We even set up a little wedding blog for it!

You might notice the wedding blog is a Django site (so says the little button at the bottom). It’s coded by yours truly, Mr. Jack Hsu. I’ve actually released the code on Google Code with the New BSD License. So if you have Django running somewhere and wanna check out the blog app, please feel free to do so. It’s still a work in progress, and I’ve been working hard the last week or so to get the code ready for public consumption. The documentation is coming along as well!

I <3 Django!

Javascript is a Programming Language

April 22nd, 2008

I’ve come across a few individuals who still think that Javascript – or ECMAScript — isn’t a real programming language. For example, on Facebook, there is a group called I forgot the semi-colon, which is a programming group, and in the group info it says the group isn’t for anyone who thinks Javascript is a programming language. The problem is that a lot of these so-called “programmers” think of the web as just another view for which applications written in something like Java would “dump” their data into. The is a completely wrong way of thinking about the Web, and people who think this way will never become successful developing for the Web.

Javascript is used in many places outside of the browser. It is used to develop many feature-rich applications on the Web, and a large part of the Firefox GUI is written in Javascript. Not to mention all those Dashboard Widgets you Mac users like, yep, all in Javascript.

The thing I love about Javascript is that it is flexible. Unlike languages such as Java or C++, Javascript variables are dynamically typed (like Python). This means I can define a variable and initialize it to a string, then later on assign an integer or an object to the same variable without getting some kind of incompatible type errors. You can use structural programming, functional programming, or object-oriented programming in Javascript. This allows you to choose what best fits the current application you’re developing without being restricted to one particular programming paradigm.

So for anyone who thinks Javascript isn’t a real programming language, please tell me why.

Greasemonkey: Facebook Poke All

February 14th, 2008

Firefox only!

I just finished writing my own Poke All script for Greasemonkey. Using it ispretty straight-forward, I basically added a single button you can use to poke everyone that has poked you. After everyone has been poke, a “close” link appears next to the Pokes header. Clicking this link will close the entire section — with a nice animation too!

You can get the script here. Or if you don’t have Greasemonkey for Firefox, you can install the Poke all Firefox extension I compiled using this compiler — just save it to disk and drag-and-drop it into Firefox, and choose to install.

Poke all button

Done poking!

Visit the script’s page on Userscripts.

Websites I Visit at Work

February 13th, 2008

If you work as a programmer then you know as well as anyone that you just can’t work so many hours in a row. For myself, I usually have to take a break after 2-3 hours of working max. Programming takes tremendous amounts of brain power, so have to take a breather every once in a while. I spent most of my free time reading blog posts, and I find it easier to use an RSS reader so you only have to go to one place to get all your blog-reading fix. I personally prefer using Bloglines, their interface is great — especially the new beta version. Another good choice is Google Reader, which you can actually incorporate into your iGoogle portal page. There are many others out there, so find one your like and use it. Now for the good part. :)

I’m gonna list the blogs I frequent the most, ordered by my visiting frequency.

  1. Lifehacker: Hands down my favourite website to read. You get “tech tricks, tips and downloads for getting things done.” Some tips require a more technical-minded reader, but overall the instructions are pretty straightforward. This is IMO the #1 website to increase your productivity in life.
  2. Racialicious: A blog dealing with racial issues in the US. Although the focus is mainly on American issues, most of it applies to Canada too. And it’s always good to know what’s going on in our neighbour south of the border.
  3. Slashdot: News for nerds, stuff that matters. This is purely a geek site, so if you’re not “into” the whole geek thing maybe you shouldn’t visit ;). It many topics, including gaming, new technologies, and politics. I find that I skip over most of the stories, but there are some great ones on there. Be sure to check out the comments too, I actually enjoy reading those over the actual articles themselves a lot of the times — RTFA!
  4. Gizmodo: A website dedicated to gadgets. I think that pretty much says it all. It’s a place I go to, to see all the cool, shiny gadgets that I probably wouldn’t be buying. Did I mention they’re shiny?
  5. Coding Horror: A must-read for an programmers. Jeff Atwood writes about coding horrors that programmers create, aka the “human factors.” He provides great insight into many problems, including ones that seem trivial at first glance, like writing an algorithm to shuffling a deck of cards.
  6. Joel on Software: Joel is one of the most well-known programmers out there. He heads Fog Creek, the company that makes FogBugz. The must-read post is his talk on Computer Science and Software Engineering that he gave at Yale (parts 2 and 3 too!).
  7. Ajaxian: Probably the best blog to read for any developers working with Javascript, and of course Ajax (as the name suggests).
  8. RedFlagDeals: Deals on many different products for the Canadian buyers. They have have many deals added everyday, including deals on many electronic products.
  9. The Daily WTF: Readers submit their WTF stories working in the tech industry. Mainly just for laughs.

All of the above sites provide RSS feeds, so you can subscribe to them using your favourite RSS reader.

More Greasemonkey+Stylish Goodness

February 1st, 2008

I took a little time styling my del.icio.us page (well, actually it’s the whole site in general). I got tired of the plain fugly layout. Although I didn’t change too much besides the colours, I think it’s more pleasing on the eyes. I also used Greasemonkey to change the background colours on the “save by x other people” based on the number of people that save it. The original background color was too light IMO, and makes the text hard to read.

I also prefixed the active tag with “{{”, and appended “}}” to the end of it. If find this styling more visually pleasing, and more obvious than the original “!” in front of it. I also hid the “!” using Greasemonkey since it also got the same styling as the active tag.

(more…)