Spot any errors? let me know, but Unleash your pedant politely please.

…

Wednesday, 9 March 2011

Offensive.

I've just been reading a Grauniad article: Not quite a paedophile' – John Humphrys' strange correction in which Tanya Gold has written:
Mainstream porn actresses – I will not call a woman who is a paid-for receptacle for semen a "star".
Yes. Really. In a written piece about poor choice of words on live radio, one woman calls another woman a spunk bucket.

I'd love to hear Anna Span or Belle de Jour's opinion on this.

Sunday, 30 January 2011

Python FTW: Clearing an FTP folder.

I'm doing some testing that involves kicking off a lot of concurrent processes. Some of these write files to an FTP server. I don't need those files once I've checked that they exist, but FTP doesn't allow deletion of multiple files (AFAIK). The first time we cleared the server, we took a directory listing and wrote an FTP script from that. It worked well enough, but we'd need to write that script each time.

So a little play with Python gave me this...


from ftplib import FTP

def clearFTPDirectory(address,
username,
directory):

server=FTP(address)
server.login(username)
server.cwd(directory)

directory=[]
server.dir(directory.append)

# list comprehension, baby!
filenames=[entry.split(':')[-1][3:] for entry in directory]

for filename in filenames:
try:
server.delete(filename)
print 'Deleted:%s'%filename
except:
print ('failed to delete "%s"'%filename)

server.quit()
…it should save a fair few cumulative hours, but more importantly, it'll save a fair few hours of tedium.

The bit that tripped me up for a little while was server.dir(directory.append) which takes the append function as a parameter. Makes perfect sense now.

Note: if you use this, you may need to check the format of the strings returned by dir(), and adjust the line that extracts the filename.

Briefly Sexist Dad

I caught myself being an old-fashioned gender-stereotype father this morning. I have a chest of drawers to put together for my daughter's bedroom. Last night I thought that I'd see if my son would like to help put it together. Then this morning I realised that was a bit daft. There's no reason why my daughter shouldn't help put it together. It's for her room after all.

So I asked her.

"Nah", she said, and turned back to watching some crap on the Disney channel.

Sunday, 2 January 2011

When i became a skeptic

I've sometimes wondered whether I've ever had faith. Ever believed in God. I don't think I ever have. I don't have any memory of faith. I went to a church pre-school, to Sunday school, to state schools that did the obligatory Christian service each morning at assembly. But I don't think I ever believed it.

I do recall though, the first time I thought faith was bollocks. It was in an R.E. lesson with Mrs Stone, aka Ol' Ma' Brick. She explained faith in terms of the chairs the class was sitting on. That we had unquestioning faith in each chair's ability to support us. I couldn't articulate why I thought this was bollocks at the time, but bollocks it most certainly was. I'd have been 11 or 12, I think.

We don't have blind faith in chairs. We have years of experience of chairs and knowledge of the physical world to inform us that the chair will support our weight. Sometimes a chair will break. A old and brittle plastic garden chair might lose a leg. A wooden glued chair may have joint that's worked loose and come apart.

Sometimes we might see a new design of chair that seems impossibly flimsy, perhaps made of wire, that becomes stronger when we sit on it. Or that appears not to have a full complement of legs. When we sit on these, we don't do so with blind faith, we do so tentatively, half expecting it to collapse, preparing for it to break, and being pleasantly surprised when it doesn't.

Saturday, 1 January 2011

Another iPad Epiphany

My wife bought a traditional compendium of games for the family for Christmas. A nice wooden box with Chess, Draughts (Checkers), Backgammon, Othello (Reversi), etc. The pieces for the games are hidden inside the box, the lid is reversible with different game boards painted on each side.

It's like a primitive, manual iPad.

Looked at another way, the iPad is like a compendium of apps, but the box under the board is like a TARDIS, and you can't lose the pieces in or under the sofa.

I'm going to start saving for iPad II.

Thursday, 30 December 2010

Elton John

The first I heard of Elton John having a child was when I read that the BBC had sought the opinion of the despicable Stephen Green on the news. Stephen Green is, in my unqualified opinion, delusional bordering on insane.

It's not (just) because I'm an atheist and he's religious. Some of my best acquaintances are religious. It's because he's a hateful biblical literalist, a Leviticus believing religious nutjob.

My opinion on gay sex, gay marriage, gay adoption, gay surrogacy, gay parents and gay elderly parents is that it's not really any of my business.

It's worth remembering, before judging these new parents, that children are born to terrible parents, to elderly fathers, to cuckolded husbands, into loveless marriages etc, all the time. No licence is required, no exam needs to be passed. The same applies here.

The objections are simply about homophobia, about man-on-man action, not about parenting. Usually, when sex is discussed, I'd say it's OK as long as it's consensual. The ambivalent and those supporting Elton don't see it as being about sex though, and so it's not about consent. Children do not give consent to their parents. Children do not choose their parents.

I'm not a fan, incidentally. If anything will make me turn the radio off, it's Elton bloody John.


Budgeting

I've been looking at my bank statements for the last 6 months to try to figure out where all the money's gone. I seem to spend a lot, but I don't actually buy much. Or at least I don't have much to show for it, except an expanding waistline.

My plan for 2011 is to have a budget. Unavoidable things will still go out as direct debits, petrol will go on the debit card. Food and drink will come out of a weekly cash allowance, and when it's gone, it's gone. If I want something, I'm going to save for it. I hope to find that by the time I've saved enough to make the purchase, I'll no longer really want it. I also hope that by using real cash, I'll become more aware of what I'm spending.