Saturday 7 November 2009

Craig and Charlotte's 100 things to do in Britain - #13 Shakespeare's Home, Stratford on Avon

Well, well, well... Stratford on Avon is a quaint little place with more mimes, street artists and musicians than you can shake a swan at. The whole area lives and breathes Shakespeare, and why not. From the variety of gift shops, boutiques and stalls you can pretty much deck your home with anything Shakespeare, but a must do is getting your mug shot in front of good old William's home complete with authentic electrical lighting...

Well some of the 'realism' has definitely been lost along the way but this shouldn't deter anybody as the vibe in the area is great. Some of the restaurants here are also little gems in themselves but those who have travelled to Stratford on Avon before will be distraught to find that the 'Teddy Bear Museum' has up and ran off to London. No fear we managed to find 'another' with human sized teddy waiting for us just outside the door which more than made up for it :D.

The highlight of this brief visit was the awesome Christmas shop opposite old Shakespeare's crib. It is decked out a mighty 365 days a year and again you can find anything with a Santa Claus on it. I'm not really a Christmas fan but its worth a delve for the laugh.

Overall Stratford on Avon does what it says on the tin, its a fun little area packed with things to see, eat and see some more. Parking and travelling were a breeze and was a great relaxing day out. Be prepared to meet the Chinese though, they love old Shakey's house.

Rating:

Monday 17 August 2009

Craig and Charlotte's 100 things to do in Britain - #63 The Rows, Chester

A Roman-Norman-Saxon-Victorian charm of a city, closely knit shopping streets and some great architecture both historical and modern make Chester a great place to visit. We found ourselves almost lost in the hundreds and hundreds of shops ranging from high street brands to small independant's tucked away in "The Rows". You can spend hours perusing what Chester has to offer and with most things to see and do literally 10 minutes walk away we loved every minute of it. After shops, milkshakes, afternoon tea, a brass band on the promenade, some truly weird people dressed as medieval characters and the Roman amphitheatre we were plum tuckered out. Again the evening was great with a mixture of loud venues and bars for the young and hearty or the not so loud but no less enjoyable restaurants that add a touch of class. We happened upon the "Sian" a Thai restaurant on the canal which is a definite recommendation.

As an extra, the following day we spent at the absolutely huge Chester Zoo which should not be missed at all costs if your in Chester. By far the best in the UK.


The only down side would be the parking, there was very little and what we found of it seemed to be a hell of a way away from the centre. Tip of the day, park at the train station, plenty of spaces and relatively cheap but it is literally 5 minutes walk to the shops.

Rating:

Sunday 16 August 2009

Craig and Charlotte's 100 things to do in Britain - #90 Sherwood Forest National Nature Reserve, Nottingham

First place visited on our list, the mighty Sherwood Forest, home of the heroic outlaw Robin Hood. I had high hopes for Robin and his band of Merry Men and they did not disapoint. Arriving on the 9th August 2009 we happend upon the "The Robin Hood Festival" which takes place yearly, being free apart from parking we had a brilliant time with falconry, jousting and live music aplenty as well as a lot of activities for kids including archery, face painting and jesters (which to be fair we enjoyed just as much :D). And if all that is not enough there is miles and miles and yes... more miles of walks through the scenic forest to enjoy. The day was great and the visitor centre is pretty good value for money considering that would be nothing. One tip though, turn up early as people were being turned away who came later than mid day.


Being the first place to visit on our adventure were going to set the score at 5 out of 10 and this will be used as the benchmark for future expeditions.

Rating:

Craig and Charlotte's 100 things to do in Britain


Figuring that I am in great need of fresh air, a more cultured outlook and a "life" me and my other half have put together a listing of 100 things to do in Britain. By no means are these "the best" things to do, especially since we dont know what half of them are :P but we rekon you should know where you come from (roughly) and have set upon this mini adventure. Well be posting up each place as and when we visit them with some aw(ful)esome pictures and a bit of a write up about what went on for future place goers...

