Tim

Footprints in the snow of a warped mind

Tag Cloud

AJAX (4) ASP (6) ASP.Net (40) Error Reporting (2) Web Service (1) WSDL (1) Atlas (2) Business (67) Business Start-up Advice (24) Client (12) Expanding Your Business (15) C# (11) Canoeing (4) Canoe Racing (5) Cheshire Ring Race (5) Racing (2) Training (4) CIMA (1) Cisco (1) 7970G (1) CSS (3) dasBlog (2) DDD (1) Design (9) Icons (1) Development (8) General (39) Christmas (6) Fun and Games (11) Internet (20) Random (44) RX-8 (8) Home Cinema (2) Hosting (1) IIS (8) iPhone (1) JavaScript (2) Marketing (3) Multipack (1) Networking (2) Nintendo (1) OS Commerce (1) Photography (1) PHP (1) PowerShell (1) Press Release (1) Security (1) SEO (5) Server Maintenance (3) Server Management (8) Software (9) Office (5) Visual Studio (8) Windows (4) Vista (1) SQL Server (12) Testing (1) The Site Doctor (94) Turnover Challenge (1) Umbraco (10) Web Development (42) WebDD (33) Wii (1)

Atom 1.0 RSS 2.0 CDF 

Search

<November 2006>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

Recent Comments

Blog Archive

Various Links

Blogs I Read

 Google Blog
Official Google Webmaster Central Blog
 Matt Cutts
Gadgets, Google, and SEO
 Ol' Deano's Blog
My mate Dean's blog on my space, equally as random as mine but not off on as much of a tangent!
 Sam's Blog
Sam is one of my younger brothers studying Product Design and Manufacture at Loughborough, this is his blog :) Enjoy!

Recent Tracks

last.fm - The Social Music Revolution

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

newtelligence dasBlog 2.0.7226.0

Send mail to the author(s) Email Me (Tim Gaunt)

© 2009 Tim Gaunt.

Sign In

Get Windows Live Alerts

 Monday, November 13, 2006

Making sense of database responses

Monday, November 13, 2006 8:48:41 PM (GMT Standard Time, UTC+00:00)

We're nearing the end of a large system for the lovely people over at Consolidated Communications Management Ltd and we've just come across a nice idea to make sense of database responses. Typically in the past we've simply returned -1/0 for failure and a positive integer (usually an id) of it was successful. The new method should add a little more conformity to our code. We already use a common Database Access Layer which handles the opening/closing of our connection, adding parameters etc but I’ve just added an enum with the common database responses, thought it may be of use to others:

public enum DatabaseResponse
{
    Success = 0,
    Init = -1,
    Found = -2,
    NotFound = -3,
    Duplicate = -4
}

This should cover the common responses from our database however to make it a little more futureproof we'll keep -1 through to -10 reserved for this data level and then start more specific responses from -11 (i.e. BadPassword).

Using it is simple (this is not real code before you ask!):

public bool Save()
{
    DatabaseLayer DBLayer = new DatabaseLayer();

    //Check whether we should be saving or inserting this record
    if (this.Id == (int)DatabaseLayer.DatabaseResponse.Init)
    {
        //The Id's set to initialised only so insert
        //The create method simply inserts the values into the database and returns
        //either the Id of the newly inserted record or our database response
        this.Id = DBLayer.Create(this);

        if (this.Id >= (int)DatabaseLayer.DatabaseResponse.Success)
        {
            //The insert was a success
            return true
        }
        else
        {
            //The insert failed for some reason -you could throw an error 
            //to catch or simply bubble the response upto to the code behind layer
            return false
        }
    }
    else
    {
        //When updating the record don't use the Id to store the response, instead
        //throw it into a temp object and use that so the Id's still stored in the object
        int response = DBLayer.Update(this);

        if (response == (int)DatabaseLayer.DatabaseResponse.Success)
            return true//All's ok
        else
            return false//Something went wrong -it could be the item wasn't found etc
    }
}
Making sense of database responses
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [1]  Trackback Link
CategoriesTags: ASP | ASP.Net | SQL Server

The 300 mile club -I'm finally in!

Monday, November 13, 2006 8:54:01 AM (GMT Standard Time, UTC+00:00)

I’ve been a member of the RX-8 Owners Club since I bought the 8 –a little sad but there’s great discounts and help on the forums so I thought it was worth the £30pa, anyhow, they’ve had the converted 300mile club on the forum for a while which I’ve wanted to get into however as most of my trips are 200miles it means the last bit of fuel is wasted on city driving (not the most efficient) so any attempt was lost.

