Archive for May, 2014

Using WordPress on real websites

Wednesday, May 21st, 2014 | Thoughts

WordPress is a super piece of software. It has made it easier and quicker to get a website up and running than any other content management system out there. It has a great range of plugins and themes, and is reasonably easy to add your own too.

That said, there are a couple of issues that I think make it a questionable choice for using on an important website.

It works fine if you deploy it to one location and just build everything there. However, often I will have a development version, a staging version and a production version. This allows me to pass a website through each stage while making sure it is working.

With WordPress, this is difficult.

You need to put the site URL into two different places in the config. This means that you have to update these values every time you deploy content to another server. So for example a typical use case would be to copy all your production data over to staging so you can perform major testing, and then potentially copy it back again. Or you want to develop the site locally and then push everything up to your server.

Unfortunately WordPress uses these URLs for the login process, so you cannot just log in and change them in the admin panel because you will not be able to get in. You have to do it via a script or by editing the database directly.

Secondly, it uses absolute URLs everywhere. Every time you upload a piece of media, or a post, it will store a URL for it in the database with the hostname included in it. When you insert the media into the post, it puts a absolute URL and SRC in there too.

This means that you have to do two things. Firstly, take our all the hostnames from the SRC and URL HTML content that WordPress generates every time it inserts a piece of media for you.

You also have to update the database to change all the URLs in there too. There does not seem to be any support to do this at all. I had to write a little plugin to change these. Arguably, you could use this plugin as well.

I am not sure why it does this. There does not seem to be any compelling argument to use absolute URLs. I had a look around for one, and the closest article was by Joost de Valk, none of which I think really stand up (certainly not in comparison to “is your site probably tested?”).

As pointed out here, if you really need to use absolute URLs, you could implement a short code to allow it to remain dynamic.

WordPress is a super piece of software, and indeed runs my blog. But I think it has it’s place in a certain set of use-cases and large production systems do not seem to be one of them.

Give me your organs

Tuesday, May 20th, 2014 | Religion & Politics, Thoughts

The UK currently has an opt-in system for organ donation. That means that unless you have specifically opted-in to donate your organs after you die, the NHS cannot have them. Sort of. Actually, whether you are signed up or not, they just ask the family. The NHS advice that making your views clear can be helpful. But actually, it is fairly irrelevant.

So a graph like this might look pretty scary:

organ_donation

But actually, it is not a complete disaster, because they will just ask the family anyway. I still think it would be worthwhile for the UK to switch to an opt-out system though. In general, you get higher donation rates in countries with an opt-out system.

organ_donation_2

If they also just ask the next of kin, it is not immediately obvious why this should be the case. Perhaps the relatives are less likely to say no if they do not feel the individual felt strongly enough to opt out, or perhaps there is just a general culture of that being the done thing. I am just speculating, I have no idea.

To me though, I wonder why there would be an opt-out at all?

What is the point? I cannot think of a good reason why the NHS should not just have a free right to help themselves to my organs after I am dead.

Perhaps you could make the argument that the family don’t like the idea. Or that it makes some people uncomfortable with the idea that their organs will be removed after they are gone. But organ donations save lives. Are these the reasons that are worthy of condemning someone to death? I would argue they are not.

Flash Boys

Monday, May 19th, 2014 | Books

When someone says the phrase “high frequency trading” (HFT), most of us have no idea what it means. Even those of us with some idea, probably think it is trading by computers, but essentially doing what traders do – wheeling and dealing in an attempt to make some money.

Michael Lewis’s book “Flash Boys” tells a different story. High frequency trading is all about front-running. You want to buy 10,000 shares in Apple? Great, I’m going to buy them before you can and then sell them to you at a higher price. It’s illegal, or it was, but with the deregulation of central stock markets in favour of competition between markets, you can now exploit milliseconds it takes for them to talk to each other.

This caused huge investment into the history with HTF firms making enormous profits. The banks didn’t say anything because they were making money from selling the HFT companies the data they needed. The stock markets didn’t say anything because they were making money from the huge increase in trading activity. Everyone was getting rich from scalping the ordinary investor.

I say was, but the problem has not gone away. However, the book also discusses how former trader Brad Katsuyama has gone on to set up IEX, a private stock exchange that tries to eliminate all the unfairness in the market.

It is a fascinating by scary read. To see how totally wrong the entire banking industry is. We all kind of know it, but it really brings it home.

Flash Boys

Kick the Drink… Easily!

Sunday, May 18th, 2014 | Books

Jason Vale’s book “Kick the Drink… Easily!” suggests that it is easy for someone to stop drinking because there is no such thing as an alcoholic. Alcohol completely leaves your system within 10 days so the idea that it is a lifelong problem is “brainwashing”. Once you remove it, you can just stop drinking.

It was an interesting read, though I do not agree with all of it.

He makes a lot of astute points. Alcohol gets a special treatment among recreational drugs. When you say you don’t drink, people ask you why. Nobody has ever asked me why I don’t take crack. Alcohol is a drug and it messes up the human body.

