Last week I wrote about the set of developer questions posted by Scott.  Well, as promised, here are the first few that I’ve got through…thumbnail

Q1.  Describe the difference between a thread and a process

A1.  A process is a container of threads (having a least one thread of execution).  It has its own memory space.  A process can have multiple threads that share the same memory space and program code.  A thread is a single thread of execution.

Q2. What is a Windows Service and how does its lifecycle differ from a “standard” EXE?

A2.  A Windows Service runs under the control of the SCM (Service Control Manager).  They run in the background under the SYSTEM account and do not require interaction with a users desktop therefore they can run independently of a user (hence they do not require a user to be logged on for them to run).  When the system boots any services marked as “automatic” are started and when Windows shutdowns they are terminated.

A standard EXE is invoked by a user post logon and runs under the security privileges of the current desktop user.  A user may close the EXE at which point the program is terminated, otherwise the program is terminated at log off (which can occur without a shutdown).

OK, more of these later.  In the mean time I’m developing my .NET product showcase site.

I’m young, 24 years old.  Sometimes I feel like I’m ready to change the world today.  Fortunately I know I’m not.  As I said recently at a talk I gave to University finalists, “it takes a whole series of small steps to achieve something great”, I now remind myself of my advice.  Take your time.

And so I view these years of my life as training, preparation, learn all you can years.  In that vein and inspired by Scott’s Be a better developer in 6 months I’m taking on two challenges:

  1. Answer one question every day from What Great .NET Developers Ought to Know.  At the end of each week I’ll post up my answers.
  2. Start the project below

ASP.NET logoA number of my web design buddies, notably Paul and Chris, are PHP coders and turn out great sites with full XHTML 1.0 Strict markup and CSS 2.0 compliant styles.  Accessibility is big on the web these days, so are sites which degrade with older browsers and mobile devices.

I’m out to prove to them (and myself) that using ASP.NET I can put together a fully functional web site that passes W3 CSS and XHTML validation, is accessible according to WCAG guidelines and utilises some of the benefits of ASP.NET (i.e. I don’t have to hack it to death to get it to work).

So, I’ve created a new virtual machine in Microsoft Virtual PC 2007, running Windows XP, IE 7, Firefox and Safari.  I’ve installed Visual Web Developer 2008 Express Edition (all free tools).  I’ll put up my site plan in another post, but the idea is to blog every week on progress, with screencasts of what I’ve learned.

To assist me will be a couple of good ASP.NET books I have, the ASP.NET site and a few late nights.

Watch this space.

Picture it: It’s Friday night, 11pm, pouring with rain and strong winds.  I’m en route to IMAGE_133collect my buddy Dave Hodgkinson up from the airport when I realise I’ve got no fuel left.  So off to Tesco I go, discount voucher in hand.  Half way around this roundabout, the backend slipped out and the car launched into a lamp post right next to the road side.

I’m fine, no injuries just a bit shaken up.  But I think the car will be a write-off, so I can finally get that camper van I’ve wished for :)

The other shots:

IMAGE_131 IMAGE_132 IMAGE_130

This weekend I started my duties as best man by organising Pete’s stag do.  We spent the weekend in the Forest of Dean, raft building, learning survival skills, building shelters, making fires and generally having a good time at Pete’s expense.

Pete’s flat is lush and has given me some ideas on the media front.  Behind his TV stand lies an Acer PC, running Windows Vista Ultimate.  This includes the Vista upgrade to Windows XP Media Center Edition.  In the machine is a dual tuner TV card, so he can record TV and watch it at the same time.  The PC then connects to the TV with ease, so you get full media center capabilities plus Windows Vista on the TV when you want it.

Coupled with all of this is the flashy Microsoft Media Center remote, which brings the whole lot together very nicely.

So I’m doing some sums on the media front…eBuyer’s cheapest Acer PC comes in currently at £235 and includes Windows Vista Home Premium (the other SKU of Vista to include Media Center).  Couple that with a TV card and the Microsoft remote, the Xbox 360 and the home server, you get a nice package.

But then there’s always the surround sound, HD TV….the list goes on.  So I’ll be content with the fun of the new Xbox for the time being.

My photos from the weekend are now on Facebook.

Sheesh, I’ve hit the end of another week.  I never want activity to take priority over learning.  I’ve done quite a bit of travelling around, speaking to new people, feeling relieved after the stress of the previous week, our servers are now running a bit smoother.

As a kid I never had many things and I never was that interested in games consoles or gadgets.  Now that I’m starting to make more choices based on what I actually think over what would make others happy, I’m discovering a whole part of my life that I never lived.  It’s quite exciting.  Suddenly adventure, games, competition and practical jokes are becoming more appealing and are areas that I want to go to.

xbox360

In this vain I just ordered an Xbox 360 from Amazon and saved £30 off the retail price (went for the Premium model in the end; the Arcade is cheaper but no hard-drive and the Elite is a lot more expensive for really just a 120 Gb hard-drive, although it is black and looks cool).

We’ll be able to view photos and play music from the Windows Home Server on the T.V., as well as enjoying Call of Duty 4 and whatever else comes our way.  Ideally I’d like to set up surround sound in the lounge, so we can fully enjoy our Tesco DVD rentals (which is a great way to get movies without having to buy the discs).

I want to get back to the gym and running again; the Chicago Marathon is in October and I’d love to be there.

