atheism

I’ve been an atheist most of my life, and I find it very strange when people don’t understand.

So, this article will try to explain why I am an atheist.

First, we need to define what a “god” is. Incredibly, this first step annoys some people! When I ask people what they mean by “god”, they say things like “well, you know…” (no, I don’t), or “what do you mean?” (was I not clear?).

Let’s define a god based on the most common christian beliefs:

Each one of these criteria is incredibly unlikely.

Seven Day Creation

The first one, “Can create a whole universe in 7 days right down to animals” is easily disproved.

By simply looking at the night sky, measuring the distance of stars and how the further stars are from us, the more their light is shifted to the red, we can measure the age of the universe pretty confidently to about 13.75 billion years.

That’s not 7 days. And if the religious apologists reply by starting “well when the bible says ‘days’, what it means is …” – stop right there. If the bible said “days”, then the bible meant “days”. Otherwise the bible is incorrect.

Self-creation

Next, we have “can create itself”.

Obviously, it is possible for something to come from nothing. This is self-evident.

Things that exist either existed forever, or they came into being from nothing.

The idea that everything that exists has always existed was believed for a very long time, but it causes a load of unanswered questions, such as why, after an eternity of existence, everything is not either compressed to a single un-moving point, or spread out to a completely uniform volume.

The idea that things can come from nothing causes a few questions as well, such as “how?”.

Combining the two, modern science shows that something can come from nothing, through a quantum effect called the Heisenberg Uncertainty Principle, and yet the sum total energy still equals zero. In other words, the universe is both eternal, and yet its material can have emerged a set length of time ago.

On the religious side, Christianity does not believe in an eternal universe. If the universe is eternal, it does not need a creator, and therefore there is no need for a god.

Christianity believes that something can be intentionally created from nothing. They say that God created himself from nothing (example 1), and then created the universe from nothing (example 2).

So, based on two explanations of how things can come from nothing, we have a choice of which to believe.

Choice 1:

  1. God intentionally created God from nothing.
  2. God then created the universe from nothing.

Choice 2:

  1. The universe emerged naturally from nothing.

Occam’s Razor suggests that when given the choice between two explanations, you should choose the one that is the least complex.

Even if there were no God, the universe would have created itself from nothing anyway. Quantum mechanics ensure this.

We do not need to invoke a god to create a universe.

Creation of Life

According to the bible, God simply created life one day. As simple as that.

And then after all of the animals were created, a human male was created. From clay.

And then a human female was created. From the male’s rib.

Compare that to the idea of evolution, where simple molecular reactions “evolve” over time through competition to eventually become the hugely diverse life-forms that cover the planet today.

I don’t even know why I need to explain this one. Seriously – created from clay? And a rib?

Evolution is the only viable explanation for life and its huge variety.

Everything else is fairy-tales.

Selectively Infinite Caring

Priests say that “God loves us, every one”, and then they claim that you will go to hell if you don’t worship him.

As an aside: in 1999, Pope John Paul II changed the Catholic church’s stance on Hell, demoting it from an actual place to a mere state of being. This changed 2000 years of supposedly infallible truth that Hell was a place.

I guess “infallible” doesn’t mean the same thing to me as it does to them.

Anyway – apparently, God sees everything and knows everything, and cares for all of his children, but only those that worship Jesus.

This means that, if the christian God exists, then every person that has never heard of Jesus, or that doesn’t believe he is the son of God, will be punished eternally.

Yeah… right.

Personally, if I created a universe (for example, a computerised simulation), I really don’t care about the individuals. I might find the civilisations interesting, but the individuals are not interesting.

Similarly, for someone studying ants does not find any individual ant interesting, but the colony would be fascinating. Even if they do focus on an individual ant, it’s not that specific ant that they are interested in, but the type of ant it is (soldier, queen, worker).

And even if any individual was interesting, why is their belief somehow a criteria for whether they should be rewarded or not?

Summary

Well, there it is.

So, I don’t believe in gods for the simple reason that I don’t see any compelling evidence that gods (of any type) exist.

split testing

I wrote a split-testing plugin (also known as “A/B testing”) for my CMS early last year. It wasn’t very good, so I wrote an external split-testing tool instead, which you can you for your own websites if you want.

Split-testing application

It works similarly to Google’s “web optimiser”, but I think it’s easier to use.

As a test, I chose to optimise the front page of KV Sites, to see if I could encourage people to contact me or read other pages on the website.

In particular, I wanted to see if it was better to explain what I do, or to assume that the reader knows and just wants to get on with.

As an example, consider the following two extracts:

Indirect speach – explaining what I do

Web Development

Reduce costs by automating and networking your business.

Proven record, with a number of large projects completed. Example projects include Duffy Transport's management application, the crop prediction software used by Cropworks, ongoing development of the WebME CMS, and technical support for a number of projects by other web development companies.

vs.:

Direct speech – asking what the reader wants

I am looking for Web Development

