The web is broken, please fix…

Posted in Uncategorized on June 6th, 2009 by admin – Be the first to comment

The web is really broken right now. It takes all sorts of elegant hacks and skill with CSS and Javascript to take something originally intended as a document and turn it into an interface for a fully-functioning web application.  The fact that Google have already managed to pull of Google Maps and GMail so brilliantly is nothing short of amazing given the underlying mess they have inherited to work with.

I think HTML5’s canvas support could change a lot as it becomes possible to render directly to screen. I wouldn’t be suprised if Google or some other big organisation release a new kind of markup more suited to laying out application interfaces than HTML to make this easier – some kind of CanvasML (Update: In fact Mozilla Thunderhead seems to be pursuing this).

Mozilla’s Bespin looks like an awesome project but the decision to use Canvas as the rendering layer to avoid the overhead of HTML makes me realise why I like developing with Flash and Flex and why Silverlight looks like a great option too.  OK so Flash’s text handling isn’t brilliant but on the flip-side it’s going to take years before there is the same level of  Canvas to the same level of rendering capability as Flash and even then there’s the whole networking and data binding layers.  Javascript just isn’t as nice to work with as a compiled language like Actionscript 3 or C#.  So, with Canvas applications, aren’t we just starting over for the sake of “standards” ?   Maybe propietary plugins aren’t so bad after all… or perhaps haXe + xinf is the open-source answer waiting in the wings?

Seems I’m not the only one thinking about this.

Upgrading the core of my HTPC

Posted in Computers, Hardware on May 24th, 2009 by admin – 2 Comments

Following on from my last post, I’ve ditched the idea of building a new mini-htpc for the time being.   Nothing quite beats building a PC from scratch – it appeals to the Lego man in me – but using my existing Antec Fusion mATX media centre case and PSU saves me a considerable amount of money.  I’d love to build something small and sexy in the future but for now I just need a working system for as little outlay as possible.

I am still sticking with the AMD 780G platform, however.  The desktop (mATX) versions of these boards have recently dropped dramatically in price.  The energy efficient 45W CPUs have gone up slightly since my last post but overall a 780G system is getting cheaper.

Here’s what I’ve just bought for £125 at eBuyer:

  • Motherboard: PowerColor RS780G
    - bumpytrails has a nice unboxing gallery of this board
  • RAM: Kingston 2GB DDR2 800MHz CL5 1.8V
    - Single stick. I know they work better in pairs but I’m on a budget and want to expand later – the PowerColor only has 2 RAM slots!
  • CPU: Athlon64X2 4850e 2.5Ghz @45W
    - Obviously not as power efficient as an Atom but should have no problem transcoding video on the fly.
  • Extras: Plexus SATA TO IDE Dongle
    -  The PowerColor motherboard only has one IDE connection so to make use of my existing drive I need to use this adapter.  I’m waiting for SATA SSDs to come down in price so this is a temporary measure for the system drive.

I think this is £125 well spent.  When the bits arrive and I plug it all together I should be good for 1080p playback and reasonably quick video encoding.  This will be a huge step up from the 1.4GHz 512Mb RAM Athlon XP sytem currently squatting in my lounge.  It’s going to be more powerful than the Eeebox B208 system I’ve somehow convinced myself I NEED too (although I can’t fix this one to the back of a TV in quite the same way!) .

Software-wise, I’m going to install Windows 7 and try that version of Media Center out.  I’ve been looking for a decent media center application and previously tried MythTV (via Mythbuntu).  Ugh! – I never got it working and wasted days trying to get the RadioTimes TV listing feeds integrated.  Until Boxee has TV tuner support, I’ll stick with Redmond thanks.

A Faster, Smaller, Cheaper, Greener HTPC

Posted in Computers, Hardware on September 27th, 2008 by admin – 5 Comments

Update: Apparently the groovy NOAH case only has an 80W PSU.  This is insufficient for the components specified.  However, this is such a nice case I might see if the on-board PSU can be upgraded.