It is also important to say that the following are in no particular order.
  1. Hadrian's Wall, Northumberland
  2. Natural History Museum, London
  3. Lincoln Cathedral
  4. Newcastle Race Course
  5. Climb Big Ben Clock Tower
  6. Outdoor Proms Concert, Belton House
  7. Castle Howard, Malton
  8. Windsor Castle
  9. Stonehenge
  10. Snowdonia, Wales
  11. York Minster Cathedral
  12. Roman Baths, Bath
  13. Shakespeare's Home, Stratford on Avon
  14. Iron Bridge, Shropshire
  15. Edinburgh Castle
  16. Caernarvon Castle
  17. The Royal Pavillion, Brighton
  18. British Museum, London
  19. Tate Modern, London
  20. National Gallery, London
  21. The London Eye
  22. The Victoria and Albert Museum
  23. Madam Tussauds
  24. The Tower of London
  25. National Maritime Museum
  26. Kings Cross Station
  27. Wembley Stadium
  28. The Houses of Parliament
  29. Science Museum, London
  30. Queen Mary's Rose Gardens, London
  31. Changing of the Guard, London
  32. Camden Market, London
  33. Portabello Market, London
  34. Westminster Abbey
  35. Orkney, Orkney Islands
  36. King Arthurs Castle
  37. Murder Mystery Dinner, London
  38. The playhouse Theatre, London
  39. Blackpool Tower
  40. Colchester Castle
  41. Harewood HSE
  42. Penshurst Place and Gardens
  43. York Ghost Trail
  44. York Dungeon
  45. King Arthurs Labrynth
  46. The Museum of Welsh Life
  47. Conwy Castle
  48. Athurs Seat, Edinburgh
  49. The Scottish National Gallery of Modern Art
  50. The Witchery Tour, Edinburgh
  51. Castle Campbell, Scotland
  52. Glenfiddich Distillery, Scotland
  53. John O' Groats, Scotland
  54. The Biblical Garden, Scotland
  55. Waltzing Waters, Scotland
  56. Seaforde Butterfly HSE, N Ireland
  57. The Glens of Antrim, N Ireland
  58. Tollymore Forest Park, N Ireland
  59. Tolkeins House
  60. Cotswold Wildlife Park
  61. Kew Gardens
  62. River Camto, Cambridge
  63. The Rows, Chester
  64. Lake District
  65. Longleat Safari Park
  66. Kingsgate Bay, Kent
  67. Twycross Zoo
  68. Garston Wood
  69. Blue Water Shopping Centre and Ice Rink
  70. The Norfolk and Suffolk Broads
  71. Cheddar Gorge
  72. Raby Castle, High Force Waterfall
  73. Peak Cavern
  74. Weston Supermare Beach
  75. Norwich Medieval Castle
  76. Eden Project, Cornwall
  77. Canonteign Falls, Devon
  78. Jurrasic Coast, Dorset
  79. The National Marine Aquarium, Plymouth
  80. Pensthorpe
  81. London Zoo
  82. The Town of Harrogate
  83. Cotswold Wildlife Park and Farm
  84. Winter Wonderland, Hyde Park
  85. Bath Christmas Market
  86. Wimbledon
  87. Up-Helly-AA, Shetland Isles
  88. The Great Ormes Head Copper Mine, Llandudno
  89. Aberglasney House and Gardens, Wales
  90. Sherwood Forest National Nature Reserve, Nottingham
  91. Pistyll Rhaeadr, Wales
  92. Lulworth Cove
  93. Giants Causeway, N Ireland
  94. St. Michael's Mount, Cornwall
  95. Groombridge Place Gardens
  96. The Trafford Centre
  97. River Thames
  98. Carrick-A-Rede, N Ireland
  99. Creetown Gem Rock Museum, Scotland
  100. Bond Street, London

Monday 13 July 2009

Clean Up Your Unmanaged Objects

After working for a few days on a project which had partially been started, I hit across a gem of a piece of code to help myself clean up those nasty COM components. Yes, the dreaded COM! Due to the fact that this was the actual core of the system (having no other choice) I set about at least trying to make it tidy. Quickly I found references to objects, destruction of instances and the good old .Net Garbage Collector couldn't handle what had been written. So time for a rethink.

I was quite lucky in the fact that the COM library in question was written pretty well and most of it was named sensibly (full marks to the bloke who did the naming).

So to business. The requirements, simply to allow disposal of the object if I manually call it and/or if the so called variable is no longer in scope or referenced anywhere I want the .Net Garbage Collector to clean it up.

Step 1. The class

Due to not being able to inherit from this COM library I set about wrapping up the instances of each type in a class using Generics to pass the objects type through at runtime.

