Of Code and Me

Somewhere to write down all the stuff I'm going to forget and then need

Great error message from Castle Windsor March 30, 2010

Filed under: C#,Coding — Rupert Bates @ 8:19 pm

This is a great exception from the Castle Windsor IOC container:

Looks like you forgot to register the http module Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule
Add '<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.MicroKernel" />' to the <httpModules> section on your web.config

It tells you exactly what you need to do to fix the problem. If only more developers took the time to throw such helpful exceptions!

Looks like you forgot to register the http module Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule
Add ‘<add name=”PerRequestLifestyle” type=”Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.MicroKernel” />’ to the <httpModules> section on your web.config

 

links for 2010-03-26 March 26, 2010

Filed under: Uncategorized — Rupert Bates @ 10:05 pm
 

The .gitignore file I use with Visual Studio projects

Filed under: Git,Visual Studio — Rupert Bates @ 7:48 pm

This seems to keep most of the crap out and I haven’t found anything necessary that it excludes yet.

# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
*.suo

# Include dlls if they’re in the NuGet packages directory
!/packages/*/lib/*.dll

# VS Upgrade stuff #
####################
UpgradeLog.XML
_UpgradeReport_Files/

# Directories #
###############
bin/
obj/
TestResults/

# Web publish log #
###################
*.Publish.xml

# Resharper #
#############
/_ReSharper.*
*.ReSharper.*

# Packages #
############
# it’s better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sqlite

# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db

 

How to install maps on a Garmin Edge 705 March 24, 2010

Filed under: Bikes,Garmin Edge — Rupert Bates @ 8:49 pm

I recently bought a Garmin Edge 705 bicycle GPS and the documentation is, how can I put this, terse? So I thought I’d document what I found out as I went along.

To add a new map to your Garmin Edge 705 using Windows (assumes you have a .img file)

  1. Get a Micro SD card and insert it into your Garmin Edge. Apparently the unit used to only support cards up to 2 gigabytes, but I think I also saw that this limitation is now fixed. I’d check for yourself though
  2. Connect your unit to your computer using the USB cable supplied, make sure it shows up as a drive in Windows Explorer. You should see one drive for the main unit and another for the SD card
  3. Create a new folder in the root of the SD card and call it Garmin
  4. Copy your map (.img) file into the Garmin folder you have just created, I’m not sure whether the map needs a particular name, mine is called gmapsupp.img
  5. Now disconnect your unit and switch it on, it should be using the new map. You can check by pushing the menu button on your unit, then going to ‘Settings’ then ‘Map’ and you should see the name of the map you have just installed at the bottom of the screen
 

Format a string in RFC 2822 format for use with Http headers in c# March 17, 2010

Filed under: Asp.Net,C#,Coding,Web — Rupert Bates @ 11:45 am
var lastModified = AppStart.ToString("ddd, dd MMM yyyy hh:mm:ss ") + "GMT"; //note the hard coded GMT, there doesn't seem to be any other way to get this

Custom Date and Time Format Strings on MSDN
Standard Date and Time Format Strings on MSDN