If you are looking for an online solution which to reduce your office expenses, we have experience writing solutions which can cut hours of work per day off your load. Read more about our web application development here.

It seems obvious that the direct speech version would work better, but when your job is involved, it’s better to be certain than to work based on assumptions.

So, I set up a split test. On the homepage of KV Sites, I sent the HTML for both versions to the browser, and set the different versions to display randomly using CSS.

Each version includes a “more info” link (of sorts), so I added the “conversion” code (which records when people go to the page you want them to) to the pages they were linked to, and started recording.

It took a few weeks for the information to come in, as my site does not have heavy traffic, and I didn’t want to artificially boost it in any way, but here’s how it turned out:

Name Visitors Conversions
front page direct marketing 237 v2: 12
v1: 24

It’s obvious from the above that “v1″ (the direct speech one) is twice as effective as “v2″ (indirect speech).

I’m very encouraged by these results. They mean that it is possible to both a) improve “conversions” based on text changes, and b) provide numbers proving those results.

This year’s Féile Oriel sucked

Féile Oriel this year is crap, in my opinion. We went into town today to see what was going on.

The Market House had a few violins in it. Well, my house has a few violins as well. There were two interesting violins. One had a long neck and only one string. I imagine it’s played something like the Chinese erhu. I asked what it was. The guys that were managing the exhibition didn’t know. I then spotted a violin that had a very interesting shape for its top plate – there was a deep scoop just inside the arches. I asked why that was. I was told “I don’t know – they’re just different”.

We were looking forward to the “try it out” shop that they’d had last year, where the owner of a local instrument shop would bring a load of things into a vacant shop and let visitors come in and try them out. We were then told that it wouldn’t be on this year.

So, I asked Bronwyn if the website had said anything about what’s on. She said no, that there /were/ some things mentioned, but generally things that you have to pay into.

We found some music finally outside the Westenra hotel. Boann had a great time dancing.

Then we noticed there was a session going on inside the hotel and went in, in the hope that we could sit down for a few minutes with a coke or lemonade and listen. The musicians were all in the reception area, where we couldn’t stand and listen as that’s where people come in and out. So i took the kids in to the seated area. We couldn’t hear the musicians at all from there – just some football that was on a TV. the kids wanted some food, so we got sandwiches and then went home.

I then checked the website, and found that Bronwyn was right:

- under Musical Events, it mentions /one/ thing on today and /one/ thing on tomorrow, and doesn’t give a time for either.
- There is a link for Sessions, and the link is to a broken page.
- under Other Activities, there’s a busking competition mentioned. well, my guess is that there won’t be any winners this year, because there weren’t any buskers that I could see!

All-in-all, the day sucked.

code golf

I came across a new (to me) game yesterday – Code Golf.

The game involves coming up with an algorithm to solve a programming problem, and trying to condense the code for the algorithm into the smallest number of bytes possible.

The first one I tried was this. It was a fascinating problem, and took me a day of musing on it (in the back of my head as I did other things) before I had a solid solution.

After writing the solution, which took 1380 bytes, it was time to start “golfing” it.

At first, I thought I’d try my compressor on it. This shrank it to 825 bytes, but after compression, it couldn’t be worked with anymore, so I thought I’d try compressing it manually.

This resource was fascinating, and gave me a load of pointers.

There were a few small points I came up with myself while working on it:

I prefer to use “\n” instead of “;” for command endings, as it makes code more readable. (the game is about shrinking the code, not obfuscating it)

A saving can be had by combining nested loops:

// before
for(i=5;i--;)for(j=5;j--;)M[i][j]=0
// after
for(i=25;i--;)M[0|i/5][j%5]=0

If you need to push into an array on multiple lines, make a shortcut for the push method:

// before (example)
a=[]
cond1()&&a.push(1)
cond2()&&a.push(2)
cond3()&&a.push(3)
cond4()&&a.push(4)
// after
a=[]
P=a.push
cond1()&&P(1)
cond2()&&P(2)
cond3()&&P(3)
cond4()&&P(4)

If possible, find a maths way of identifying interesting points, instead of comparisons.

// before
if((x==4&&y==4&&z==3)||(x==4&&y==3&&z==4)||(x==3&&y==4&&z==4))dosomething()
// after
if(x*y*z==48)dosomething()

I think this game is really interesting, and it will sharpen my own skills as a programmer, as it taxes the mind not only to find the solution to a problem, but also to express that solution as concisely as possible.

In the end, I was able to solve the problem in 668 characters – that’s 142 characters less than my compressor was able to manage.

musical intervals trainer, web version

last weekend, I wrote an intervals trainer app for practicing recognising intervals.

I want other people to use it, but haven’t got a Google development account yet so can’t upload an app.

So, today, I improved the app and made a web-accessible version.

try it out!

it’s designed to move up from very simple intervals (major/minor 2nd intervals, with only natural notes) to more difficult intervals (diminished/augmented, with double sharps and flats), but it’s also designed to only get more difficult at a rate that /you/ can manage.

