Hire me at Go Tripod.

Gateshead Council Website Fail #2After yesterday’s post I didn’t really imagine that it’d attract the attention of anyone in the right departments – I guess I just assumed the problem would get fixed due to someone high up noticing it. What I didn’t imagine is that the problem would get replaced by another totally different issue:

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Cannot create an object of type 'System.Web.UI.WebControls.Unit' from its string representation 'r_height' for the 'Height' property.

Source Error:

Line 1559: <div class="sys_news">
Line 1560: <div class="sys_standardrepeater">
Line 1561: <asp:literal visible="false" id="D2_Count" runat="server" text="0" /> <contensis_controls:dataviewdatalist id="D2" runat="server" repeatlayout="Flow" cssclass="sys_standardRepeater" height="r_height" repeatdirection="Vertical" repeatcolumns="1" shuffledataset="False" displaytype="SpanLayout" onupdatecommand="dlUpdateCommand" oncancelcommand="dlCancelCommand" oneditcommand="dlEditCommand" ondeletecommand="dlDeleteCommand" onitemcommand="Link_Data_Click" datakeyfield="PageID"><itemtemplate><% D2_Count.Text=cstr(clng(D2_Count.Text)+1) %>
Line 1562: <h2 class="sys_repeaterItemInner">
Line 1563: <%# CustomProcessing_D2(DataBinder.Eval(Container.DataItem,"newsHeading"),"newsHeading") %>

What sort of process is in place to allow a developer to replace a known failing page with another failing page? Surely, knowing that the first version was failing you’d be double-eager to check the latest upload is working? Baffling.

Council Website Fail

July 23rd 2009, 4:45 pm in .NET, Personal.

My local council, Gateshead in the UK, recently had a notice on their website declaring that it would not be updated for two weeks as they were performing essential maintenance. This was WTF number one – I have no idea what happened behind the scenes to make them buy this nonsense but it smacked to me of technical incompetence. What do I know though – like I say, there could have been valid reasons for this decision and it’s really not that big a deal.

So today I went back on their website and it seemed to be up and running with some new updates. I hit the News section to see this message:

Server Error in '/' Application.

Compiler Error Message: BC30569: 'New' cannot be used on a class that is declared 'MustInherit'.

Source Error:

Line 341: DataviewObject(component).GetData
Line 342:
Line 343: Dim RSSWriter As New CMS_API.WebUI.WebControls.BaseRSSFeedWriter
Line 344:
Line 345: Me.Controls.Add(RSSWriter)

Source File: E:\websites\www.gateshead.gov.uk\Council and Democracy\news\home.aspx Line: 343

Ouch. This brought down the page with a bang, no decent error handling. What’s the problem? It looks like someone’s been trying to set up the RSS feed for that page but has used an abstract class instead of the concrete one. Fair enough, that’s a simple mistake but surely WTF number two is that this could be pushed to a production server?

A good provider would have a local test, a staging server, and then production, at the very least. It looks to me like this change has been pushed directly to the site without any kind of quality control.

A possible WTF number three arises when you think again about the error message in general, which should only be shown when debug information is available. This could mean that debug settings are enabled on the web server, which is a definite WTF. Showing any kind of information like this – such as drive names and file paths – probably isn’t a very good idea.

I wouldn’t really care if this was just some corporate website but I know that my tax has gone into the development of this system and it’s painfully clear that the developers are not up to the job. Are open bidding systems in place for this kind of contract? I don’t know, but I bet that even if they are they don’t go on merit. Gateshead Council: shame on you. Can I get a refund? I can certainly recommend so decent software companies with local ties:

http://www.plastiscenic.co.uk/
http://www.gotripod.com/

The book which Cutter, Shea and I wrote is up on the publisher’s site for the Author of the Year award. Obviously in our case it’d be co-author of the year but it’d be really nice to be in with a chance. Packt have a microsite for the award and the actual poll is here. It’s up against some other great books so if you could spare a minute to vote it would certainly be appreciated!

Delicious Library

January 23rd 2009, 9:32 pm in Delicious Library, Personal.

I’m sure there are a load of posts professing their love for Delicious Library. It’s pretty sweet. I downloaded it just after Christmas for no reason other than I thought it was really cool, but since then I’ve started to realise that some features could be real-world useful. Making an inventory of your possessions could be useful for insurance purposes, which is a most sensible use of this great program. I can also use it to track items that I’ve lent to people, because it integrates with Address Book on OSX.

