Tuesday, October 31, 2006
Monday, October 30, 2006
Visual Studio Developers need to get out of the IDE more
at 11:12 0 comments
Friday, October 27, 2006
rude words
at 16:10 0 comments
Firefox 2.0
at 10:11 2 comments
Wednesday, October 25, 2006
The Perry Bible Fellowship
at 15:37 1 comments
Monday, October 23, 2006
New Google Reader
Google relaunched their RSS aggregator a few weeks ago. I was quite a fan of the old version, which was fairly simple - a list of all available messages down the lefthand side, and a big reading pane. Gary didn't like it, because it didn't allow you to view messages by feed, but I quite liked its simplicity.
Their new version is more like other aggregators I've seen - there's a hierarchical list of feeds down the lefthand side, and a scrolling list of messages. It works really well, especially the special functionality that automatically marks messages as read when you scroll past them. It's still simple looking - a bit like Google Mail - but it works really well. There are two other screens: the home screen; and the all items screen. The home screen is a bit useless, as it only provides a list of the latest two unread messages... The all items is much better, showing all items, which you can filtered by read/unread.
There are two things I don't like about it: it doesn't work well with the SessionSaver/SessionManager plugins in Firefox - it invariably displays an error message when it's shown in a restored tab when FF starts up. It requires me to do a <ctrl>+<f5> to get it working again.
The other thing I don't really like is the "mark as read" check box - it doesn't really change when a message is read/unread. The "shared" icon lights up, the "starred" icon lights up, but the "mark as read" check box stays a very indistinct colour, and a difficult to see check appears.
The "Shared" items functionality is cool - you could do this with the old reader, but you had to do it by tagging messages with a distinct tag. It's much simpler now, and the integration with blogger beta is cool.
at 11:19 1 comments
Sunday, October 22, 2006
Weekend End
Wow. That has to have been the busiest weekend I've had in a while - and certainly the drunkest one, seeing as I hadn't had an alcoholic drink since the beginning of September. The reason for this was Gary being over from China for a week. It was a bit unexpected, and certainly not the best of circumstances, but it was still great to see him - it's a bit weird when you see someone nearly every day, and then you don't see them at all for six months.
We'd already met for lunch in Manchester on wednesday, so I didn't stay out for that long on Friday night (I got the 2140 train home), and he was already drunk by the time I got there...not that I didn't try to catch up! The beer in the Victoria was quite nice - the Timothy Taylor's Landlord was good, and then I had a pint of a similarly bitter tasting one before I left. It was good to see some of Gary's friends too - I'd met most of them a few times before, and Antz is a really nice bloke.
So yeah, apart from the bizarre train home, which went about half a mile at 7 miles per hour before turning back, and then having to walk to a different platform and get on a different train, Friday night was pretty uneventfull. I'm glad I did leave early, as apparently they didn't stop until 4am on Saturday.
On Saturday evening, we went over to Leeds, and met Gary, Antz, Mike and Cate at Hansa's - one of my all time favourite places to eat. The food was amazing, as usual, and as usual, we all left feeling like we'd eaten too much. With it being Diwali, there were free sweets, the one I had tasted a bit like pistachio turkish delight. We had a chat, ate, and it was good. Anthony and Gary were both monged out...
Cate and Mike came back to ours to visit Henry and stay the night (not sure which order). It was nice to catch up with them, as we'd not seen them since the beginning of September, when they came to drop off Henry. They've just put an offer in on a house, which is quite an exciting time. They'd left by about 11am, and I've mostly pottered around and cooked today, although we did go out for a walk in the rain and discovered that there are allotments quite close by, and that most of them seem to be used, which is good in one way, as if we did get one we wouldn't have to fight against nature as hard as if it was all overgrown, but it also means that there might be a waiting list. Mind you, we've still got lots of house stuff to sort out before we should be thinking about getting an allotment.
The week ahead might be quite busy at work, with a project due at the end of the week - the three week project that's had about one week of work actually spent on it...oh well. Amy also starts her new job tomorrow, so it might be a bit hectic at home too.
at 21:27 0 comments
Friday, October 20, 2006
email address regular expression
^[A-Za-z0-9!#$%&'\*\+\-\/\=\?\^_`\{\|\}\~][A-Za-z0-9!#$%&'\*\+\-\/\=\?\^_`\{\|\}\~\.]*@[0-9a-zA-Z\-]+(?:\.[0-9a-zA-Z\-]+)*$
complies to what wikipedia says on the subject
at 13:33 0 comments
Why Refactor?
Because the aim of refactoring (in essence) is to reduce the amount of code, and less code = less chance for wrong code = less bugs.
at 12:03 0 comments
Thursday, October 19, 2006
Lego Ice Cube Tray
http://shop.lego.com/product.asp?p=EL502
Sadly not available in the UK.
at 20:38 0 comments
Wednesday, October 18, 2006
anonymous delegates in .net 2.0
This is a real quick sample of how anonymous delegates work in .Net 2.0.
your simple code:delegate void test ();
public static void Main()
{
test r = null;
for ( int i = 1; i < 11; ++i )
{
int p = i;
test x = r;
r = delegate { Console.WriteLine ("{0}", p ); if(x != null) x(); };
}
r();
Console.ReadLine ();
}
gets translated to:class tmpClass
{
test x;
int p;
public void Execute ()
{
Console.WriteLine ("{0}", p );
if(x != null)
x();
}
}
delegate void test ();
public static void Main()
{
test r = null;
for ( int i = 1; i < 11; ++i )
{
tmpClass tmp = new tmpClass();
tmp.x = r;
tmp.p = i;
r = new test(tmp.Execute);
}
r();
Console.ReadLine();
}
So, for this simple (contrived) example, you end up creating 10 temporary objects.
I really like the idea of anonymous delegates, but their use needs to be reviewed carefully.
at 11:40 0 comments
Labels: programming
Tuesday, October 17, 2006
Autumn. Yay!
I love autumn. It has to be my favourite time of year. Yes, it's a bit colder (it feels a lot colder at the moment), and, yes, I'll admit it's darker, and wetter, but I still love it.
Because the Sctoland trip was cancelled (boo!), I've managed to get out for a few mini day trips - yesterday to the Yorkshire Sculture Park, and today to HardCastle Crags and Hebden Bridge.
I love the sculpture park, and the James Turrell exhibition has been extended until January. I really do advise you to go and see it. Even if you've seen it already, going to see it again is still amazing. He's also go a permanent installation, in what was the deer shelter. This is so simple, yet so effective. It's essentially a hole in the roof, but the roof is so thin, and featureless, that it frames the sky, and makes it appear close enough to touch. It's as if it's a moving picture of the sky rather than the sky itself. The space is also so quiet, it was nice just to be sat in there, looking at the sky.
There's also an interesting Simon Whitehead exhibition - it's a bit wierd as it's about walks that he's taken, and there was a stuffed goose, which meant I had to leave before looking at videos and listening to the cds, but the book about it seems a lot more interesting, and given some guitar ideas to try (not with my aria though!).
We didn't really look at much else - just had a bit of a wander. It was a shame to see the absence of the Ronald Rae stuff, but I suppose it can't stay there forever. There were quite a few Shaggy Ink Caps around, but not where I could pick them.
HardCastle Crags was really pretty with all the autumn colours, and we saw quite a few mushrooms - as yet unidentified. Again, it was a shame to remember that the sculpture trail will no longer be happening, but it was still nice to wander around. We saw the biggest dog I have ever seen (it came up to my chest).
Hebden was a bit hippy-fied, but most of it was closed due to it being tuesday (they seem to open wednesday - sunday, which I suppose works better with the tourists). Saw Sam, and went to Organic House for lunch. It's an ok resturant (Amy liked it), but there was a feeble vegan choice (hummus, basically).
Yay, so get out and enjoy Autumn. Take your waterproofs, wear a jumper that you'll have to take off, and after a while come home and feel cosy, but, most importantly, get out and enjoy it before it turns into winter.
at 17:08 0 comments
Sunday, October 15, 2006
Why using code samples from the internet is a bad idea
If you're anything like me, you don't know how to make a computer do almost anything, but you do know where to look for code samples that show you how.
Also, if you're anything like me, you don't often have a lot of time to play the code samples, see how they work, read the API documentation (if there is any!), or often even the article text that accompanies the code. Usually it's: google, download code, unzip, compile, run. Then a quick once over to see if it does what I want.
However, sample code should never make it into production. Why? Because it's SAMPLE CODE.
The aims of sample code are to illustrate how a technology/technique works.
What it doesn't aim to do is be ideal code that you can copy and paste straight into your application.
Here's a sample from devx.com:
string connectionString = "Data Source=MEDIACENTER;" +
"Initial Catalog=AdventureWorks;Integrated Security=SSPI;" +
"MultipleActiveResultSets=True";
string strSQLGetOrder = "Select * from Sales.SalesOrderDetail" +
"WHERE SalesOrderID = 43659";
string strSQLUpdateInv = "UPDATE
Production.ProductInventory " +
"SET Quantity=Quantity-@amt WHERE (ProductID=@pid)";
SqlConnection marsConnection = new SqlConnection(connectionString);
marsConnection.Open();
SqlCommand readCommand =
new SqlCommand(strSQLGetOrder, marsConnection);
SqlCommand writeCommand =
new SqlCommand(strSQLUpdateInv, marsConnection);
writeCommand.Parameters.Add
("@amt", SqlDbType.Int);
writeCommand.Parameters.Add
("@pid", SqlDbType.Int);
using (SqlDataReader rdr = readCommand.ExecuteReader())
{
while (rdr.Read())
{
writeCommand.Parameters
["@amt"].Value = rdr["OrderQty"];
writeCommand.Parameters["@pid"].Value = rdr["ProductID"];
writeCommand.ExecuteNonQuery();
}
}
marsConnection.Close ();
If I saw code like this in someone's production code, I'd see red. This is, frankly, shit.What does is illustrate how you can use Multiple Active Recordsets in ADO.NET 2.0.
What's wrong with it?
- Embedded SQL.
- It doesn't clean up the open connection reliably.
- Embedded column and parameter names.
- Hard coded connection string.
- No mention of Transactions.
- Result would be better achieved in a simple SQL statement.
So, we should use code samples to see how to use a specific technology or technique, but then go away and write our own code that fits in with your application.
at 10:07 0 comments
Saturday, October 14, 2006
Work
Friday was my first day actually coding for my current employer.
However, I'm getting some bad feelings about the code base.
First, rather than use a closed source, but otherwise free, component, the developer I'm working with had decompiled it, and renamed the namespace.
Why? I have no idea. He'd certainly not touched, or even really looked, at the code.
Secondly, the other senior developer has a laptop and a desktop machine, and his code seems to be shewn across the two. If I had this, I'd be sure that I was using source control, even as a joint store between the two machines. But no. I asked him for some code that I was meant to be working on, and it took a full hour before it was in the company's code repository. This is the company's prime assets (it's a technology company), and it's not even under source control. WTF?
I've watched the programming team, and whilst they seem to get on, there's not a lot of "team" working. Everyone seems to work in isolation, then run into trouble when code sharing comes along. I presume this is because there used to be three of them, and now there are five, and an office/project manager. Information sharing becomes more and more important as the team grows.
I'm going to stick with it for a few days, then try and rock the boat a bit, and see what happens.
at 07:42 0 comments
Labels: work
Scotland is off
Yeap, you heard it straight, Scotland is off.
After going back to work yesterday, both Amy & myself were absolutely drained last night, and realised that a dead early start, followed by 10 hours on a train, and then an hour car journey, may not be the best thing for our recoveries.
It's a pain, not least because of the money (I don't think we'll be able to get any money back on the cottage), but also because I was looking forward to getting away for a few days, getting some fresh air, and meeting up with Chris and Conrad. I think Amy was looking forward to finally meeting some of my Sheffield buddies - I think she thinks they're made up.
Despite not going, I'm still glad to have a few days off. I know I've been in bed for most of the last week, but I feel like everything's been hectic recently. I don't know, perhaps it's the fact I'm out of the house from 0730 to 1845, so I've effectively lost an hour of free time a day.
at 07:35 0 comments
Labels: holiday
Friday, October 13, 2006
Fwd: weekly update friday the thirteenth of september two thousand and six
This week, brilliant indie record store Norman Records offered Max Richter cd for cost price. here's their explanation:
This week you may have noticed we put the Max Richter up on the site very cheap 'n all. In fact we are selling it at cost price so we're not making a bean on this. The reasons for this crazy phenomena are twofold:Fat Cat have released some of my favourite albums lately, and this behaviour is fucking ridiculous. I've sent them a rather rude message asking them how they like being a coporate gimp, and I'll let you know if I get a reply.
1) It's a great album and you all need to hear it. Selling it at cost is a great way of spreading the music
2) Errr... we had no choice as Boomkat managed to get it a week early as they had struck up an exclusive deal with Fat Cat. I called Fat Cat who were very nice but they couldn't really help us in the way we wanted to be helped (ie we all get it at the same time to create a level playing field). This kind of behaviour is going to be the downfall of indie music stores as the big corporate style of said online store slowly takes over. It's fine for stores to have exclusives but on big properly distributed releases like this it just isn't fair at all. If everyone buys it from them, then no one buys it elsewhere thus taking important key sales away from the smaller indies. You can say what you like about the indie stores but without them you have no independent music. Thus, to support independent music you need to support the little stores otherwise both small labels and artists will suffer. Eventually it will get to a stage where there are no indies left and the lesser known artists will struggle to get their releases into the handful of stores left (they may not see it worthwhile as they won't 'shift enough units for them). I am not just romanticising here, this will happen! So we thought the only thing to do in this case was to sell it at cost price which may be suicidal but this is an important release for us this year. You may notice other shops have done this too so it is not just us who are aggrieved. The independent music store is the lifeblood of music. Without that you have a load of bland corporate places telling you what you should own. As indie stores shut down there will be less choice available and those in need of their fix will go straight to labels which is what kind of happens anyway. Only time will tell what will happen eh....
at 13:21 1 comments
Running...or not
at 10:05 0 comments
Tuesday, October 10, 2006
shit
Was looking at http://flood.firetree.net/, which shows estimates for how sea levels could rise. Basically, a 14 meter sea level rise (yes, that is a lot) would see Leeds virtually on the coast, and even 5 meters sees Selby under water*.
*not necessarily a bad thing.
at 06:57 0 comments
Monday, October 09, 2006
Sick
I'm off work today, with a cold. It sounds lame, but walking downstairs to phone work took it out of me, so I don't think that a 40 minute train ride, followed by a 15 minute walk was really feasible. Amy was feeling dodgy too, but she's managed to go to work. I hope she's ok.
So, because I've not put anything on my blog for ages, here's a quick summary of what's going on in my life:
Running
The big event is next weekend (argh!), but I managed to do 10 miles on Saturday, so hopefully should at least be able to make it round the course. It's looking possible that I'll be running it by myself, as Bill and Conrad didn't get round to entering, and Chris' ankle is still playing up. Still, I'm sure the other people running will provide inspiration, and Paul Radcliffe's tip about counting to 100 instead of constantly worry about how far you've got left seems to help too. It's just a bit difficult counting to 100 whislt breathing enough, but it did seem to help on saturday.
Cat
Henry gets his stitches out today, but his wound is still a bit scabby, so we're going to keep him in until he's healed properly. That should stop another fight opening up the wound again, but won't stop more wounds. He's been being really friendly, and a pleasure to have around (most of the time). He did knock an entire pint glass of water off the coffee table yesterday, but he was just sniffing around, and didn't do it intentionally.
Work
Yeah, work. Yeah. Been going ok. Just one day, when they said "you can all work an extra half hour a day for the next month, can't you?", has been bad, but it seems ok. Still haven't done any serious coding, and I can hardly wait. They don't seem to know about unit tests, loose coupling, or anything like that, so I'm looking forward to introducing some of those concepts. The manager seems quite keen on BUFD, almost done to the code level, which worries me slightly, but I can see that he'll be happy as long as the work gets done. I hope I never have to spend a month on requirements capture again.
I need to go and lie down now.
at 09:57 1 comments