The real problem with electric cars

July 15th, 2010

I’ve been seeing lots of articles recently about how someone has solved the “last remaining technical problem” to make electric cars a practical reality.

The one thing all these articles have in common is that none of them ask the most important question – where is all the electricity going to come from ?

An average car (say 80 horse power) uses the equivalent of 60 Kilowatts of electricity. I’ve no doubt that we can build electric cars that are more efficient than their petrol equivalents but nonetheless, cars need a lot of “juice”.

To put this in perspective, the chart below shows “primary energy usage” for the UK in 2008 in “barrels of oil equivalent”.

uk energy consumption 2008

It’s pretty clear that if we switch to electric cars, we are going to need to generate *a lot* more electricity, approximately 600% more !

As natural gas runs out, we’re going to need *even more* than that if we still want to heat our homes (roughly a further 600% increase). This means that over the next 10 to 20 years, we’re going to have to increase our electricity production by 1200% to maintain our currently relatively carefree energy lifestyles.

Houston, we have a problem !

My top 10 most significant web technologies

June 21st, 2010

Drupal
The mainstream web has yet to fully catch on to the significance of Drupal although it is rapidly gaining significant momentum. Kind of quietly whilst nobody noticed – at least, not me – the Drupal team have been developing a most intelligent, comprehensive framework for assembling tailored content management systems.

Having worked with content management systems for 10 years I had all sorts of ideas and aspirations for problems to solve and technology to develop. It came as a revelation to discover Drupal a year ago and realise that most of my wildest content management dreams have not only already been realised, but matured, tweaked, documented and improved. Discovering Drupal has pushed my information technology horizons at least 5 years into the future and not only that but I’ve discovered a large, well organised, friendly and extremely well informed community of fellow developers to work with.

A year later, I’m beginning to discover the new boundaries, but wow, what a ride ! Imagine all the “web things” you’d like to build have already been built, have had the quality and intelligence dials turned up to max (and then some) and it’s all for free.

If you work on the web or especially with content management and you haven’t yet discovered Drupal then you are essentially blind to the reality that is surrounding you.

JavaScript
I think most programmers tend to think of Javascript as a toy programming language, the sickly younger brother of Java; good for animating flashy web pages but not much else?

Nothing could be further from the truth. JavaScript is probably the most powerful, flexible, portable and accessible mainstream programming language available. True, it’s object orientation is a bit weak but this is a minor detail and will fully resolved with JavaScript 2.

Prediction: JavaScript will become *the* programming language of the 21st Century

jQuery
jQuery is a library that empowers JavaScript with vastly easier and more powerful control over html user interfaces. It makes it practical to create much more engaging and responsive html applications that easily work across different browsers.

cPanel / WHM
WHM (Web Host Manager) and cPanel are the unsung heros of anyone who enjoys cheap high quality Linux web hosting. cPanel is a “control panel” that  de-skills the management of web servers and allows computer literate people to host and manage their own websites for a minimal cost. The best value and quality hosting in the UK that I use for all my sites and clients is powered by cPanel and available from eukhost for as little as £30 per year !

WHM is a web system administrators dream come true for the large scale management of multiple servers hosting many sand boxed customer hosting accounts.

mySQL
A fast, simple and reliable SQL database for the web. More than a little behind on functionality compared to many other databases but it doesn’t matter because it’s fast, it works and it’s free.

mySQL is the backbone of the interactive web.

HTML / CSS
Flawed and quirky, html & css are the foundation of the web. Open, secure, flexible and can deliver information and applications to any device with a web browser. The next version, HTML 5 will enable a quantum leap in the quality and variety of browser based applications.

postgreSQL
Possibly the most advanced relational database available (certainly for the price). Not as popular as mySQL due it’s more demanding hardware requirements which is a shame because postgreSQL has game changing, next-generation RDBMS features. It supports table inheritance, multi-values, user defined data types and the ability to code stored procedures in your choice of programming language as well as high end features such as table spaces.

WebGL
WebGL is a relatively new project that gives JavaScript direct access to the 3d acceleration hardware of a device through a web browser – It’s so new, it only works if you download the “development” versions of browsers.

You may or may not appreciated the significance of this development but it’s going to be huge, from 3d modelling to product marketing and augmented reality WebGL will be the key to the next generation of web applications.

