Web Info & Tutorials

March 19th, 2008

BANK OF MONTREAL RESTRUCTURES APEX AND SITKA TRUSTS TO AVERT WRITEDOWNS

Bank of metropolis , Canada’s fourth- large bank, reached an commendation to structure digit advertizement essay trusts it oversees, shunning a possibleness writedown. via Bloomberg.com

March 19th, 2008

BARRICK GOLD, BCE, MANULIFE, TECK COMINCO, NOVAGOLD: CANADA EQUITY MOVERS

The following is a list of companies whose shares were having unusual price changes in Canada. via Bloomberg.com

March 19th, 2008

GOOGLE VISUALIZATION JOINS THE AJAX APIS

Yoah Bar-David & Itai Raz of Google have introduces the latest Ajax API: Google Visualization API, a new API designed for visualizing structured data.

There is a large visualization gallery that can show you some of the visualizations that you can use.

You tie into the API as you do with other Google Ajax APIs:

JAVASCRIPT:
  1.  
  2. google.load("visualization", "1");
  3.  
  4. var q = new google.visualization.Query(DATA_SOURCE_URL);
  5. q.setQuery("select A, sum(D) group by A");
  6. q.send(responseHandlerCallback);
  7.  

Take a look at this very cool example that the Gapminder team came up with (click on play)

This complements the Google Chart API, which just lifted its limits on the number of calls for charts.

NOTE: Google I/O is a conference being held at San Francisco on May 28-29 2008. APIs like this will be talked about. I will be there. And lots of good folks will be there (Steve Souders, Mark Lucovsky, Guido van Rossum, Jeff Dean, Chris DiBona, Josh Bloch).

March 19th, 2008

CIUI: CNET IPHONE UI

Vladimir Olexa of CNET has released CiUI a iUI inspired iPhone JavaScript libary that mimics the iPhone UI behavior.

It's already being used on CNET¹s iPhone page (http://iphone.cnet.com). It's been greatly inspired by iUI with a few key differences:

  1. AJAX calls are performed after a page slides
  2. DOM doesn't get overloaded with "pages" as they load. Instead, two DIVs are constantly being reused
  3. Page titles are set on the source page, not on the destination page
  4. Only specified "a" tags are assumed a part of the UI.

To create a sliding load you simply annotate the link (iUI takes over automatically, in contrast):

HTML:
  1.  
  2. <a class="go_forward" title="CNET" href="http://www.cnet.com">CNET</a>
  3.  

Check out the source and an enclosed working example or go to iphone.cnet.com to see it in live action. You can download the library from our download page.

March 19th, 2008

ECHO 3 RELEASES CLIENT SIDE COMPONENT MODEL

Echo has been known as a Java server side component framework, but with the release of Echo 3, they have added a way to build component applications using JavaScript:

Client-side Echo applications do not require an application server, and can also be run entirely offline.

With Echo3, the formerly server-side-only component framework has been recreated in client-side JavaScript. This was not a direct “port”, but rather a re-imagining of the framework with the ideals of JavaScript development in mind. For example, the client-side version of the framework takes advantage of JavaScript's object and array literal syntaxes to create a capability called "hierarchal component construction", where an entire hierarchy of components can be created in a single call. Such code winds up being extremely readable, as, when naturally indented, it resembles the component tree.

Core.js framework

A low-level framework, called “Core.js” was created to ease development of object-oriented and event-driven code in JavaScript. Core.js provides an inheritance model for building JavaScript objects using class-based (rather than prototype-based) inheritance. It additionally offers the capability to specify abstract classes and methods, and features “pseudo-private variables” where a class can reserve internal method/field names that cannot be overridden by subclasses. The framework includes utilities for managing events and listeners, and can register event
handlers on object instances.

New Back-End / Rendering APIs

The “back-end,” which is responsible for rendering components within the web browser, has been re-engineered for Echo3. Instead of each component having its own client-server serialization code, Echo3's web application container simply serializes the state of updated components directly to the client, where JavaScript versions of the server-side components are then created and updated. This feature makes the component development process substantially easier and faster than it was in Echo2. The new approach also yields performance dividends when creating server-side Java applications -- Echo3 consumes less CPU and a mere fraction of the bandwidth of Echo2.

New and Improved Components

Many new components have been added to the framework and existing components have been enhanced in Echo3. WindowPanes, for example, will always stay on screen, even if the browser window or containing component is resized. Menus can be configured with opacity and fade-in effects. New components have been added to the Extras library including a RichTextArea and Tree/TableTree. New APIs for keyboard accessibility and focus management allow for mouse-less operation (note: still under development in some components).

Echo3

March 19th, 2008

IE8 AND SAFARI 3.1 COMPATIBILITY UPDATES

IE 8 added

Our hero, PPK, has updated his compatibility tests to include IE 8b1 and Safari 3.1.

You can now check out the W3C DOM Compatibility - HTML table, and the W3C DOM Compatibility - Core tests.

Thanks for the reference PPK!

March 19th, 2008

JAVASCRIPT METACLASS PROGRAMMING

Neil Roberts is continuing a really nice set of blog posts with one that teaches us about JavaScript Metaclass Programming:

Metaclass programming is the programming that builds a class. Since most of the time a metaclass simply takes an already declared class and manipulates it, you can think of a metaclass as a template: a class goes in, and a specifically structured class comes out.

Why didn’t I realize that I was using it in JavaScript? Well, mostly because if you want to build a class structure in JavaScript, you are forced to do everything related to OO in JavaScript programatically. Want to do inheritance? There’s no syntax for it, you have to do it programatically. Want to add some functions and properties? You have to do it programatically.

Which is why almost all of the toolkits make some provisions for doing these programatic procedures. All of these tools are related to metaclass programming, but they’re almost all geared to constructing a class. What metaclasses are truly awesome for is manipulating a class, and we’ll be doing that today.

This article reminds me of the talk that Glenn Vanderburg uses to give on JavaScript that went deep into the language and had a bunch of people a bit surprised at things they didn't know about the language.

Neil walks us through a mixin that can make your data private, ending up at:

JAVASCRIPT:
  1.  
  2. function privatize(instance){
  3.   var c = instance.constructor;
  4.   var p = c.prototype;
  5.   if(!c._privatize){
  6.     c._privatize = { privates: {}, functions: {} };
  7.     for(var key in p){
  8.       var value = p[key];
  9.       if(key.charAt(0) === "_"){
  10.         c._privatize.privates[key.slice(1)] = value;
  11.         delete p[key];
  12.       }else if(dojo.isFunction(value)){
  13.         c._privatize.functions[key] = true;
  14.       }
  15.     }
  16.   }
  17.  
  18.   var context = dojo.delegate(instance, c._privatize.privates);
  19.   context.public = instance;
  20.  
  21.   for(var fn in c._privatize.functions){
  22.     instance[fn] = dojo.hitch(context, instance[fn]);
  23.   }
  24. }
  25.  

You can check out a demo here. Keep 'em coming Neil!