Archive for May, 2007

Spam spam spam

Thursday, May 10th, 2007

I hate it so much. I’ve had willmcgugan.com for many years, and in the early days I was complacent about posting my email address in newsgroups / BBs etc. Consequently I get an impressive amount of spam. I use SpamBayes, which worked great in the beginning, but now training it seems almost as much effort as deleting the spam manually.

Since I can’t nuke the spammers from orbit, I’ve restricted my email address to . Unfortunately this means that you will no longer be able to email me at studmuffin@willmcgugan.com or youreallyrockmyworldiwanttohaveyourbabies@willmcgugan.com (sorry). I have also enabled SPF on my domain. I’m not exactly clear on what that is, but easydns.com claim it will cut down on spam, so I am giving it a go.

If you are reading this within 24 hours of the post, please send me a brief test email. If you don’t get a brief test reply by tomorrow, then please post a comment to let me know.

And if you have any other tips for reducing spam - let me know!

3D Lissajous in PyGame

Monday, May 7th, 2007

Okay, I would be the first to admit that I am getting carried away with these little PyGame experiments. This one renders 3D lissajous figures, which are kind of like a 3D spirograph drawings. It’s the first time I have use Game Objects in anything other than a test, and is a good example of simple Vector and Matrix math. Enjoy!

Download Spiro

lissajous3d

PyGame Runtime?

Sunday, May 6th, 2007

Pygame is a wonderful API for creating games and rich media applications, but the diffulty in distributing PyGame creations may be holding it back from the big time. When you write a game / application / demo, the first thing you want to do is have your friends and family play it, then you want to launch it on the internet, and perhaps even profit from it. To distribute a PyGame app you currently have two choices. You could ask people to install Python and Pygame, plus any other modules you may have used. Which is fine for other Python programmers, but your grandmother may find it tricky - “Are you sure I should click on the snake, dear - what if it has a virus?”. The other option is to build a package with Py2exe or similar tool, which works great but requires a little effort to get working and will generate a large bundle of files - and then you are left with the tedious task of making an installer.

I think this lack of easy distribution is preventing many amazing PyGame creations from getting ‘out there’. What I would love to have is the ability to zip up a bundle of .py files and assets, rename the zip to .pyg then have a PyGame runtime launch the game. This runtime would be available on the net somewhere and have install packages for all the major platforms. So .pyg packages would be “write once, play anywhere” games.

No-doubt there be a number of challenges in implementing something like this, but I’m sure it is doable. The runtime may have to support multiple versions of Python; at least 2.4 and 2.5. It would also have to contain a number of modules that are popular in games, and know how to get modules that aren’t installed - possibly with import hooks and cheeseshop.

I know what you are thinking; if it is such a good idea then why don’t you do it yourself? I may eventualy try it, but I’m still working on other good ideas at the moment. I guess I was hoping that some inspired individual would pick it up and go with it. Looking at Movable Python may be a good starting point.

Ultimately there may even be profit to be made from such a thing. Make the runtime a free download, but sprinkle the site with a few google ads, and perhaps even charge for some of the more professional games. Casual games are big right now, and PyGame programmers would have a big advantage over the poor schlobs working on C++!

I am the next stage in human evolution

Friday, May 4th, 2007

I’ve been thinking about genetics recently. I have red hair and fair skin (if I were any more pale I would be transparent). As well as giving me a fiery temper, the red hair gene reduces production of the skin pigment melanin, which provides protection from the sun. Consequently I burn easily, and the closest I ever come to a tan is when freckles join up. This may make you wonder why such a trait would ever exist in the population.

It turns out that the red hair gene is advantageous because red heads can produce more vitamin D from sunlight. Which is why red hair is common in north western Europe. If the gene had occurred in Africa, then it is unlikely to be passed on since carriers of the gene would have succumbed to skin cancer before adulthood. I find this interesting because it is a recent addition to the human genome. For the creationists in the audience, it is a gene in human beings that has come about through natural selection (go Darwin, it’s your birthday)! I suspect that if human beings didn’t move about so much my descendants would evolve in to the lesser-spotted red human, common in northern areas.

My girlfriend has a very different complexion to me. She is Brazilian, with ancestors from Italy and Portugal. Her skin is darker than mine and tans very easily. She also has other adaptions to a sunny climate; her skin always seems hotter than mine, as if her body favours getting rid of heat rather than conserving it. And she will shiver and get goose-bumps at temperatures that I find comfortable. I can see us fighting over the thermostat!

The red-hair gene is recessive, so a child must get it from both parents to have red-hair. Which means that if Maria and I have children (patience sweetheart), they are unlikely to have red hair since she probably doesn’t have the gene (our kids will probably look like this). I’m actually quite relieved that my kids will look more like her. Hopefully they also won’t also inherit my unmanageable hair and allergy to house dust mites.

This makes me wonder if evolution in human beings has effectively been halted? We are no longer constrained by geography in the way the rest of the animal world is, and most people will get the opportunity to pass on their genes. Will human beings evolve in any significant way in the distant future? I suspect not. There are plenty of species that seem to have stopped evolving, because they occupy an evolutionary niche. Disappointing really, I wouldn’t mind a philips screw-driver for a pinky finger.

Infinite sprites with PyGame

Wednesday, May 2nd, 2007

The one thing that has always bugged me about sprites in PyGame is that they are so damn finite. Why should I be restricted to an upper bounded number of sprites in my game? Fortunately, I figured out a way of breaking the finite sprite limit, and render an infinite number of sprites to the screen - without any reduction in the frame rate!

Now before you try to convince me this is impossible with such arguments that as “an infinite number of sprites requires an infinite amount of memory”, bare in mind that I consider the laws of mathematics to be more rules than actual laws. And rules were meant to be broken, as they say. Not convinced? Download and run this demo, and tell me when you run out of memory. Requires Python and PyGame.

Download Infinite Sprites

infinitesprites

Snakes. Why did it have to be snakes?

Wednesday, May 2nd, 2007

DSC02507I recently bought a book on Python. Which is not something unusual since I have a steadly growing collection of Python books. But before I could pay for it, Amazon kindly suggested some other items I might like. One of which was a ‘Giant Soft Touch Python’. At this point my inner-child realised the outer-man had a credit card, and instructed me to click on the Python toy - then suppress all knowledge of it. That is until it arrived this morning. I am now the proud owner of a giant soft touch Python.

If anyone wants the aforementioned rubber serpent, then let me know. I want to get rid of it before it starts leaving little rubber droppings behind the television. I’ll even post it to you for free (UK only). On the condition that you have kids and you’re not just a geek with an inner-child.

Now if you will excuse me, I have to get back to day-job, which is something that we adults have to do.


Close
E-mail It
Socialized through Gregarious 42