Public Class ComWrapper(Of T)

Private _value As T

Public ReadOnly Property Value() As T
Get
Return Me._value
End Get
End Property

Public Sub New(ByVal value As T)
Me._value = value
End Sub

End Class

Step 2. IDisposable

Having the base class in shape I now implemented the .Net IDisposable interface to follow the .Net IDisposable pattern, meaning any using statements would clean the object but also I could call "Dispose()" manually and simply follow the .Net way. The proper way to dispose of COM objects is to use the "Marshal" class found in the namespace "System.Runtime.InteropServices". Calling "ReleaseComObject()" will force the object to be cleaned safely.

Private _disposed As Boolean = False ' To detect redundant calls

Public Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub

Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not Me._disposed Then
If disposing Then
' TODO: free other state (managed objects) if you have any.
End If

If Me._value IsNot Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(Me._value)
Me._value = Nothing
End If
End If
Me._disposed = True
End Sub

Step 3. Finalize it!

Finally :P we override the "Finalize" method making sure to implement the base finalize but also clear up the COM object. This means if the variable goes out of scope and gets flagged for the Garbage Collector to dispose of it will clean it up nicely and not leave unmanaged instances everywhere.

Protected Overrides Sub Finalize()
If Me._value IsNot Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(Me._value)
Me._value = Nothing
End If
MyBase.Finalize()
End Sub

So that's it, you should have nicely managed objects now, and for those who need to be nursed hand in hand a sample below shows the full class and some examples of usage and when they will be cleaned up.

Public Class ComWrapper(Of T)
Implements IDisposable

Private _value As T
Private _disposed As Boolean = False ' To detect redundant calls

Public ReadOnly Property Value() As T
Get
Return Me._value
End Get
End Property

Public Sub New(ByVal value As T)
Me._value = value
End Sub

Public Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub

Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not Me._disposed Then
If disposing Then
' TODO: free other state (managed objects) if you have any.
End If

If Me._value IsNot Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(Me._value)
Me._value = Nothing
End If
End If
Me._disposed = True
End Sub

Protected Overrides Sub Finalize()
If Me._value IsNot Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(Me._value)
Me._value = Nothing
End If
MyBase.Finalize()
End Sub

End Class

' #### Now Some Examples
' #### Where "MyComObject" is the com librarys namespace
' #### and "MyComType" is the com object your creating an instance of

Public Sub Test1()
Dim com1 As New ComWrapper(Of MyComObject.MyComType)(New MyComObject.MyComType())
' ... Use com1.Value
com1.Dispose() ' Object disposed here
End Sub

Public Sub Test2()
Using com2 As New ComWrapper(Of MyComObject.MyComType)(New MyComObject.MyComType())
' ... Use com2.Value
End Using ' Object disposed here
End Sub

Public Sub Test3()
Dim com3 As New ComWrapper(Of MyComObject.MyComType)(New MyComObject.MyComType())

' Object is not disposed of but once the variable is out of scope or in other words the methods ends the garbage collector flags "com3" for finalizing. This will not happen instantly so dont rely on it, but it should be fine for those of us who get a bit lazy :P
End Sub

Tuesday 16 June 2009

Norway is Light!

After having just returned from the might home of the vikings to my own discovery I have concluded that Norway is in perpetual light! Camping under the somewhat cloudy stars for three nights makes you aware of this. Note for future reference, no torch required.

Wednesday 10 June 2009

The Art of the Entertainer

Hey folks, just an update. I have started working with entertainer Sam Rabone in developing a personal site to showcase his... entertainment qualities! From radio to drag he has it all so be sure to take a look at the further work that goes into his project over the next coming weeks. Some nice draft shots below.




Monday 18 May 2009

Removing Process Instances - Apparently I Am Clever

A good year ago i posted on Daniweb (to whom I actively help) a code snippet for using the office interops and creating a wrapper class for them (you can see that post here). Anyway a few private comments and some posts later I received feedback that it was pretty clever, get that eh! So I thought seeing as I may need it sometime and am moving all my useful artifacts over to this blog account I would post it up. The "clever-bit" apparently is in working out a processes unique number so it can be killed later on if there are problems with it. This comes in handy when performing server side or hidden client side interactions with other interops such as Microsoft Office (creating Excel spreadsheets and such) without destroying a users existing session or other sessions that a server may be using (such as threading multiple requests).