Linux
Linux seeded the crystallisation of free and open source software. It’s a mature and extensive business and personal computing environment and it’s totally free. Linux is the ninth wonder of the world. Amazingly, even when it’s right under their noses many people still fail to see the opportunties and possibilities of not paying licence fees for basic IT infrastructure. Not to worry, they’ll get it eventually because Linux *is* taking over the world.

The Gimp
The amusingly named GIMP (GNU Image Manipulation Program) isn’t a web technology as such but it’s an excellent tool for slicing and dicing images for building websites. If you’re a professional graphic designer then it’s probably going to be worth investing in a licence for Photoshop, but for the rest of us, The GIMP is a powerful tool for processing photos and images for the web – and it’s free!

Useful modules for a kick-ass Drupal Website

May 10th, 2010

Drupal is an awesome content management system, but in Drupal version 6 one thing that makes it difficult for beginners is that it’s necessary to install and understand quite a large number of modules in order to get the best out of the system. Drupal 7 (when it’s available) dramatically reduces this need, but in the mean time, here is my list of top Drupal modules that I use to build sites.

I generally install the following modules on most sites, but the ones marked with an “*” I consider to be absolutely essential.

Modules can be researched and downloaded here: http://drupal.org/project/usage

Enjoy

acl
*admin_menu
advanced_forum
advanced_forum_more_styles
advanced_help
amazon
author_pane
backup_migrate
backup_migrate_files
calendar
*cck
*cck_time
*ckeditor
*comment_notify
*commentrss
*contemplate
*content_access
*ctools
*date
elysia_cron
*faq
*fckeditor
*filefield
gmap
*google_analytics
*image
*imageapi
*imagecache
*imagefield
*img_assist
*jquery_ui
lazyreg
*lightbox2
*locale
login_destination
mass_contact
menu_per_role
*nice_menus
nodeasblock
*node_clone
panels
*pathauto
stringoverrides
*taxonomy_image
*taxonomy_manager
*taxonomy_menu
*token
transliteration
twitter
typekit
*ubercart
*views
*views_bulk_operations
*views_customfield
*xmlsitemap

Precision Scalextric Lap Timer

May 7th, 2010

Accurate to 1/1000th second, the Precision Scalextric Lap Counter & Timer is much superior to the standard Scalextric model. Compatible with any modern computer that can run a web browser. Produces a graph of lap times, not just the basic info produced by the standard Scalextric model.

And, you can try it here (see further down this article for instructions)

More Info
I’ve been playing Scalextric quite a lot recently with a few friends. Great fun, but I was dissatisfied with the existing lap timer manufactured by Scalextric – it is only accurate to a tenth of a second which is a bit crude when average lap times are around 5 seconds and it only displays a lap count and current fastest lap on a basic LCD display.

Scalextric also sell a “Race Management” software package, but this is also very basic and doesn’t begin to tap the potential for this kind of software. There are a number of open source Race Management systems available but these seemed complex and ugly.

I decided to make something better :)

(If you don’t want to read all my self-congratulatory drivel, you can jump straight to trying the software here.)

Keyboard MembraneMy idea was to take the controller from a USB keyboard and hook it up to some magnetic leaf switches hidden under the track. When a Scalextric car passes over the switch, the magnets in the car trigger the switch which results in a key press been sent to the computer via the USB. The keypress is then counted by some software running on the computer.

One great advantage to this approach is that since I’m using a standardised bit of existing hardware I didn’t need to write any extra driver software to interface between my software and the track. Also since the device sends it’s signals using key presses I could develop my application in a web browser using html and javascript making it instantly compatible with any relatively modern computer (or for that matter, even a mobile phone).

This was one of the those rare projects where everything seemed to work first time. It took me about 3 hours to extract the “brain” of the keyboard, “decode” it’s internal wiring and solder it up to the magnetic switches which successfully fired either a “Q” or an “A” when I passed a fridge magnet over the track. Another 5 hours and I’d hacked together some basic software to time the laps, accurate to at least a 1/1000th of a second and display a nice graph plot of all lap times over the course of a race.

Version 1 lap timerFrom pipe dream to reality in 8 hours – an inspirational first for me :) !

Unfortunately, the first real test was a bit of a let down. The timer worked great with cars going slowly but didn’t work with cars whizzing round the track at full tilt.

Having got this far, I wasn’t going to give up. After a bit of thought, I decided that using infra-red beams to detect the passing of the cars would be the best solution as there would be no mechanical contacts to wear out or interfere with the cars.

