Hate filled men of love?!

Filed Under Polemics & Politics on August 30, 2005 | 2 Comments

Something that has confused me for a while now is how so called men of God can be so hate filled.“Thank God for the bombing of London’s subway today, wherein dozens were killed and hundreds seriously injured. Wish it was more”

Are these the words of Osama or of some other Islamic cleric? No, they are the words of a Christian reverend who goes by the name of Fred Phelps and he is an American.

How can people of God come out and say things like this?

Fred Phelps

Those of you who keep an eye on the more public hate mongers in the US should be familiar with Fred Phelps, he is the nice, loving man who pickets gay funerals with “God Hates Fags” signs, even funerals of the victims of hate crimes. He is also well known for his continued harassment of them memory of Matthew Sheppard, a gay teen beaten to death in the US a number of years ago. He picketed his funeral with signs saying “Matthew is in HELL” and tried to get a monument put up where he was killed with the words “Matthew Sheppard Entered Hell Here”.

This man thinks he is a Christian. I personally don’t see how he can be because it would appear that he is not living like Christ did. On the contrary, he is living in a way that Christ would have considered very bad in deed. Christ never excluded anyone, he spent his time with sinners and with people from other religions. He never treated them with intolerance, always tolerance and love. Jesus brought a message of love and told all his followers that they must “love one another as I have loved you”. I think Fred must have slept through that bit of the bible!

However, now that he has publicly supported murder and terrorism Phelps has gone yet further and proved that even the old testament passed him by as “thou shalt not kill” is also beyond his grasp of Christianity!

Mind you I have a feeling the man is a few cards short of a full deck because he blames the London bombings, not on the war in Iraq or Muslim extremism but on Homosexuals and on Britain’s support of civil unions for same sex couples! He said that Tony Blair and “his bitch barrister wife” are to blame because they have “led England to irreversible doom, pushing the fag agenda” and in so doing have turned England into the “island of the sodomite damned”. Did you know Cherie was in the cabinet? I sure didn’t!

Anyhow, the bottom line is that the man is speaking on behalf of Christians in the same sort of extreme and loony way that extremist Islamics do for Islam. We constantly hear in the news that ordinary Muslims must oppose and speak out against the extreme elements in their Religion, well, it would appear to me that Christians need to start heeding their own message and start speaking out against hate mongers like Phelps.

You would assume that Astronomers have manged to make up their minds on what a planet is, especially since we are now discovering them around others stars but you'd be wrong! ATM something is a planet if and only if the IAU (International Astronomical Union) say it is! They are currently working hard on a definition but nothing has been agreed yet. This new interest in an actual definition for a planet is being spurred on by yet more discoveries of large objects out beyond Pluto that the press are immediately dubbing "the 10th planet"(we have had 3 "10th planets" in the past few years!).

So, lets have a look at the facts as I see them. Read more

GIMP on OSX comes with a little program to enable X11 Focus Follows Mouse on OSX. This means that all you have to do to focus an X11 Window is to move your mouse over it. Sounds great so I ran the program, turns out it isn’t so great and is in fact REALLY annoying. Does the GIMP ship with a program to turn X11 Focus Follows Mouse off again? Hell no, that would just be far too considerate of them!

However, fear not, some googling lead me to the answer, to turn it off just run the following from your command prompt:

defaults write com.apple.x11 wm_ffm -bool false

No prizes for guessing how to turn it back on or for how to set it for other apps!

Tagged with:

Yes, you should of course avoid ever shelling out in Java, but from time to time shelling out becomes the lesser of two evils (the greater usually being writing a native class) and when that happens you need to be aware of some extra complexity that is often over looked and can result in some very strange and hard to diagnose run-time errors!Many people think that all you have to do to shell out in Java is to do something like the following:

Runtime.getRuntime().exec("/usr/local/bin/convert x.png y.jpg");

This works fine if, and only if, you never assume in the rest of your program that this call completed. Or to put it another way, if your script tries to use the output of the program you shelled out to just launching it in that way could result in inconsistent behavior at run time.

Many programmers who are used to shelling out in Perl or the like assume that Java works in the same way and that the program shelling out will wait till the process it shelled out to completes before moving on. In Perl that is a correct assumption, in Java it is not! The shelled out process runs in a separate thread and Java just carries on execution regardless of what is happening with it’s baby process!

If you need Java to wait because you need to manipulate some outcome from the process you spawned or if you need to find out whether is succeeded or failed you need to do a little more. The following is a function I wrote to shell out properly in a project I am working on, it should be a good enough example for you to work out what to do!

static void executeCommand(String cmd) throws Exception{
try {
Process p = Runtime.getRuntime().exec(cmd);
if(p.waitFor() != 0) {
throw new Exception("The command " + cmd + " returned with an error)");
}
} catch(Exception e) {
// do what ever error handeling you want
}
}

Tagged with:

