Bluish Coder

Programming Languages, Martials Arts and Computers. The Weblog of Chris Double.


2007-05-31

New Javascript features in Firefox nightly build

John Resig has a post going into detail about the new Javascript language features in the latest nightly builds of Firefox. They include:

  • Expression Closures
  • Generator Expressions
  • Array.reduce

Read John's post for all the details.

Tags: javascript 

2007-05-31

Google Gears for Offline Web Application Support

Google have announced the release of Google Gears, a browser extension and set of Javascript libraries for offline web application support. Supported browsers are Internet Explorer 6.0+ and Firefox 1.5+.

The library provides support for:

  • Storing and serving application resources locally
  • Storing data locally in a fully-searchable relational database
  • Running Javascript asynchronously

Google Reader now has support for offline usage using Google Gears.

Tags: ajax 

2007-05-29

Offline Zimbra with Firefox

In my new job at Mozilla I've been working on adding offline support to Zimbra as a proof of concept of the new Firefox offline capabilities.

Zimbra is heavily ajax based and gives a good idea of how difficult or easy it is to convert an existing application to use the offline support. For this first cut I made Zimbra work when the browser is in offline mode and provide the ability to browse the email folders, and view messages while offline that are held in the Inbox and Drafts folders.

The Firefox features used to enable offline operation were:

  • DOM Storage for storing emails and folder information. DOM Storage is an implementation of a WHATWG specification.
  • Offline Cache. A patch is available for Firefox that adds an offline cache specifically for web applications to store data (like images, pages, etc) that must be available while offline. Items are loaded in the cache using a rel="offline-resource" element on a <link> element.
  • JAR file Protocol. Firefox accepts JAR protocol URLs. These reference individual items in a JAR file and allow convenient bundling and caching of resources. For example, to reference the file /core/AjxCore.js in the ajax.jar file, the URL would be: jar:/zimbra/js/ajax.jar!/core/AjxCore.js
  • Offline Events. The browser has "offline" and "online" events that are triggered when the user chooses to go offline via the menu, or when network connectivity is lost. I modified Zimbra to listen for these events and display a status indicator showing whether it is in offline or online mode.

A screencast shows me logging into Zimbra, viewing some emails, going offline, the offline/online indicator and the availability of the emails while offline. It's available here: http://www.bluishcoder.co.nz/offlinezimbra.

It's the first screencast I've out together so hopefully it comes out ok. I used the excellent 'wink' tool.

Offline Zimbra

Tags: mozilla 

2007-05-29

More on Firefox Offline Web App Support

Robert O'Callahan posts with more details on the offline support in Firefox. In a later post I'll go into more technical detail on how I used the features to add the offline support to Zimbra, along with the issues I faced. At the moment I'm working on adding the ability to edit drafts and have it updated on the server when you go back online.

Tags: mozilla 

2007-05-29

A mix of many things

I haven't been blogging much about what I've been doing lately so here's my attempt to put lots of little things in one post.

Work at Mozilla is going well. My patches for Firefox related to offline event notifications were reviewed and committed to CVS. Offline support is now in the nightly builds and can be used.

I finished the work I'd been doing on Zimbra. I can now edit emails offline, save them and they are sent automatically when I go back online. This is using the support for offline web applications that was recently added to the nightly builds. At some stage I'll do a screencast and go into detail about it.

Now I'm working on implementing a <video> tag in HTML that will provide a user interface similar to Flash video's and native support for Ogg Theora streaming videos. At least, that's the current plan, and it's based on a proposal from Opera posted to the whatwg mailing list. This proposal is being discussed fairly heavily on the list at the moment with an additional proposal from Apple so what I end up implementing may change as it gets nailed down.

While my head is in the Ogg space I added some Ogg support to Factor in my free hacking time as I mentioned in a previous blog post. I expanded on that this weekend and added support for Theora. From the latest code in the repository you can play Theora videos:

"apps/ogg-player" require
"test.ogg" play-theora-file

It has some issues (well, quite a few) at the moment. The YUV to RGB conversion is done in software, written in Factor, and is a bit too slow at the moment. A 320x240 video frame takes about 70ms on my laptop to convert. As a result it skips quite a few frames and is not synchronised with the audio.

I'll work on this over time and Slava has mentioned that he'll look into speeding the compiler up to make it faster for this sort of thing. I can also look into doing the conversion in hardware via an OpenGL shader. I would like to see it possible to be done in Factor though.

I'm still playing online poker regularly. Last year I won a few multi table tournaments which probably made my expectations on how much I could earn a bit optimistic.

Not long after that I hit a tournament dry spell, coinciding with the US law changes preventing US players, which made the tournaments less interesting to play. I switched to playing at a different site, signed up for rakeback (which gives you a percentage of the money you pay in rake to the site back to you), and played low stakes ring games. This is the $0.25-$0.50 and $0.50-$1 levels.

This has been profitable for me this year so far, although March was looking touch and go for awhile. I'll probably go back to playing tournaments at some point as I really enjoy them, but the ring games so far have been a better hourly rate. Of course, playing at these low limits I'm not making a fortune, but I'm not risking one either - and I prefer the enjoyment of the game. As my bankroll increases I'll look at moving up the limits.

But my time in Auckland hasn't all been poker playing, Factor programming and Firefox. I've been working more on my family history research, explored a few of the places and cemeteries where my ancestors are buried in Auckland. I found a few new avenues to research and explore and located the graves of great, great, great, great grandparents.

Next week I'm off to Mountain View, California, for the Mozilla "All Hands" meeting. This will be my second trip ever to the US and to California so I'm really looking forward to it. I leave NZ on Monday 9th April, and leave San Francisco airport on Saturday 14th.

Tags: factor 


This site is accessable over tor as hidden service 6vp5u25g4izec5c37wv52skvecikld6kysvsivnl6sdg6q7wy25lixad.onion, or Freenet using key:
USK@1ORdIvjL2H1bZblJcP8hu2LjjKtVB-rVzp8mLty~5N4,8hL85otZBbq0geDsSKkBK4sKESL2SrNVecFZz9NxGVQ,AQACAAE/bluishcoder/-61/


Tags

Archives
Links