The following code function basically works out all existing process' total for a given instance.


<summary>Function to calculate the total sum of process ID's for a given process name.</summary>
<param name="instanceName">The instance to count</param>
Private Shared Function GetTotalProcessID(ByVal instanceName As String) As Integer
For Each diaProc As System.Diagnostics.Process In System.Diagnostics.Process.GetProcessesByName(instanceName)
GetTotalProcessID += diaProc.Id
Next
End Function


This does not seem to special but when performing this before and after we can subtract the first from the second to give us our process' unique number. Bingo! The following code demonstrates this showing an example creating a Microsoft Word instance.


' Get Total before app exists
Dim totalProc As Integer = GetTotalProcessID("winword")
Dim wordApp As Word.Application = New Word.Application()
' Hide alerts and screen updating
wordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone
wordApp.ScreenUpdating = False

' Get New Total and subtract to get out ID
totalProc = GetTotalProcessID("winword") - totalProc

' ... Do some magic with the word instance ...

' When finished you should call 'worApp.Quit()'
' And also 'Marshal.ReleaseComObject(wordApp)'
' But incase that instance just wont go away... Kill it!
System.Diagnostics.Process.GetProcessById(totalProc).Kill()


So there we have it you now have the process' ID and assuming everything goes right you wont have to kill it, but for thos times everything fails you can always fall back on calling "System.Diagnostics.Process.GetProcessById().Kill()" to get rid of that pesky instance.

Sunday 17 May 2009

Background Flickr - Update Your Android Background

As a side project having finished university and wanting to get to grips with the awesome Android SDK I am working on a background photo changer which connects to the public Flickr services. The application will periodically download images from tagged flickr accounts and switch them as often as required for your phones background. The project has a way to go yet but I am looking forward to man handling the Android internals. For more information on the development you can see the project site hosted at Google Code. Also if anybody feels interested in lending a hand your more than welcome and can contact me through the project site.

Thursday 14 May 2009

Java URLEncode

After working on an android project for Google's G1 phone I came across a problem using the java.net.URLEncoder class whereby it was not correctly encoding 3 values in conformance to the RFC 3986. The function URLEncoder.encode(s, enc) does not encode *, ~ or + (asterisk, tilde and plus) which was causing trouble when accessing particularly picky web services with strict definitions on content encoding. So with a bit of botchery you can make the string compliant by encoding them seperately using java Strings built in replace method. The example below shows a bare bones example of encoding a value.


String value = "beans+pies*with~fries"; // Mind the awful scentence
String encoded = URLEncoder.encode(value, "UTF-8");
encoded = encoded.replace("*", "%2A");
encoded = encoded.replace("~", "%7E");
encoded = encoded.replace("+", "%20");
// The output is "beans%20pies%2Awith%7Efries" all done!

Monday 4 May 2009

jQuery Image Preloading with Callbacks

Googling for image preloaders? Yes that was me and I couldn't find anything which fitted the bill. Needing some form of JavaScript to preload an image and then have a callback function trigger when the image had finished loading (for some pretty transitional effects) I set about writing myself a jQuery plugin (as I use jQuery alot!). The code snippet below could easily be adapted for other libraries and I have tested it in all modern browsers and the onload event seems to trigger nicely in all. Its definately not the best way to add an event handler but as mentioned before it seems the most cross-browser friendly.

So here it comes, what you have been waiting for... Just copy the following into your page or seperate JavaScript file (you can even minify it if its too big for you).

* Update: After the glorious Internet Explorer 8 release it seems my code was causing a sporadic race condition bug. It is due to the code executing so fast that it preloaded the image before it appended it to the DOM causing the code to attempt to remove the element before it existed in the document. Not that this was too much of a problem, it simply left several hidden nodes in the DOM. Not to worry though I have updated the script accordingly to stop this in the future by adding a loaded flag to check if the handler has been triggered.


(function($) {
$.extend(jQuery, {
preloadImage: function(src, callback) {
var i = new Image();
var f = false;
i.onload = function() {
f = true;
if(callback !== undefined) { callback(this); }
$(this).remove();
};
if(!f) {
$(i).attr('src', src).css({
position: 'absolute',
display: 'none',
width: 1,
height: 1
}).appendTo(document.body);
}
}
});
}(jQuery));

