Archive for May 2007
Google Mashup Editor Launches
Google just released a web-based mashup creator and hosting environment. The editor accepts HTML, CSS, and Google-specific XML tags. These tags provide access to google feeds such as the Google Calendar and Base. The example we just saw built in front of us took six lines of code and plotted locations on a map. Pretty impressive. This can be hosted at googlemashups.com or you can make a gadget for iGoogle.
It is very similar to Yahoo! Pipes and Popfly in intent, but not in focus or implementation. Of the three web-based mashup creators this one is the least graphical (being almost all text) and is the most developer focused. Google has a history of starting with developers and then making things easier overtime. The most obvious example of this in my mind is the evolution of KML’s relationship with Google Maps. Last year at Where 2.0 it was announced that hosted KML could be display in Google Maps. Very dev friendly, less consumer friendly. This was the predecessor to Mapplets (Radar post), a much more accessible way of loading external data sets onto Google Maps.
(Via O’Reilly Radar.)
Hacked Xbox 360 firmware prevents banning
digg_url = ‘http://digg.com/xbox_360/Hacked_Xbox_360_firmware_prevents_banning’;In today’s episode of tit-for-tat, hackers have blocked Microsoft’s attempt to ban their modified consoles. Just two weeks ago remember, Microsoft began checking and then banning Xbox 360 consoles from Xbox Live if the Big M found the gear to be modified in violation of the Terms of Use. However, new firmware — a tat if you will — was just released by the lively (to say the least) modding community makes hacked Xbox 360s invisible to Microsoft’s snooping; if they can’t see it, they can’t ban it. Now come on Microsoft, show us your tit. Erm.
(Via Engadget.)
Firefox 2.0.0.4 and Firefox 1.5.0.12 Security and Stability Update
As part of Mozilla Corporation’s ongoing stability and security update process, Firefox 1.5.0.12 and Firefox 2.0.0.4 are now available for Windows, Mac, and Linux for free download from http://getfirefox.com.
Due to the security fixes, we strongly recommend that all Firefox users upgrade to these latest releases.
Note: We anticipate this to be the last release in the Firefox 1.5.0.x series. Mozilla typically maintains support for previous releases for six months after a major release. Mozilla has previously extended the planned end of life for the 1.5.0.x series in order to accommodate some recent changes in update functionality. Firefox 1.5.0.12 is available for download from http://www.mozilla.com/firefox/all-older.html but all users are encouraged to upgrade to Firefox 2.
If you already have Firefox 1.5.0.x or Firefox 2.0.0.x, you will receive an automated update notification within 24 to 48 hours. This update can also be applied manually by selecting “Check for Updates…” from the Help menu starting later today.
For a list of changes and more information, please review the Firefox 1.5.0.12 Release Notes and the Firefox 2.0.0.4 Release Notes.
Over the coming weeks, Mozilla will be presenting 1.5.0.12 users with a notification message that will offer users a “major update” to Firefox 2. Upon confirmation, a user’s browser will be upgraded from 1.5.0.12 to 2.0.0.4.
(Via Mozilla Developer News.)
JavaScript 1.8 Progress
In case you haven’t been following the progress being made on JavaScript 1.8 here’s a quick overview of what’s already landed in the latest Firefox 3 nightlies.
So far, three main features have landed, with a few more to come. In general, this release will be relatively ‘light’, mostly attempting to bring the current JavaScript implementation closer to the desired JavaScript 2 spec.
Expression Closures
This just landed in trunk and I’m sure it’ll tickle those of you who enjoy functional programming. Effectively, this addition is nothing more than a shorthand for writing simple functions, giving the language something similar to a typical Lambda notation.
For example, look at the Lambda notation that’s available in a couple languages, in comparision to JavaScript 1.8.
Python:
- lambda x: x * x
Smalltalk:
- [ :x | x * x ]
JavaScript 1.8:
- function(x) x * x
(For reference) JavaScript 1.7 and older:
- function(x) { return x * x; }
I think, probably, my favorite use for this shorthand will be in binding event listeners, like so:
- document.addEventListener(“click”, function() false, true);
Or combining this notation with some of the array functions from JavaScript 1.6:
- elems.some(function(elem) elem.type == “text”);
This will give you some JS/DOM code that looks downright elegant.
Generator Expressions
This is another one that was just committed to trunk. It’s a little bit more involved than the previous addition, as this one encompasses a number of concepts. Specifically, it requires knowledge of most of the features within JavaScript 1.7, specifically Iterators, Generators, and Array comprehension. This particular feature is based off of the generator expressions that exist in Python.
In the ticket tracking this feature, Brendan posted an elegant, functional, Sudoku solver written using the new syntax that this addition affords us. This demo is based off of a similar one written in Python used to demonstrate its generator expressions.
To better understand what this feature means, lets look at a single line of JavaScript 1.8 code, taken from the Sudoku solver.
- dict([s, [u for (u in unitlist) if (u.contains(s))]] for (s in squares))
This line relies upon the dict() function, which takes a 2xN sized matrix, and converts it into a key/value pair object. The code of which can be found here:
- function dict(A) {
- let d = {}
- for (let e in A)
- d[e[0]] = e[1]
- return d
- }
Let’s go through that line of code, part-by-part, to better understand what exactly is going on.
- [u for (u in unitlist) if (u.contains(s))]
The first part of the line is an example of array comprehension coming from JavaScript 1.7. Specifically, we’re iterating over ‘unitlist’ and building it out into an array of keys (excluding which keys don’t contain ’s’).
- [s, …] for (s in squares)
The second part of this line is another example of a feature from JavaScript 1.7, a destructuring assignment. What’s cool about this destructuring, though, is that it’s occurring within an array comprehension – meaning that we’re effectively building an array of smaller (2-long) arrays. (The result of which will plug back into the dict function.)
- dict([s, …] for (s in squares))
This is where the magic happens. In JavaScript 1.7 we could’ve called the dict() function like so:
- dict([[s, …] for (s in squares)])
Note the extra, explicit, use of array comprehension. The issue with that extra comprehension is that it has to be completely run when it’s first encountered, in order to build out the full array (which will then be turned into a ‘dictionary’). However, the lack of extra [...] is what makes this a generator expression. That makes that line in JavaScript 1.8 equivalent to the following in JavaScript 1.7:
- dict((function(){ for (s in squares) yield [s, …] ; })())
As you’ll see, it the generator expression lazy-builds the resulting array, handling it as a generator – meaning that the specific values won’t have to be generated until they are explicitly needed by the dict() function (resulting in less loops and better overall performance).
Here’s another example of a generator expression
- // Create a generator that loops over an object values
- function val_iter(obj) {
- return (obj[x] for (x in obj));
- }
- // Iterate through an objects keys
- for ( let key in obj ) { … }
- // Iterate through an objects values
- for ( let value in val_iter(obj) ) { … }
Of course, the val_iter() function could be built with JavaScript 1.7 right now, using yield:
- function val_iter(obj) {
- for (let x in obj)
- yield obj[x];
- }
Most likely, though, generator expressions will see the most use in memory/cpu hungry code (like the Sudoku solver), since solutions will now be able to get results when they need them, as opposed to loading them all up front.
Fun with iterators
On a side note, I’ve been playing with iterators/generators a lot more lately and one particular feature that I’ve wanted was the ability to easily iterate over a set of numbers. (e.g. 0 – 9) With a little bit of dancing, we can add that functionality to the language, like so:
- // Add an iterator to all numbers
- Number.prototype.__iterator__ = function() {
- for ( let i = 0; i < this; i++ )
- yield i;
- };
- // Spit out three alerts
- for ( let i in 3 ) alert( i );
- // Create a 100-unit array, filled with zeros
- [ 0 for ( i in 100 ) ]
- // Create a 10-by-10 identity matrix
- [[ i == j ? 1 : 0 for ( i in 10 ) ] for ( j in 10 )]
This may be old hat for some, but I’ve gotten a real kick out of it.
Array Reduce
The last feature to sneak in recently was the addition of the missing Array.reduce/Array.prototype.reduce function, from the JavaScript 1.6 Array Extras.
You would call reduce on an array, something like this:
- someArray.reduce( fn [, context] );
with the function being called like so:
- someArray.reduce(function(lastValue, curValue){
- return lastValue + curValue;
- });
The “lastValue” argument is the return value from the previous call to the reduce callback function. The first time the callback is called, it’ll have a “lastValue” of the first item in the array and a “curValue” of the second item in the array.
Thus, if you wanted to sum up the numbers 0-99, you could do it like so (using JavaScript 1.8, and the number iterator from above):
- [x for ( x in 100 )].reduce(function(a,b) a+b);
Pretty slick!
Try it yourself
Everything that I’ve mentioned above is live today in the latest nightly builds of Firefox 3, thus if you want to try some of the above for yourself, just do the following:
- Download a Nightly of Firefox 3
- Create a page that has the following script tag in it (which was just committed):
And that should be all that you need – enjoy!
(Via John Resig.)
Firefox 1.5.0.12 & Firefox 2.0.0.4 to be available soon
On Wednesday, May 30, we expect to begin distributing Firefox 1.5.0.12 and Firefox 2.0.0.4 via automatic updates. These are standard stability and security updates for the browser to ensure a fast and secure online experience for our users. We expect this is the final stability and security release for the version 1.5 product series. Firefox 1.5.0.12 includes an auto-update mechanism that offers users the ability to migrate to Firefox 2. The upgrade offer will be enabled within in a few weeks. We strongly encourage everyone to download Firefox 2 now at www.getfirefox.com to benefit from features that make search, communication and online security more effective.
(Via Mozilla Developer News.)
Apple Releases iTunes 7.2 Supporting DRM-Free iTunes Plus

