I'm a Bristol based web developer, programming in .NET by day and whatever has taken my recent fancy by night.
I currently work for a not-for-profit company called Eduserv, specialising in developing custom web solutions for government bodies using Sitecore and a variety of other tech.
I'm interested in the future of HTML and Javascript - focusing on how advanced sites and web applications can be built in a 'pure' environment of HTML5 and Javascript alone. This is extended to bridging the gap between desktop and 'cloud' (can we please just call it the internet?)
Outside of work I'm an average runner, a keen squash player and an ethusiastic gamer. If you want to get in contact please do.
I'm chugging away making a native Android app for the rather splendid @stringfellow. It's been quite the eye-opener in terms of Android fragmentation, the joys of returning to Java after a (very) long hiatus and the intricacies of the platform as a whole. I fully intend to write-up a few posts on what I've done (and hope for feedback on how things can be improved) but the following was an unexpected pitfall I think is worth talking about now.
Naturally the wealth of apps on Android and other mobile devices require some kind of network interface for consumption of data and communicating details back to servers. Android - being built with Java - allows you to use the org.apache.http.client.HttpClient which is great until you want to send an image/file or anything else in a multi-part form.
The version of HttpClient in Android (2.2 - not developing against other versions yet) does not have support for multi-part forms. You could write content as separate entities/directly to the stream but that can soon get messy.
To make things simpler, grab the HttpClient (4.1.3) jar from Apache, drop into your Android project build path and do the following in your request/response handler:
The Chrome Dev tools provide a lot of functionality to you as a developer when making changes to scripts, CSS, HTML or testing out the performance of a page.
| Chrome filters the properties based on the text you enter |
| Hitting 'ctrl+space' provides a full list of static values |
I played around with Posterous some time ago (the old version of this blog used to be there).
Twitter recently acquired Posterous and there has been some talk about it shutting down. Naturally some people would like to get their content out of the system sharp-ish but the latest API needs a key.
I wrote PostLib ages ago when I was looking to process content from Posterous offline. I couldn't find the original project (but I had the debug version of the dll referenced in an old project). I've used Reflector to extract the source code and update it to .net 4.0 (it was 2.0). No promises on it's full capabilities or the quiality of code but it should help out someone. You can grab it from here
It uses the old API so it may not be perfect, but it does seem to be responding with the expected content. Hopefully it'll help people out. You can use it by putting a reference to the project and then doing the following:
It looks like I may be getting a new work machine. I say looks as it may end up being a month before anything happens.
Anyway, having a clean environment to build up I thought it might be an opportunity to look into using some new applications to see if I can improve my workflow and make my life easier.
The usual suspects currently include
During the last six months of 2011 I began picking up and reading more tech books then I think I had in the previous 3 years.
I'll admit, I'm a cheap gamer.
It's not often I'll buy things brand spanking new. While I fully appreciate the time, effort and dedication it takes for a team of developers to create a gaming masterpiece, not all games are masterpieces. Game prices continue to soar and as a lowly (greedy) consumer I can't afford to buy all the games I want as soon as they are released. Nor do I always have the time I would like to dedicate to them!
Some games offer a vast amount of playability e.g. Skyrim, some games offer far less e.g. Portal 2. Both these games are fantastic creations but I felt more comfortable handing over a healthy chunk of money buying Skyrim on release day than I did Portal 2. I love Portal 2, absolutely love it, for it's design, character and genius. But I couldn't justify £40+ for less then ten hours of gaming. Skyrim at 100+ hours is acceptable.
So, being the cheap gamer that I am, I enjoy the January sales. There has been a recent trend in the high street game stores to offer less interesting deals on pre-owned games. Some old games such as Hitman and Oblivion have seen a price hike (I got Hitman for £2.50 2 years ago, today it was £7.99!). With Skyrim being released I assume interest in Oblivion has raised, hence the price change. But again, 2 years ago I purchased the GOTY edition for £9.99 brand new. Today the original release (no DLC) pre-owned was £17.99. Similar patterns can be observed with the Assassins Creed series, Call of Duty and many others.
Two brief shopping sprees have left me with a nice pile of games to get through over the next few months. By the time I've finished this lot, Assassins Creed Revelations and a few others will have dropped in price!
# Ignore ReSharper stuff
_ReSharper*
git rm -r --cached *_ReSharper*
One of the things I love about programming and development in general is that, no matter how well you think you know something, there's always something that can surprise you.
It doesn't matter what language/domain/stack/toolset you're working with, there are often ways of doing things you haven't thought of. Sometimes these other ways of doing things are obscure or different to your normal way of thinking. That's why you've missed them to begin with.
Other times, well...you can't see why you haven't thought of them. I like it when the surprises are so simple, so immediately effective, that you can be pretty sure you'll remember them from then on.
So to the point.
I'm currently reading Javascript Web Applications. An excellent book by Alex MacCaw, the author of Spine. Aside from the book being pretty well written, there are some awesome nuggets of information in there. In a section discussing the benefits of using a CDN, the following example code is used:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>Just double check that again, did you see it? There's no protocol declared for the script request. This makes it a protocol-relative URL. The request for the script will be completed over the same protocol as the current page.
I've been playing around with Google Chrome extensions again (you should too, they are really simple).
Chrome extensions at their most basic level consist of HTML and Javascript; allowing full utilisation of HTML5 APIs such as WebStorage, IndexedDb and everything else. Chrome sandboxes extensions just as it does with each tab you have open, so an extension follows the HTML5 requirements of only having access to it's own 'domain' of data.
When creating an extension, you'll likely want to store some data. The HTML5 WebStorage spec allows a site (or extension in this case) to store simple key value pairs. This is ideal for extensions looking to keep track of simple things such as user preferences. It shouldn't be used for complex data or data that you'll be expecting to search over. Use IndexedDb for that.
The following is a simple mechanism which can be used in an extension to store and retrieve data using localStorage. It provides no data validation or verification other than returning null if no data is found and storing values as JSON.
Stored properties are added by calling the settings.implement function. The function will take any number of parameters, so additional properties can be added with ease. Properties are checked to see if they already exist before being created.
As the model is in Javascript, it can of course be utilised by any web page as well :-)
... I present the development model that I’ve introduced for all of my projects ... which has turned out to be very successful... I won’t talk about any of the projects’ details, merely about the branching strategy and release management.A successful Git branching model » nvie.com
Getting up and running with Node is pretty simple. Here's a quick script (with the largest part of help from here) to move things along that little bit quicker. This isn't the best way if you want to stay up to date with releases, this will just get Node installed and ready to play
Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors Project page on GitHub
Beautiful jQuery plugin which makes HTML selects much more user friendly!
What is it? Everyone loves the Google CDN right? Even Microsoft runs their own CDN. The problem is, they only host the most popular libraries. We host the other stuff.
A CDN designed to cater for the other javascript libraries people use.
Cdnjs.com is a CDN governed by users/developers. You can request a library to be added where it will be peer-reviewed and if successful, made available to all.
Looks to be a simple way to add functionality while developing as well as provide an easy deployment process, amongst all the other benefits CDNs offer.
Note Tame is not an attempt to dumb down async programming. It's just a cleaner way to write it. Further, your programs will likely have lower latency; with Tame it's a lot easier to keep parallel calls parallel.
Tame JS doesn't just 'dumb down' async programming in Javascript, it makes it beautiful, simple and incredibly elegant.
The sample code demonstrating parallel dns lookups in Node show just how simple it is.
Definitely one to play with in the future.
(again thanks to Steve Pope for the link)
In this book, we will take a look at a number of popular JavaScript design patterns and explore why certain patterns may be more suitable for your projects than others. Remember that patterns can be applied not just to vanilla JavaScript, but also to abstracted libraries such as jQuery or Dojo as well. Before we begin, let’s look at the exact definition of a ‘pattern’ in software design.
A free mini book from Addy Osmani available as a straight htm download, or (if you navigate up the site tree) as an ePub.
Osmani also writes some cracking articles on HTML5, jQuery and Javascript in general
DotNetZip is an easy-to-use, FAST, FREE class library and toolset for manipulating zip files or folders. Zip and Unzip is easy: with DotNetZip, .NET applications written in VB, C# - any .NET language - can easily create, read, extract, or update zip files. For Mono or MS .NET.
By far, the easiest .NET zip library I've used to date
To echo Node’s evolutionary nature, we have refreshed the identity to help mark an exciting time for developers, businesses and users who benefit from the pioneering technology.
Building a brand
We began exploring elements to express Node.js and jettisoned preconceived notions about what we thought Node should look like, and focused on what Node is: kinetic,connected, scalable, modular, mechanical and organic. Working with designer Chris Glass, our explorations emphasized Node’s dynamism and formed a visual language based on structure, relationships and interconnectedness.
Inspired by process visualization, we discovered pattern, form, and by relief, the hex shape. The angled infrastructure encourages energy to move through the letterforms.
This language can expand into the organic network topography of Node or distill down into a single hex connection point.
This scaling represents the dynamic nature of Node in a simple, distinct manner.
We look forward to exploring this visual language as the technology charges into a very promising future.
We hope you’ll have fun using it.
To download the new logo, visit nodejs.org/logos.
I'm no designer, I wouldn't say I have a keen eye for good looks, style or art. But I find the new logo rather... jarring. Something just makes my eyes hurt.
Full credit to the node team though. The requirement for building a brand as they put it means node is continuing it's progression to the fabled 1.0 release
To echo Node’s evolutionary nature, we have refreshed the identity to help mark an exciting time for developers, businesses and users who benefit from the pioneering technology.
Building a brand
We began exploring elements to express Node.js and jettisoned preconceived notions about what we thought Node should look like, and focused on what Node is: kinetic,connected, scalable, modular, mechanical and organic. Working with designer Chris Glass, our explorations emphasized Node’s dynamism and formed a visual language based on structure, relationships and interconnectedness.
Inspired by process visualization, we discovered pattern, form, and by relief, the hex shape. The angled infrastructure encourages energy to move through the letterforms.
This language can expand into the organic network topography of Node or distill down into a single hex connection point.
This scaling represents the dynamic nature of Node in a simple, distinct manner.
We look forward to exploring this visual language as the technology charges into a very promising future.
We hope you’ll have fun using it.
To download the new logo, visit nodejs.org/logos.
I'm no designer, I wouldn't say I have a keen eye for good looks, style or art. But I find the new logo rather... jarring. Something just makes my eyes hurt.
Full credit to the node team though. The requirement for building a brand as they put it means node is continuing it's progression to the fabled 1.0 release
...you can now make cross-origin XMLHttpRequest calls with the privileges of the extension directly from your content script. You will no longer need to relay these requests through a background page; this should simplify your code. In some cases, it may even eliminate your need to use a background page. Here’s a sample extension which demonstrates the old way a content script could make a cross domain request. As you can see, the extension required a background page to route the cross-origin calls through a chrome.extension.onRequest listener. Using the new content script cross-origin capabilities, we were able to successfully rewrite the extension to completely eliminate the background page requirement. This reduces the memory required to run the extension, and reduces code complexity as well...
You can now (as of Chrome 13) directly execute cross-origin XMLHttpRequest calls from content script pages, as opposed to routing calls through the extension background page.
This is a real performance gain as the background page does not have to be riddled with listeners and in some cases can be removed from the extension all together. Content scripts are injected based on match patterns in the extensions manifest file.
Further advances include additional match pattern options and advances to the Proxy API