Posts

Showing posts from May, 2009

Grandma errors.

After having checked for splling errors, it can be good to check for grandma errors.

'In linguistics, grammar refers to the logical and structural rules that govern the composition of sentences, phrases, and words in any given natural language.' - wikipedia (writer Hannes Hirzel is listed as the oldest writer for the Grammar entry on wikipedia... an entry with many many many hundreds of revisions).

So why "grandma errors" and not grammar problems?

Firstly grandma is a word spelt correctly... however used in that context is incorrect. It is a grammar problem itself.

It also sounds like grammar. So it's a self describing word illustrating itself with a meaning completely different to what it is supposed to be used for.

I use "grandma errors", rather than "grandma problems"... because "grandma problems" is used more often when people discuss problems with their grandmas. If someone says they have grandma errors.... and are talking about t…

Pythons float makes me want to smoke crack.

Ran into another annoying bug with pythons 'float' numbers today, and it reminded me of an old post about how Decimals should be default in python3.

Witness pythons supreme silliness printing out time.time()...

$ python3 -c "import time;print(time.time())"
1242730404.02

$ python2.5 -c "import time;print(time.time())"
1242730412.33

$ python2.6 -c "import time;print(time.time())"
1242730416.87

$ python2.6 -c "import time;print(repr(time.time()))"
1242730432.5543971

$ python2.6 -c "import time;import decimal;print(decimal.Decimal(str(time.time())))"
1242730432.55



Notice how it truncates the float to only two decimal places?! So silly, and likely the cause of many subtle bugs in programs throughout the land. If you repr it, there are less places cut off (12 for print vs 17 for repr).

The last example shows the real bad part... say you want to use a decimal... python strangely wants your argument to decimal be a str, not a float. Then your fl…

Some ubuntu love... ♥

Really enjoying Jaunty!

There was only one slightly annoying issue with the graphics being slower (now fixed for me). I have since learnt that there's some very good speedups coming in the next linux kernel too - since a lot of the intel video driver has moved there now. This means it will reuse a bunch of the highly optimised memory management code and also be maintained as the kernel is maintained... meaning less problems. It also means that the driver can be optimised by very good kernel hackers, and the X and framebuffer drivers can use the same code.

My wacom tablet is now autodetected... and works with touch sensitivity without it being plugged in at the beginning. Means I don't have to remember to plug it in before I start X... and no configuration needed either.

The trackpad is working much nicer, and does not misbehave :)

There is a standard kernel, a low latency kernel... and a realtime kernel all apt-get able! The realtime kernel is really nice for sound/music/vide…

bundling testing with your program... Ubuntu does too with Jaunty.

Ubuntu, with the latest release Jaunty, has a new application called "System Testing" which allows users to run system test.

The program is called checkbox, and you can run it by selecting it from the menu:
System -->Administration-->System TestingNow it's not a bunch of unittests... but instead it is a bunch of interactive tests. It's written in python too.

It asks you some questions, and you need to perform the tests manually, and tell it if things worked correctly.

At the end you can send the test results and the details gathered to the Ubuntu hardware database if you choose.

As mentioned in 'pygame.test - moving testing forward', 'pygame.tests and pygame.examples as packages' and 'Distributed testing - the easy way.' installing tests with your program lets way more people test your shit.

So why not join numpy, cherrypy, pygame, ubuntu and others in installing tests with your program or package?
>>> import yourpackage.test…

python3, and symbian(nokia phone) branches merged into pygame trunk

Over the last week two branches merged into the pygame trunk.

Lenard Lindstrom got his python3/python3.1 branch merged in.

Jussi Toivola had his symbian_s60 branch merged in to trunk.


Both ports do not have complete functionality yet... but both have most major modules working.

The python3 code has also been tested with the python3.1 beta release (there are small C API differences between both). Some of the work was based on stuff done by Marcus for his super-cool pgreloaded branch of pygame (which he is going to start doing some pre-releases of soon).

Pre-release builds for both pygame-python3.0, and pygame-symbian_s60 are available... search the mailing list for details. Both also build from subversion trunk.

Lenard got the python3 stuff ready quickly for a course a teacher is doing teaching python3 - part of the course uses pygame. So the pygame should work for his class.


We are hoping to release pygame1.9 in 3-4 weeks. Which means that there's about 1 week to get any last minute …

SHA-1 - fail.

As some people have been saying for a while now, SHA-1 has reached it's end of life.

Summary of the paper: SHA-1 collisions now 2^52 (pdf) by Cameron McDonald, Philip Hawkes and Josef Pieprzyk, Macquarie University and Qualcomm, Australia.

More details about how Debian and openpgp are moving away from SHA-1.

So if you're still using SHA-1 (or md5!) time to move onto the next one... SHA-2.

pygame 2001-2009(8 years), 1100+ projects at super speed.

Image
I have put together a video representing some of the pygame work out there.

Enjoy!
http://www.youtube.com/watch?v=Qu2Tuo3HPbo