When will the age of reason begin?

January 6th 2008

As anyone who knows me even moderately well will know, I am an atheist. No, not an atheist. You should not describe yourself in terms of what you don’t believe. I do not believe in Father Christmas so I suppose you could call me an asantaist. I am probably a Secular Humanist or Naturalist and may start calling myself a Bright. Pretentious as it sounds (I am not saying I am bright), it is an attempt to turn the word into a noun to describe someone who worldview is entirely naturalistic. From their manifesto:

  • A bright is a person who has a naturalistic worldview
  • A bright’s worldview is free of supernatural and mystical elements
  • The ethics and actions of a bright are based on a naturalistic worldview

Probably some redundancy there, item one would suffice in my view, but definitely hits the mark for me.

I am writing this now because I am extremly annoyed after seeing a psychic on Screenwipe that claims to read babys minds. In this appaling scene, after stumbling around and being off with a few of his guesses he stumbles on a history of abuse and tastlessly probes it, even swearing in front of the child claiming to be speaking for her. It would be funny if the woman was not so clearly upset.

Badpsychics is a site devoted to debunking all of this shit. James Randi has been at it for years, offering a million dollar prize to anyone who can demonstrate any powers under scientific conditions. Richard Dawkins did a great documentary on Channel 4 called Enemies of Reason about all the ridiculous stuff people believe and how dangerous it can be.

I was glad to see the government have responded to a petition started by Badpsychics to amend the Fraudulent Mediums Act 1951,

“The Fraudulent Mediums Act 1951 has rarely been used in the prosecution of mediums and psychics, who claim to contact the dead relatives of people. Yet there are increasingly more TV shows and live acts where people claiming to be mediums and psychics prey on vulnerable people who have lost loved ones, giving them spurious information and taking their money. We call upon the Government to revise the Fraudulent Mediums Act and make it easier to prosecute these people.”

The Fraudulent Mediums Act 1951 will be repealed from April 2008 by the Consumer Protection from Unfair Trading Regulations 2007 (CPRs) which implement the Unfair Commercial Practices Directive (UCPD).

The CPRs include rules prohibiting conduct which misleads the average consumer and thereby causes, or is likely to cause him to take a transactional decision he would not have taken otherwise.

Although the average consumer would arguably not be misled by a person who claims he is able to contact the dead, such conduct would still be unfair under the CPRs if it deceives the average member of (i) the group to which it is directed, or (ii) a clearly identifiable group of consumers who are particularly vulnerable to this type of practice.

Unlike the Act, there is no requirement in the CPRs to prove an “intent to deceive”. This means that where practices are aimed at vulnerable consumers or average members of particular groups, it should be easier to take action against fraudulent mediums than under the Act.

The CPRs will be enforced by both civil (injunctive) action and criminal sanctions.

I really hope someone uses the law straight away but would rather there was an All Mediums Are Frauds Act.

More worrying is the counter petition that has 1500 signatures, more than 3 times as many. Thank god the government pays no attention to these things.

Posted by tom under bright | No Comments »

Python talk for WYLUG, Ruby envy, Haskell Joy.

December 27th 2007

I am just getting a talk ready for WYLUG on python.

I sent Dave the following blurb:

Why I love Python:

A talk on the programming language Python, in 3 parts (feel free to
leave in the interludes if you have had enough)

Part 1: Past, Present, Future.
A bit of history and the design of the language, a look at all the
implementations available today, quick tour of built-in and commonly
used modules and future plans.

Part 2: Language overview
A quick tour of the language: builtin types, control structures, using
modules etc

Part 3: Recent Magic.
Some relatively recent changes that make programming Python even more
pleasurable.
Decorators, Generators, List comprehensions, Iterators, Functools and
anything else I can fit in.
Again a whirlwind tour, but you should be impressed and want to read
up on these some more

I have been revisiting some of the Python talks I have watched over the last few years for ideas and will update my ComSci page with links.

I stumbled across some excellent video from RubyConf, particularly the Rubinius one. Rubinius is a ruby VM partially written in Ruby, taking some lessons from Python and Smalltalk. Some of the stuff he bigs up (compiling to bytecode automatically comes to mind) Python has had for ages, but the self hosting aspect is cool (not as cool as PyPy though). Rubinius seems to be doing what Avi Bryant suggested here, learn from the Smalltalk guys and the papers from the Self team that Sun spun off and later bought back to do the hotspot VM for Java. Interesting times for dynamic languages, target the JVM, CLR, self host and generate code in other languages while always writing in the same fun language. I say Ruby envy only because I think the Ruby community does a better job of looking cool and exciting people than the Python one.