to do this, the app uses a “levels” system, where each level has one more extra type of interval or note type, and you are tested on them. over 50% of the time, the question will be from the level you’re on, and the rest of the time, the question will be randomly chosen from every other level that you have already passed.

get 10 in a row correct, and you go to the next level.

but, get 5 wrong in a row, and you go down a level.

at the moment, there are 24 levels – all the way up to augmented 8ths – can you get through all the levels?

give it a try!

music theory trainer app

i had an itch to scratch over the weekend, so wrote up a simple app for working on music intervals.

If you have an Android phone, feel free to download this file and give it a try:

MusicTheoryPocketTrainer.apk

Note that this app is not in the market. You need to install it manually. Here are some instructions on how to do that.

Adding a trigger-based plugin to WebME

One of my clients has his own fork of WebME that he keeps current with the SVN version.

He mentioned a collision recently, where a hack he had written into the online store plugin was overwritten by updates.

So, in this post, I’ll demonstrate how to add a plugin that uses a trigger to run some code.

First, we define what needs to be done.

The client wants that when an order in an online store has been processed, an email is sent out to that client.

This immediately points out where the trigger point goes. The processing of orders is done in the file ww.plugins/online-store/verify/process-order.php, so we need to put the trigger in there as well, at the end of the OnlineStore_processOrder() function:

  Core_trigger('after-order-processed', array($order));

What happens at that point is that the CMS will check all plugins to see if there are any that have a trigger of the name “after-order-processed”, and if there are, then that trigger will be fired.

So, next we need to create the plugin. In fact, it’s so easy I’ll just write it straight out. I’m calling this one “DemoPlugin”, so we start by creating the directory /ww.plugins/demo-plugin”, and placing the file plugin.php in it:

<?php
$plugin=array(
  'name' => 'DemoPlugin',
  'triggers'      => array(
    'after-order-processed'=>'DemoPlugin_afterOrderProcessed',
  ),
  'description' => 'Sends an email after an order is processed',
);

function DemoPlugin_afterOrderProcessed($PAGEDATA, $order) {
  mail('kae.verens@gmail.com', 'subject line', print_r($order, true));
}

Simple!

Now, in order to do this, I edited one file which is part of the “official” WebME package, to add the trigger. If you find you need to do this, please contact me and tell me what you’re trying to do, and what you edited, so I can add it to the SVN version and not break your code in future releases.

FB and G+, the new OS-wars

Back when Linux was a gangly youth, there was a great excitement every time you did an update. Unlike Windows and Mac with their expensive three-year-nothing-then-a-service-pack-with-cool-stuff routines, in Linux, there were so many cool free packages around, and /every one/ of them would have something new almost every week.

So, I spent quite a lot of time compiling and recompiling, everything from wget up to the KDE behemoth. And I’d be reading the weekly release notes as well to see if there was any new trick out that week.

I can’t tell you how excited I was when I first installed a copy of Linux where I didn’t have to configure X11 using a text-mode Xconfigureateur!

Or when I recompiled my kernel the first time, or when I recovered from a bad update straight from the GRUB command-line. Or the first time I ejected a CD from across the room (logged in remotely), or freaking out the wife by playing some music on her laptop from a different room.

In the last few years, Linux development has matured, though, so there’s not the same edge-of-the-seat excitement that there used to be, but I think there’s still hope for the techadrenaline junkies out there, because Facebook and Google+ are the new cool, and there’s a /ton/ of stuff that can be done with that!

My eyes are on how FB and G+ evolve. now that FB has competition, I expect some /really/ cool stuff is going to come out of the woodwork.

first and last saturday of a month

I’m working on an expenses application. In order to do it, I need to display the entire month, with full weeks in each (from Saturday to Friday).

To do this, I need to know what date the Saturday in the first week falls, and the date of the first Saturday in the following month.

Here’s the code (assuming year is a 4-digit year, and month is a 1-12 number):

      // { start date
      var start=new Date(year, month-1, 1);
      var day=start.getDay();
      day=(day+1)%7; 

      start=new Date(start-3600000*24*day);

      // }
      // { end date
      month++;
      if (month==13) {
        month=1;
        year++;
      }
      var end=new Date(year, month-1, 1);
      var day=end.getDay();
      day=7-((day+1)%7);

      end=new Date((+end)+3600000*24*day);

      // }

can’t be bothered explaining it – just trust that it’s right ;-)

separating buttons in jquery-ui dialog

By default, the jQuery-UI dialog will place buttons on the right side of the popup:

This causes a problem because if you have “OK” right next to “Delete”, and you click the wrong one, well …

The obvious solution is to move the “Delete” to the opposite side.

To do that, add the following two lines after creating the dialog:

$('.ui-dialog-buttonset').css('float','none');
$('.ui-dialog-buttonset>button:last-child').css('float','right');

Now the buttons are on opposite sides: