Monday, December 29, 2008

Ben's Imaginary Band rocks

I sometimes wander about Jamendo, an excellent web site which collect and promote artists who feel like making their songs or, more commonly, albums available to the public under a Creative Commons License.
A few days ago I was then wandering about Jamendo and stumbled upon this album from Ben's Imaginary Band. I was in the mood of listening to something calm and the tags "pop - indie - acoustic" did intrigue me. Thus I downloaded the album and since then I'm listening to it over and over.

Nocturnal Fables and Illusions is the first album from Ben's Imaginary Band, a young independent and very promising Canadian artist. The album contains a total of 12 songs all acoustically very refined so that they give the album a halo of elegance. Ben sings his ballades with a warm a relaxing voice which almost lulls the listener while bringing him or her to a world of dreamy sensations. Among these ballades are a few of more lively songs -mostly in the second part of the album- which, also in this case, convey a sensation of equilibrium. My favourite songs are:
01- Underwater Waltz
02- Black Sheep
04 - A Reason Why
07 - My Self-centered World
11 - Chloroform For Your Ears
I won't call myself a music savant but I dare say that this Ben's Imaginary Band first album is a masterwork in its way.
Now just a bit of background of the name of the band. The reason of the name is that the band doesn't exist, all is done by Ben. On his web site he tells the story of his music background and what most of all pushed him to write his first song recounting the events of an interesting yet terrifying Halloween.
I strongly invite you to listen to this album on Ben's website and, if you like if, you can even buy a copy of it. You will realise that the price of $15.00cdn (approx. 12,4US$ and 8,8€) is very low compared to the quality of the album.
Ben's says he will use the money to fund living expenses and new equipment while he make more music and, judging from what he already gave us, this is a very promising investment :)
Oh, and do not forget to spread the voice around your friends and family!

Sunday, December 28, 2008

My Fallout 3 review (XBox360)

I'm no IGN or Game Spot guy but I anyway want to give my review of a title that's lately stuck into my X-Box360 tray.

Fallout 3 is a first person action RPG and third installment of the Fallout trilogy. The game's developed by Bethesda which is well known for their Morrowind and Oblivion games. As a matter of fact, as soon as I saw the game in action -well maybe just after the first introductory chapter- I felt Oblivion's influence quite much, a sensation which got only stronger as I got diving into the game. I must say this was a nice sensation and a somewhat relieving one because, as we use to say, you don't change the winning horse -or maybe you just customize and improve it a bit.
I am always scared, when awaiting for the sequel of a famous game to be released, that the new episode would spoil the series or spoil the gameplay and feel by attempting to revolutionise the game engine. But this wasn't the case at all. Bethesda pick up the fruit of their tested and appreciated RPG engine and focused on the graphics appeal and story. Graphics and story are two great pros of this awesome game.

The year is 2277 and the location's Washington DC wasteland. In 2077 United States fought a nuclear war against China resulting in the complete devastation of the American nation (what about China and the World we don't know). After World War 2 Fallout's timeline split from ours and in 2077 the World was in the verge of its development, relying on robotics and nuclear power for even the more trivial tasks as powering cars and trucks. Despite this technical and scientific advancement, society values remained those of the 50' in our timeline. The society structure and values are pictured and described so well to be very present and strong in the game. By roaming the wasteland you can almost taste the ancient flavours even if they're just a mere reflect and survive only through devastated structures, forgotten objects and worn out posters.
The game starts with your birth and the death of your mother (what a good sign uh..). You then play some brief sequence related to your childhood and adolescence sheltered in the safety of Vault 101 with your father. Vaults are huge and very advanced nuclear shelters manufactured by Vault-Tec before the nuclear mayhem and designed to protect just a selected number of humans from the devastation and fallout. You will soon discover that there are a few of Vaults in the DC area. However you will soon be forced to leave the comfort and protection of your home and experience a new strange, dangerous, devastated world.
You begin your adventure -and new life- in an effort to track down your father who escaped the Vault without giving any explanation to anyone including his only and beloved son. The outside world is shattered and you will soon meet the desolated ruins of what once used to be a suburb called Spring Vale. In my play session it was nigh time when I exited Vault 101 and the desolating effect of the destroyed houses, the smashed and rusted furniture and the occasional ancient skeletons, was impressive.

Despite the holocaust humanity hasn't given up and the outside world is full of life. But humans aren't the only one roaming the capital wasteland, radiation turned either human beings or animal into monsters. There are the so called Ghouls which are mangled figures of those that once were humans. They're usually discriminated if not loathed mostly because of their aspect and because some of them are driven crazy by the radiation and get turned in Feral Ghouls which attack anyone who encounters them. Washington DC ruins swarm with Super Mutants, another human derived monster which are much more dangerous than the Feral Ghouls. The Super Mutants, whose origin I won't discuss here, usually haunt downtown DC streets and buildings in packs and can master a wide range of lethal weapons, from hunting rifles to miniguns and rocket launchers. Speaking of mutated animals there are rad-ants, rad-scorpions, Yao Guais (a sorta freaking ferocious bear), Mirelurks (super armored biped crabs), molerats, and abominations like the Centaur (a puke-stimulating Super Mutant pet), and Deathclaws (freaking fast and deadly ferocious).
Humans are present in a variaty of factions. Within the Capital Wasteland humans live in towns made of whatever piece of scraps of pre war metal they can find, like parts of airplanes, like Megaton, or caravans, like Arefu. Beached on the Potomac shore a rusty aircraft carrier hosts Rivet City one of the most important and largest human settlement in the game.
Where downtown DC streets are deprived from human colonization, because they're basically taken by the Super Mutants), they are also home of the Citadel, the stronghold of the local detachment of the Brotherhood of Steel, a national organization going back to the U.S. Army which struggles to somewhat normalize the nation by fighting minions (in this case mostly Super Mutants) with soldiers wearing Power Armors. Always present in your radio is the frequency of the Enclave, a mysterious organization which sports itself as the legitimate successor of the U.S. government. Other organizations present in the game are mercenaries, raiders (evil psychopaths, sociopaths killers), slavers, Brotherhood of Steel Outcasts and regulators (a sorta rangers who kill evil characters).

