#31/12/2008#

"Java is great but..."

Why is it that I need to use at least 10 small obscure classes when doing anything with Swing (the primary GUI Framework)?

Example

In a program I'm writing I need to display the contents of a list.  Java provides a handy class called JList, which can display lists of things.  Now, in VB.NET I would create a List control and use DataBinding to bind the collection to the list.  That's four classes, two of which are collections, one of which I wrote myself.  With the JList I'll need to almost re-implement my collection in a class implementing ListModel, along with some other Listener classes to communicate between the JList and the ListModel.  That's four classes, three of which I wrote myself.  Add to that some pretty shoddy documentation and tutorials and... welcome to the world of open source.

Oh and did I mention that JList doesn't implement scrolling or selection, no they're contained in other classes, and that's after you've had to layer up 20 panels to get your UI to layout the way you want.  What's wrong with a Location property, why do my controls have to be laid out by a layout manager?  Do I really care so much about how aesthetically my user interface resizes that I have to know 2 interfaces and at least 5 classes just to put my controls at a certain point on the screen?

#30/12/2008#

"Media Players and Libraries"

Despite MP3s being around for 20 years, the iPod being round for 7 or so years, and media library integration in media players around for at least 9 years, Media Players nowadays are really disappointing.  Windows Media Player is slow, iTunes hasn't got a Now Playing list, RealPlayer isn't much faster than Windows Media Player and Winamp hasn't got a very inspiring UI or library.

In today's world of internet, Web Services, XML and service endpoint integration I'm really suprised there's no central industry standard service where music publishers can register the details of the CDs they've published.  Instead it's up to those of us who can't bear to live without a properly organised CD shelf to fill in those details and out of the kindness of our open-source hearts, upload the details to some very incomplete database, or pay someone else to compile that information for us.

Media players are also ridiculously stupid.  None of the major media players seem to be able to do anything remotely intelligent with artists, for example.  If the internet is the future of music distribution, then this kind of thing needs to be more readily available in media players.  For example, if I'm listening to Tim Hughes, then I could click a link or a button to view some kind of profile page about him, with a photo, vital statistics, short bio, discography, and a short (upto 10) list of similar artists (i.e. If you liked Tim Hughes, you'll also like Matt Redman, Ben Cantelon, etc.), perhaps using some kind of last.fm type of thing which records which artists people listen to.

Usage of Album Art in Media Players is also appaling.  Windows Media Player serves up blurry micro-icons with a vague similarity, iTunes needs your credit card details, RealPlayer is ... RealPlayer and image processing is probably considered an unnecessary feature by the Winamp fans.  Why can I not get high resolution album art for an album I've just paid £15 for?

The problem that the music industry seems to have is that they're so focused on music, they're not studying how people are using the music they publish.  Once we've given them our life savings to listen to a 30-second demo they're uninterested in what we do next.  When I've paid for a CD and put it on my computer and Windows Media Player doesn't know what it is, I feel disappointed with my purchase.  When I can't see the album art clearly I feel disappointed with my purchase, and I'm not going to be so willing to pay £15 when I can get pretty much the same thing for free over Limewire or Bittorrent.

First hurdle however, is that the CD format doesn't support identifying different albums - it's basically a digitised gramophone, with some extra digital markers thrown in.  This is perfectly understandable as CDs were invented before the age of the internet, and at the time, they probably had more storage than most hard drives.  Of cause this could be easily fixed by shoehorning 16 bytes in somewhere to store a GUID for the album that can be picked up by media players and CD ripping software.  These GUIDs can then be registered at a central database that Internet-aware devices can contact to download the necessary information.  The other way to fix this would be to use CD-Text, but then you're getting into the realms of code-pages, character encodings, and text on the CD will take up alot more space than a 128-bit GUID.

#26/12/2008#

"Wii Tennis is a great game but..."

My arm is really aching after yesterday's tennising at Uncle and Auntie's house.

#24/12/2008#

"Yes"

Aero over RDPYes, this is a remote desktop session

Yes that is Aero you see

Yes that is rather cool

 

 

Flip over RDP

Yes this is Flip 3D

Yes it is a bit jerky, but suprisingly stable...

Remote Desktop is able to tell if both server and client are running Vista (or Windows Server 2008) and can enable Aero over the remote session.  It's done by sending the appropriate drawing commands to the client, so it doesn't work on XP, which doesn't have a rasterising desktop composer...

#18/12/2008#

"Webflex is now feature complete"

For those of you that are interested, Webflex is now feature complete for Version 1.0.  This means I no longer have any completely new bits to add to Webflex (I think).  Instead I now have the tediously boring task of reviewing the 1000s of lines of code I've written and make sure it's mostly consistent (which I know it isn't) and test that it all works (which some of it probably doesn't).

What is Webflex?