As well as containing very useful functions and objects for the creation of GUIs (useful because Swing extends AWT really) Java AWT (Abstract Windowing Toolkit) also provides a bunch of utility methods and object used for non-GUI related image manipulation via the excellent ImageIO classes that were introduced in Java 1.4. This all sounds great but the problems start when you try to use ImageIO in a scenario where the JVM has no access to an X-server or equivalent to do GUI stuff, then ImageIO breaks down because as soon as you access any AWT component java checks for a place to render to and if it finds none it gives a bizarre and really un-informative exception and dies! Now, you might ask why you would need to manipulate images if you have no GUI, well if you think about it that is the kind of thing that web servers have to do all the time, in fact the blogging software I am using to write this post needs to do that kind of thing all the time (but not in Java of course)!

However, do not despair, deep in the bowels of Java there is a solution and since even Google had some trouble pointing me to it I figured I’d share it with the world!

The key is to decapitate AWT, or, to be more formal to force it to run "headless". If you are just running your application from the command line this is not hard to do at all, you just pass Java a command line argument to tell it to run AWT headless like so:

java xxxxxxx -Djava.awt.headless=true

However, the chances are you won’t be running this kind of application from the command line, in all likelihood you will be trying to do this from within a web server like Tomcat and you can’t just add that -D flag to the Tomcat startup script!

However, after some dissecting of the main tomcat startup script (catalina.sh) I found the solution for Tomcat servers, you need to set up an environment variable called JAVA_OPTS that contains the option and export it in what ever script you are using to start Tomcat. I am running Tomcat on OS X so I did this in my StartupItem for Tomcat (/Library/StartupItems/Tomcat/Tomcat) which now looks like this:

#!/bin/sh

. /etc/rc.common
export JAVA_HOME="/Library/Java/Home"
export CATALINA_HOME="/usr/local/tomcat"
export JAVA_OPTS="-Djava.awt.headless=true"

if [ "${TOMCAT}" = "-YES-" ]; then
ConsoleMessage "Starting Tomcat"
su tomcat - /usr/local/tomcat/bin/startup.sh
fi

So, it really is that simple but I have to say it took me a long to to figure all this out this afternoon when for no apparent reason ImageIO was crashing with some error about a window!

Tagged with:

I’ve had my Mac Mini for a few months now and it is still surprising me from time to time. It comes with built in speakers which, for the size of the thing, are very impressive, but of course nothing on proper speakers. I had the volume up full with no speakers plugged in, then while something was playing I plugged in the speakers not realizing that they were on, did I get my eardrums blasted off? No! OS X turned the volume down for me when it detected the speakers being plugged in!

It really is the little things that make a lasting impression …..

Tagged with:

Something that I always thought was a bit wrong with OS X was that there seemed to be no way of un-installing a .pkg file once you installed it. As a result I tended to avoid software that used .pkgs and instead opt for software that used the more standard OS X technique of being entirely encapsulated in a .app file with no installer. Not anymore thanks to OSXGNU.org!

OSXGNU.org have created a nice COCA GUI to allow you to easily install and more importantly un-install .pkg files. It is an absolute must have and comes it self as a .pkg and installs it self in the Applications folder under Utilities.

You can download it here: http://old.osxgnu.org/software/Utils/OSXGNU/

Here is a screenshot from their webpage:

Tagged with:

Many people seem to go to bizare lengths to get colour ls working on OS X and end up doing things like building their own ls from source or getting fink or darwinports to build a new ls for them. This is utterly pointless as the ls that comes with OS X 10.3 and higher has colour support built in!

So, how do you enable it?

For some reason best known to themselves the clever people in Apple decided that the flag for colour on ls should not be –color like it is on just about every other OS on the planet but instead the rather bizarre choice of -G!

So, to enable colour ls all you have to do is add the following to your .bash_profile file:

alias ls="ls -G"

If, like me, you like to have a black background on your terminal you may also want to set the colours so that folders are an easy to see yellow instead of an eye-hurting dark blue. To do this just add the following to your .bash_profile too:

export LSCOLORS=dxfxcxdxbxegedabagacad

Don’t ask me what the letters means, all I know is it works!

Tagged with:

I was recently forced to switch from MySQL to PostgreSQL for a project I am working on and at first I was very reluctant to change because I had been using MySQL for years, was very familiar with it, and knew my way round the developers section of the MySQL website. However, having worked with PSQL I would now never go back to MySQL, it is simply in a lower league than PSQL!

When using a DB the differences are not all that big but when creating and admining DBs there are some differences that will throw you at first so I’ll list the ones I came across and how to get by them.

User Management

MySQL has a bizarre model of user management, the user bart from say localhost is considered a completely separate user to the user bart from any host or the user bart from a particular host. This makes managing users interesting and TBH I have always hated this aspect of MySQL. PSQL takes a simpler view, it uses the system accounts as its accounts. The user bart is the user bart no matter where he is logging in from and his password is his system password. Also, there is no root account as such on PSQL, if you access PSQL as the user who owns PSQL then you have ‘root’ powers, if you don’t you only have the powers that have been given to you by the DBA with GRANT statements.