With all the fuss over the recent Intel Atom processors I thought it time to look at what components I could use to build a smaller, more energy efficient machine than my honking huge lump that’s too big to fit under my TV.

I am currently running an old 1.4GHz Athlon XP 1600+ with 512Mb RAM which has been just fine for my needs with a regular CRT telly.  My graphics card is a (now ancient) nVidia FX 5200 with a decent S-Video out but incompatible with Vista and while I dearly love my Antec Fusion case it really is too huge to have kicking around my living room floor.

My first thought was whether I could use the cutesy Asus Eeebox for but reading up on it’s video playback performance I quickly realised that it’s no good for content with a resolution above 720p.  The Atom just doesn’t cut it.

How about two Atom processors then I thought?  The MSI Wind Desktop barebones kit looked much more  capable but the case was just plain ugly and there doesn’t seem to be anyone other than Newegg stocking these little boxes – no good for me as I’m UK based.

So I paid a trip to mini-itx.com and wasted an hour or so investigating my options.  I was pleasantly surprised to find it’s now possible to put together a spec for a mini-itx box that uses a standard desktop processor for a relatively affordable price.  AMD have radically improved the energy efficiency of their processors in the past year and good performance is finally attainable for little power consumption.

So, after a little research to find the best prices from other sites, here’s my current thinking:

List of Components

From mini-itx.com – £101.05 (incl. VAT)

From ebuyer.com – £114.20 (incl.VAT)

From linintx.com – £104.58 (incl.VAT)

From my spares – £0.00 (incl. VAT)

  • 80Gb Hitachi SATA 2 2.5″ laptop drive (small drive needed to use the PCI riser for a TV card in the Noah case)
  • PCI Digital TV Tuner Card

So the grand total for my upgrades would be £319.83.  I’ll certainly be considering this…. :-)

Indiana Jones and the Kingdom of the Crystal Skull: Mini Review

Posted in Uncategorized on June 16th, 2008 by admin – Be the first to comment

A nostalgic, tongue-in-cheek, roller coaster of a film that captures the spirit of the original trilogy. Plenty of over the top action sequences, comic book villainy and rich special effects that enhance the much-loved Indy aesthetic.

However, the film feels like a cast and crew reunion with Indy as the guest of honour, swept along in the action rather than being the dynamic pivotal character. After the ‘fridge’ scene, Indy was never in any believable danger and the minimal romance aspects of the plot didn’t allow Harrison Ford a chance to fully deliver his famous wise-guy charm.

Overall though definitely worth a watch. Real value for money in terms of sheer entertainment.

Content Modeling with XML

Posted in Content Management, PHP on May 20th, 2008 by admin – Be the first to comment

The Content Management System I'm currently working on has some known and reasoned limitations. It was designed a couple of years back for immediate ease-of-use by clients with simple needs and so i more an Adobe Contribute replacement rather than a full blown enterprise-ready überapp. There are some dynamic/shared elements such as 'Common Content' (think footer/sidebar content) and Collections (think FAQs and lists of things that need to be managed separately but appear on multiple pages). The navigation also builds itself from the site structure. It works well and I get good feedback from the clients and developers using it.

However, there normally comes a point when the client wants to do something a bit different. Lets say that rather than maintaining a simple list of FAQs with Collections, they want to create a knowledge base of articles. Up to this point clients have had to re-purpose a set list of properties for each 'Collection Item'. The fields were: publish date, title, summary, thumbnail and link. Thanks to a bit of ingenuity on the part of our developers, these properties were sufficiently generic to be useful in a range of scenarios from making a randomly rotating banner to an events list to a simple photo gallery with albums. I was surprised how flexible something so statically defined could be. That said, the fields weren't all used all the time and since the labels were generic, sometimes it has hard for the client to relate which form fields affected the final output on the website. In short we needed something more scalable and user-friendly. We needed 'custom' Collections where the form fields could be configured for each type of content the client required. We needed a way to model content.

