I like TDD for some things, I've had genuine fist-in-the-air moments when a test passes, but I'm having issues with the fact that I am writing two or three times as much code as I was before, plus I sense a real increase in the complexity of some of my code.
I enjoy some things, writing the tests first creates some nicely decoupled code, and as I say I have had some really great moments when a a complex algorithm finally passes. I was writing some code the other day that converted base 10 numbers into base 36, and I found the tests very helpful while I grappled with my bad mathematics.
It will be very useful when working with dynamic languages, such as Python, when you don't have the safety-net of the compiler, but I'm not convinced that for the sorts of GUI apps I write, that I am really getting an equal return for the time-investment.
Anyway I'm still having fun and I plan to continue with it for the time being.
The Lib Dems are completely allowed to complain about the validity of the system, because they had 23% of the popular vote, but only earned 8% of the seats. They may well want a change for selfish reasons, but Labour and the Tories want the status-quo for selfish reasons too!
Well, that's democracy for you. Everyone gets represented, no matter how deranged they are.
Edit: To clarify - if there is a proportion of the British people who support the BNP, they have the right to be represented in parliament. The issue here is with a society where people grow to believe such things, not in the political system which allows them to be represented. If you want to change peoples minds, you do it through education and reason, not through withholding their voice.
Yeah, spot on. Seems everyone these days thinks we have a presidential style of government, but actually it's an old-fashioned parliamentary democracy. We don't elect the Prime Minister, we elect an MP for our constituency and, by tradition, the PM is just the leader of whichever party gets a majority in the Commons. Technically the monarch can elect whoever she chooses to be Prime Minister, but thankfully she doesn't excercise that right.
But I'm with Kev, if anything comes from this, I hope it's proportional representation. Seems this might be the one big chance this generation to actually get it.
Meh, it's funny, I came into this thread thinking it might be nice to find out some random peoples opinions on the election, but guess I should have learned by now. I'm almost embarrassed to be British after reading all this bullshit.
Based on Dygear's answer, presuming you have a dictionary/map of User objects named _users, it would be something like this in C#:
// Imaginary user map keyed by the UCID. var _users = new Dictionary<int, User>(); var _rand = new Random();
User GetRandomUser() { return _users.Values[_rand.Next(_users.Count - 1)]; }
List<User> GetRandomUsers(int count) { if (count < _users.Count) { throw new ArgumentException("not enough users"); }
var selectedUsers = new List<User>(); while (selectedUsers.Count < count) { var user = GetRandomUser(); if (!selectedUsers.Contains(user)) { selectedUsers.Add(user); } } return selectedUsers; }
Note: This code isn't tested, but I have determined it to be correct.
You would call it like this:
var randomUsers = GetRandomUsers(3); // Get 3 random users
So it's OK to be reckless if what you are doing is inherently dangerous? If you're doing something risky, you should go out of your way to ensure the safety of others.
I agree on the whole, although I do think the McLaren/RBR pit exit was dangerous. What if they had touched and spun into the pit-equipment or mechanics? It looks slow on the TV, but they're still going at about 60 mph or whatever. As a pedestrian if you get hit at 60 mph you chance of survival in about 0.1% (non-scientific). Young hot-headed guys shouldn't be messing around challenging each other in those sorts of situations. Sure, maybe the lollipop guy was in the wrong, but either of them could have gotten out of it and happily resolved the situation. Anyway, it was a racing incident, and I wouldn't have expected much different from a couple of twenty-year-olds.
Another great race and another smart drive by Button. I was sceptical at first, but the non-refuelling has put strategy much more into the driver's hands, and I think we're seeing far more tactical driving (as opposed to team tactics) than we were before. So far it's all good and I'm happy to have been silenced.
Well, yeah, I can see how it's a similar problem, but DC obviously hit the curbs hard and the suspension was under a lot of lateral load. For Buemi he was going in a straight line and wasn't putting the car under any obvious strain (excepting the normal strain it would be going through at 180 mph). So yeah, kinda similar, but different at the same time.
InSimSniffer already ran pretty fast, I put a lot of effort into optimising it a while back, so it's hard to tell without doing actual tests. The bug fix will have improved performance quite a bit, as it was a dumb error where at one point in the logic I was doing:
Info info = GetInfo(); ProcessInfo(GetInfo());
And processing everything twice. Which means a lot of performance was being thrown away anyway...
Sadly I think it's too late to register, plus I think you need a £500 deposit to run for office. Well, I guess there's always 2015. The dream lives on...
Yes - UK internet is very slow compared to other counties, but that's because, like so many things, it never gets the investment it needs from the government. Apparently though there is an election coming up.
I think I just had an idea for a political party! Free high-speed broadband for all and forced-cabbage for the under-fives! Who's with me?!
Nah, they just hadn't optimised the new code. It had quite a few issues, as well as some pretty horrendous memory leaks, which sadly seems to be a reoccurring theme with applications written in WPF. Obviously managed code doesn't remove the necessity to manage memory, but in WPF it seems there is a tendency to have orphaned XAML elements which never get garbage collected. Pretty much all of those issues have been fixed, plus a few old things, such as the Add References dialog, have been hugely improved. Well, I know there are always people who will never be happy with Visual Studio, but I do think it's a very nice upgrade.
Well having written almost the entire Wiki entry on InSim, I would be happy to learn of which areas you feel are most in need of improvement. Of course as a Wiki anyone can edit it, so instead of saying that it sucks you could always improve it.