If you have no idea what Webflex is, then let me explain.  About three years ago I was registering on various forums, noticing that each time I was repeatedly putting in the same information.  This got me thinking that rather than using a web browser to access a forum, one could craft an application that would be able to access forums in a similar matter, but allow extra features like automatically registering at new forums and keeping those profiles in sync.  This idea grew into Aspex, which is currently on hold.  As I was writing Aspex, I noticed two distinct streams in the project: one side dealt with the forum part - headers, boards, posts, etc. and the other side dealt with managing data and the website.  I noticed that there was a clear gap between the two streams, which allowed me to to focus on creating a basic website management tool, which could be easily extended to provide both a web-based and local client based interface.

This web and local client mix is where I believe that computing should be heading.  The browser is nothing more than an over-hyped shop window.  I'm not going to use a browser to edit my 100,000 word thesis, I'm not going to use a browser to edit my companies balance sheet and I'm not going to use a browser to create and show a presentation; I will use desktop applications for these tasks.  I'm going to use a browser to read articles, and access the communication services that networking (not just HTTP over TCP) allows when I'm away from my normal computing context (like at an airport, in town, etc.).  These communication services could be email, facebook, twitter, etc.  If I'm going to use these communication services they need to integrate into my current computing environment, and if that's isolated in a web browser, then that's one more button to click which is one more barrier to cross.  Therefore, any communication service worth my time will have both a web based interface and a local client that can integrate into my operating system (such as a Twitter gadget for the sidebar to let me micro-blog my current activity).

Anyway, back to Webflex.  Webflex itself looks after the management of a website and it's data.  The idea is that you take Webflex and build up your website around it as one or a number of plugins.  Plugins have two versions: a server and a client version.  The server version contains Data Item classes, Data Handler classes, Web Services, Web Pages, plus the necessary XML and code to install the tables into the database.  The client version contains the web service clients, controls and other classes to integrate with the Webflex client and allow users to access the services on the server.

The way in which Webflex manages data is quite important.  I felt that it was important that Webflex is as compatible as possible with different DBMSs.  Unfortunately DBMSs have different ways of expressing similar (but subtly different) things, so I needed a way to express the tables and queries that would be used in an independent way, that was easily usable by my code.  This resulted in the creation of XTDML (eXtensible Table Definition Markup Language) and XQDML (as XTDML, but with Query instead of Table).  These two XML based formats describe the necessary features of a table and query in a way that allows them to be converted to SQL statements at runtime to be installed into a database.  Rather than executing SQL queries each time, XQDML files are saved as stored procedures and views on a DBMS, so only the very simple task of calling the appropriate stored procedure is needed to get the data.  I also wrote a tool to convert Access queries to XQDML meaning that a developer never actually needs to touch SQL when developing a Webflex application.  Unfortunately the side affect of this is that Webflex is incompatible with OLEDB and ODBC databases (the .net provider for each doesn't support named parameters) and MySQL 4.0 and below (it doesn't support stored procedures or views).

Another major feature of Webflex is it's security model.  The core of Webflex consists of about 15 tables for storing users, groups, plugin and security data.  Each user can be a member of many groups, upon which security controls are applied.  When a plugin is installed it may register a number of Object Types that can be secured.  Security can either be shared among all records in a table, or specific to an individual record.  The plugin will also specify the default security for each of the five ranks for each action defined on an object, so for example a plugin could specify that by default an Administrator can Edit a Header, but an unregistered user cannot.  This model allows for the adding of any number of objects and any number of actions, helping Webflex be a highly extensible core for a website.

The final feature of Webflex is the Task Manager.  The Task Manager has a number of Tasks, that contain a number of actions and a number of triggers.  Triggers can be triggered by an Event, or at a certain time (which can be repeated over a certain period).  Whenever a trigger is triggered, each of the actions associated with that Task are run asynchronously.  Examples of Tasks include Installing a Plugin when requested, or sending an email to a newly registered user.

And that pretty much sums up what I've been working on for the past three years.  And in writing this I've just realised that I haven't yet written the web interface, the ability for the local client to add new tasks to the Task Manager or for emails to be sent to new users telling them their credentials and registration code.  Oops.

#13/12/2008#

"Laptop Shopping"

If there's one thing I hate more than Macs, it's buying a laptop.  As an aside I'm not a great fan of laptops anyway, but I can see where their portability would be advantageous.  This time I've been asked by the Anglo-Italian Family History Society to get a laptop for them to take round the Family History Fairs, so that they can show their website and allow visitors to search their transcription records.

Now, much as I despise Dells and their cheap rubbishness, they have got the buying-a-laptop-online thing sorted.  I choose my model, customise it, get any extra accessories Dell can provide and buy it there and then, I've got what I want quickly, easily and with little stress.  So, with a rough figure to work from I can now go to other manufacturers and see what laptops they've got to offer.  On Acers site, rather than giving a handy scriptlet to customise my laptop, they just list every model of laptop they sell, with a basic specification.  No customising, no searching, no "this is the model most suited for you", just me and a list of meaningless product codes.  Same with Toshiba (although they do have a searchy thing), same with HP, same with Lenovo.

Let's face it, unless you don't mind sitting down with a large Excel spreadsheet ready to compare each one, you might as well get a Dell.

