February 7th, 2010
I needed the outlines of most countries for a simple GIS project that I’m doing. I managed to find a world simple shapes file from http://mappinghacks.com/ called TM_WORLD_BORDERS_SIMPL-0.2.zip
This was in a shapes format used by ARC GIS and the likes, but I needed it in an easy to consume manner i.e. XML
So taking it, feeding it through MapWindow GIS and a shareware plugin “Shape2Earth” (a shapefile to KML converter) I received a KML file out the other side.
As it was a bit bloated, I built a console app using some hideous code turned it into a nice usable XML doc.
Here’s an example of the result showing the UK, France, etc, produced in DeepEarth:
Deciphering should be pretty easy. Here is the rundown:
A country has a name and ISO3 tag and one to many polygons.
Each polygon has one outer bound (outer island) and zero to many inner bounds (inner islands) for where the country isn’t (as in Swaziland inside South Africa).
Easy stuff. Here’s the zipped download:
Let me know where you use it!
There is no licence except where mappinghacks.com applies one, but I couldn’t see one there. Tell me if I’m wrong.
Tags: deepearth, GIS, Mapwindow, shape2earth, XML
Posted in GIS | No Comments »
December 30th, 2009
Just made a quick and dirty Ubiquity command for StackOverflow searches.
Download from GitHub: Ubiquity StackOverflow Search
Don’t know Ubiquity?
It’s like a Command Line for the web but… it’s really cool! Trust me. Watch the clip below. Sure it starts out dull, but then so does District 9. Then bam, explosions and stuff! It’s not 0.1 anymore either, so ignore that bit.
The link to get it is https://mozillalabs.com/ubiquity/
Then go to about:ubiquity and read the Commands. There are lots!
Posted in Uncategorized | No Comments »
December 29th, 2009
But how do you fix it? The weird thing is that to fix it, you install another program: Adobe Shockwave
Don’t know how or why, but it fixes the high CPU usage where Firefox sits at 99% or 100%
Strange huh?
You should probably update Adobe Flash while you’re at it anyway. Do it first, that way it’s all associated nicely.
Tags: firefox
Posted in Tips | No Comments »
December 21st, 2009
Whatever I think of Godaddy, they haven’t caused me too much pain yet, just minor inconvenience. This time it’s my precious StructureMap.
StructureMap, I like it and alot of people do, but it just won’t work under Medium Trust! So it’s either time to change Hosts, or change IoC container. Pretty obvious which one is the easier choice here.
So what choice do you have? Well not much. So the answer is:
Unity from Microsoft Patterns & Practices*
Here’s a nice manual to go with it.
And what’s not able to be run in medium / partial trust:
Windsor Castle
Spring.Net
StructureMap
There was someone who was explaining how to download and build Spring.Net to allow it to run under Medium Trust, but that seems pretty likely to cause issues when you hack code (try to ignore my NHibernate post when I say that).
It may be the same for the other 2, but off the bat, Unity wins.
*Caveat: Unity is restricted in what it can do when run without ReflectionPermission (which is what Medium Trust disallows), but typically this won’t affect much from the normal IoC behaviour. The restrictions are explained on this MSDN doc, but it’s to do with internal and private constructors and properties. If it’s public you should be sweet.
Tags: godaddy, IoC, unity
Posted in ASP.Net, godaddy | No Comments »
December 13th, 2009
Ok, so Log4Net is not that bad. It is a very good logging system, etc…
So how do you perform IoC with the NHibernate logger? Well, you can’t. Unless you are ready to HACK CODE.
That’s the brilliant thing about open source. Take it and modify until its the shade of green that suits you.
The First Warning
If you modify the DLL for NHibernate, then all associated DLL’s break.
For me this means FluentNHibernate wont like you. So you will have to rebuild that too for the new NHibernate DLL.
According to the bug report for exactly this issue, in the future log4net will be removed as a dependency (yay). For the logger interface Commons.Logging has been “sort-of” chosen. Meaning: you should use the ILog interface from Commons.Logging for your Log interface! Make’s it a bit more future proof.
What I did to have IoC : 2nd Warning – This is not a concise walkthrough
- Download the source code of
- NHibernate – Under the Browse Files you will find a SRC version.
- FluentNHibernate – Download from GitHub
- Commons.Logging
- Create a new Interface called ILog that is inside the NHibernate project. This is because it will be used as an adapter for the Commons.Logging. It’s probably best to put under a smart namespace like NHibernate.Logging.ILog
- Create a LogManager class that does the same thing as the log4net LogManger, but using the Commons.Logging assembly. I know this is vague, but my implementation wasn’t very good. The idea is that when NHibernate is called, the LogManager is setup using the Commons.Logging.ILog object that was returned by my IoC object factory.
- Remove the References of log4net from the projects
- Replace all namespaces of log4net with the namespace of your new Interface and LogManager (say NHibernate.Logging).
- Remove all Log4Net residue, like Cfg calls and XML setup arguments.
- Build and everything should be happy.
Tags: FluentNHibernate, Logging, NHibernate
Posted in ASP.Net | No Comments »
December 10th, 2009
This is a direct quote from the Wikipedia page on Global.asax. Just thought it would be nice to a quick list to refer to.
- Application_Init
- Fires when the application initializes for the first time.
- Application_Start
- Fires the first time an application starts.
- Session_Start
- Fires the first time when a user’s session is started.
- Application_BeginRequest
- Fires each time a new request comes in.
- Application_EndRequest
- Fires when the application terminates.
- Application_AuthenticateRequest
- Indicates that a request is ready to be authenticated.
- Application_Error
- Fires when an unhandled error occurs within the application.
- Session_End
- Fires whenever a single user Session ends or times out.
- Application_End
- Fires when the application ends or times out (Typically used for application cleanup logic).
Posted in Uncategorized | No Comments »
December 9th, 2009
I had some time trying to work out the details on the ol’ neufbox, so here is a hint for getting it to be in English which makes life easier for non-francophones:
- Hold down the green button on top of the neufbox until it starts flashing purple (takes about 5 seconds)
- Go to the neufbox Configuration Page Maintenace –> Personnalisation page.
– usually http://192.168.1.1/6_3
- Click the “Continuer” button (should still be flashing purple on the box)
- Change the language to Anglais (English) and click “Valider”
Done!