Now Haskell joy. After describing working through Yet Another Haskell Tutorial to the 2 friends doing it with me as “not an obviously pleasurable experience” I had a great moment on the train the other day looking at partial application.
(\y -> y*3)
is Haskell for the anonymous function that takes y and multiplies it by 3 (I wish I had LaTeX here to draw the lamda calculus). What I like is that you can also write that as
(*3)
While this example is trivial, what is happening is interesting. The compiler knows * is an infix operator that takes 2 arguments and that is has been supplied one and “partially applies” the function, making (*3) (a function that takes one argument). One more thing is changing prefix and infix operators around using ( _ ) and ` _ ` , for example:
3 * 5
(*) 3 5

map (*2) [1,2,3]
(*2) `map` [1,2,3]

I hope this second example is clear, map usually is a prefix function that takes a function and a list and returns a list with the result of applying the function to each element (the return value here would be [2,4,6]). This flexibility is neat and is starting to make Haskell a joy to hack in.

Merry Christmas,

Posted by tom under Ruby & Python & haskell | No Comments »

Microfinance and Peer Lending

December 15th 2007

No blog post for a week, perhaps I am not as self important or tenacious as I think I am.

I have been meaning to read Muhammad Younus’s book “Banker to the Poor” for a while, I had not heard of him till he won the Nobel Peace Prize. He helped found the Grameen Bank, a bank that lends small amounts of money to poor people in Bangladesh who have no collateral (called Microfinance for obvious reasons), and later the Grameen Foundation. Access to collateral is obviously really significant in your success; I know a great way to have a guaranteed income of 80k a year (less tax), put a million quid in a savings account at 8%.

Peer Lending is another topic that is becoming popular, particularly as we experience the so called credit crunch. Zopa in the Uk and Prosper.com in the US are interesting ways for lending and borrowing money. This is often described as “cutting out the middle man” but obviously this is just being a middleman that skims rather than grabs. Sometimes you directly loan money to an individual, sometimes the risk is spread for you. This risk spreading reminds me of Collateralized Debt Obligations; the source of much of the cheap credit now available and an accelerant of the recent crunch, also claimed to be a big factor in the supposed Great Moderation we are experiencing (along with supply chain innovations like Just In Time Inventorying). The web is obviously an enabler for this sort of idea and I think the market forces mean users are getting a better deal than they otherwise would. This happened in gambling with BetFair and SpreadFair (which is owned by Cantor Fitzgerald and run out of Canary Wharf, a very good friend of mine works there).

Markets are good (at least sometimes).

A more traditional way for people to access capital and services are non profit organisations like credit unions and friendly societies. I recently joined the Leeds City Credit Union and am pleased to say I got a loan off them at 9% APR to consolidate the credit card debt I still have from my time at university, debt free in 5 years (I am going to overpay and try and clear it in 3). You can access cheaper credit if your credit history is pristine, but my time in India at the beginning of the year after quitting teaching made mine a little tarnished and I do not begrudge them the small difference as all profits are given to members as dividends. They provide a much needed service to less well off people banks could not care less about and help them avoid horrendous door-to-door lenders like Provident. “The Provvy” absolutly disgust me; I got a letter through the door with a picture of a christmas tree and an offer of £500 for only £15 per week. This is for 56 weeks though, so you pay them £840, which is an APR of 183.2% which they are not shy (due obviously to regulation) about telling you on their site. My first instinct was to feel sympathy for people for whom this is the only option, but clearly it never is; go to the credit union or start saving in June for Christmas. I am back onto my standard rant about whether people are undereducated or wilfully careless about their own wellbeing in the long-term in favour of instantaneous gratification, which I hope should stop in adulthood. One shit year while you paid off your loan and one shit year while you saved would allow you to spend twice as much each year, to me that is a no-brainer.

Quite link heavy today, may save you some googling.

Posted by tom under Economics | 2 Comments »

Second Python User Group meeting

December 7th 2007

I gave a talk at the second python user group in leeds on Wednesday. It was called “Anatomy Of A Python Program - How Much Can You Do In 0.1 KLOC?”. It is based on Peter Norvigs Sudoku solver. I had been thinking about doing it for WYLUG, possibly as a second talk after an intro to python. The slides were the same, but instead of looking at cool features of python that make the code so concise we critiqued it a bit and spoke about the style and possible speedups. The slides for the talk is here, but as I did not add any notes, you would be better off just reading Norvigs article (though the Javascript slideshow is cool, press t to toggle views)

The slideshow was made using rst2s5 and I am amazed how well it works. Restructuredtext is from Pythons Docutils and is a simple markup language designed to be readable as plain text, see here for details. Below is part of the code for my presentation

Continue Reading »

Posted by tom under Python | No Comments »

Get Nexenta Now

December 4th 2007

I have blogged about Nexenta before, Solaris kernel with Ubuntu userland. It is great if you are familiar with Debian/Ubuntu and want to play with the features in the solaris kernel (DTrace and ZFS got me excited). I was complaining that the www.gnusolaris.org site was quiet and then saw www.nexenta.com , their commercial offering (looks neat, but I prefer free). Turns out there is some work going on for a full release of Nexenta (GnuSolaris is a cool name but both are registered trademarks apparently, and it should probably be called Gnu/SunOS anyhow), see the Launchpad page.

