Monday, January 29, 2007
Friday, January 19, 2007
Foundation Schools
at
09:40
0
comments
Sunday, January 14, 2007
Wednesday, January 10, 2007
Taps...fans...work
at
10:21
0
comments
Monday, January 08, 2007
Back at work...glad to be alive...wondering what other electrical surprises the house has for me.
at
09:43
1 comments
Friday, December 29, 2006
I've got a new camera
It's a Canon Powershot A710 IS, and already I've killed the batteries that came with it.
So far, it seems great. I'm loving the 6x Optical Zoom, and the all round photo quality seems great. I'm going to have to play with it some more. I took a picture of a christmas card from across the room, and you can read the writing in it and everything.
It does up to 7.1 Mega Pixel, and, although I'll probably never really need that power, it seems sharp as anything, so lower resolutions will be even better.
It appears to be simple enough in Point & Shoot mode, but the settings can be played with and tweaked. And, as it's a digital camera, I can erase it and put it back into P&S mode when it all goes stupidly wrong.
Best of all, is that it's about 1/2 the size of my old camera, which will hopefully mean I carry it around with me more, and thus take more pictures.
at
15:39
0
comments
Google logging in and out
My blog is with Google, and I use Google Reader and Google Mail. They all share the same log in mechanism. This is great, as I only have one set of credentials to remember. However, it backfires massively when I have blogger, reader and gmail open in different tabs, and then sign out of one of them. Suddenly, it all stops working. Google Mail and Reader and Blogger all behave differently in this situation. Blogger and Mail behave okish - both requiring you to sign back in somehow. But Reader just kind of silently stops working. The worst thing is that I have to sign into each app separately, rather than it picking up that I'm signed in again and getting on with it.
at
11:34
0
comments
Thursday, December 28, 2006
Putting methods in the correct place
Object-orientated programming is all about encapsulation - the principal whereby an object exposes only what is needed by other objects and, by doing so, remains in control of its state.
For example, your Collection class exposes methods to add, retrieve and remove items, as well as a Count property, which indicates how many items it contains.
In your program, you no longer have a collection, you have a Pupil Collection (first example that came to mind). This is exposed as a property of your Class class.
You've got this far, and then you find you need to check if a Pupil is in a Class, so you write code like this:
public class Class
{public PupilCollection Attendies;
//other methodspublic bool ContainsPupil ( Pupil pupil )
{
for ( int i = 0; i < Attendies.Count; ++i )
{
if ( Attendies.GetPupil(i) == pupil )
return true;
}
return false;
}
}
public abstract class PupilCollection
{
public bool ContainsPupil (Pupil pupil )
{
for ( int i = 0; i < pupils.Count; ++i )
{
if ( pupils[i] == pupil )
return true;
}
return false;
}
}
public class Class
{
public PupilCollection Attendies; //other methodspublic bool ContainsPupil ( Pupil pupil )
{
return Attendies.ContainsPupil ( pupil );}
}
And the next time you need to see if a Pupil Collection contains a Pupil, the code's already there. Your code looses a whole load of duplication, and reads nicer, simply because you moved a method.
In this case, we can start to think about things like specifications [pdf], and other more intricate designs, because we no longer look at the code for the Class and have to think about how it's doing what it's doing.
Using tools (and Code Smells)
I've been using Resharper for the past two years, and I can hardly use Visual Studio without it (well, I can, but I always get frustrated that
Its Extract Method option is probably the one I use most. Not only does this decide what to have as parameters for the method, but the majority of the time, it's "Declare Static" box is checked too - meaning that the method it will create will be a class level method.
When it does this, I take it as a sign to assess whether this newly created method wouldn't be better off somewhere else. Sometimes it doesn't make sense to move it, but often, just thinking about what the new method does means I put it somewhere more appropriate, and I find my code reads a lot better for it.
So, next time you see a static/class level method, ask yourself if it doesn't belong elsewhere.
at
11:48
0
comments
Seasonal stuff
at
10:49
0
comments
Wednesday, December 20, 2006
I don't often post links, but...
Go and read "Code tells you how, Comments Tell You Why" on Coding Horror.
Go on.
at
09:17
0
comments
Monday, December 18, 2006
Veg Box
I can understand that, in the winter, it's going to be hard to put together locally sourced organic food for the same price as during the summer (and I suppose I'm surprised the price doesn't reflect this), but they are invariably full of stuff that you don't eat - either because you don't know what it is, or because there's so many of them (e.g.: one massive squash that you'd not even think about buying from the shop).
Even the "best ever veg box" that Amy and I had (from Goosemoor Organics, who don't deliver to where I live now) still had a large celeriac every week. They did leave it out when we asked, but there were a few that turned runny before we actually got to eating them.
The other thing is that they are not tremendously good value. This true of organic veg in general, but I've found that, from a £25 "mixed" box, typically I end up buying another £5-10 worth of veg. This is sometimes simply because there weren't basic things like onions, but also because, being vegan, I tend to eat a lot of fruit and veg, and there wasn't enough variety in the veg box to keep me healthy.
We tried doing a veg box where we got to choose what we got. It was a nice idea, but it turned out that, because the supplier was so unreliable, we'd usually only get half of what we ordered. Very annoying, especially if you were trying to get specific ingredients. Also, we had to order the new veg box the day after we got the old one, so we'd have to try and predict what we'd need a week in advance.
at
10:57
0
comments
Friday, December 15, 2006
Coffee
I haven't really been drinking coffee lately. I quite like coffee - not nasty NesCrappy, but freshly brewed coffee, preferably from fresh grounds (although they're usually not quite so fresh).
I have to take my hat off to Union Coffee Roasters <http://www.unionroasters.com/> for having made the nicest coffee I've ever tasted. The packets I've tasted are smooth and fresh tasting, and have a pleasant citrus element. The only places I've found to buy it are Waitrose (nearest is either Otley or Sheffield), Beano and Just Bean (both in Leeds). It's subsequently a bit of a treat when I do get some.
Since I've been tired, I've been drinking coffee everyday this week - I think it was three cups on Monday. It started because I was shattered after staying out late on Saturday night, then waking up early on Sunday morning. So on Monday I drank lots of coffee to get me through the day. Monday night I had about five hours sleep.
Tuesday was a busy busy day - was at work by 8am, and, after taking the cat to the vet's, didn't get home until nearly 8pm. Not much coffee drunk, and I took some Nytol before bed, and I slept deeply.
Wednesday, I had 1 cup of coffee, felt really bad when I got home from work, but managed to drag myself out to Yoga, and unsurprisingly, slept really well, (and I managed to get up slightly later than usual). I felt really awake yesterday (Thursday), but I still had some coffee, and didn't sleep at all well last night.
So, from tomorrow, I'm going to stop the coffee, and hopefully I'll sleep better.
Right now, I just need one more cup now to get me through the day...
at
11:37
1 comments
Wednesday, December 13, 2006
Holmfirth
at
10:10
0
comments
Spam
Dammit, I started getting spam on my Google Mail account. For the moment, it's about one a day, and the spam filtering catches.
Also, it's clearly designed to fox spam filters, resulting in some rather surreal text:
Coming from where? I asked.A galactic garbage dump! I cried aloud. Where you holier-than-thouNow is the time, Captain. For at this meeting I am not only going toOh, I do appreciate a sense of humor, stranger. The tentacle tookthere. Stand up, Jim! I got as far as my knees and he came on.will not shout or you really will be dead. You will speak to me softlyslumworld. Think quickly, Jim, before things get any worse.Very gradually the wall became higher as we walked beside it. Intearful thanks in advance. This is the experience that will changethe bed, turn off the searing lights, stumble on all fours to my packeverything was in great swing already. I ready. And gory too; I
at
08:59
1 comments
Monday, December 11, 2006
Armando says...
"isn't there a possible compromise to be reached on the successor to Trident? How about taking all the money and saying we've spent it on a fresh batch of nuclear warheads, but quietly spend it on other things like street parties and the Olympics. Blow the money big time on fun and, instead, construct a missile system made out of bars of soap."
at
16:18
1 comments
Hooray for Open Source!
Jeremy and Ayende (and probably others by now) have been considering the Microsoft attitude to Open Source.
I can see why companies don't like GPL, but it can turn out to be a good thing.
The very fact that Linksys decided to use Debian Linux kernel for their NSLU2 device, and were obliged by the GPL to release (bits of) their code, has meant that a whole community has sprung up around it (http://www.nslu2-linux.org/), who figured out how to run Debian on it, which has resulted in their product being used as a lightweight, low-cost, server. (yeah, 32MB ram and 266Mhz is hardly going to win any performance awards, but for ~£40 + cost of storage device, what do you expect?) [Edit: Thanks to Øyvind Repvik for setting me straight on this]
Jeremy makes the point about Agile development in .Net only being possible with open source tools tools. I don't think that this is just related to OSS. In the places that I've worked (my view of the 'Microsoft world'), people don't seem to want to know about something unless it comes from Microsoft. (The only notable exception is the miles of sub-standard code that's been copy-pasted from the code project).
Agile? Not until MS announced they'd been dabbling with SCRUM.
Unit Testing? Not really, and still not very much (too much poorly written code based on sample provided by Microsoft).
IoC/Dependancy Injection? Despite working with numerous "plug-in" frameworks, based on DLLs, then COM, and now .Net, people still don't see the benefit of taking it that one step further and creating all of their code based around this model.
In my view, the problem in the .Net world is that there are too many .Net developers. Many of these have come to it from VB and from ASP, and have little experience of rich OO architecture, and many wouldn't know a proxy from an abstract factory.
What happened to the Visual C++ developers? Most of the Visual C++ programmers I know are still developing in unmanaged C++, claiming the performance of .Net prevents them from moving.
To be honest, I've been trying to plot ways of leaving .Net, and moving to RoR or Java, as a way to escape the crippling laziness/poor practised that I consistently experience in Microsoft based developments. I'm fed up with having to teach people about loose coupling, dependencies, and other really basic stuff - the kind of things that other development communities seem to have tackled years ago, and from which they are now reaping the benefits.
at
13:47
2
comments
Labels: opensource, programming
Tuesday, December 05, 2006
Sufjan Steven's Christmas Songs
at
12:09
1 comments
.Net Testing And Assemblies Signed with Strong Names
at
11:27
0
comments
Monday, December 04, 2006
Development Metaphors
[Update: this is written about far more eloquently on coding horror, which I read quite coincidentally]
at
10:18
0
comments
Sunday, December 03, 2006
Ubuntu
Gary's written a reflection on using Ubuntu. It's kind of reassuring.
I've been using Ubuntu in a virtual machine for a while for some projects I've been working on. I kind of like it (although, I have switched to using Xubuntu, as it has a lower resource overhead).
There are still a few areas where the open source community lacks strong software. These are .Net development (nothing comes close to Visual Studio and Resharper), and music.
There's one DAW solution, but I tend to use Ableton Live, which is a bit of a hybrid, and I've not really seen else like it. That, and Guitar Rig. There is FreeAmp, but Guitar Rig is soooo amazing, I don't know how anyone else could do that.
There are some components out there that could be put together to arrange something ableton like, but, as always, it's time, and tweaking, and it's time i could actually spend playing guitar.
Yeah, so use ubuntu if you don't want to do music on your pc.
at
09:01
1 comments
Labels: linux



