Published June 15, 2007
I found myself needing to subtract a number of days from a date today in SQL Server. I couldn’t think what the function name was that would do this for me so I speculatively typed in DATESUBTRACT, which obviously didn’t work as there is no such function.
So, I had a shufty around the good ol’ Internet and what did I find?
The function I needed to use to subtract from a date was… yes, you guessed it…
I believe the American phrase ‘go figure’ would be appropriate in this instance…
Published June 15, 2007
ASP.NET , PowerShell , Rails
During my recent forays into the world of Rails I have discovered, as do most people working with Rails, the deployment tool Capistrano. For those of you unfamiliar with it, in a nutshell you end up with a simple command that deploys your application either afresh or as an update including all the database stuff etc. Very nifty (or at least it looks like it is as, being a bit of a newcomer to the leafy green world of Linux, I had a few issues but that was me not Capistrano).
In use, you check your source into Subversion and then Capistrano instructs your server to check it out onto the server and organise it all. So the code only gets onto the server when the server ASKS for it rather than when someone puts it there. This is good… Capistrano communicates via SSH and so this is all the server has to listen for. All is well…
Of course, deploying an ASP.NET app is different in that it isn’t necessarily the source that you want to deploy but the binaries. What I hadn’t considered before is to put the builds into source control as well as the source. This then allows you a central repository for the latest build that your servers can draw down from giving you the Capistrano like experience (to a point). What is missing is the SSH-esque bit.
Enter Windows PowerShell. I won’t go on as you can get a good idea of the possibilities by watching Scott Hanselman discuss Corillian’s deployment set up which is extremely impressive I might add.
While I’m about it Scott mentioned that he was after a good PowerShell editor and we had discussed the possibility of a bundle for e-texteditor although I think maybe this fell out of favour a bit as e-texteditor was quite flakey at the time. It is still in beta but much more stable now so that might be something for a budding PowerShell programmer to look into. Also, I just noticed that the new beta of PrimalScript has PowerShell support although I haven’t tried it.
Published May 11, 2007
General Nerd Interest , Web
I have been on the case of changing my ISP for a little while now. I have had a Pipex Business package for a few years, latterly at 2mb and haven’t had any problems to speak of. My only issue is that 2mb is the fastest service they provide to business customers and I’m seeing at least 8mb all over for the same price or less that I have been paying (£26).
So, I had a look around and spotted ‘Be’ which offers downloads of up to 24mb and uploads of 1.5mb (you can get up to 3mb up I think but I didn’t go for that)… I asked around and found that David Smalley had taken the plunge and he seemed happy enough. I signed up…
Well, today it finally arrived. All went smoothly and I only lost my connection for a couple of hours.
Published April 20, 2007
GeekUp , Web
I just discovered that the new Upcoming.org site has been released and very nice it is too. The first feature I used was to change my location to Liverpool rather than London. I’m not a particularly practised Upcoming user but I’d never managed to tame the ‘metro’ thing on the old site.
With my location changed to Liverpool I was pleased to see the Liverpool GeekUp spring up on the ‘front’ page.
We’ve had a Manchester GeekUp for a good while now but Stuart and I thought it was about time we got a Liverpool version going and with Andrew’s blessing we have done.
So, on the last Thursday of every month we will be holding a ‘GeekUp’ at 3345 Parr St in Liverpool, from 6pm onwards. If you have an interest of any description in all things Internet and are local to Liverpool, come along…
Published April 6, 2007
Look at yourself in the back of a spoon.
Note: whilst I thought this was funny, I unfortunately didn’t make it up. I also am not sure of the original source so apologies to the author.
Published April 6, 2007
css , html , Web development
Is it only me that thinks that the ‘padding’ value of html elements getting added to the width value of html elements is stupid? ‘Margin’, yes that should be added because it is on the outside of the element but if I set a div to be 750px wide I don’t mean it to become 770px wide when I add 20px of padding.
Whose bright idea was that?
The other day I discovered that if you hold down the ‘shift’ key whilst right clicking on a directory in the Vista explorer you get a ‘Open Command Window Here’ entry in your context menu. You can do this on XP with a PowerToy or some registry jiggery-pokery but it was nice to have it out of the box in Vista.
Having picked up on the excellent ‘Console‘ from Ben’s post the other day I was back to having to ‘cd’ into directories again so set about rummaging in the registry. So… the fruits of my labours:
Add the key – HKEY_CLASSES_ROOT\Directory\shell\open_console
Set the value of that to whatever you want to appear in the context menu e.g. Open Console Here
Under that add the key HKEY_CLASSES_ROOT\Directory\shell\open_console\Command
Set the value of that to the path to your console.exe with the parameters -d %1 In my case that gave me C:\Program Files\Console 2 Beta\Console2\console.exe -d %1
There you go… You should now have the context menu entry. Right click on a directory and open Console on that directory. Coupled with e – texteditor’s “Open as e Project’ you can have your rails set up running in a jiffy.
I would like to add the ability to open a few tabs in Console from the context menu with the same command and maybe start a server running in one and have another ready for commands but I can’t seem to get that going at the moment as I’m no great shakes in the registry. If anyone could point me in the right direction for that I’d be most obliged… In fact, it would be nice to open the ‘e’ project and the Console tabs avec server etc with the one context menu command, perhaps ‘Open Rails Environment’ but maybe I’m getting carried away there…