The above probably needs a little explanation and rightly so. I use the JavaScript onload event property directly on the image object as jQuery's event handling is a little more advanced and for some reason setting this through addEventListener or attachEvent does not result in the desired effect. Also setting the elements position to absolute and its size to 1x1 might appear to be (stupid) adding extra css for the sake of it, the idea is that on a large image I have had some issues with a flicker and a quick resizing of the page before the browsers rendering kicks in so by setting it to 1x1 and absolute we avoid this eventuality.

So you want to use it in page now eh? Then call it using...


var url = 'http://.../yourimage.jpg';
$.preloadImage(url, function(image) {
alert('The image from ' + $(image).attr('src') + ' has finished preloading...');
});

And there you have it. Image preloading made a doddle. I would like to point out that the above will only work if you are using jQuery but as mentioned before it would be very very (very) easy to modify for another library.

And thats all folks.

Saturday 2 May 2009

The Dissertation... It's Over!

Well it is over. Four years, eighteen modules and apparently 2160 hours study time (yeah right) , but seriously I have hit the end of my degree and I can't help but feel like an age is coming to it's end. I'll be no doubt proverbally filling my pants over the next few months awaiting the results but it just would not be the same if it did not have some sort of suspense.

The only milestone to mark that it is truly over is the hand in of the dissertation. To summarise it was "one hell of a" report! Those who wish for a copy can email me as im sure everyone is up for a thrilling read (along with the going rate for the average dissertation... I'll make it a level £1k). (Yes the last sentence was sarcastic and no I will not be giving out my dissertation).

I also have been meaning to get around to working on my personal website lately and its just about finished so you can now see it in all its glory at www.designdotworks.co.uk

Thursday 9 April 2009

JavaScript JSON Serialize

First of all this approach is not for everyone there are many fully implemented JSON libraries for JavaScript but i'll explain the scenario. I recently worked on an ASP.Net project which relied heavily on page methods and ASMX webservices.

We attempted to make the in page JavaScript as "light-weight" as possible by cutting down on using the ASP.Net ScriptManagers JavaScript proxys. This technique is really useful in a small project but when we have 50+ services which may be called by one page injecting that many js files cant be good for bandwidth or performance. Using the jQuery library as a foundation for the majority of the project we found using the ajax request methods difficult to use in conjunction with our web methods. After following Dave Ward's great article on connecting jQuery to such services we were left with the huge pain of converting our JavaScript objects into JSON serialized form.

The json.js file that ASP.Net generates when using the scriptmanager was out of the question since we wanted to avoid the Microsoft bloat so I wrote a custom JSON serializer for the client. This way we could build our objects in JavaScript then serialize them to a JSON string on the fly whilst still keeping the project as lightweight as we needed. So enough jibber jabba heres the code I hope its useful to somebody.


// Change the variable name if you like 'JSON' seems pretty general
var JSON = function() {

// Method to decide the variables type and call its relevant method
var getNameValue = function(name, value) {
var t = typeof value;
if (value === undefined) { return getValueUndefined(name, value); }
if (value === null) { return getNameValueNull(name, value) }
switch (t) {
case 'string':
return getNameValueString(name, value);
case 'number':
return getNameValueNumber(name, value);
case 'boolean':
return getNameValueBoolean(name, value);
case 'object':
// If we get here then we need to decide what the constructor was
// To successfully convert the type
return getNameValueConstructor(name, value);
default:
return '';
}
};

// Method to decide the constructors type and call its relevant method
var getNameValueConstructor = function(name, value) {
if (value.constructor == Date) {
return getNameValueDate(name, value);
} else if (value.constructor == Array) {
return getNameValueArray(name, value);
} else if (value.constructor == String) {
return getNameValueString(name, value);
} else if (value.constructor == Boolean) {
return getNameValueBoolean(name, value);
} else if (value.constructor == Number) {
return getNameValueNumber(name, value);
} else if (value.constructor == Object) {
return getNameValueObject(name, value);
} else {
return '';
}
};

// Methods to convert a name value pair to a JSON serialized string for each data type
var getNameValueString = function(name, value) {
return '"' + removeInvalidChars(name) + '":' + getValueString(value);
};
var getNameValueNumber = function(name, value) {
return '"' + removeInvalidChars(name) + '":' + getValueNumber(value);
};
var getNameValueBoolean = function(name, value) {
return '"' + removeInvalidChars(name) + '":' + getValueBoolean(value);
};
var getNameValueDate = function(name, value) {
return '"' + removeInvalidChars(name) + '":' + getValueDate(value);
};
var getNameValueNull = function(name, value) {
return '"' + removeInvalidChars(name) + '":' + getValueNull(value);
};
var getNameValueArray = function(name, value) {
return '"' + removeInvalidChars(name) + '":' + getValueArray(value);
};
var getNameValueObject = function(name, value) {
return '"' + removeInvalidChars(name) + '":' + getValueObject(value);
};

// Method to decide the variables type and call its relevant method
// This method is similiar to above but calls the methods with no name and just returns a value
var getValue = function(value) {
var t = typeof value;
if (value === undefined) { return getValueUndefined(value); }
if (value === null) { return getValueNull(value) }
switch (t) {
case 'string':
return getValueString(value);
case 'number':
return getValueNumber(value);
case 'boolean':
return getValueBoolean(value);
case 'object':
// If we get here then we need to decide what the constructor was
// To successfully convert the type
return getValueConstructor(value);
default:
return '';
}
};

// Method to decide the constructors type and call its relevant method
// This method is similiar to above but calls the methods with no name and just returns a value
var getValueConstructor = function(value) {
if (value.constructor == Date) {
return getValueDate(value);
} else if (value.constructor == Array) {
return getValueArray(value);
} else if (value.constructor == String) {
return getValueString(value);
} else if (value.constructor == Boolean) {
return getValueBoolean(value);
} else if (value.constructor == Number) {
return getValueNumber(value);
} else if (value.constructor == Object) {
return getValueObject(value);
} else {
return '';
}
};

// Methods to convert a value into its JSON format
var getValueString = function(value) {
return '"' + removeInvalidChars(value) + '"';
};
var getValueNumber = function(value) {
return value;
};
var getValueBoolean = function(value) {
return value ? 'true' : 'false';
};
var getValueDate = function(value) {
return '"\\/Date(' + value.getTime() + ')\\/"';
};
var getValueNull = function(value) {
return 'null';
};
var getValueUndefined = function(value) {
return '';
};
var getValueArray = function(value) {
var json = '[';
var first = true;
var copy = removeFromArray(value, undefined); // Remove undefined values
for (var i in copy) {
json += first ? '' : ',';
json += getValue(copy[i]);
first = false;
}
return json + ']';
};
var getValueObject = function(value) {
var json = '{';
var first = true;
var copy = removeFromObject(value, undefined); // Remove undefined values
for (var i in copy) {
json += first ? '' : ',';
json += '"' + removeInvalidChars(i) + '":' + getValue(copy[i]);
first = false;
}
return json + '}';
};

// Method to remove invalid chars, unescape or other methods will destroy strings formatting
var removeInvalidChars = function(value) {
return String(value).replace(/["]/g, "`");
};

// Method to remove all instances of a value from an array
var removeFromArray = function(array, value) {
var i = 0;
while (i < array.length) {
if (array[i] == item) {
array.splice(i, 1);
} else {
i++;
}
}
return array;
};

// Method to remove all instances of a value from an object
var removeFromObject = function(object, value) {
var copy = {};
for (var i in object) {
if (object[i] !== undefined) { copy[i] = object[i]; }
}
return copy;
};

return {

serialize: function(o) {
var json = '{';
var first = true;
for (var i in o) {
json += first ? '' : ',';
json += getNameValue(i, o[i]);
first = false;
}
return json + '}';
}

};

} ();

The code above seems commented enough for somebody to follow it through but if more clarification is needed just drop me a message. Ive also minified the code for use as an external library if nescessary. At just under 4kb i can't complain about the outcome and it seems to work with no problems. Hope it helps.

Wednesday 8 April 2009

Start Something

I once vowed never to blog but after its apparent global uptake and recognition for just how powerful a tool it is designdotworks now have a working blog. Keep up to date with what is happening with Craig McNicholas and designdotworks as well as anything useful I decide to post.

A quick description of what I do would be everything from and including taking your thoughts to the final product in a low cost and communicative way. Need a developer to take on a personal, corporate or social project? Then contact me now.