I borrowed a bluetooth barcode scanner from my friends at Internetware and used that to zap over 500 items – books, DVDs, CDs – and Delicious Library ate them all up. It can be configured to read out the title of the item you’ve scanned so you can confirm it’s been inserted correctly, which was great for us as we bleeped our way through our bookcases in another room. The novelty of it didn’t really wear off either, in fact I found myself looking for more stuff to scan even when I’d finished the bulk of the items.

I’ve now got an attractive, searchable database of many of my possessions, and the Delicious Library publish feature means I can expose it to the web. My library currently holds 442 items and certainly gives a good look at my interests – most of my books are science fiction, for example.

When adding new items, Delicious Library offers the ability to use a webcam (such as my iMac’s built in iSight) as a barcode scanner. This feature’s been pretty disappointing and it requires quite a few attempts to get it to work, but adding items manually is pretty straightforward. New items can be automatically filtered using the smart shelf feature, which currently pulls all sci-fi and fantasy stuff into a separate area. In short, Delicious Library is much recommended!

I reserve the right to be excited by this one; in fact pretty much everyone’s gone “oooooh” when they’ve seen it. Last week I received the author copies of Learning Ext JS from Neel at Packt, and the book looks great. I’m going to talk a little bit about the way I approached the writing, and how I feel about it all after the fact.

Learning Ext JS Author Copies

Each chapter which I wrote was supposed to be around 25 pages, consisting of 6000 words. When I write a blog post, a good one is around 1000 words, so that was my comparison. I’ve not done any real writing since high school, so while I’ve continued to put out a lot of words, they’ve never been particularly well thought out, scheduled, or planned in any way. So six thousand words a chapter did cause a bit of a problem when I tried to churn out a few pages every night.

One of my techniques was similar to one of my main development ideas – don’t get bogged down in thinking how something should be done in the perfect way; just get started and refactor later. In this case, change refactor for edit, but you get the idea. I suspect this is writers block, and it was definitely a problem for me. Pushing on and getting something down turned out to be much more productive than mulling over “better” ideas. Another problem wasn’t necessarily thinking what to write, but making each chapter stretch out to the required number of words. Quite often I’d have a good couple of evenings when the writing was going well only to find that I’d underestimated how far an idea would stretch. In these cases I’d try and go in to detail on working with the subject matter or I’d think up another example to try and illustrate my points in a different or more advanced way.

Even when the initial drafts were completed, there was still a matter of sending them off for review. Editing sounds like it’s going to be the easy bit, but when you’ve been working on something for a few months you’re most likely sick of the sight of it, so revisiting it isn’t going to be high on your agenda. Still, it was an education reading over comments about my own writing, bringing me down to earth or giving me a buzz depending on how each chapter and paragraph was received. How often do you really get an outside, independent person to review your work?

Even when the edits were complete, there was still more: promotional material to be written, screenshots and code samples to be made available, blog posts to be written. After all that, and a few extra weeks, the physical copies arrived in the post and pretty much made the whole harrowing process worthwhile. Writing a book was always one of those things I’d quite fancied doing and never imagined I would, so being able to contribute to Learning Ext JS ticks a pretty cool box for me.

A few months ago I was approached by Packt Publishing to help out with one of their up and coming publications. After reading some of my blog posts and seeing some screencasts I’d done on Ext JS, they felt I’d be a good candidate to co-author a book on the subject. I quizzed them quite a bit before committing; the offer was so out of the blue that I felt I needed as much information as possible, but it’s flattering to be offered such an opportunity anyway. When I felt I could make an informed choice, I accepted, and became part of the Learning Ext JS team.

The other authors are Shea Frederick and Steve “Cutter” Blades. Shea did the first block of chapters:

  1. Getting Started
    Setup Ext JS to be used on your page and troubleshoot common installation problems.
  2. The Staples of Ext
    Explore some of the foundational components and configuration of Ext JS.
  3. Forms
    Create complex forms, database-driven combo boxes, and populate form fields with data.
  4. Buttons, Menus, and Toolbars
    Use toolbars to create compact complex navigation for your web application.
  5. Gridsâ??Making Data Intuitive
    Render database-driven grids that include paging, complex rendering, and user interaction.
  6. Editor Grid
    Go past the standard grid, and set up an editor grid that edits data in line.
  7. In an AJAX World, You Need a Good Layout
    Create a layout that provides a very flexible and attractive user interface.

I did the middle lot:

  1. Ext JS Does Grow on Trees
    Demonstrating how to display and manipulate hierarchical data.
  2. Windows and Dialogs
    Focusing on displaying information in pop-up containers.
  3. Effects
    Add spice to your applications with compelling visual effects.
  4. Drag and Drop
    Learn how to move and rearrange elements within your application.