Interfacing some infra-red photo-diodes with the keyboard controller was more difficult than wiring the leaf switches and required some experimentation and “bread-boarding” with inverters, resistors and relays. However after a few days and a number of trips to Maplin.co.uk (my new favourite shop) it actually worked.

This is the first electronic device that I’ve designed and then actually made so I was pretty excited !

We’ve been using the new timer for a few weeks and I’ve made a few enhancements to the original hacked-together software. One advantage of the software being “browser-based” is that I can publish it online and you can try it out for yourself here. You can press “Q” and “A” on your computer keyboard to simulate cars triggering the lap timer – admittedly not as much fun as real Scalextric but it gives you the idea of how the software works.

If you like the software and want me to make you a lap timer I can currently make one for you for £100 GBP given a fair bit of notice and depending on my work schedule. Yes, this is outrageously expensive but I currently have to hand-make the timers which is extremely time intensive.

If there is enough interest, I may find a way of getting the timers mass produced which will bring the cost down significantly. Drop me an email at slgard@gmail.com or leave a comment on this blog post and I’ll see what I can do.



Try my Precision Scalextric Lap Timer here

Note the software has been designed to be operated using a keyboard (although you can still use a mouse if you wish).

Key controls are:

1 = simulate Track 1 lap (“a” also works)
2 = simulate Track 2 lap (“q” also works)
n = new race (you need to press this before the software will start counting laps)
t = about
e = settings
f = show times for the 10 fastest laps for each track

Note that the first time you press “1″ or “2″ on a given race, the software doesn’t actually record a new lap – it just starts the timer. This is intuitive when used on a real Scalextric track (ie the cars cross the start line) but not so when “testing” the software on a keyboard.

Also, note that the “Vroom” noise indicates a new “fastest lap”

Drupal Automated Title Update SQL

January 3rd, 2010

update node_revisions as nr
JOIN node AS n ON n.nid = nr.nid
JOIN content_type_yoga_class AS yc ON yc.nid = nr.nid
JOIN content_type_location AS loc ON loc.nid = yc.field_class_location_nid
join node as locnode on locnode.nid = loc.nid
set nr.title = concat(‘Yoga class at ‘, locnode.title, ‘ ‘, loc.field_town_value)
where n.type = ‘yoga_class’

Solar Laptop Charger for Tour d’Afrique 2009

December 17th, 2009

Something that readers of my TDA 2009 blog may not have realised, is that for the first half (2 months) of the tour, I was writing my blog posts on an Asus eeepc laptop powered almost entirely from a solar panel and li-po battery mounted on the rear rack of my mountain bike.

My home made charger worked perfectly, giving me an average one hour of netbook use per day and also allowed me to charge my mobile phone from a USB port on the netbook. Throughout most of Egypt, Sudan, Ethiopia and Kenya we had very limited access to electricity and on the occasions where mains was available, competition for “socket space” was fierce. There were also security concerns leaving valuable electronics lying around to charge up. Having independence from the grid was very handy and it was a fun and successful experiment :) .

Home made solar chargerThe photo shows the top of the unit which consists of  a 12 volt and 6 volt solar panels wired in series to give a total of 18 volts and about 10 watts of power. The reason for having 2 panels is that it didn’t occur to me until after I bought the first panel that you can’t efficiently charge a 12 volt battery with a 12 volt power source.

The solar panels are screwed to a wooden frame which had space underneath for a lithium polymer universal external laptop battery to actually store the power. I wasn’t about to subject my poor little laptop to the vibrations of crossing Africa on the back of a hard tail mountain bike.

In addition, there was a “mounting plate” made from 12mm marine ply which was bolted to the rear rack. In combination with the web straps this held the whole thing securely in place on the rack. It also protected the unit from dust and water (within reason) and meant that by unclipping the straps, the valuable parts of the unit could be removed and replaced in about 30 seconds.

Orange P7 in Keyna.The whole unit weighed 2.2Kg + the weight of the bike rack. It was heavy enough to upset the handling of my bike slightly and I guess it made a difference going up the many hills, although I can’t say I noticed ( I was exhausted anyway).

Relatively speaking, my solar panel was quite low powered (size does matter!). It would take 5 days to charge from empty to fully charged, and this would give me about 5 hours of computer use. Combining this with charging both the laptop and my charger battery from the mains when power was convenient meant that I always had enough electricity.