Tags: sfr
Posted in Tips | No Comments »
December 5th, 2009
A handy list of ActionResult’s that I found on StackOverflow thanks to Chris.S and his reference to the MSDN doc.
ContentResult
Writes a string value directly into the HTTP response.
EmptyResult
Does not write to the HTTP response.
FileContentResult
Takes the contents of a file (represented as an array of bytes) and write the contents into the HTTP response.
FilePathResult
Takes the contents of a file at the given location and writes the contents into the HTTP response.
FileStreamResult
Takes a file stream produced by the controller and writes the stream into the HTTP response.
HttpUnauthorizedResult
A special result used by authorization filters when authorization checks fail.
JavaScriptResult
Responds to the client with a script for the client to execute.
JsonResult
Responds to the client with data in JavaScript Object Notation (JSON).
RedirectResult
Redirects the client to a new URL.
RedirectToRouteResult
Renders the specified view to respond with an HTML fragment (typically used in AJAX scenarios).
PartialViewResult
Renders the specified view to respond with an HTML fragment (typically used in AJAX scenarios).
ViewResult
Renders the specified view and responds to the client with HTML.
Tags: asp mvc
Posted in Uncategorized | No Comments »
December 5th, 2009
I stumbled across this excellent written / video tutorial with source when starting out in my Prism adventure.
Prism for Silverlight – Silver Bay Labs


I think this is the best starting out example I have found. It still requires a basic understanding of Inversion of Control to figure out what he’s trying to do, but run through it a few times and it all sort of fits together.
Tags: IoC, prism
Posted in Silverlight | No Comments »
December 5th, 2009
After trying for a while to figure out how it all sort of works and what I was actually looking for, I found this page at Sparkling Client – Downloading Prism.
Once you get there, there is a 10 step method on how to use Prism/CAG or whatever you want to call it.
Not intuitive in any way for Microsoft to hide it by giving it different names (Prism == Composite Application Guidance), but I guess that’s life.
I blame Microsoft’s love (or perhaps just programmer’s vanity) of renaming things that already have a name, but I think it got away on them here.
Update: Herding Code, in an interview with Glenn on Prism / CAG, discovered that Prism is the “Cool Name” whereas Composite Application Guidance is the “Serious Important Name”.
Coming soon: A photo viewer app using Prism. I know it’s been done to death, but it’s a good start.
Tags: CAL, Composite Application Guidance, IoC, prism
Posted in Silverlight | No Comments »