Steve rounded it all off with the final chapters:

  1. Itâ??s All About the Data
    An introduction into the various types of data Stores, the kinds of data they can consume, how that data is defined, and how to get it.
  2. Code for Reuse: Extending Ext JS
    An introduction to creating custom application components by extending existing components of the framework.
  3. The Power of Ext JS: What Else Can You Do?
    A look at many of the utility classes of the library, including formatting and state management, as well as Community Components and resources.

It was certainly a learning experience. I thought I knew Ext JS pretty well before this, but having to fill 20 pages of text about a single part of the framework lead me to discover a lot of new things, not least how to fill out text to make it interesting, rather than a lecture. I’d like to thank the Packt team, my co-authors, and of course the Ext JS team for the opportunity – one I never dreamed I’d have.

Learning Ext JS is available for pre-order on the Packt Publishing web site, as well as some mainstream retail sites such as Amazon. If you do decide to purchase – and I strongly urge you to! – then please let us know what you think by leaving a review on the Learning Ext JS Amazon page.

Freshbooks Invoice Widget

November 27th 2008, 12:50 am in Freshbooks, PHP, Personal, Plastiscenic, Projects.

At Plastiscenic, I organise all the boring stuff using Freshbooks. In fact, Freshbooks make sorting invoices, estimates and time tracking a bit of a breeze. I was mulling over the past month of work when it struck me that I was thinking about things in completely the wrong way: I was trying to ensure that I was busy all the time, when in fact all that matters – from a business perspective – was that I was earning enough.

Freshbooks has a record of all of the Plastiscenic invoices, and therefore the amount we’ve brought in during a given month. It also has an API. I decided to quickly flex my PHP muscles and come up with a cash-orientated way of viewing my performance via my invoice data.

I created a web invoice widget for Freshbooks which uses the Sparkline PHP Graphing Library to generate a graph of the past 12 months. Ones in which invoice totals exceed the specified upper threshold are marked in green, and ones which are lower than the lower threshold are red. Everything else is black. To the side of the graph, there’s a numerical readout of the invoice totals from this month and the previous month, again coloured accordingly.

In terms of the actual scripts involved, you need to edit FbInvoicePerformance.php and enter your Freshbooks API token and API URL which can be obtained in your Freshbooks account. Then just tweak index.php from the archive according to your needs. The good and bad variables are the high and low thresholds for colouration, and the HTML in that file it just boilerplate for demonstration purposes and can be hacked as you like. Notice the readout function for displaying the numerical invoice totals. The FbInvoicePerformance class powers the whole thing but it’s pretty small and usage should be clear from the index.php file.

This Freshbooks invoice widget is completely unsupported by me. Sparkline requires PHP 4.0.6 or newer (including PHP 5) and GD 2.0 built as a PHP module, so bear that in mind if you try and use the widget. There’s no demo, but you can download the widget here.

A Confession : DataGrids

August 19th 2008, 11:41 pm in .NET, Personal.

At one point, nearly five years ago now, I not only used DataGrids…. I liked them. I’ve learned a lot since then, I recall thinking the other day that Microsoft must have had a bit of an off year when they decided to release a web development platform which pretty much relied on the client having Javascript available.

Have you made any claims in the past which you’d like to own up to now? Or do you think any of the current fads of today are going to look foolish in five years time?

NHibernate Query Woes

May 21st 2008, 1:17 pm in NHibernate, Personal.

I’m banging my head trying to solve a particular type of querying problem. I think I can simplify it like this:

Categories have many Posts, Posts have many Comments

I’d like to search for Comments with a particular author, which is easy enough, but I’d like my result set to be made up of Blogs which contain Posts which contain Comments with author = ‘ramsay’.

The problem I’m having is that if I have 50 Comments then it’ll return 50 duplicate Blogs to contain those comments. Argh! I can add groupings (i.e. group by Blog), but that means it’ll only pull back the things I group by and not the full Blog objects.

Navigating the Blog

March 24th 2008, 4:04 pm in Blog Stuff, Personal.

Just a quick pointer in response to a comment, all of the posts I make are categorised, and those categories can be accessed by hacking the URL. For example, http://colinramsay.co.uk/diary/category/screencasts/ will list all of my screencast posts. The obvious problem with that is that you’d need to know what the categories were in the first place, so as part of an ongoing blog redesign, I’ve included the categories of a post underneath the post title.

You can also hack the URL to browse by date, for example http://colinramsay.co.uk/diary/2008/03 shows all of the posts I made in March this year, and http://colinramsay.co.uk/diary/2007 shows all of the posts from last year.

As I mentioned, I’m in the middle of a redesign, but the main change you should be able to see is in the readability of my posts; I’ve increased the font size and the line height to make it a lot easier on the eyes.

Next Entries »