Archive for the 'Computers' Category

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.

Every Programmer Shall Have Admin Access

April 3rd, 2008

Everyone in my team at work (Front End developers) just got administrative access to their PC today. It’s ridiculous to thing about working as a programmer and not have the rights to install things, but that’s what we had. This got me thinking about the post on The Programmer’s Bill of Rights over at Coding Horror. I went and had a quick look to see if it mentioned admin access. To my surprise the post said nothing about such thing. Maybe it’s just too stupid to even mention not having admin access? Or was I spoiled during all my co-op terms?

In any case, giving programmer the right to do their work properly is very important, and it should definitely be include in our bill of rights. ;)

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…)

Greasemonkey and Stylish to control webpages

January 26th, 2008

I finally got around to installing Greasemonkey and Stylish for my Firefox. For those that don’t know, Greasemonkey is an extension that allows you to run custom Javascript scripts for pages that render in your browser. Stylish is basically the same thing, but for CSS not Javascript.

I haven’t gotten around to doing anything with Greasemonkey yet, but I’m pretty sure a week from now I’ll have a bunch of scripts running. :P The very first thing I did with Stylish is to hide all ads on the website. I think the social ads was a horrible idea for facebook. I’m so tired of seeing an ad in my newsfeed that tells me so and so is a fan of x and y. This little script below will eradicate all known ads on facebook!

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain(”facebook.com”) {

#ad_0, #ad_1, #ad_2, #ad_3, #ad_4,
#ad_5, #ad_6, #ad_7, #ad_8, #ad_9,
#ssponsor, .advert, .ad_body,
.ad_capsule, .ad_media,
.comments_ad_image, .sponsors,
.sponsor_absolute, .social_ad,
#new_stuff_content, .nextstep { display:none !important; }

}

Quick and dirty does it! Goodbye facebook ads!

Happy Birthday to Knuth!

January 14th, 2008

This is a late entry, but I was in Waterloo over the weekend so I’m just getting to this now. :)

It was Donald Knuth’s 70th birthday this past Thursday (January 10th). Anyone who studied Computer Science will probably already know who Knuth is. He is the author of one of the most important book in CS, The Art of Computer Programming. In this book, Knuth covers algorithms stretching from sorting and searching, to graphs and networks. He is also the person who popularized the beloved big-O notation that we use in algorithm analysis.

The field of Computer Science would not be the same without Knuth, so here’s to a happy belated 70th birthday! :)

Bill Gates’ last days at Microsoft from CES 2008

January 7th, 2008

Proof that Bill Gates is cooler than Steve Jobs!

Okay, that was a joke so don’t flame me. But the video was pretty damn funny, and shows that Bill isn’t afraid to embrace his geekiness.


Video: Bill Gates Last Day CES Clip

Navigate Google search results via keyboard shortcuts

November 29th, 2007

I was browser around on lifehack today and found this entry for Google Experimental’s keyboard shortcuts. Of particular interest if the comment left Davosian that gives a way of adding the keyboard shortcut to your Firefox search bar.

From the post:

I added a new search engine to Firefox’s top right search field by adding the following xml file to

C:\Documents and Settings\[YOURUSERNAME]\Application Data\Mozilla\Firefox\Profiles\[YOURPROFILENAME]\searchplugins:

—– googleext.xml start ————
<SearchPlugin xmlns=”http://www.mozilla.org/2006/browser/search/”>
<ShortName>Google Exp</ShortName>
<Description>Google Experimental Search</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width=”16″ height=”16″>data:image/x-icon;base64,R0lGODlhEAAQAPfLAAATVikwdA8SnxUfgAsWpAAilholjxw4jBc7kwAlvQQ2sRMsoBUqqhMzuhY/vxw4tSgmiyM1mSUztiQ6sTE3sQ4qyxMxxRoyxiAuxR1CtBxJsBxasSJuuTFguBte0Rlf2xVc9h9W9xVjzxVr0gdj6BRh4R1o5yBcyiZbyydT1i9b2Ddb1iFY6CJg2Vpor1dzvEJu20Z0yi23QDy1REi2OUy0O1WzOVC4PU+tVUe5Sk2xQU2zRUO4UE21Ula2SmKEqWWF2HyPx2+a6X6e6Xqk1m+s78sUDs4UGdEQB9YfDdwaANEfHd0YEscjAM4mAM0qANIoD9IkGdslGswuItYgL4aP0ImP2YGZ36Opzaq2wq/S+rzX/7/e8MrS1MLO/sTb48rT8snX/83c89PZ+crq+cH1/9Dl/9Ln/93r/9fy/+Hf7P/42eDm/O7u/+T29uX2/eT2/+f4/+f5/+j/9u//8+3/9u7/9ur5/+j//+n//+v//u3//+7//e7//+////b66/T/6vX/6/f/7f/07fj/4fv/4Pj/5v/45v7/4/r+7/3/6fDw+Pfx//D/9/X/8fT/8/f/8ff/8/D///H///L8/fL///P///X7//b6/ff/+/T///b9//f///v19//w9v/09P/29v/x+f/y///z///1+v/1///2///3//j79P/58/z/8/z99/z/9v7/9P7/9vn7//v6//j9//n9//j///n///v//vv////4+v/5+//6+P/4///6/P/6/v/6///7///9+P/8+v/9+v7/+Pz////8/f/9/f79///8///9//7//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAMsALAAAAAAQABAAAAj/AEn4oIFjBw8bOnrMuJGjhowZM1T8UdYJUZ5ZcNRYWjSrVK5QU0DMmtUnzRAXEy4o6FCEy6NDTkQIq1MmRgM0eZTlCXMgQJtRSE4gmgUkwh1EiZTNUiamy6NUUExcuoJgDCdDjQg9KgVL2SNFT1hwEvKglLBWuixZ+jSrlSBdRlL04bBBkTBdpZTpIqWsFaBcTEr0QaEhl6dWlswKW6poDRUPlmAUQKWMkTJLc76QMQNGUZMWgIgkCFJnlq5WXigwkFClVZQQyuRgELAlk7JBymCZGYAF0ZEPrQixgUDAihxVdPpoAZAFUZIRfThxgvPCwAILDipk+OFG2ZIVoxApERtPfvwlvZ+kQFzPvv0MJQEBADs=</Image>
<Url type=”application/x-suggestions+json” method=”GET” template=”http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&qu={searchTerms}”/>
<Url type=”text/html” method=”GET” template=”http://www.google.com/search”>
<Param name=”q” value=”{searchTerms}”/>
<Param name=”ie” value=”utf-8″/>
<Param name=”oe” value=”utf-8″/>
<Param name=”esrch” value=”BetaShortcuts”/>
<!– <Param name=”esrch” value=”RefinementBarLhsGradientPreview”/> –>
<!– Dynamic parameters –>
<Param name=”rls” value=”{moz:distributionID}:{moz:locale}:{moz:official}”/>
<MozParam name=”client” condition=”defaultEngine” trueValue=”firefox-a” falseValue=”firefox”/>
</Url>
<SearchForm>http://www.google.com/firefox</SearchForm>
</SearchPlugin>
—– googleext.xml end ————

You have to restart Firefox for this search engine (called Google Exp) to show up in the dropdown list.

D.

Photosynth

November 27th, 2007

I just saw a really cool demo of a product called Photosynth. It’s a new way to link and present digital images on a computer. There is also a demo on the Live website, so you can check it out yourself.