After midnight Eastern tonight, Apple let its own cat out of the bag to go along with Microsoft’s announcement of Surface. The Mac OS X Software update brings iTunes 7.2, featuring support for DRM-free downloads off of the iTunes Store, what Apple is calling “iTunes Plus.” The update notice mentions this support from “participating labels” (does EMI have friends in its DRM-free world?), and then the help file goes further, as noted by MacRumors:

The iTunes Store also offers songs without DRM protection, from participating record labels. These DRM-free songs, called “iTunes Plus,” have no usage restrictions and feature higher-quality encoding.

The first time you buy an iTunes Plus song, you specify whether to make all future purchases iTunes Plus versions (when available). You can change this setting by accessing your account information on the iTunes Store.

If you already have iTunes Store purchases that are now available as iTunes Plus downloads, you may upgrade your existing purchases. To do so, visit the iTunes Store and follow the onscreen instructions.

Perhaps there’s hope for converting my library of FairPlay-encoded files to come back to life. We can only hope. Tomorrow’s going to be exciting. Stay tuned…
(Via Cult of Mac.)
GWT 1.4: Size, Speed, Deployment, and more…
With the Google Developer Day here, we are seeing a lot of interesting news from Google (If I may say so myself).
We just saw that GWT 1.4 RC has been released, and it is a big deal for the GWT community.
With version 1.3 we saw the fully open source migration of the framework. With 1.4 we see “undoubtedly the biggest GWT release yet. In addition to 150+ bugfixes, GWT 1.4 RC includes a ton of new features, improvements and optimizations.”
There are a huge amount of changes, but some highlights:
- Size and Speed Optimizations: The compiler keeps getting better, startup is quick, and more
- Deployment Enhancements: Modularized RPC, Simple module inclusion, and more
- Widget and Library Enhancements: A bunch of very rich widgets have been added to the toolkit
- ImageBundle: “the single biggest have-to-see-it-to-believe-it feature of GWT 1.4 RC. Image bundles make it trivially easy to combine dozens of images into a single “image strip”, collapsing what would have been dozens of HTTP requests into one: a single, permanently-cacheable image file.”
The GWT team is particularly excited because this release has been developed with major participation from the ever growing list of open source contributors. Apart from the G in the name, this isn’t a Google only beast anymore.
If the GWT module is your bag, check out the release.
(Via Ajaxian.)
TableKit: Prototype Table Tweaking
TableKit is a Prototype based library that lets you create sort, inline edit, and resize tables.
There is a simple unobtrusive way to use the component:
-
-
<table class=“sortable resizable editable”>
-
And, you can get lower level and work directly with the API via the TableKit objects.
(Via Ajaxian.)
JSVI: You love Vi. You love JavaScript. Now you have both
From the “we can do it, so we will” department we have JSVI, a JavaScript implementation of vi, in ~3.5k lines of code.
(via Dean)
(Via Ajaxian.)
Richard MacManus: Google Launches Street View Maps
Not to be left behind, Google announced their own bit of mapping news at O’Reilly’s Where 2.0 conference today: the debut of ‘Street View’ maps. The new maps are essentially a 360 panoramic image taken from a specific point on the street (see an example here).
The Street View maps are developed in partnership with Immersive Media, which according to the O’Reilly Radar blog is “a company that has an eleven lens camera capable of taking full, high-res video while driving along city streets.” What that means is that these Street View maps, because they are extracted from video shot while driving, are not just static images at random points around the city. They can be advanced fluidly down the street.

