Farewell, old friend
With Movember over, it was time to say goodbye to the would-be soup strainer. I thought I would take one last picture after experiencing record growth this year.
With Movember over, it was time to say goodbye to the would-be soup strainer. I thought I would take one last picture after experiencing record growth this year.
This is one of the geeks among you. I’m currently working on a new open source project which uses a series of database models derived from a base model which includes some standard methods and I was having one problem in particular to do with updating data values in an object.
if (
!$object->setName($d["name"]) ||
!$object->setSlug($d["slug"]) ||
!$object->setDateByArray($d["date"]) ||
!$object->setContent($d["content"])
) {
$this->setMessage($object->getMessage());
return false;
}
As you can see, this does an if statement and then runs all the updates – the idea being that if any of them come back as false, it can set the error message and return false to the controller.
This worked as expected but with one problem – as soon as one of them appears false, PHP stops looking at the other conditions in the if statement. This is a problem because it means the user only gets one piece of feedback at a time. Whereas, it would be much better if we could give them all the fields that were wrong at once.
However, this doesn’t seem possible in the above implementation. Even if I switched it round to check that everything is true, and everything must be true, that suffers from the same problem that once something isn’t, PHP will stop checking the conditions.
I considered whether I could implement it using exceptions – putting all the checks inside a try block and then have the update operations throw an exception if they were invalid. I could then catch this exception and add the error to the list of errors. However, this suffers from the same problem – as soon as the first invalid value triggers an exception, the rest of the try block is ignored.
The solution I have eventually come to is this:
$writes = array (
$object->setName($d["name"]),
$object->setSlug($d["slug"]),
$object->setDateByArray($d["date"]),
$object->setContent($d["content"])
);
if (in_array(false, $writes)) {
$this->setMessage($object->getMessage());
return false;
}
All the operations are run, and their values are fed into an array. That way all the checks get run no matter what value they return. I then search the array for any values set to false and if any of them were, I know there has been a error and can flag it up with the user.
Mark Edon recently gave a talk to West Yorkshire Humanists about “talking to creationists.” I’ve already seen Mark talk three times before but never the less it was interesting as ever, with plenty of fresh material.
As part of Non-Prophet Week, Atheist Society recently held a charity quiz to raise money for the very much worthwhile cause, Medicines Sans Frontiers. It was an enjoyable night and I came away with a pair of tickets to the West Yorkshire Playhouse so a good night all round.
Recently, I visited Headingley Cafe Scientifique for the first time for a talk entitled “Intelligence of Genetics.”
I had never attended the Headingley Cafe before but it seems very well attended. It was standing room only by the time the event kicked off and there were plenty of seating available – so they probably had 50+ people there.
The venue was the New Headingley Club which looked very fancy on the website but turned out to be significantly less fancy in the flesh. I got plenty of change from my round at the bar though, so will approve of that!
The event itself was somewhat disappointing. I came away from the talk not really feeling that I had learnt anything – other than that we have a one in three chance of getting Alzheimer’s disease and this massively varies depending on our genetics. There were lots of stats, but a lot of these weren’t really in much context – am I supposed to be impressed by that number? I don’t know what an average sample size for your area of science.
Still, it was good to finally make it down to the Headingley Cafe.
Just six days after we released version 0.2 of SocietasPro, we’re pleased to announce that we’re announcing the third iteration, which is now available to download on Github.
Here is what we’ve changed in this version:
Where will the project be going next? We’re going to put some work into the front end and then it should finally be ready to demo! Stay tuned to our updates on Twitter for further updates.
I don’t keep a great deal of food at home. My freezer is always full of stuff, and I have some backup tins in my cupboard, but beyond that, I have to specifically go out and buy food to put in my fridge. The reason is, it never really seems to get eaten.
Taken my recent weekend for example. On Saturday afternoon I went for lunch with Raby. We hit up Las Iguanas which is always a pleasure and it was great to catch up with Raby as it’s been quite a while since we’ve met.
In the evening, we hit Sam’s Chop House, then on Sunday afternoon, I headed over to parents for lunch before hitting up Humanist Community on Sunday evening – which may well have set a new record for attendance.
A few weeks ago, we headed to Sam’s Chop House for a meal while Kat was in Leeds. I had been there once before and had had a great experience, so I was looking forward to it.
Unfortunately, I didn’t feel they really delivered. The steak was good, but not great. It also took a really long time for it to turn up and though I was hoping they could recover with desert, that proved similarly disappointing.
Afterwards we headed over to Brown’s to enjoy their fine range of cocktails.
Ben brought up an interesting topic in this month’s Humanist Community of Leeds meeting. The topic was the discrepancy between the age of sexual consent and the age at which you can vote.
I’ve heard the argument before, and similar ones that I don’t buy in to – for example, you can pay tax at 16 but you can’t vote until you’re 18, therefore it could be suggested it is unfair that you pay tax to a government you can’t vote for.
I don’t find this a credible argument because you don’t necessarily pay tax as a way of gaining a vote in democracy. You’re vote in democracy is a guaranteed right, even if you’re not paying any tax at all – it simply isn’t available until you’re ready to make an informed decision. The reason you pay tax is primarily to pay for public services such as hospitals and schools, which you almost certainly have been making use of at the age of 16.
The argument for having a different age for sexual consent and voting is a less clear cut one though. Indeed, Ben made a very powerful argument that I think may be winning me over.
The reason we don’t let people vote until they are 18 is because we’re worried they would vote for the wrong political party – a lot of them might vote for the Monster Raving Looney Party, or the BNP, or the Greens, or one of the many other fringe parties and being the pretentious grown up real adults we are, we don’t approve of such free spiritedness.
But it’s very hard to make the case that they can do more damage with a vote, than they can do by having sexual relations.
Actually, having a vote probably won’t make any difference. Voter turn out is low in young people anyway, let along even younger people and at the end of the day, it’s only one vote and there are lots more people aged 18 or over than there are aged 16 or 17.
Sex however, can be quite damaging. Initially it could appear this is primarily damaging to themselves which is perhaps why we allow it (whereas voting for the wrong political party would be damaging to society and is therefore not allowed), but of course sexual relations can be incredibly damaging to society.
Unwanted children are a huge problem because they don’t get properly parented and therefore become out of control kids and eventually grow up to become criminals, breaking into your house and filling up those prisons that your tax money pays for. Not to mention the possibility of ending up in care, which our tax money also pays for.
In fact, one of the biggest reductions in crime has come from legalising abortion[1], simply because most of the unwanted pregnancies that would have previously been born and grown up to become criminals are now getting aborted. Unwanted pregnancies cause problems, as do STIs which are also prevalent with young people who engage in regular exual intercourse with multiple partners.
Therefore, giving how damaging it is in society, it is very difficult to justify having a higher age for voting than you do for sexual consent.

There are only two places you are allowed to sing in public – church and karaoke bars. Unfortunately, many people feel uncomfortable doing karaoke and you never get to sing anything good at church.
The solution – karaoke congregations! It’s a meeting, where you all turn up and do karaoke as a group. There are a number of different songs to suit people’s tastes (or as the movement grows separate meetings with different genres) and you come along and everyone sings along together. This way, you can sing popular songs and you don’t have to be embarrassed because everyone is singing so nobody can really hear you anyway.
It’s also important to point out that it is karaoke. That is an important term because it stresses that it is fun and you don’t need to be able to sing. As opposed to a term like choir where there is a focus, or at least an interest in signing properly, in a formal way and performing together, these meetings would just be fun meetings where you can turn up and sing badly because it’s just about having a laugh, just like when you go to a karaoke bar with friends.
Thoughts?