Sadly, after the laughably serious hammering from the “roads” in Kenya, something in the external battery gave up the ghost and the unit stopped working (and started smoking!) at roughly the half-way point in Arusha. By this point, electrical sockets were much more common, and whilst it wasn’t as convenient I was able to keep blogging by charging from mains power. I regret not removing the solar charger from my bike during the “Trans East Africa Highway” section, because then I think it would still be working today :(

Carolyn Steel: How food shapes our cities

October 7th, 2009

Does Windows vs Linux really matter any more ?

September 22nd, 2009

Some people might argue that it never mattered, but I think I had a moment of insight the other evening :) .

With freely available virtualisation technology it’s going to matter less and less what operating system you’re running or which operating system your applications need to run on.

My understanding is that Windows 7 includes “seemless” virtualisation to allow Windows XP applications to run successfully without compatibilty problems.

When Linux is able to use something like VirtualBox to provide similar seemless virtualisation functionality then it really won’t matter in most cases whether your applications have been developed for Windows or Linux.

I’m currently using VirtualBox to do ASP.NET development on an XP guest using Ubuntu 9.10 as the host. XP runs “snappily” on the VirtualBox virtual machine and using Visual Studio / Photoshop is sufficiently like running it natively that it doesn’t matter.

The VirtualBox virtual machine seems to have a very small memory overhead (35Mb last time I checked).

Update: It appears that VirtualBox does provide “seamless” virtualisation. This effect isn’t perfect since even though the Windows XP desktop disappears, the Windows applications are not added to the Linux task bar. It works pretty well, but it’s not (yet) truly seamless.

More amazing robotics

August 29th, 2009

This robotic arm is co-ordinated with a camera to perform feats of incredible dexterity and speed. In the near future these things are going to be everywhere – building, cleaning, protecting, farming. Then what ?

Review of Online Clothing Retail

August 13th, 2009

I was recently asked by Asos.com (the leading online UK fashion retailer) to review their e-commerce site and suggest how it could be better.

My intitial impression was that Asos.com *really* know what they’re doing and that improvements were going to be incremental and somewhat hard to find.

After a few minutes of browsing it was clear that whilst Asos have put thought and talent into creating a great site with innovative features there is still massive room for improvement. The same being true of *almost every* website.

Fashion is a difficult product to sell online. Clothing is highly personal and customers all have different tastes in colour, fabric, quality, design and of course fit.

Taking jeans as an example, I’m very choosy: I prefer a specific colour, fairly loose fit, zip fly, “high quality” denim and no “weird frills” such as buttons on the pockets. I also don’t want to pay much more than £30 per pair.

I don’t think I’m asking a lot but finding the right pair of jeans on or off-line is  a headache. Any company that can get this right for me probably has my business for life.

Despite Asos.com having 319 different styles of jeans I still couldn’t find a pair that I liked in my price range. This lead me to wonder what the competition were up to and what constitutes “state of the art” in online clothing retail.

The contenders

To get my shortlist of sites I googled “online clothing sales UK”. I picked the top 3 pay-per-click advertisers and the top 5 organic search results. Far from exhaustive, but a good starting point.

This lead me to the following online retailers with a plan to test each site by trying to find a decent pair of jeans:

The results

I was surprised by just how far away these retailers are from getting me to part with my money. Asos.com were the clear leaders, although still no “ka-ching”.

Some of the bigger names (notably Next and Boden) were terrible. They appeared to have given no thought as to the process that a customer goes through when selecting a pair of jeans. I hope their current offering is merely a “toe in the water” until they work out how to do this thing right ?

Physically travelling to shops is expensive and time consuming, but none of these guys are going to be getting my money and I’m not getting a new pair of jeans. A lose – lose situation :(

The leaders

asos.com (chances of me buying : 40%)

Asos have evidently thought about and made a decent stab at solving the difficult problem of online clothing sales. With features such as a flexible product search, good product information and a video catwalk for each product they are the clear leaders of the field.

There are still many refinements and innovations that could be applied to the site but their biggest problem in winning my business is too small a range (despite stocking 319 jeans styles). I’d guestimate that they need double or triple this number to randomly hit the combination of colour, fabric, cut and style that I’m looking for.

Multiply the approximate required number of styles by the number of different sizes offered (38) and you end up with 957 styles x 38 sizes which comes to 36366 potential product lines just for jeans. Realistically, that’s just for starters – you can see why this is difficult !

reason for not buying: nothing i liked in my price range

laredoute.co.uk (chances of me buying 50%)

La Redoute don’t have as big range of jeans at 183 styles but more of their products fall into my price range. The product search is basic and whilst it is effective, it is somewhat labour intensive. I want to be able to filter out jeans with button flies and “weird frills” – not to have to click on each pair and examine the details.

On my second look through their site whilst writing this article, I did manage to find a pair of jeans that I might buy. Not my favourite colour though and bit more than I want to pay. Will think about it :)