Clicking the white arrows on the image, advances it down the street a few paces, and quickly loads a new panorama, and double clicking on any part of the image zooms you in (you can actually read license plates and see recognizable faces). This is a very cool technology that adds a great new dimension to Google’s Maps.
In my post about EveryScape I compared that company to Amazon’s old A9 Block View maps, and the comparison is probably even more relevant here. But these blow A9’s old maps out of the water since they are not static images, but clear, and very well stitched 360 degree panoramas taken every few feet. They offer a very complete and dynamic, block-by-block view of a city street.
I would be remiss, however, if I didn’t compare this technology to EveryScape. It seems like Google really stole the show today, with Street View, but don’t count EveryScape out completely. Their panoramas offer a wider range of motion (Google’s are fixed, 360 degree left to right — no up and down), and they offer one feature that Google cannot with this specific technology: indoor panoramas. Remember, Google’s new Street View maps are shot from the top of a car, and you obviously can’t drive a car into a hotel.
It seems the two companies have opposite aims. Google wants to create better, more useful maps by providing photographic, street-level views of entire cities, while EveryScape hopes to entice business owners with the ability to offer virtual tours of their business within interactive virtual tours of neighborhoods.
According to Greg Sadetsky, Google has rolled out Street View in Denver, Las Vegas, Miami, New York and San Francisco.
(Via Planet Ajaxian.)