Fallout 3 sports several game features very well developed. I've already talked about the story; another of these prized aspect is the Karma system. Fallout 3 gives ample free choice to the player. There are countless way to proceed in the game. Karma is a dynamic picture of what is Dungeons & Dragons alignment. Depending on how you choose to behave your character can be good, neutral or evil. There are actions which give you different amount of Karma points. For example, if you choose to set off the A-bomb resting in Megaton, instead of disarming it, you'll get a huge amount of evil Karma points. More of that, by doing so several consequences in the game take place. The town is destroyed and the inhabitants killed, you can't access certain missions, your home will be somewhere else and so on. If you're evil then, raiders won't attack you, slavers will recognize you as a friend, etc... Words travel fast in the Capital Wasteland. Every situation has at least one good and one evil way to be solved, but usually the options are many more.

Another polished feature of Fallout 3 is the V.A.T.S. combat system. Before speaking of that though I must say something about the Pip-Boy 3000, the ultimate gadget Vault-Tec originally gave to those blessed people selected to be sheltered inside the Vaults. Pip-Boy is Fallout 3's green screen H.U.D. and provides the player several tools as the Geiger counter, the inventory, the map and much more. Among this more is the V.A.T.S. (Vault-Tec Assisted Targeting System), the ultimate tactical software for those player who like to take a breath from the action and have a more rational approach to killing. Once V.A.T.S. is enabled the action freezes and the Pip-Boy 3000 shows the image of the target with a part of its body coloured in green. According to the number of Action Points the character has, the player can aim one or more shots to different part of the enemy's body or weapon. Each body part has an energy level which, once drained, causes the body part to become crippled, with evident consequences to the enemy combat behaviour.

Like all the GDRs games, in Fallout 3 the character is governed by main features and abilities which are improved or accumulated by means of Experience Points. S.P.E.C.I.A.L., which stands for Strength, Perception, Endurance, Charisma, Intelligence, Agility, and Luck, are the main characteristics which are mainly chosen at the beginning of the game and can marginally be improved during the game by certain abilities or items. The Skills are the various abilities (i.e. Energy Weapons, Medicine, Lockpick, etc..) that the main character can learn through the game. Each of them is related to a certain S.P.E.C.I.A.L.. Now, Fallout 3 gives the player one more way to improve the character by means of the so-called Perks. These are very special abilities (i.e. Computer Whiz, Cyborg, Gun Nut, etc..) which enable the character to do some special thing (like have access to the slavers or regulators organizations) or do something regular (like shooting or hacking) better.

Speaking of the general appeal, Fallout 3 graphics is definitely very good. The fact is that technically it doesn't show anything like a big leap from what seen with Oblivion. This isn't a cons at all though. It's clear that, having already an engine which was doing its job quite well, Bethesda teams focused on the story and the gameplay. However, apart from pure technique, the style and detail of the graphic representation of the world is impressive. The world is huge and, despite the prevailing desolation, there are many distinct location to go sightseeing. Downtown Washington DC you can come across the remains of the pre war monuments like the Jefferson Memorial, the National Library or the ruins of the Washington monument with the radioactive pool. Walking on the deserted streets of the Capital, looking at the grey and massive buildings, all focused to hear the sign of Super Mutant ambushes, it's a rather disturbing experience.

Something that's seen of one of the best aspect (and one helping the game to be awarded of X-Box 360 game of the year by IGN) of this awesome game is the Audio. From the metallic screeching of the doors to the frequency noises of the radio, the sound is all aimed to increase the sensation of loneliness and fall of the civilization. What has mostly struck me is anyway the music. The soundtrack is outstanding. All the songs are in perfect fifties style and as a matter of fact they're all old songs from historical American singers like Cole Porter, The Ink Spots, Tex Beneke and Roy Brown). Walking on radiation scorched land listening to The Ink Spots singing "I don't want to set the world on fire" is just priceless.

Well, I suppose this is enough for now. I could certainly go on ages writing about this wonderful game and I'm certain you'll just like reading along, but you know.. I must go and play right now :D

If you like GDR games you better don't miss Fallout 3.

Here below you can see the official E3 2008 trailer which shows some of the various aspects of the game

Wednesday, December 17, 2008

Do you like flow charts?

Another amazing XKCD installment.

Image by XKCD

Sunday, December 14, 2008

My PyQt Scribbles (Python and Qt) #3: A calendar in 30 or so lines

I often amuse myself exploring APIs and experiment classes and functions which seem attractive or curious.
I've always thought that experimenting is a much more interesting and effective way to learn something than merely theoretical study.

By messing around with PyQt classes I stumbled upon the QCalendarWidget class and I had a sparkle.

Being a project manager I happen to use calendars quite much for scheduling and I always find those I use rather uncomfortable. MS Outlook calendar is a mess and for some reason (at least that installed on my office pc) it doesn't shows week numbers. The "Date&Time" XP app (the one appearing by double clicking the time displayed in the right corner of the systray) doesn't show the week numbers and the navigation of months and years is rather uncomfortable. The big company calendar pinned on the wall is fine but during the last 2 or 3 months of each year we reach that "dark zone" where there's me that must schedule activities in the first months of the new year and the huge calendar shows only the month of January(NewYear).
So I thought that this PyQt calendar could be a nice season-so experiment for my journey into PyQt.

I coded a bit and realised that the result was far more better than all the calendars surrounding me. No special functionality for the moment but it's small, fast, simple, clean, easy to navigate and shows the week numbers. Yippee!!