reason for not buying: not convinced about quality

direct.asda.com (chances of buying 20%)

Asda Direct has a tiny range of jeans styles but at between £6 to £18 they are incredibly cheap. Their search interface is clean, simple and unsophisticated but with only 13 different styles it’s good enough for the job.

I liked some of their styles but I wasn’t convinced about the quality. It’s very difficult to get this across from a photograph. I think it’s worth paying extra for quality jeans and I just couldn’t be sure what I would be getting for my money.

reason for not buying: not convinced about quality

The also rans

debenhams.co.uk (chances of me buying 20%)

There’s nothing terribly wrong with debenhams site but there’s nothing terribly good about it either. Like *all* of the sites reviewed you have to look through each item indivually to determine zip / button fly but in debenhams case the information is inconsistently specified (sometimes in different places on the screen, some times not at all).

The product search is a superficially credible attempt but is nonetheless misses the mark. I just couldn’t be bothered to manually go through each primary category and manually filter for button /zip fly – and then try to remember / shortlist suitable jeans.

I *don’t care* about whether my jeans are boot cut, relaxed fixed or classic fit (what on earth do these terms mean anyway?) but I do care about zip flies (and yes, no “weird frills”). Why this isn’t blindingly obvious to e-fashion retailers I have no idea ?

reason for not buying: to difficult to search

fashionworld.co.uk (chances of me buying 20%)

Fashionworld probably had the second best product search (after Asos) but predictably still no zip / button filter.

The product details are poorly presented and the zip / button information is not provided consistently. Overall the user interface for the site feels cluttered and confused.

With a small range of only 80 styles, I didn’t find anything I liked, but then I couldn’t be bothered trawling through each item to find my key buying features.

reason for not buying: not convinced about anything

The loosers

next.co.uk (chances of me buying 20%)

I pretty much buy all my clothes from Next’s high street stores. Good quality and price and their styles are closest to what I like (fewer ripped jeans / t’s and no stupid sounding brands like fatface or crimnal). It’s a pain driving across town to my nearest Next and they only tend to have something I like about 1 in every 5 visits.

I had high hopes for the Next online store but was sadly very disappointed.

Their jeans search forces me to click through their entire range of about 45 styles 3 at a time and to check each product individually for the features I’m after (eg no button fly /weird frills etc). Sorry guys, I’m just not going to bother.

Not only that, but incredibly the Next home page automatically plays a video with loud elevator music when I arrive at the site. This was tacky and stupid back in 1998 but these days, jeez ! What are you guys thinking? Your web agency should be sacked either for incompetence or cowardice in the face of the customer!

reason for not buying: couldn’t be bothered to trawl through items

boden.co.uk (chances of me buying 10%)

Boden have a range of 5 styles in 3 or 4 different colours each. The prices aren’t great (£45) and they only seem to sell stock button fly jeans.

The product search isn’t helpful at all, and you basically have to click through all the jeans (fortunately only 5 styles) to find what you want. The product information they provide for each pair is pretty comprehensive.

Boden also have quite a neat feature allowing you to order your jeans “unhemmed” so that you can get the length just right. They can also tailor the length for you at a cost of £6.

I managed to find some jeans that I like but the absence of a zip fly means no-deal !

reason for not buying: insufficient product range

peacocks.co.uk (chances of me buying 0%)

A nice clean site design but very few styles of jeans. No product search but then with only 6 styles they don’t currently need one.

The prices were cheap but the jeans probably looked it. Almost no product information such “zip / button” was provided. Hey, they’re only jeans right, who cares ? Wake up guys – your customers website visitors care !

reason for not buying: not enough product info. not convinced about quality.

The Conclusion

Sucessfully selling clothing online is difficult challenge who’s time has come. The technology, bandwidth and economic conditions are there for someone to do this right and make trillions :)

Asos.com are the only team out of the those reviewed that seemed to have fully grasped the issues although they have a way to go before all the challenges are solved.

Asos.com are in pole position but far from unbeatable. Anybody with vision, deep pockets and a sufficiently large warehouse who feels like taking them on would be very welcome to get in touch and have a chat about what needs to be done !