Web Programming

Audio in Linux

Oliver Brown
— This upcoming video may not be available to view yet.

I’ve started writing the page to actually play the audio clips in my language learning app.

At the moment it loads the Windows Media Play plug in. This obviously won’t work on Linux so I have to ask, how do you play media files in a web browser when not on Windows? Flash would be the obvious answer I suppose but I have an uncommon requirement - I need to be able to access the object via Javascript. Specifically, I need to know when a track is finished and the next one begins (from a play list) and none of the freely available Flash media players do that.

Any advice from anyone?

Zend Framework

Oliver Brown
— This upcoming video may not be available to view yet.

Zend, the commercial endeavour of the people who brought you PHP have a produced a framework, cleverly called the “Zend Framework”.

It’s basically a lightweight MVC framework for PHP. Lightweight in this case is good. It doesn’t do as much as Rails does for Ruby (although it is significantly younger) - the most notable hole is a object-relational-mapping system. But it does provide URL rewriting for Rails-esque view/controller access. I started writing my clever language thingy in it.

The biggest problem I had was getting it to work with IIS. Which I couldn’t. I decided since I had IIS installed I’d give it a go. Unfortunately you require mod_rewrite which IIS doesn’t have. So I installed ISAPI_rewrite, a version for IIS. After an hour of trying to get it to work I went and downloaded Apache 2.2. Which was my second mistake You see it seems PHP doesn’t work with Apache 2.2. Not sure why but I found a vague mention of it on a forum after trying for another hour to get it to work. So I got Apache 2.0 and everything worked. Of course there are reasons not to use PHP 5 with Apache 2, but meh.

There is one little problem with the Zend Framework, I think. It seems to be printing a space somewhere before any other output. It wouldn’t be a problem except I need it to output XML and a space at the beginning makes Firefox (and probably Internet Explorer) explode.

Back to language learning

Oliver Brown
— This upcoming video may not be available to view yet.

After spending a couple of weeks dealing with foreign text and Unicode at work, my interest in foreign language learning with the aid of a computer has returned.

My main goal is a Pimsleur style system but with the repetition handled by computer - i.e. with just the individual phrases (and words and syllables for earlier lessons) as audio files, the program should generate complete conversations with sensible parts repeated and useful instructor comments in between. That sounds like it requires some sort of script in some sort of markup language. Since it needs to be highly structured I guess that only leaves XML as a sensible possibility. So I marked up a conversation from Pimsleur’s German I.

There was an unexpected result. It’s fairly straight forward to have multiple source languages in one script file. Although there are certain things that would not work best this way, a lot of things in German (for instance) would be taught the same regardless of what language you are learning from. Ultimately source-language-specific scripts would have to be supported though.

Yet another XML based AJAX toolkit

Oliver Brown
— This upcoming video may not be available to view yet.

Jitsu is another AJAX toolkit.

Like Backbase and Atlas it supports an XML based declarative format that is parsed by JavaScript and converted into real HTML.

This one is open source and free.

ASP.NET Atlas really is like Backbase

Oliver Brown
— This upcoming video may not be available to view yet.

It turns out that ASP.NET might not suck after all. Atlas for ASP.NET is a toolkit for doing AJAXy stuff.

Well in fact it is quite a bit more than that. It has many features of the Google Web Toolkit (except in ASP.NET instead of Java) including serializing server side objects for use client side use. Interesting it also has a lot in common with Backbase. It allows you to embed some nifty XML to define a user interface which is then interpreted by the Javascript to render real (X)HTML.

The final irony is that it’s pretty much free. Since it’s .NET, to really use it you need Visual Studio, but the Atlas part itself is free and should be perfectly usable with the Express version of the Visual Studio projects.

Another Firefox cleverity

Oliver Brown
— This upcoming video may not be available to view yet.

Cleverity? Something that is clever. If that word really exists I should get an award.

A lot of people love Firefox and seem to think that loving it is “obvious”. This is despite the fact that it just eats up memory. Not only that but it keeps it regardless (if you minimise most programs on Windows they free up most of their memory).

There are uses for it, most of them for developers. The DOM explorer and JavaScript debug consoles are absolute necessities. But another cool feature I’ve found is “View Selection Source”. Highlight part of a web page, right-click and you can view the source just for that bit. Yay :)

3D gaming in Firefox and Safari

Oliver Brown
— This upcoming video may not be available to view yet.

Using the canvas element with some clever JavaScript, someone has written a basic ray-traced 3D graphics engine that runs in Safari and Firefox.

Okay so “3D gaming” is overstating it slightly, but it’s clever. What’s double clever is that you can get a pure JavaScript implementation of canvas for Internet Explorer from Google Code. Which means technically you can now do 3D graphics using JavaScript and a browser.

Internet Explorer 7 Beta 2 review

Oliver Brown
— This upcoming video may not be available to view yet.

Well since I tend to use Firefox here at work I figured I could install IE7 without too much risk. And I must say it’s actually quite good.

Initial impressions

The most obvious feature is thye really minimalist chrome. The back and forward buttons are a little smaller and now to the left of the address bar; refresh and stop are to the right and then underneath that are tabs. By default there is no application menu (File, Edit, View etc). which strikes me as odd. But to the right of the tabs are other buttons to do common things that you’d normally use the menu for. Speaking of opening new tabs, there is a special thin blank tab to the right of the others that you click to open a new one.

Conditional tags

IE has a special feature called conditional tags that let you specif markup just for IE that other browsers ignore. This doesn’t seem to work in IE7. Unfortuantely this means a 1px rendering error is present on my blog. The irony being I’m assuming it’s been taken out because they think they don’t need it anymore…

Zooming

The zoom feature is snazzy and most of all, actually works. It scales everything properly and still renders text as vectors. Even better is that the tab preview (thumbnails of all the tabs) just use zoomed out versions of the page. This means the thumbnails are completely live. Well almost. It seems you get snapshots of plugins (although they work fine when viewing a normal zoomed page, not the overview thingy).

It also works with the dev bar add on I installed.

Tabbed browsing

New to IE and probably the most requested feature (beyond standards compliance :P). And it works. There are some subtle differences between it and Firefox which will take a little geting used to. For example IE puts the cross to close a tab on the tab itself instead of on the right. And newly opened tab appears immediately to the right of the currently opened one instead of at the end of the list.

Acid2

The acid test was invented to test a web browsers CSS standards compliance. Acid2 is it’s sequel. Well IE7 fails the Acid2 test miserably. I mean it’s truly awful. In Firefox and Opera you can at lest tell what you’re supposed to be looking at.

Multiple themes, sort of

Oliver Brown
— This upcoming video may not be available to view yet.

To counteract the fact that I’m using Kubrick, the single most common Wordpress theme (by virtue of being the default) I’ve started to develop different themes for different categories. The first I’ve implemented is PHP which now has a different colour scheme and a different header image.

Windows Live Mail dies a little

Oliver Brown
— This upcoming video may not be available to view yet.

Windows Live is the name for the new set of technologies software and computery goodness Microsoft is developing.

A lot of the components aren’t especially related, it’s just a brand name of sorts. Part of it is Windows Live Mail, designed to ultimately replace Hotmail. As of this morning, it doesn’t work on Firefox. You are greeted with the normal Hotmail interface and a message saying due to various problems they’ve rolled back to a previous version meaning Firefox users have to use Hotmail Classic. Well it is beta (and they’ve said it’s beta instead of releasing it and then finding these problems) so I’ll let them off.