Tuesday, June 2, 2009

And the winner is ... Xbox 360

If you haven't heard about "Project Natal" don't feel bad, you have now! It is a body motion capture for the Xbox 360. There is no controller required (direct shot at Wii), by using a 'box' that can capture motion, sound, 3D movement for multiple users during a one game session, and offers facial recognition used for example for signing you in to Xbox Live. The release date, although not officially released, it is expected to be some time later this year (Christmas maybe?). I am curious about the cost of Natal. We should not forget that the Wii has a lower price compared to the Xbox 360 and PS3. I guess we'll find out sooner or later.

All the tools you need to work with JavaScript

There is a JavaWorld article titled Ajax: Tools of the trade, which consists of a survey of tools for the JavaScript developer.

The article starts by mentioning the JavaScript support offered by popular IDEs such as NetBeans, IntelliJ, and Eclipse. It continues with describing tools such as Firebug (lets you edit, debug, and monitor JavaScript on the fly), YSlow (analysis webpages and suggests ways to imporve performance), and Hammerhead (measures the load time of web pages).

The next part of the article goes into ways of testing your JavaScript code, by using tools and frameworks such as JsUnit (unit testing framework for JavaScript), JSSpec (you have one or more tests that describe the behavior), YUI Test (testing framework for JavaScript), and Crosscheck (checks if your code runs in many different browsers).

If you are interested in testing your user interface, the article mentions some of the tools available, such as Selenium (set of tools that supports rapid development of test automation for web-based applications), Watir (an open-source library for automating web browsers), and YUI Test mentioned above which can also be used to simulate the DOM and user interaction.

Other utility tools for JavaScript include JSLint (JavaScript code quality tool), or JSMin ( removes comments and unnecessary whitespace from JavaScript files) and YUI Compressor (in addition to removing comments and whitespace, it also obfuscates local variables using the smallest possible variable name), for minimizing our JavaScript.

Since I have just started JavaScript, I cannot make any recommendations. Try them out, see which one fits your project best, and use it.

Wednesday, May 27, 2009

Free course on creating iPhone applications

Stanford University offered a free iPhone application development training course. The course is available on iTunes U as video and pdf, and can be found on Standford on iTunes U website. Interesting is the fact that in only 7 weeks, the course has been downloaded a million times from iTunes U. You can read the press release for more information. If you are interesting in iPhone application development, then these resources should come in handy.

Wednesday, May 20, 2009

From HTML to XHTML

XHTML, or eXtensible HTML, is considered to be the evolution of HTML. I believe that the biggest difference between these two is that XHTML is XML, while HTML is, well, HTML. Other noticeable differences are that XHTML can be extended to include new markup (i.e. elements for vector graphics are already available); XHTML is the language of choice for browsers on mobile devices; data written in XML can be easily transformed into XHTML. Do remember that XHTML is backwards compatible with HTML.

How to convert from HTML to XHTML:
- Change the DOCTYPE to (Strict) XHTML.  For example:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

would become

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

- The <html> opening tag needs new attributes: xmlns, lang,
and xml:lang. For example:

<html>

would become

<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
lang="en">

Why do we need both lang and xml:lang? Because depending on
how the XHTML is interpreted by the browser, either of them
might be needed, hence it is considered a best practice to
include both.

- There must be a matching closing tag for any opening tag.
This implies that if you have empty elements, the tag must
end with />. For example:

<br>

would become

<br />

Why do we need a space before the slash? Because older
browsers cannot recognize "/>" without that space.

- All elements must be in lowercase.
- Attribute values must be in between double quotes and have a
value.
- All special characters must be converted into entities.
For example:

& should be &amp;.

Wednesday, May 6, 2009

Parameterized types and bounded wildcards

We know that parameterized types (in Java) are invariant, which implies that, for example, even though Integer is a subtype (subclass) of Number, List is not a subtype of List. Let's see how this impacts you code. Assume we have a class named Bucket declared below:

public class Bucket {
   public void add(E e){...};
   public void addAll(List list){
      for(E e : list) {
         add(e);
      }
   }
}

If you would try to do the following:

Bucket numberBucket = new Bucket();
List integers = new ArrayList();
...
numberBucket.addAll(integers);

you get the error:

The method addAll(List) in the type Bucket is not applicable for the arguments (List).

How can we get out of this? Easy, by using a bounded wildcard type:

public void addAll(List list){
   for(E e : list) {
      add(e);
   }
}

Friday, May 1, 2009

Top 10 most popular U.S. handsets in December 2008

RCRWireless has published a while ago the top 10 most popular U.S. devices in December of 2008. Blackberry Bold and Blackberry Storm (which was released in November) came in at no. 6 and 3, while the iPhone still remains no. 2, but I assume these numbers are limited because of the single-carrier barrier. Topping the list was the Blackberry Curve.

Useful links for all mobile related

mobiThinking has posted a very useful webpage of resources related to the mobile industry, covering news, blogs, guidelines, forums, and many many more valuable information resources. You can read more here.