Tuesday, September 28, 2010

On an obsolete road

I have already forgotten these things.


1. Inner join versus outer join
2. Simple select statement for getting the max value of a column + another column
3. Definition of Object Oriented programming
4. Exact figure of the limitation of HTTP GET.
5. Differences between GET and POST.
6. The default method of an HTML form when submitted.


I have made time to review them. Here they are.


1. Inner join will return matched results between two tables while outer join will return all regardless if there is a match or none between the two tables. Here’s a good article by Jeff Atwood, A Visual Explanation of SQL Joins.


2. Given a table Person with two columns, Name and Age. To get the eldest,



SELECT Name, Age FROM Person WHERE Age = max(Age);

3. Object oriented programming is a programming paradigm that uses objects. These objects consist of fields, methods and their interaction.


4. 256 characters.


5. Given the size limit of GET, POST is used to overcome that. POST is used if you want to submit data with non-ASCII characters. If you want to hide data you’ll prefer POST than GET since it hides hidden fields in the URL but it’s not enough since you can view the source or use browser debugging tools such as FireBug and Chrome Developer Tools.


6. If you have an HTML form with no method defined, GET is the default.


There goes my hopes and dreams. The road less traveled.

Friday, September 24, 2010

Casting to a Boolean in JavaScript

I came across with this expression,



button.enabled = !!enable

!! is just a double not. This is just obscure.