It so happened that the way in which I'd designed the database earlier abstracted the notion of a schema for Collection Items away in favour of storing name/value pairs to facilitate versioning. In fact the static properties discussed above (title, summary etc.) were only enforced as hard-coded items in PHP. Good so far but I needed a way of mapping some sort of structure to the data on its way into the database as well as on its way out.

XML was the answer. For each 'Collection' of content added to the site, a collection type is used to provide a 'content schema' for the data. The basic idea is to have a single XML file that carries just enough information to build a form, validate the user input (and filter it if necessary) and then store the data entered.

A sample collection type is shown below:

XML:
  1. <?xml version="1.0"?>
  2. <collection-types>
  3.     <!-- DEFAULT -->
  4.     <collection-type guid="00000000-0000-0000-0000-000000000000">
  5.         <name><![CDATA[Default Collection Type]]></name>
  6.         <description><![CDATA[GCMS v1.0 Collection Type]]></description>
  7.         <settings items-sortable="true" grid-columns="link" grid-search="title|summary" />
  8.         <properties>
  9.             <property id="title" type="TextField" label="Image" required="true" />
  10.             <property id="summary" type="RichTextArea" label="Summary">
  11.                 <default-value><![CDATA[blah blah]]></default-value>
  12.             </property>
  13.             <property id="thumbnail" type="AssetChooser" label="Image" />
  14.             <property id="link" type="LinkChooser" label="Link" />
  15.         </properties>
  16.     </collection-type>
  17. </collection-types>

As you can see the XML schema is fairly simple. Each collection type gets a node with a unique identifier by way of the 'guid' attribute. This GUID gets stored in the database along with the name and description node values for each Collection and the GUID is used in an XPath query to retrieve the schema from this document at runtime.

The property nodes define the actual form fields that appear when the user adds/edits Collection Items. There are various property types which relate to the interface elements used when the form is rendered. Other attributes on each property node relate to how the data should be validated and filtered (such as have the entered text made uppercase or hyperlinks made clickable). Some more attributes specify default values that should be used, whether values should match another field, be unique etc.

The settings node in the XML document is used when the Collection records are viewed in the Content Management System. The attribute values are used to determine which properties are displayed in a datagrid and which can be searched.

And so, the XML simply defines a form to be rendered but also, the fact that we have a record of the structure of the stored content means that we can use this to publish content from the database into HTML (by means of templating), XML (by using the 'id' attribute of each property node as the tag names) and even to an SQLite database. Since SQLite supports only a few simple data types I was able to simply map the property types (taking into account their validation rules) and create an SQLite database for each Collection on the fly. This proved to be an ideal solution for reasons I've mentioned before.

So modeling simple content with XML is a very useful way to make your Content Management System flexible and because the content model is not stored recursively in your database, getting at the schema is simple and quick. If you're planning a CMS then I'd strongly recommend this approach

Essential Programming Tools

Posted in General Programming on May 17th, 2008 by admin – Be the first to comment

Here is a list of programming tools I find essential in my development work. I'm omitting the obvious PHP, Apache, MySQL, Flash, Flex etc. in the hope of highlighting the smaller utilities. These are the ones off the top of my head but I hope to add to it later.

General Programming

  • Aptana - PHP and Subversion integration, Dreamweaver "Ctrl+U" upload goodness.
  • Beyond Compare - Compare folders, zip files, FTP sites. Integrates well with Tortoise SVN and Tortoise CVS.
  • Notepad++ - Excellent file support, the right balance of being lightweight and feature rich for a text editor.
  • Tortoise SVN - Windows Explorer integration, very easy to use and unobtrusive Subversion client.
  • Enhanced Windows Console - A recent find but looks very useful.

Design Tools

  • Color Cop - Simple, no-nonsense colour picking.
  • @icon sushi - A really good little .ICO file editor