Time for some West Wing Season 4 and then sleep – I don’t think I really woke up properly all day, so rather then try and work late I’m calling it day and catching up on sleep (rest is not the problem but sleep sometimes gets behind).

I was in London yesterday in glorious Spring weather – slightly cold, but bright sunshine.  I snapped the following on my phone whilst crossing Waterloo Bridge:

IMAGE_128

It reminded me of my marathon experience last April and got me thinking again about running…

In the mean time I’ve been tweaking system performance, improving our caching through the use of HTTP headers in ASP.  RFC2616 details the HTTP 1.1 status codes, which can be used to control the caching of certain items.

Our problem is that a table of contents sometimes grows to over 1Mb and every time a user visits the site they pull back this huge file.  In order for this file to be cached, we send back a HTTP header LAST-MODIFIED, equal to the last modified date on the ToC file.

Now if the browser already has this item in its cache, it will send a header HTTP_IF_MODIFIED_SINCE containing the last-modified timestamp from the cache.  On static files, IIS (the webserver), takes care of looking for this header and responding appropriately.

However for dynamic files that serve semi-static content (like the ToC in my case), you have to handle things yourself.  If the HTTP_IF_MODIFIED_SINCE header is detected, then the timestamp is checked against the file on the server.  If nothing has changed, then just report the HTTP-STATUS as 304 Not Modified.  It is then up to the browser to use the version from it’s cache.

A couple of useful articles on this:

http://www.15seconds.com/issue/970911.htm

http://www.web-caching.com/mnot_tutorial/how.html

After implementing these changes we saw a huge reduction in request timeouts and dropped network connections.  Well worth building into future work.

It’s been a crazy couple of weeks, hence no posts.  Firstly, my laptop finally gave up the ghost.  Whilst trying to reimage it from my Windows Home Server, the power unit just kept cutting out.  And then I was getting blue screen memory errors.

So my new Dell Latitude D630 arrived, all shiny and fast, and boy is it nice to work with!  I went for the 9-cell battery which, after my tests, will run for just over 5 hours on normal usage.  It comes with a light sensor inside the lid so it can automatically adjust the brightness of the screen to suit your surroundings, thereby saving battery power and making sure you don’t strain your eyes.

It’s a 2.4 GHz dual core Intel, 160GB hard drive (the largest I could get), DVD R/W, 4 USB 2.0, modem, WiFi etc.  It also comes with a smart card reader should you need it for work.  Anyway I’m very pleased with it.

d630

Then I had a crazy week of work, culminating with a 10 hour day in London, the afternoon of which I spent frantically working in Costa Coffee on the WiFi, trying to drink my cappuccino medo as slowly as possible!

Then the Pioneer Leaders Conference in Letchworth, then spoke at Open Heaven, then had a meal to welcome new people to the Church and tonight I’ve got a consultation team meeting on a building we are looking at buying.

To keep me sane I’ve been having fun with the various bits of technology around the house, getting the WHS backup going.  My next step is to test the remote access…

Time for some work now!

One of my favourite Christmas presents this year was a “build your own” VW campervan.  I’ve jokingly said that I’d like one some day to tour around Europe.  Well, now I have one sitting in my lounge which I can look at every evening!

campervan

Opposing my success with the van, is the regression with my laptop.  After running defrag my laptop power cut out every time.  So I decided to take the plunge and rebuild it (software wise).  After finishing the full NTFS format the power cut again.  Arrgh… There must be some overheating problem going on and when the PSU detects this it just shuts down to prevent the whole thing bursting into flames.

After much waiting and frustration I’ve now reloaded Windows XP, Office 2003 and now I’ve got to wait while Windows Update downloads the hundreds of updates and service packs….zzzzz

(More visits to Lenovo today)

My laptop is over 4 years old now, purchased from Novatech after my Compaq died and I did rather well on the insurance.  It has served me very nicely, running most of my development software and the long list of essential utilities I have now amassed.  During my time at Xerox, it went through a couple of upgrades, the most interesting of which was repacking the battery.

A mate of mine at work discovered a place in the Far East where you could order the individual cells from so I jumped in with him and we ordered a whole batch between us.  They came with the rather daunting warning of being highly explosive if punctured!  It rejuvenated the battery for a year and I can still get an hour out of it, so not bad for a £50 investment.  Here I am re-soldering the pack:

repacking_battery

I’ve left it defragmenting the hard drive – 24% defragmentation over 30GB of data, no wonder it’s been chugging a bit.  It’s got more serious problems though, the power keeps cutting out, which I think must be to do with the location of a temperature probe and the surroundings getting too hot, so the power unit just switches off as a safety mechanism.  I’m loathe to dive into that circuitry and given that it will run happily from AC without the battery I might turn it into a portable desktop.

My browser history is starting to fill up with visits to Lenovo :)

Continuing in the cookery theme I used up the rest of the puff pastry last night to make some delightful Apple Turnovers. The rest of the leadership team and student team enjoyed them over coffee as we caught up on the year just gone and the year now ahead of us.

Nice cooking does not have to be complicated – all it takes, as with so many things in life, is just a little time and concentrated effort. And when you get results like the following (badly captured in poor light with my O2 XDA) it really is worth it:

IMAGE_112

Note I finished this post using Windows Live Writer, which seems like a nice little Windows App for posting to a variety of blogs.  More on that later.

Tomorrow night will be Sea Bass – my first real adventure into the fish world (apart from the no-brainer Salmon, Cod or Plaice).  Food is so diversely interesting!

« Previous PageNext Page »