If you want to experiment, this is your best bet (the homepage only has alpha7 from ages ago on there). I think this is exciting stuff and so does the new Debian project leader .

Come on Nexenta, go 1.0.

Posted by tom under Nexenta & OpenSolaris | No Comments »

GNU PDF

December 3rd 2007

In the great tradition of minimising the barrior to only using free software the FSF have announced GNU PDF. This is a fully feartured PDF library for apps to view or create PDFs so you should see an Acrobat killer in your favourite distro sometime.

We use Acrobat in work and don’t get anything like our moneys worth, we basically use it to annotate PDFs that come back from translators and print to PDF. I have used PDFCreator for one of those tasks, but the other is more of a hurdle.

PDF is a pretty good open standard. I would be very glad to see a GPL3 library that fully implements all its features.

Posted by tom under linux | No Comments »

RubyQuiz 148 - Postfix to Infix

December 1st 2007

I have been meaning for some time to tackle the RubyQuiz problems in Python.

The one from yesterday (#148) is quite interesting, taking postfix notated expressions and returning an infix version.

For example
2 3 5 + * -> 2 * (3 + 5)

I spoilt it a bit by reading Reverse Polish Notation on Wikipedia, which gave away how to evaluate the postfix expressions.

Here is my python code to evaluate postfix expressions
Continue Reading »

Posted by tom under RubyQuiz & Python | No Comments »

Oxfam Unwrapped

November 29th 2007

Oxfam Unwrapped, it sounds like a site exposing the real harm done by Oxfam or something. It is actually a great idea, giving people a little card to show you donated an amount of money to Oxfam rather than spend a few quid on something they may not even like. Also there is nothing like a bit of conspicuous giving to alleviate guilt. It hits the emotions too, I bought part of a school in Africa apparently (I suppose because “£5 could buy part of a school” does not sound as good). I wonder if anyone really thinks that the money they spend does end up where it says on the card, half of oxfams money would go in the infrastructure to support the tracking and allocation of it all.

I went 50/50 for my £10 secret santa gift, getting some Fair Trade chocolate to wrap up alongside the card.

Posted by tom under random | 1 Comment »

Faith, Evolution, and Programming Languages

November 28th 2007

I just watched Faith, Evolution, and Programming Languages, a Google EngEDU video. It was by Philip Wadler, a chap who I had never heard of but who has done loads of cool things. He designed Haskell’s Type Classes and Java’s Generics, and is currently working on a bridge between strongly typed and dynamically typed languages. The talk starts off with a brief, fascinating explanation of links (more properly isomorphisms) between logics and programming languages and makes the point that aliens may not create Java but certainly will create (discover?, I suppose it depends if you are a Platonist) the lambda calculus (calculi ?).

For about 20 mins towards the end I lost the plot and could not really follow his argument, but I will revisit it when I know a bit more. I am glad I hung on as the 10 minutes of discussion at the end were quite interesting and Links (the recent work he did not have time to show the slides for, a web framework with every tier written in the same language) seemed very interesting.

For more on the language/logic link, see here

Posted by tom under Java & ComSci & haskell | No Comments »

Why I am learning Haskell

November 27th 2007

I saw Simon Peyton-Jones talk on Software Transactional Memory at OSCON and was amazed at how neat it sounded. Taking some ideas from databases to remove some of the pain of multithreaded programming is a great idea. His point that a thread-safe Dequeue is a post-doc publishable result convinced me that something is wrong with the threading models in widespread use, while STM reduces it to an undergrad problem. The maping from the complexity of the problem domain to your code should be sane, if implementing a a simple structure like a dequeue using threads makes the code lots longer and requires a large amount of effort by someone with a doctorate, something is wrong. I love python, but multithreaded programs suffer (at least in the C implementation) because of the global interpretor lock (GIL). So I decided to learn Haskell.

There are (as far as I know) two ways of doing concurrency; shared state and message passing. STM is a neat syntax and smart compiler technology that ultimately uses shared state. See a Java or C# implementation here.

Erlang is becoming increasingly popular and big successes with high availability at Ericsson are compelling real world examples of its use. It uses message passing concurrency and is a nice (mostly) functional language. I am happy with the choice of Haskell though, the syntax seems neat (because of my maths background) and the functional purity enforces functional thinking more than (say) Common Lisp or OCaml. There was a great post today on Planet Haskell on concurrency options in Haskell and I am keen to explore them.

Maybe I will not hack in Haskell full time, but I think some of the ideas will go mainstream (already appearing in Linq and C# from Microsoft, who have bought in a lot of talented folk from the FP world ), but maybe I will.

It fits my mind well so far.

Posted by tom under ComSci & FP & haskell | No Comments »

« Prev - Next »