James Hollingworth’s Adventures in Code

C# PostCode GeoCoding

leave a comment »

Part of my project needs me to get the coordinates for a given post code. I found FreeThePost.org which allow you to perform geocoding querys pretty easily by doing something like http://www.freethepostcode.org/geocode?postcode=rg20eu. Decided to whip up a quick C# object to do it. Its all pretty simple, do something like:

PostCodeGeoEncoder encoder = new PostCodeGeoEncoder( postCode );
Coordinates coords = encoder.GetLocation();

The assembly for it is here, i hope this saves someone a couple of minutes of hassle!

Written by jhollingworth

August 8, 2007 at 4:15 pm

Posted in .net, c#, geocoding, postcode

LINQ trying to be clever

leave a comment »

So have been playing around with LINQ today which I have been pretty excited about. I loved all the ORM’yness in Ruby but hated the floating point arithmetic so I can now have a fast language with simple database access! Anyway, was designing the db the ruby way, i.e. pluralizing all the table names, e.g. Car becomes Cars. I built my LINQ to SQL class, and then get down to some ORM fun. I look through the list of tables created, and find that LINQ pluralizes the databases automatically which is pretty clever, unfortunately I dont think they have fixed all the bugs. They seem to have missed out the “ple” plural since they have rename tblPeople to tblPeoples.

Linq trying to be clever

Written by jhollingworth

August 8, 2007 at 12:49 pm

Posted in c#, linq

Added event to OFXImporter

leave a comment »

Just a quick update, added a OFXFileLoaded event so you can run it on a separate thread and then populate the form. Had to change how it works slightly though:

OFX ofxFile = new OFX(fileName);
ofxFile.OFXFileLoaded += delegate() { DoSomething(); };
ofxFile.ReadFile();

the assembly can be found here.

Written by jhollingworth

August 8, 2007 at 7:32 am

Posted in Uncategorized

C# OFX Importer

with 4 comments

So i didn’t have much to do yesterday so I wrote an OFX importer. I used Jason’s sharpCash as a starting point but ended up doing my own implementation (always easier to rewrite than to understand someone else’s code!). Its pretty compliant to the main bulk of the OFX specification, although it only supports Credit Card and Bank account types at the moment.

It was written in C# and I have compiled it to a class library, the dll for it is here. Basically because this is for my dissertation, I don’t really know where I stand with releasing the code, I will speak to my project supervisor, worst case scenario I will release it early next year but if anyone wants the source, just email me.

To use it, you simply do:

    OFX ofxFile = new OFX(filePath);

Hope this saves someone a couple of days of trouble!

**Update **

Sorry, hadn’t realized  that the link had expired, I have put it in my university web space hosting which you can get here. Will be releasing the code as soon as possible but may be a month or 2 before thats possible. I have one request to make for anyone using, could you just drop me an email with the names of banks you are using, and if feeling very generous any performance metric’s you happen to have collated. I need to show this component works properly on a range of banks but can only personally get hold of OFX documents for a couple of banks. Any help would be greatly appreciated.

Written by jhollingworth

August 7, 2007 at 3:54 pm

Posted in c#, dissertation, ofx

Importing OFX troubles

with one comment

For part of my project, i need to do import data in the OFX format. Trouble is that no one has really done much, apart from one library (http://www.nsoftware.com/ibiz/ofx/) but from what i heard, it wasn’t very good. I found this article, http://www.west-wind.com/WebLog/posts/10491.aspx, where some guy seems to be having similar troubles. Had a look around and hes started a project called sharpCash where he has done an implementation of OFX import. Spent the day poking around and its seems to be a good starting point. Currently working on my own implementation, will keep posted on any discoveries i have!

Written by jhollingworth

August 5, 2007 at 10:22 pm

Posted in c#, dissertation, ofx