Stacey and I had our 5 year anniversary this weekend so I suggested a trip to Scotland to celebrate –fancy that, just over 300miles to the hotel (303 according to the sat nav) and some super A roads, not sure what influenced that!

Anyway, on the way up we took a slight detour and got stuck in hours of traffic on the M6, not to mention torrential downpours so I took it nice and easy and I’m pleased to announce I made it into the 300mile club! WOOHOO!! I’m sure I was running on fumes in the end as I went about 35miles on the light.

311.9 Miles to one tank of fuel in the RX-8

What I loved the most though was on the way home we took a slight detour through the highlands to have a bit of a play (testing out what I’d learnt on the track day a few weekends ago) so I wasn't easy on the throttle and by the time I filled up there was only 16miles difference in the fuel economy... What a car!

I know it’s a little concerning being pleased about getting 300miles out of a 50L tank (around 24mpg) but most 8’s can’t make it over 250 let alone 300!

Here are some shots of the car on the trip home (very artsy :P) I'll post some on the Falkirk Wheel and Edinburgh later.

  • Night Shot of the side of our RX-8
  • Reflection of the sky in the wheel arch of our RX-8
  • Reflection of the sky down the side of our RX-8
  • Reflection of the sky in the sunroof of our RX-8
  • Reflection of the landscape down the side of our RX-8
The 300 mile club -I'm finally in!
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [0]  Trackback Link
CategoriesTags: RX-8
 Thursday, November 09, 2006

Setup.exe

Thursday, November 09, 2006 12:59:46 PM (GMT Standard Time, UTC+00:00)

I'm forever downloading application trials to see how other developers write applications, partly out of curiosity but moreover to improve applications we’re developing –seeing what we’ve left out, how we may be able to do it better etc.

I keep a fairly clear desktop but today I booted up and noticed a “setup.exe” file sitting there and I had no idea what it was, I knew it must be something I downloaded to test so I ran it which probably wasn’t the most logical thing to do but hey. Luckily it was something I’d downloaded but it got me thinking, what if it was a malicious script that a virus had placed there for me to click? I wonder how many people would be caught out by that…

Setup.exe
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [0]  Trackback Link
CategoriesTags: Random | Software
 Monday, November 06, 2006

ASP.Net WebException and Error Reporting useful code

Monday, November 06, 2006 6:59:55 PM (GMT Standard Time, UTC+00:00)
Since integrating Phil Winstanley’s error reporting code into our first ASP.Net project we've made a number of useful alterations to the way we use it and I thought we'd take another dive how it's used including riding yourself of spambots, 404 errors and a few other useful methods.

The housing market's gone mad

Monday, November 06, 2006 4:52:11 PM (GMT Standard Time, UTC+00:00)

Matt Smith sent me this today which made me laugh, the housing market really as gone crazy...

http://www.findaproperty.com/displayprop.aspx?edid=00&salerent=0&pid=605998&agentid=04438

£95,000 sounds a bargain to me!

The housing market's gone mad
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [0]  Trackback Link
CategoriesTags: 
 Saturday, November 04, 2006

Free copies of the released versions of Windows Vista and Microsoft Office 2007

Saturday, November 04, 2006 10:58:14 PM (GMT Standard Time, UTC+00:00)

This is still unconfirmed and somewhat word-of-mouth etc atm but if you check out Ian Moulster's blog you'll see his post about Microsoft giving away free copies of the release version of Vista and Office 2007 check out his blog post to find out more.

Hopefully we'll hear more before DDD Day

When an acronym saved my bacon

Saturday, November 04, 2006 12:12:38 PM (GMT Standard Time, UTC+00:00)

Once again playing joker could have got me in trouble while chatting to Doug from 27Seconds last night:

(21:21) Tim™: hold this thought, I've gtg shopping (bitch's come home)
(21:21) Tim™: I'll prob email you over the next few days
(21:21) Doug: Did you really just call S a BITCH?!
(21:22) Tim™: yes

In this case, I was referring to my darling Stacey (see below) so I was (of course) using the well known acronym “Beautiful Independent Totally Chilled Hottie”!

My Princess Stacey

When an acronym saved my bacon
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [1]  Trackback Link
CategoriesTags: Random

Time Breakdown of Modern Web Design

Saturday, November 04, 2006 12:12:12 PM (GMT Standard Time, UTC+00:00)

After the fun and games we had with IE and sorting out an old CSS design for www.technikfloor.co.uk on Friday when I saw this pie chart I thought it was an excellent summary of a modern web designer’s life.

Personally I feel my Teal coloured slice is smaller but hey!

Time Breakdown of Modern Wed Design

Originally posted at: http://www.dangerouslyawesome.com/2006/07/02/throwing-a-wobbly/