What about the great leveller of the internet - price comparison websites.  Why shop around yourself, when a website can do it for you?  One issue I have with price comparison websites is that they tend to simplify things quite a lot.  For example, for filtering CPU speed I have to choose within their pre-determined ranges.  I can't say I want 1.8, but don't mind a little either side, I've got to say 1.7-1.79 and 1.8-1.89.  It's also increasingly common for CPU speeds to mean very little to the performance of a processor.  A uninformed user may see that there's 3GHz P4s or 1.8GHz Core 2 Duos.  Which one is better?  The Core 2, because it's got two cores, but the price comparison website doesn't see that, it only sees a processor (and who says a laptop can only have 1 processor) with a speed.

Another price comparison website I went to, asked me to choose which brand I wanted first.  But that defeats the whole point of a price comparison website, when I want to compare competing laptops from different providers.

Another problem with laptops (and computers in general) is different components from different makers.  Do I go for an Intel processor or an AMD processor?  Do I go for an ATI graphics chip, or an nVidia graphics chip?  What are a real performance differences?  Will the AMD spontaneously self combust on account of it's heat?  Will the ATI be let down by some terrible software?  Is it worth spending £30 on go-faster-strips?  Should I really throw this all away, become a hippy, buy a Mac and put Ubuntu on it?

What's needed is a central website with a large database with all the necessary statistics about every laptop, and every component in a laptop - from the RAM clock speeds, to the colour of the trackpad.  The site should then have extensive reviews comparing different components, and benchmarking them against each other.  The site can then use these facts to recommend different choices to users when they search for laptops.

In other news Windows Vista is actually faster than Windows XP.  Unfortunately for Web 2.0 pro-Apple, pro-Google hippys, the world did not end, but a small deer was run over in a country lane in the upper left corner of Mongolia.

#10/12/2008#

"Speedy Browsers"

Everyone knows that the problem with today's Web 2.0 applications is that they're uselessly slow.  Facebook, for example, is infuriatingly unresponsive to my clicks, and quite easily gets confuddled if I press the back button a few too many times.  Obviously Google has a few things to say about this problem and has come up with this.

So, I want native speeds, network awareness, easy deployment... Simple, a nice application with a well written Windows Installer based auto-update manager would be perfect.  But then you'd have to be good at programming and that might be a problem for all those Web 2.0 companies that have problems thinking outside the browser...

At the moment, we have a desktop which is too difficult for some 'programmers' to access.  So some very clever people made an abstraction of the desktop and invented a scripting language so that the world and his horse could display rubbish on our screens.  After a while this abstraction becomes more complex, and one wonders if there'll ever be an abstraction for the abstraction (a browser within a browser)...

#02/12/2008#

"On Java And Headaches"

Today's question of the day:

How on earth did Sun manage to frak Java up so much?

I suppose I ought to point out that I come from a VB and VB.NET background, so I'm not going to enjoy curly braces, case-sensitivity and semi-colons, but I can also point out that VB.NET and Java are competing in the same market and my thoughts about them will decide which one I 'push' in any programming related projects I take part in in the future.

We have to learn Java at Bath in the first year, having just been molly coddled by Python for 6 weeks.  The issues that I have with Java can be summed up in this nice little list:

  • Type coercion:
    VB.NET will let you run the following statement:
    Dim x As Single = 2.02
    Java, on the other hand won't let you execute this equivalent statement:
    float x = 2.02;
    Why? Because 2.02 in Java is created as a double and you can't coerce a double straight to a float, despite the fact that I CLEARLY WANT THIS VARIABLE AS A FLOAT and 2.02 is perfectly representable by this data type.  Similarly I can't assign a long variable a value greater than 2^32 because by default Java creates numbers as ints, despite the fact I'm clearly assigning this constant value to a long variable.  Similarly I can't coerce a char to a String (although I can append chars to Strings).
  • String equality:
    The following function returns false:
    boolean Example(){ String s1 = "blah"; String s2 = "bl"+"ah"; return s1 == s2; }
    Why does it return false? Because the == operator on strings compares the reference not the value.  How many times will I want to know if two variables reference the same string compared to the number of times I will want to two if two variables reference equal strings?  Instead I've got to use the compareTo function to find that s1 and s2 are equal.
  • Interface naming
    In the .net framework all interface names start with 'I', so we have 'IList', 'IComponent', 'IComparable', etc.  In Java there is no difference between the naming scheme of a class and an interface.  In Java is 'Collection' an interface or a class?  Is 'Set' an interface or a class?  You can't tell until Java complains when you try to inherit them that they're both interfaces!
  • IDE
    Why does Eclipse have to be so slow?  I'm half way through typing out a line of code and it spends 15 seconds thinking about nothing before letting my text appear on the screen.  With VB.NET, all you need to do is install VB2008 Express and you're sorted with one of the best IDEs ever made.  With Java you can use Sun Development Studio, NetBeans, Eclipse, Emacs (if you're brave) and so on and so forth.  This means that rather than focus on one quality product, developers are spreading their efforts to maintain 3 IDEs (Emacs doesn't count) and the reduction in quality is noticable.
  • ;
    And one last shout to my friend, the semi-colon.  Why can't they develop and IDE clever enough to put them in for me?  Or develop a language clever enough not to need them?  Oh wait they did...