Flash Development

  • FlashDevelop - Nice integration with open-source Flash compilers etc. Better than the ActionScript editor in Flash IDE anyday.
  • ServiceCapture - Nice tool for debugging AMF, JSON and SOAP. Acts as a proxy for your browser and so can also be used to throttle bandwidth for testing.
  • .sol Editor - A Flash Shared Object file parser and editor. Very handy indeed.

Network Tools

  • WinSCP - Good SCP Client for remote file administration.
  • FileZilla - Simple, lightweight and efficient FTP Client. A handy connection manager interface. Regularly updated.
  • PuTTY - Command line console for remote server administration.

Database Design & Management

  • fabFORCE DBDesigner - Great (but slightly buggy) tool for sketching out DB schemas visually. Will create/update/reverse-engineer databases.
  • SQLite2008 Pro Enterprise Manager - Powerful tool for managing SQLite databases. I've found myself using this a lot lately.

.NET Programming

  • SharpDevelop - Very lightweight compared to VS.NET. Perfect for the odd bit of ASP.NET 2.0 development.
  • UltiDev Cassini Web Server - A No-frills (embeddable) web server for .NET written in .NET. A great development alternative to IIS.

Hybrid Static/Dynamic content with SQLite

Posted in Content Management, Uncategorized on May 12th, 2008 by admin – 1 Comment

I've been reading Deane's posts on Gadgetopia a lot recently and one of them refers to the notions of ' Data Push' and 'Template Pull' in terms of how content gets to the page driven by a CMS. This was an interesting post for me as I've recently found that a combination of these models provided a solution to a problem I was having.

As part of my work for Golley Slater Digital I've been architecting a PHP5-based CMS that uses the 'Push' model where content authored on a private 'admin' server is published to a public 'live' server to be viewed by end-users. Essentially, the CMS stores content in MySQL, writing it out as a hierarchy of static HTML (well PHP really) pages when the user elects to publish. These static pages, along with the other assets are 'pushed' live using RSync which copies them from one server to the other.

In addition to regular page content, there are other types of content such as 'Collections' that are used in the CMS and that need to be copied to the live server. A Collection is a list of structured data types, Collection Items, that are managed independently from page content. Collection Items have their own approval workflow, go-live dates etc. and can be bound to pages through the admin UI. Typically, Collections are used for News, Events, FAQ's etc. but really any content type that can be modeled with a simple structure is a candidate.

Now up to last month I had stored published Collection Items in XML which was parsed at runtime on the live site (The XML would get conveniently pushed live with RSync along with the pages). With PHP 5's improved XML support this was a reasonably performant solution and provided a basic storage mechanism for the structured data. But what if I had thousands of items in a Collection and wanted to perform a complex search to display the results over a few pages? Hmmmm. It was achievable with XML but was going to get tricky with XPath expressions and server resources would definitely suffer when parsing the XML and sorting arrays of data. I needed another way.

Enter SQLite! This database engine is embedded into PHP5, and was the answer to my woes. SQLite databases require no setup, passwords and are nothing more than regular files so they play very nicely with the RSync deployment scheme I use. On top of that since the vast majority of SQL can be used to query SQLite databases, searching and paging of results was going to be a breeze. So I made a change to the CMS that saw published collection items going into a local database rather than the XML.

Using SQLite means that the CMS can effectively queue-up content ahead of a display date and expire content at some point in the future. What's even better is that the published sites are still standalone in nature and do not need any knowledge of the CMS which created them.

O.k. so using SQLite is nothing groundbreaking but the application of it in this context made me stop thinking of a database as something at the bottom of a technology stack and as an portable and intelligent file format that can be shared between applications. Revelation!

If you're planning a CMS then I recommend you look at SQLite for creating hybrid static/dynamic pages. It certainly opened some doors for me.

Disclaimer: Yes, I used the word 'performant' in this post.  Apparently it's not a word but I like it. So Sue me.