It also tastes like piss. We all know it. We all had that first drink, it was horrible. But we kept at it because it was the socially acceptable thing to do and gradually built up a tolerance to the horrible taste. But at the end of the day it is still a poison that our body does not like.

It goes on. Does it make you more sociable? Probably not when you think about it. People slur their words, withdraw themselves from conversation and become violent. 75% of stabbings involve intoxication. It’s expensive. It’s had for our health. It makes us feel horrible the next day. Why then do we do it?

I don’t agree with all his points. For example, it could offer a pleasurable effect. Being “numb to the world” as it he puts it, could be thought of as pleasurable if you are not happy with your live.

It also does grease the wheels of social interaction. While I do not think being intoxicated actually does make it any easier for me to talk to new people at parties, or make me a more interesting or lively person, it does help many of us get together with long-term partners.

As for his tenet that there is no such thing as alcoholism, that is less clear. Mainly because nobody can really agree on what alcoholism is.

Overall, I think it makes a good case against alcohol. It is more a large collection of anecdotes than a well cited review of the evidence. However, we all know that this evidence is out there. The book is designed to convince people to stop drinking, and people often respond better to anecdotes than hard evidence.

Kick the drink easily

Although, that does appear to be a quote from the Daily Mail on there.

The Valley of Fear

Saturday, May 17th, 2014 | Books

The last full Sherlock Holmes novel that Arthur Conan Doyle wrote is The Valley of Fear. It is a great example of how Doyle’s writing progressed as his career went on. It has a similar structure to that of his first novel A Study in Scarlet but is delivered in a far more coherent and logical way as to make the pleasure of reading it greatly increased.

It does, however, like quite a number of the stories in the Sherlock Holmes canon, lack an entirely-satisfying ending. However, there have been worse conclusions of stories in the series.

The_Valley_of_fear

Climate hoax

Friday, May 16th, 2014 | Religion & Politics

climate-hoax

Lovely cartoon by Joel Pett.

Run Less, Run Faster

Thursday, May 15th, 2014 | Books

I recently read Run Less, Run Faster after it was recommended by a friend. It sets out a training programme that emphasises getting rid of “junk milage” and making the runs you do do more effective.

In general it seems to have a lot of good stuff in it, and if I wanted to take my running more seriously, it seems like a great programme to follow. As it is, I will take some ideas from it without taking the whole package.

It seems mostly written for people who run marathons. There is plenty of adjustments for 5km and 10km races and all the tables discuss these values, as well as values for quite slow runners (a lot slower than me even) but even so I feel like it is really for people who dedicate their entire lives to running. I guess that should be obviously from a scheme that advocates five workouts a week. It certainly is not a book targeted as casual runners, or anyone who’s primary purpose is fitness rather than competitive running.

It is filled with jargon. Maybe if you are a serious runner you will understand it all, but a lot of it is lost on me and I have had to look quite a few terms up.

Some of it seems cautious. It talks about speaking to a doctor before beginning a training programme. Perhaps this is good advice if you have health issues, but I am pretty sure that the overwhelming majority of doctors will tell overwhelming majority of people “yes, of course you should exercise!” And as Chris H has pointed out previously, if you are a healthy 20-something year old, you don’t really need to train for a 10km. If you already do regular exercise, you will just be able to do it. Even by accident. Again though, that goes back to whether you just want to run it, or whether you want to run it competitively.

I like the way they mix up the format of the book. Some of it is standard flowing text, other parts are delivered as a question and answer. They also intersperse of all this with letters from people telling them how amazing they are. This I find odd and uncomfortable. I am always suspicious about texts that spend so much time openly stating how good they are rather than offering real content.

Overall, I think if you want to run competitively, this is a great book to read. Otherwise, it probably is not that useful.

run-less-run-faster

Thief of Time

Wednesday, May 14th, 2014 | Books

Terry Pratchett’s 26th Discworld novel is Thief of Time. It has a mixed cast of characters including The Auditors, Death, Susan Sto Helit and best of all, Lu-Tze.

It definitely is not one of my favourite Discworld novels. While I do like the History Monks, I am not a big fan of the Auditors. I found it dragged a bit which lead to be losing focus and struggling to follow some of it.

Thief-of-time

Porn party

Tuesday, May 13th, 2014 | Events

When Google had its ten year old birthday party, it was hard to believe that such a name, synonymous with our every day lives, was so young.

You probably do not feel that way about Worfolk 18, my adult publishing arm. But hard as it is to believe, it has now been going ten years! A decade of supporting freedom of expression, fighting censorship and empowering women.

To celebrate we got together in Fab Cafe. Here is a photo. It is very dark for obvious reasons.

porn-party

Ribs

Monday, May 12th, 2014 | Life, Photos

ribs

For my dad’s birthday we went to Cattle Grid in Leeds. We had ribs.