Control of access to different databases by different users from different places is all controlled from a text file called pg_hba.conf in which you specify how PSQL should authenticate different users trying to access different DBs from different places. You have a number of choices ranging from ‘trust’ which lets any system user access the DB as any user without a password to ‘password’ which requires the user to supply a password and ‘ident’ which only allows the user to log into the DB as the user they are logged into the system as. pg_hba.conf is well commented with lots of examples so it is really easy to manage client authentication on PSQL and makes MySQL look over complicated and under-powered.

AUTO_INCREMENT

There is no AUTO_INCREMENT keyword in PSQL. This scared the crap out of me at first because I thought I had a real problem, but of course I didn’t, PSQL has a special data type for fields that need to auto increment called SERIAL. This creates an implicit sequence which adds a slight complication in that you need to grant users access to BOTH the table AND the sequence if you want them to be able to add rows to the table. The sequence always has a name with the format: <table>_<field>_seq.

ENUM

Again PSQL does not have an ENUM type which, at first, seems like a problem but you can create fields that are effectively enumerations using the CHECK keyword (and you can do MUCH MUCH more with it too!). To set up an enumeration called user_level with the possible values ‘STUDENT’, ‘MENTOR’ and ‘ADMIN’ you would use the following syntax:

user_level VARCHAR(10) DEFAULT ‘STUDENT’ NOT NULL CHECK (user_level IN (‘STUDENT’, ‘MENTOR’, ‘ADMIN’))

Transactions

PSQL has excellent transaction support and it is stable and works with things like JDBC which is more than can be said for MySQL ATM. And, to make it even better, the syntax is immensely simple!

BEGIN;
-- do work
COMMIT;

Shell

The psql shell to access PSQL is very very different to the mysql shell you access MySQL through. Basically you are just gonna have to RTFM it! Also, when you get stuck (and you will) just remember that \h gives you help and \q exits! The thing I missed most were MySQLs simple keywords SHOW and DESCRIBE, PSQL has the same functionality but just with much less memorable commands, e.g. \dt lists all the tables in the current DB.


Overall I find that PostgreSQL is a more powerful and more mature and robust piece of software than MySQL and since it is also open source I can see no reason to choose MySQL over PostgreSQL. Yes, if you have been using MySQL for years you will have a bit of a learning curve but trust me, it is well worth the bit of time and effort to do that learning!

Tagged with:

There is a lot of talk about ‘Creation Science’ and ‘Intelligent Design’ ATM because Kansas is yet again showing it self to be run by nutjobs. This entire debate is ridiculous because science and religion have nothing to do with each other and to try to force science teachers to teach the beliefs of one religion as science is just barmey since Intelligent design is philosophy not science!

Science is about devising a theory, devising an experiment to test that theory and then carrying out that test to see if the theory holds true. Key to this is ‘falsifiability’, if no experiment can be devised to possibly disprove your theory then it is not science!

Let me explain with an simple example first, and then a more complex one. Take Newton’s third law of motion, "for ever action there is an equal and opposite reaction", to test this is elementary, you get into a boat with a cannon, fire the cannon and if you go back with as much acceleration as the cannon ball then Newton’s theory gains support, if not Newton was definitely wrong! To further support the theory you need to carry out more tests, each test that passes adds more weight to the theory but all it takes to kill a theory is one failure. This same concept still holds true at the very cutting edge of science, take the ‘Big Bang’ as an example, if there was a big bang there mush still be residual energy left over from it and that energy should be all pervasive but have cooled as the universe stretched, or to be more scientific, if there was a Big Bang there must be Cosmic Microwave Background Radiation (CMBR) with given properties, if scientists find this then that supports the big bang theory, if they look and it isn’t there then the big bang theory is falsified and we need to come up with a new theory.

That is how science works, we are never 100% sure of anything but each experiment that agrees with the theory adds more weight to it and our confidence in it rises but at all times it just takes one failure to falsify it and send the scientists back to the drawing board!

So, how does ‘Creation Science’ or the entirely equivalent ‘Intelligent Design’ theory fare in the cold light of science? Well it falls at the first hurdle because both theories have at their core the assumption that there is a God. That is an un-testable assumption, hence it is not possible to falsify it and hence it is not science. Simple, creationism is not science, it is a belief, hence all this rubbish about forcing it into the science curriculum is utter rubbish. This kind of tripe has been tried before in the times of the inquisitions, the church were wrong to fight science on the shape of the earth based on a literal interpretation of the bible and the religion right in America today are exactly as wrong to fight Evolution based in a literal interpretation of the bible.

Of course to me the ultimate irony is that science and religion don’t have to clash, if you read the bible bearing in mind that it was written by men thousands of years ago and then re-translated by more men over the millennea you can get the true message it contains out of it without getting hung with excessive literalism. Reading the bible while ignoring it’s history and context is a stupid thing to do and will result in you missing the whole bloody point, it’s not about a literal interpretation of the creation myth but a book about how to live!