I started from the first gui created in the previous installment so I won't comment the parts already seen last time.
here we go:

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class WizAndChipsCal(QMainWindow):
        def __init__(self, parent = None):
            QMainWindow.__init__(self, parent)
            self.setWindowTitle("Wiz and Chips Calendar")
            self.setGeometry(300,300,300,220)
            self.setWindowIcon(QIcon("C:/Python26/PyQt/Icon/date.png"))
            #self.setWindowIcon(QIcon("/home/MY_USR/PyQt/Icon/date.png")) - on Linux
            self.setToolTip("Hello to this Wiz and Chips fancy calendar!")

            self.CloseButton = QPushButton("&Close", self)
            self.CloseButton.setGeometry(26, 190, 50, 25)
            self.CloseButton.setToolTip("" + "Press here to Quit" + "")

            self.title = ("" + "Wiz and Chips Pushable Calendar!" + "")
            self.Label = QLabel(self.title, self)
            self.Label.setGeometry(45, 5, 250, 15)

            self.calendar = QCalendarWidget(self)
            self.calendar.setGridVisible(1)
            self.calendar.setGeometry(26, 30, 250, 150)

            self.connect(self.CloseButton,
                         SIGNAL("pressed()"),
                         self.close)

app = QApplication(sys.argv)
main_window = WizAndChipsCal()
main_window.show()
app.exec_()
# the underscore is used to avoid confusion with pyhton built-in exec()
And now some notes about the new parts:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
This time I decided to import all the classes from the modules I need so to avoid using module prefix every time I need a module object (i.e. avoid -> QtGui.QIcon)
self.CloseButton = QPushButton("&Close", self)
self.CloseButton.setGeometry(26, 190, 50, 25)
self.CloseButton.setToolTip("" + "Press here to Quit" + "")
Here comes a new object: a push button. QPushButton is the class we need to create the button. The arguments are the button label and the parent where the button is placed.The ampersand before the "C" provides ALT+C to activate the button.One more time the setGeometry method sets the relative position(x,y) onto the screen and the size (w,h) of the Button.
We use setToolTip method we used before but we specify it for our button (self.CloseButton).
setToolTip accepts HTML tags so we can fancily specify size, colors and more if we want
self.title = ("" + "Wiz and Chips Pushable Calendar!" + "")
self.Label = QLabel(self.title, self)
self.Label.setGeometry(45, 5, 250, 15)
I want to create a title, within the widget, for our tiny app, so I create a label using the QLabel class.
Since I don't want to put the label raw text directly as the label argument, I create instead a "title" object just to specify the text and then assign it to the label object.
QLabel accepts HTML tags so we can fancily specify size, colors and more if we want.
self.calendar = QCalendarWidget(self)
self.calendar.setGridVisible(1)
self.calendar.setGeometry(26, 30, 250, 150)
Here comes the funny part. PyQt QCalendarWidget() class provides a nice calendar which perfectly suits my purpose. setGridVisible() method creates a grid for the calendar once it's set to 1
self.connect(self.CloseButton,
SIGNAL("pressed()"),
self.close)
Before we created a button but now we need to write some code to make that button actually perform an action.
This is somewhat tricky in PyQt (at least for me at the moment and compared to what I remembered of Tkinter). Anyway, we need to invoke the connect function* and tell it 3 things:
1- the emitter (the button in our case)
2- the signal to connect (SIGNAL("pressed()")
3- the function called to perform the action
* connect inherits from QObject class of QtCore module
Here below how the calendar looks in Kubuntu 8.10 (with KDE 4.1 and Oxygen theme) and MS Windows XP.



There are two things to be noticed about the final product. The first thing is that the calendar is quite functional and the second one is that, despite it's apparent smoothness and functionality, the code is rather primitive and not so elegant. For example we haven't used any layout manager to arrange our widget so we better remedy to this point later on.

Note for Windows users. If you save your calendar file with .pyw extension you will be able to open it smoothly avoiding python console to pop up.

Friday, December 12, 2008

Sam can keep his pony: this time the good prevailed over the evil

Maybe you read my two other posts on the subject.
This is a story I took to the heart and it was just awesome to hear that all ended well.
Yesterday Antonia Spiteri was before the Committee of Adjustments, city of Caledon, Ontario, Canada, standing for the right for his child, affected by spastic quadriplegic cerebral palsy, to keep Emily, his pony friend and part of his therapy, despite the complaint and urge from a neighbour to make the animal removed from the property (which borders a cattle farm) because of.. it smells.
Antonia's wrote me today on my Facebook profile that all went well. There had be virtually no fight during the session and all the Town parties involved into the question expressed their favorable opinion for the family to keep the pony, provided that the clean her (something they obviously already did).
To a National Post journalist, Caledon councillor Annette Groves said "While you have to enforce the rules, there are times when you have to use discretion and have to remember that you're a human being and have to have some compassion, That would be the case in the case."
My guess is that everything went so smoothly (apart from the stress of the past two months and the something like 1KCAN$ Antonia's had to pay to rise the committee meeting) also because of the local society pressure, media coverage and international support, which surely worked as a powerful actuator alongside human natural justice feelings and simple rationale for the Town officials.
Christmas is coming and this year Sam's received one of the most wonderful gifts a child could ever desire: another proof that his mum's a real hero.



And by the way, the complaining neighbour did not show up.. and for the good I suppose :)
Photo of Sam and Antonia Spiteri and their pony Emily by Peter Redman, National Post

Thursday, December 11, 2008

The essence of Python




That's brilliant and a picture of why Python's so cool!
Follow the XKCD webcomic for more comics about romance, sarcasm, math and language.
XKCD updates every Monday, Wednesday and Friday

Delicious painkiller

Last Thursday night I got hospitalized for a terrible pain in the lower part of my back. They got me some pain killers to go and then sent me home in the morning.

Speaking of painkillers, it happened me to buy this locally brewed beer during one Sunday's village Christmas market. It's a 75cl weiβ, only 5,3 alc. and neither pasteurized nor filtered.
It proved a delicious refreshment. I enjoyed its fruity taste very much. I suppose I'll go to the brewery shop to get some more very soon (and I must try the lager as well!)

DHTML Visual Art

By googling around I stumbled upon the web site of geldoot, an artist which creates visual art by using dynamic html animations only.
It's quite surprising what he manages to do and even more interesting the fact that he release the source code of his experiments to the community under a Creative Common License (this).
From the various artworks I found 2 of them especially interesting.
The first one is an animation showing many businesslike men hanging in front of the spectator's eyes and moving around according to the mouse movement. I found them quite disturbing and somewhat recalling me the paint Golconda from René Magritte.



The other artwork is a three column animation of del.icio.us popular tags. The user can actually click any of them and warp to the corresponding del.icio.us bookmark page. Of this one the source code is especially quite interesting to be modified and implemented in one's website.



The gallery of the artworks is huge so I didn't have time to explore/try all the animations contained. If you find something amazing post a comment with the link so that I can have a look as well.

Fallout 3 Editor released

I am currently preparing my review of Fallout 3. The review will be out soon but I have just discovered on the official Fallout 3 web site that Bethesda Softworks released G.E.C.K. also known as Garden of Eden Creation Kit. Beside being a main element of the game, G.E.C.K.'s the ultimate goodie for the Fallout 3 nerd.
Basically we're speaking of an editor which enables PC gamers to to expand the Fallout3 world with customized content created with this editor.
The tool should be somewhat similar to the Elder Scrolls Construction Set editor for those who're familiar with it.
Guys at Bethesda already created a wiki with detailed instructions, tutorials and videos to walk you though the usage of G.E.C.K. To make feel those who're not used to mods safe at home, the basic tutorial series is called "My First Vault".. ;)
You can download G.E.C.K. from here.
Here below the first youtube video tutorial.
[youtube=http://www.youtube.com/watch?v=Y2xskfNS8HE&eurl=http://bethblog.com/index.php/2008/12/11/the-geck-is-here/]
I have an Xbox360 version of the game so I won't be the pleasure to mod the game... :( But for those having the PC version, have fun folks!

Tuesday, December 9, 2008

How to write raw code in WordPress

As a corollary to one of my previous posts, and after extensive googling to avoid one bloody fastidious problem for one trying to blog about code (the WordPress auto-formatting which will trim your indentation and convert code enclosed between html tags in.. well what's turns out to be in reality), I found this guideline by WordPress support which is definitely godsend.

While WordPress.com doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages, like so:
Wrap your code in these tags:
[sourcecode language='css']
your code here
[/sourcecode]

Any of the following can be used for the language parameter (using one is required):
  • cpp
  • csharp
  • css
  • delphi
  • html
  • java
  • jscript
  • php
  • python
  • ruby
  • sql
  • vb
  • xml
Code in between the [sourcecode] tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.
Alex Gorbatchev’s syntaxhighligher Google Code project was used to implement this feature.

Monday, December 8, 2008

Which OS runs on Olivia's laptop (from Fringe 1x09)

I'm not sure enough to say for sure what's running on agent Olivia Dunham's laptop as seen during season 1 episode 09?

I've my own idea but as said I'm not really sure. What's your guess?

Saturday, December 6, 2008

Python 3.0 (a.k.a Pyhon 3000, a.k.a. Py3K) is the new release of the most wonderful (in my biased opinion) language in the coding world.
The fact is that Python 3.0 happens to be incompatible with the 2.x releases. The language of course is the same but there are significant differences that make most of the scripts written say with 2.5 stop running if passed to a python 3.0 interpreter.
On December 4th Guido Van Rossum, the creator of Python, drew up a What's new in Python 3.0 document to be found here.
Since I've no intention to go through every detail of the changelog I'll limit myself to tell just the most relevant change (or those that seems that to me).
- print statement becomes a function (and that's one of the biggest pain in the ass for code written with previous releases).
before we used to write:
>> print "Wiz and Chips rocks!"now we must call the function:
>> print ("Wiz and Chips rocks!")there are however many more and less trivial effects on the print statement (ehm.. function) to impact the new coding style.
- The ordering comparison operators (<, <=, >=, >) raise a TypeError exception when the operands can't be naturally compared one another. Expressions like 1 < "", 0 > None or len <= len are no longer valid. This however doesn't apply to == and != operators.
long int type disappears. There's just one integer type int which essentially behave like the old long.
- An expression like 75/27 now returns a float. To get truncated value just use 75//27.
- The repr() of a long integer doesn't inlude the L character at the end of the representation. So if you have code that cut off that character by default it will now cut the last digit instead.
- Unicode strings and 8-bits string system is suppressed and changed by Python 3.0 with the concepts of text and binary data. The type used to store text is str and the type used to store data is bytes. Any attempts to mix text and data in Python 3.0 will raise a TypeError. This is a useful rationalisation as the previous system was inelegant and prone to generate flocks of bugs. This new concept however will certainly create lots of incompatibilities with codes out there which include both encoded and unencoded text. As str and bytes types can't be mixed they must explicitly converted (str.encode() --> str to bytes - bytes.decode() --> bytes to str). Bytes is immutable but there's a mutable form called bytearray.
as and with are reserved words in Python 3.0 (but they were introduced in 2.6)
- List comprehensions no longer support the syntactic form  for x in item1, item2, ..., we must use instead for x in (item1, item2, ...).
- The from MODULE import * syntax is only allowed at the module level, no longer inside functions.
- There's a new system for the string formating operations that replaces % operator. Thank God % it's still supported in 3.0 but will be deprecated by 3.1 and removed some time later. If you're interested in the new formatting system here's an extensive documentation about it.
raw_input() is replaced by input() which also means that 3.0 input() isn't the same as 2.x input()
These are the main points that caught my superficial attention. I don't plan switching to 3.0 in the immediate future. My bet is that Python 3.0 usage path will be that of a flat curve. My concern in this field is about modules and extensions. Python has simply tons of them which enable you to pursue plainly every kind of activity you have in mind. Despite the release builtin modules I can't conceive an app written in python which doesn't rely on third part modules. Well, let alone the enterprise developed and supported libraries (i.e. reportlab which currently doesn't support 3.0 anyway), the scenario of small and often very useful libraries to be converted to Python 3.0 is not so happy in my mind. It will take time and maybe some crucial library will maybe remain relegated to the 2.x version of the language for God knows how many months / years.
The good news with this respect is that a 2to3 source-to-source translator is provided to be run on your source code. This tool should do most of the works to translate your code to be Python 3.0 compliant. The bugs remaining after a run under 3.0 must be however be fixed manually. For more information regarding this tool please read this page.
A last concern regards performance. They say that Python 3.0 runs the pystone benchmark around 10% slower than Python 2.5.  They say there's room for improvement, however this is not so encouraging given that python's not known to be a fast language.
Python 3.0 is clearly a milestone release which main aim's that of rationalise and clean the language builtins. We will see if this release will improve the already boosting success of this wonderful language.

Thursday, December 4, 2008

Sign petition to save Caledon disabled child mini pony

I already blogged about this story.
Anyway for the lazy ones here's the summary. In Caledon, Canada, there's this 3yo child Sam who was born with cerebral palsy. Sam's a wonderful family and has a Emily, his miniature pony friend he's so attached to. Emily's also part of his therapy know as horse therapy or hippotherapy. Sam's doesn't live in a flat but in one acre (4046.8564224 bloody m2) house that borders a cattle farm. Well, some neighbours complaint that the pony smells and the Town Council or Law Enforcement or whatever found the bureaucratic quibble to evict Sam's companion.
Given that Antonia's about to stand in front of the-1000CAN$-worth Caledon Committee Of Adjustments, she's working to rise a sorta mass effect over the web (as well as local and national) to see if humanity, ethics and common sense have still some value for some people. I mean, I know that there are rules and laws but men, to tear a 3 years old disabled child from his beloved pony is something worth starring with the DC or Marvel SuperEvil of the year!
There's a petition online to ask the Caledon Committee Of Adjustments to accept Antonia's request for letting the pony stay in the property as she's not livestock but pet and therapist for Sam.
You can find the petition here and here below the text.
To: Caledon Committee Of Adjustments
We the undersigned implore the Caledon, Ontario Committee Of Adjustments to find in favor of the Spiteri Family in housing "Emily" (their miniature pony) on their property who has been living on the property within the community of Caledon for the last three years. We urge them to show Empathy and Compassion for the family and understand the reasons for Emily residing on said property is solely for the benefit of Sam who resides at the family home (on said property).
Sam is diagnosed with Spastic Quadriplegic Cerebral Palsy and has been using Emily for therapeutic purpose for the last 3 years. The pony is a help animal for a child with a disability. Just as guide dogs are allowed in public places restricted to other dogs, the Spiteri's pony should be allowed to stay on their property. This is not just the beloved pet of a small child - the pony is required for Sam's therapy for cerebral palsy.
The pony has therapeutic use. It is not "livestock" in the true sense of the word. It is not being reared in an agricultural setting to make food or fiber or perform labour for sustenance or material profit. It is a help animal. It is a friend for Sam and a therapy for his disability. The bylaw should not apply.
Sincerely,
The Spiteri Family
Here's the link to Antonia's Save Sam Spiteri Pony group on Facebook where you can find more information about the situation and upcoming Committee of Adjustments meeting.
Here's some links about the value of hippotherapy
http://www.americanhippotherapyassociation.org/
http://www.narha.org/
http://www.frdi.net/

Wednesday, December 3, 2008

Wordpress writing tool it's sometimes rather uncomfortable to use as, in my opinion, lacks of the flexibility to be swiftly usable for blogging.
Changing font size and type you must be done hacking around html code. I heard this is related to the design of each template which forces the usage of a standard type. Although this is logic, I still wonder if it wouldn't be possible to implement a way to easily select a custom font (even among a limited bunch) directly from the writing interface. Sometimes I just force the font selection via "MS Word or OO Word Processor" paste tool.
More than this font issue a bigger pain in the ass is when trying to post code excerpt within a blog post. When you save or publish your post, Wordpress just format and "normalize" the text. Special format or characters used can create a messy result. This is especially true when you must insert Python indented code as, among other things, the spaces will be trimmed off.
Anyway here's a trick to work this issue out.
Just enable the HTML interface and enclose the code (or any specially formatted text) between
and 
tags and this should do the trick.
Python code without

class HelloWorldWindow(QtGui.QMainWindow):
def __init__(self, parent = None):
QtGui.QMainWindow.__init__(self, parent)
self.setWindowTitle("My First Qt Window")
self.setGeometry(300,300,250,150)
self.setWindowIcon(QtGui.QIcon("C:/Python26/PyQt/Icon/gadu.png"))
self.setToolTip("Hello to this Wiz and Chips example!")
app = QtGui.QApplication(sys.argv)
main_window = HelloWorldWindow()
main_window.show()
app.exec_()
Python code with

class HelloWorldWindow(QtGui.QMainWindow):
        def __init__(self, parent = None):
            QtGui.QMainWindow.__init__(self, parent)
            self.setWindowTitle("My First Qt Window")
            self.setGeometry(300,300,250,150)
            self.setWindowIcon(QtGui.QIcon("C:/Python26/PyQt/Icon/gadu.png"))
            self.setToolTip("Hello to this Wiz and Chips example!")
app = QtGui.QApplication(sys.argv)
main_window = HelloWorldWindow()
main_window.show()
app.exec_()
Of course I look forward Wordpress introducing some sort of code auto formatting. You can see something like the used by DaniWeb forum (check this thread of mine for an example).

Tuesday, December 2, 2008

XKCD: Faust 2.0


Image by XKCD

Monday, December 1, 2008

There's a new STXI trailer out there featuring an old Spock, portrayed by Leonard Nimoy from the old series, at the end.
J. J. Abrams is bloody good at marketing and knows for sure how to rise the hype. I'm sure we must expect some other tricks before the movie is released.
live long and prosper folks!

Sunday, November 30, 2008

My PyQt Scribbles (Python and Qt) #2: a plain window in PyQt

Today we will create a main window, set a window title, an icon and a tooltip related to the window.
First of all let's check that our PyQt is well installed and working. To do this just type: import PyQt4 from IDLE and press enter. If nothing happens we're fine. If it shows an error message like "ImportError: No module named PyQt4", try to check your installation (see My PyQt scribbles #1).
If everything is fine we can start.
I will first present the code as a whole and then proceed through it to analyse the various parts.
import sys
from PyQt4 import QtGui

class HelloWorldWindow(QtGui.QMainWindow):
        def __init__(self, parent = None):
                QtGui.QMainWindow.__init__(self, parent)
                self.setWindowTitle("My First Qt Window")
                self.setGeometry(300,300,250,150)
                self.setWindowIcon(QtGui.QIcon("C:/Python26/PyQt/Icon/gadu.png"))
                self.setToolTip("Hello to this Wiz and Chips example!")

app = QtGui.QApplication(sys.argv)
main_window = HelloWorldWindow()
main_window.show()
app.exec_()
We begin importing the needed modules.
import sys
from PyQt4 import QtGui

Sys is needed to initialise the QApplication class. This class manages the application control flow and the main settings. QApplication contains the main event loop (where all events from the window system and other sources are processed and dispatched), the application initialisation and finalization. For any GUI application based on Qt there must be one QApplication object, no matter how many windows are displayed.
QtGui is the module which contains the GUI classes. As a matter of fact extends the QtCore module with GUI functionality
We now create a main class:
class HelloWorldWindow(QtGui.QMainWindow):
The argument of our window class refers to another class, QMainWindow, which supplies a main application window.


The layout has a center widget area where any kind of widget can be placed. You can add QToolBars, QDockWidgets, a QMenuBar, and a QStatusBar. It's not currently possible to create a main window without a central widget. You must have a central widget even if it is just a placeholder.
Now we create a function to initialise the class
def __init__(self, parent = None):
            QtGui.QMainWindow.__init__(self, parent)
this is to initialise the main window. __init__ is a special function in python which is used to set up the object using the arguments to make variables for the object. __init__ is called upon the object creation.
Now it's time to shape a bit our window.
self.setWindowTitle("My First Qt Window")
The setWindowTitle() method sets the window title
self.setGeometry(300,300,250,150)
The setGeometry method sets the relative position (x,y) on the screen and the size (w,h) of the window
self.setWindowIcon(QtGui.QIcon("C:/Python26/PyQt/Icon/gadu.png"))
This method sets the window icon. For my test I have used a crystal clear project icon (http://www.everaldo.com/crystal/). For windows user be sure to use "/" as folder separator instead of "\". The latter is used for escapes in python.
self.setToolTip("Hello to this Wiz and Chips example!")
With this method we specify a tooltip related to our present object: the main window
app = QtGui.QApplication(sys.argv)
QApplication class manages the GUI control flow and main settings
main_window = HelloWorldWindow()
main_window.show()

The show() method displays the widget on the screen
app.exec_()
This is to enter the main loop
Here below you can see the result: a window with all the accessories we have defined both in Windows XP and Linux Kubuntu 8.10 KDE 4.1 fashion.



Pretty neat result isn't it? And without too much effort also! At this very early point PyQt seems quite cool and easy to me. Let's see what we can pull out of it.
As always.. stay tuned folks!
Disclaimer: I'm not a prefessional python programmer nor I pretend to be. I am just an amateur willing to learn and share its by-no-means-guarantee-as-it know-how with the reader. I nevertheless hope you will enjoy my scribbles and maybe find them somewhat stimulating and helpful.

Thursday, November 27, 2008

Town and neighbours to deprive 3yo disabled boy of his pony

I want to report what I read today following a Boing Boing suggestion by the newsletter I receive on daily basis. This led me reading an article on the National Post, Posted Toronto website which I further delved into on the Caledon Enterprise.
What I read is something that, as father of a 16 months old boy, I am especially sensitive to. It is also something which appeals to some of the most basic civil concepts as well as to a compassion feeling that should be a common base to all human beings. Of course that isn't the case and this is especially true when we see something like this taking place in one of those countries we include within the list of the more advanced and civilized ones. This is also a pilot light about how many injustices are in the world which are just there, awaiting to be eradicated.

The story is simple. Little Sam, 3yo boy living in Caledon Town, Ontario, Canada, is born with spastic quadriplegic cerebral palsy. Sam can't walk or crawl and when he was younger he also suffered from lung problems which can make him prone to possible infection. The boy suffers also from seizures.

To all this suffering Sam has only one thing, apart from his mother and grandparents, that bring joy to his difficult life: his mini pony Emily who's a gift from Sam's grandfather.

Sam rides Emily and he's happy, I imagine him dominating the world from the height of his pony friend. She holds him on his back from which he can feel freedom in a world where he can't move the way a boy of his age would like to do. I can understand deeply in my heart what he feels because I know how much my son, Robert, like to move, run, crawl and twirls like a little Tasman devil.

Now it comes the harsh news. Antonia Spiteri who's the mother of Sam, received a notice from the Town that, due to neighbours complaints and a so called out-of-the-law usage of her own property, Emily must be removed. It seems that Antonia's neighbours find the smell of Emily a severe threat to their life standards and the Town finds unacceptable to maintain a mini pony (called livestock) on a one acre property that borders a cattle farm.

Antonia, who is a single mom living with her parents, is struggling to avoid her son to be separated from Emily. Sam is really attached to the pony and Antonia says that he cries when they take him off the pony, even if he's tired. More of a friend Emily is also part of a therapy for Sam whose core muscles need to be strengthen. Sam's mother has already begun to show her son the possibility that the pony could go away. So Sam gets very upset every time they take him off Emily because he fear he will not see her again.

Antonia's going to discuss this issue to the Caledon committee of adjustment on Dec. 10. This procedure will cost her something about 1000 Canadian Dollars which are something about 650 Euro. It'sis really frustrating and absurd and tragically ridiculous that besides his serious conditions Sam, who's only 3 years old, must also face the cruelty of neighbours and the stupidity of bureaucracy.

I just want to spread the voice about this situation. I only ask you to send an e-mail to Antonia to let Sam and her your support. They need it for sure.
Her e-mail is:




If you also want to send a message of concern to the Caledon city council you will find the e-mail contacts to this page of the town website.

Wednesday, November 26, 2008

My PyQt Scribbles (Python and Qt) #1

this first installment of My PyQt Scribbles I will briefly introduce the Qt (PyQt) framework.
We will work with PyQt4 and Python 2.6. I will try as much as possible to test the code either on Linux (Kubuntu 8.10 currently) or Windows XP.
Let's start with a note on the installation.
For Windows users it's quite trivial (as usual) to download the binary from this page of Riverbank website. If you intend to use same tools I'm using then be sure of downloading the package for Python 2.6 (PyQt-Py2.6-gpl-4.4.4-2.exe). For Linux unfortunately there's no binary available but only the source for you to compile. My advice is to install the packages through Synaptict or Adept. Just look for python-qt4 in the repository.
PyQt, as binding of Nokia (former Trolltech) Qt, is a very complete library whose classes have been split is several extension modules.
The most important ones are the following:



And directly from the PyQt reference guide...
QtGui module: This contains the majority of the GUI classes.
QtCore module: This contains the core non-GUI classes, including the event loop and Qt's signal and slot mechanism. It also includes platform independent abstractions for Unicode, threads, mapped files, shared memory, regular expressions, and user and application settings.
QtNetwork module: This module contains classes for writing UDP and TCP clients and servers. It includes classes that implement FTP and HTTP clients and support DNS lookups.
QtXml module: This module contains classes that implement SAX and DOM interfaces to Qt's XML parser.
QtSvg module: This module contains classes for displaying the contents of SVG files.
QtOpenGL module: This module contains classes that enable the use of OpenGL in rendering 3D graphics in PyQt applications.
QtSql module: This module contains classes that integrate with SQL databases. It includes editable data models for database tables that can be used with GUI classes. It also includes an implementation of SQLite.
phonon module: This module contains classes that implement a cross-platform multimedia framework that enables the use of audio and video content in PyQt applications.
Qt module: This module consolidates the classes contained in all of the modules described above into a single module. This has the advantage that you don't have to worry about which underlying module contains a particular class. It has the disadvantage that it loads the whole of the Qt framework, thereby increasing the memory footprint of an application. Whether you use this consolidated module, or the individual component modules is down to personal taste.
We will begin referencing to QtGui directly -thus not calling PyQt directly-. As it happens to many voyages also my journey into PyQt has not an established trail or end. This means we will implement features together and possibly refer to many of the modules later.
As I always say, stay tuned folks!

Monday, November 24, 2008

The Linux Game Box #4: Beyond the Red Line (Battlestar Galactica)



Welcome to episode 4 of The Linux Game Box.
Today I'm gonna talk of Beyond the Red Line, a space combat simulation and unofficial spin-off of the reimagined Battlestar Galactica show.
Title:        Beyond the Red Line
Genre:     Platform
License:  Unknown but free
Website: http://www.beyondtheredline.net/

Beyond the red line is a standalone conversion (hooray!) of the award winning FreeSpace 2 game by Volition, Inc. The game released in 2007 it's only a demo featuring three single player missions and multiplayer support. A full game version (commercial?) is announced but no release date is specified. The official website provide scarce information and on October 2008 part of the team left Beyond the Red Line to work on a different project. We can thus fear that the full Beyond the Red Line full game is a vapoware.


INSTALLATION REQUIREMENTS  5
To install the demo first thing you must download the install script. You can do so using this tracker for your torrent client. If you don't have a torrent client you can just download the script directly from on of the mirrors on the official web site.
After having downloaded the file you must set the script to be executable. To do this right click on the file, choose the permission tab and click the executable check box and run the script by double clicking it. At this point you could face a library problem like "error while loading shared libraries: libgtk-1.2.so.0: cannot open shared object file: No such file or directory". If you have this issue just install the last version of libgtk from Synaptic or Adept. At this point you can double click again on the install script and install the game.   Alternatively to solve the dependency and install the the game you could type this on the console:
$: sudo apt-get install libgtk1.2
$: sh BtRLDemoInstaller.run
The installer will create a btrl_demo folder on your /home folder.
Run the btlr_demo script to run the game.
Linux system requirements:
• Operating System: Linux x86 compatible
• CPU: Pentium® 1 GHz or AMD Athlon 800 MHz processor
• Memory: 512 MB RAM, 1 GB recommended
• Graphics Card: 64 MB NVIDIA® GeForce 3 or ATI Radeon with closed source drivers, Mesa 6 or better with S3TC extension available for open source drivers
• Input Device: Mouse and keyboard
• Installation: 800 MB free HD space

GAMEPLAY FUN  8
BTRL is a space combat simulator game so the gameplay is similar to that of glorious games of the past like Wing Commander and the Lucasfilm X-Wing series. Thus the concept is basically you sit into the cockpit of a colonial Viper to do the fighter pilot's job: escort ships and do a lot of dogfight against the cylons. The game implement semi Newtonian physics flight to enable the player to perform all the manouvers seen on the show. Also the weaponry and ship instrumentation are replica of those designed for the SciFi tv show. Similar to its predecessors also BTRD features a full set of commands which requires a certain amount of practice to be learnt and mastered. This can be see as a drawback but in my opinion that's not the case. At the beginning can be hard to mess around with all the keys -somewhat contortionist- but as you learn and use them you get accustomed to them and acquire more control on the ship and this is quite rewarding. 




GRAPHICS APPEAL  9.5
From the visual point of view BTRL is quite satisfactory. The ships are accurately modeled and contain high-resolution textures. The environment is fascinating and immersing. Performing flybys of asteroids while chasing down cylon fighters with a gigantic alien planet in the background is something which provides breathtaking experience. Some effects, like explosions, could have been better and some others, like the shaking of the ship in afterburner, are really nice.




SOUND DELIGHT  9
The sound is a real plus of this game. Even if BTRL is not an official Battlestar Galactica game the guys of the development team put pieces by Bear McCreary and Richard Gibbs which, useless to say, create a unique atmosphere. Music apart, the game is rich of actor speech either during briefing or during space combat. This especially helps you to bathe into the pilot character; you will hear pilots chatting, swearing "frak!" and screaming for their life, this all melted with the crackling of the laser and the humming of the cylon fighters brushing your ship.



STORY ENCHANTMENT → 7
The story is set during Battlestar Galactica Season 2. You are a pilot recruit draft and pressed into service by the not-so-gentle folks of the Battlestar Pegasus. Who watched the show's already aware that the philosophy of the Pegasus captain concerned a struggle to survive which implied dismantling of the civilian ships it was supposed to protect. Your objective is do your job and becoming a first class pilot of the Pegasus forces and possibly not to get killed also.
I must say that the story is not that well told or present in the game. There's a lot of briefing (all spoken by actors) but no introductory sequences, no cinematics, and no after mission chill out activities such as interaction with the mother ship personnel or environment. Although this is only a demo of a future game, I must list this aspect within the cons.


MALUS POINTS  -5
Even is Beyond the Red Line is amazing under many aspects, to have only 3 single player missions to play which is simply disappointing.
Note: the source code of FreeSpace2 was released by Voliton, Inc. under a non commercial license. The source code can be used to produce mods and stand alone games and it's currently developed and maintained by the FreeSpace 2 Source Code Project

OVERALL SCORE  6.7

Here below you can see a video footage showing the game in action.
If you want browse more videos you can check the Beyond the Red Line YouTube channel here

Monday, November 17, 2008

The Linux Game Box #3: Secret Maryo Chronicles



The game I'm about to present you for this instalment of The Linux Game Box, it's just one of those title so polished, smooth and fluid that lets you think that yes, there is hope for Linux to be just a little more of a gaming platform. I say this despite the simplicity that marks every aspect of this particular game.

I don't wanna waste more time so let me introduce you Secret Maryo Chronicles.

Title: Secret Maryo Chronicle
Genre: Platform
License: GNU Public License v3
Website: http://www.secretmaryo.org/

Secret Maryo Chronicles is platform game heavily inspired (someone could find it a clone) by Nintendo's Super Mario series. The game is coded in C++ with SDL and OpenGL libraries and it's really pretty fluid on my 4yo laptop. On January 2008 SMC has been awarded #1 in the 5 best (free) open source games chart by the Australian computer magazing APC.



INSTALLATION REQUIREMENTS  7
To install Secret Maryo Chronicles on (K)Ubuntu is sufficient to add the repository to your repository list with Synaptic or Adept.
The repository for (K)Ubuntu Intrepid Ibex is this:
deb http://archive.ubuntu.com/ubuntu/ intrepid universe
The packages to be installed are called:
smc
smc-data
smc-music
The Ubuntu Package page can be found here. The download page on the official site is here


GAMEPLAY FUN  9
Of course Secret Maryo Chronicles is pure fun. Just like the old 2D Super Mario games you have basically to explore and travel through various levels running and jumping to crush enemies or discover goodies hidden behind bricks. There's no more to say about it as this is a well tested formula of simple and mindless game fun. The sensation of running a Nintendo classic on your Linux machine is strong and, as far as I'm concerned, this is also a strong plus for this well done game.



GRAPHICS APPEAL  8
The graphics is simple but just perfect for the game. I would say it's flawless either in concept or in design. The sprites and the world components are well refined with a great appeal. Again, main character apart all the graphics in the game strongly resemble that of Super Mario 2D games. This is not a drawback in my opinion but I must be honest and say that even if the guys in the wiki faq say they don't want to clone Super Mario (that's why they redrew the Maryo sprite) the sensation of playing a clone is pretty strong.
As already said the 2D engine runs perfectly fast in all the conditions I have been able to test.

SOUND DELIGHT  6
The sound is generally nice and does is job well.  The music is well suited for the game and again it reminds the Nintendo block buster. The sound effects are nothing special but they work sufficiently well.

STORY ENCHANTMENT → 3
You couldn't expect the story to be a high score aspect in a game such as this one. The game ratio is all focused on the gameplay that, as I mentioned above, scrapes perfection. However even the Mario game's attempted to sketch a story, at least as a sort of frame to give a "structured sense" to the action. Super Maryo lacks in this aspect. When you start the game you are presented with no introduction and no hints are shown during the games (at least during the few levels I played). At the beginning there's just a map showing your progress in the world and that's all.
A manual for the built-in editor can be found in the game wiki here.

BONUS POINTS  10
The game comes along with a built-in editor which is so simple and intuitive to be a valuable tool for enthusiast level creators. As a matter of fact by installing smc-data you are supplied with lots and lots of user created levels. To enter the editor you just press F8 when playing a level and you are allowed to modified everything with a drag and drop fashion by means of a side bar presenting all the game components. Creating a level with the SMC editor it's really simple and fun. To prove this you can see a screenshot of my messing around and creating a dummy Wiz & Chips level.




OVERALL SCORE  8.6

Here below you can see a video footage showing the game in action.
If you want browse more videos you can check the Secret Maryo Chronicles YouTube channelhere