Time Breakdown of Modern Web Design
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [0]  Trackback Link
CategoriesTags: ASP | ASP.Net | Business | General
 Wednesday, November 01, 2006

Parsing Apache Log files

Wednesday, November 01, 2006 5:21:16 PM (GMT Standard Time, UTC+00:00)

This is a useful Regex that Craig wrote today, it pulls out various info from an apache log file.

private static Regex __Regex = null;  
internal static Regex _Regex  
{  
    get  
    {  
        if (__Regex == null)  
        {  
            __Regex = new Regex(@"(?<remoteHost>[^\ ]+?)\ (?<remoteIdent>[^\ ]+?)\ (?<remoteUs"
                + @"er>[^\ ]+?)\ \[(?<requestTime>[^\]]+?)\]\ \""(?<request>(?<r"  
                + @"equestMethod>[^\ ]+?)?\ ?(?<requestPath>[^\ ]+?)?\ ?(?<reque"
                + @"stProtocol>[^\ ]+?)?)\""\ (?<statusCode>[^\ ]+?)\ (?<sizeByt"
                + @"es>[^\ ]+?)\ \""(?<referer>[^\""]*?)\""\ \""(?<userAgent>[^\""]"
                + @"+?)\""\r?\n?"
                RegexOptions.Compiled & RegexOptions.IgnoreCase & RegexOptions.IgnorePatternWhitespace & RegexOptions.CultureInvariant);
        }  
        return __Regex;  
    }  
}

Update: Craig's finally started writing about it, you can read the article here: Apache Log Fun

Parsing Apache Log files
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [0]  Trackback Link
CategoriesTags: ASP.Net | IIS

My day at Prodrive

Wednesday, November 01, 2006 4:57:45 PM (GMT Standard Time, UTC+00:00)
All about my day at Prodrive with my shiney new RX-8
My day at Prodrive
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [0]  Trackback Link
CategoriesTags: RX-8
 Monday, October 30, 2006

Tendering – Who, What, When and How?

Monday, October 30, 2006 5:50:52 PM (GMT Standard Time, UTC+00:00)
The tendering process can be a daunting when you know what you’re doing, but what about if you don’t know what you’re doing? I’ve tried to summarise the process for those of you who haven’t gone through it before have also covered some of the finer points. This is in follow-up to my last article about How to price your work.
Tendering – Who, What, When and How?
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [0]  Trackback Link
CategoriesTags: Business
 Sunday, October 29, 2006

Jehovah witnesses

Sunday, October 29, 2006 1:26:17 PM (GMT Standard Time, UTC+00:00)

Having lived in Cornwall for most of my life I had never encountered a Jehovah witness before and before moving up to Birmingham I think I’d only had 2 encounters –both in someone else’s flat so we invited them in for a chat (the usual studenty type malarkey where you grill them on anything that comes into your mind).

Anyways, after moving to Birmingham it was a good 2 years before I would get to meet another and being somewhat tired after work I just told them to go away. Then today we had another pair come around, I’m not particularly religious but push come to shove I’d class myself as a Quaker (yeah yeah save me the oat’s jokes) but it got me thinking, why do they do it? Why do they go around knocking on people’s doors just to be told to P off? Are the free tea and biscuits and grillings from bored/drunk/high students REALLY worth it? Seriously though, WHAT is the point?

Jehovah witnesses
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [2]  Trackback Link
CategoriesTags: Random
 Wednesday, October 25, 2006

Seeing Orange

Wednesday, October 25, 2006 5:04:41 PM (GMT Standard Time, UTC+00:00)

I don’t know about you but I had always thought Orange were the mutt’s nuts when it came to service so after a few years on other networks we decided to give them another try as their tariffs weren’t much more expensive than the competition.

All was great, we signed up and were told that we’d get a load of cash back because we’d signed up a number of phones etc but when it sounds too good to be true it probably is, we’re now coming to the end of our 12month contract and we’re still chasing the credit we’re owed which leaves me wondering whether I want to remain with Orange at the end of the term.

It’s not like we’ve not tried chasing them, I call both the Orange store representative we have AND the customer service centre every month when I get the bill, I’ve also popped in a few times with all the signed paperwork. I don’t think I’d mind sitting on hold for an hour at a go to get through to a representative if I knew that at the end of the call I’d get somewhere but alas we’re still waiting…

Surfing around Google I see I’m not the only one, then I stumbled across this petition which, oddly enough, is run by one of our newer clients. So if you’re also having issues with Orange’s Customer Service go sign it and lets sort this out!

Seeing Orange
Useful Links:  #  digg it!  del.icio.us  Technorati  email it!  Post CommentsComments [1]  Trackback Link
CategoriesTags: Random