What is the Science? – Things I Do Part 1

So I am working on filling my life with things to do that are both productive and fun. I have a rather wide variety of interests so I am trying to incorporate as many of those interests into my day to day life. My latest pursuit in rather entrepreneurial in nature, I have partnered up with a couple of people to produce a science website.

This website is called What is the Science and produces science videos with accompanying lesson plans for science and teacher’s notes. For example our latest video is for kindergarten science and is about making an optical illusion called a Thaumatrope. We film four videos at once and then edit them and post them over the following four weeks with videos and teacher notes. We have so far focused on physics and maths but we are going to try to do more biology ones in the coming months.

Please go check it out at http://www.whatisthescience.com

SOAPpy and Urchin

Want to use SOAPpy with Urchin? Well currently the WSDL file won’t work in v1 of the API, doesn’t validate when SOAPpy loads it and I’m afraid I gave up trying to use it. What does work is using SOAPProxy and calling the method on that, trouble is the getData call uses field names with dashes “-” in them which of course in python is a reserved character. So how do you call it? Well a tiny hack is needed. You need to setup a dict with all the fields and their values and then call the method with a double * (**) like in the below example (i still cannot find what this is called). So not too messy if I say so myself!

from SOAPpy import SOAPProxy

url = ‘http://localhost:9998/services/v1/reportservice’
n = ‘https://urchin.com/api/urchin/v1/’
server = SOAPProxy(url, n)

server.config.dumpSOAPOut = 1
server.config.dumpSOAPIn = 1

variables = { ‘login’:‘admin’,
‘password’:‘thePassword’,
‘ids’:‘17′,
’start-date’:‘2009-09-11′,
‘end-date’:‘2009-09-17′,
‘dimensions’:‘u:day’,
‘metrics’:‘u:visitors,u:newvisitors,u:priorvisitors’ }

data = server.getData(*(),**variables)

Let me know if you find this useful!

Dark Astronomy and the Art of a Good Question

dsc_0188This evening Cathleena and I attended the free monthly astronomy lecture at Swinburne University. The lecture this month was on Dark Energy and Dark Matter. These are two relatively untested but popular theories (especially dark energy) that astronomers and physicists are using to explain strange things that have been observed out there in the universe.

The lecturer Dr Chris Blake was quite excellent at communicating a lot of advanced topics in an hour without glossing over the science.  What I was most impressed with was the fact that not only did he talk about the theory and phenomena but he showed the data.

Where a particular theory didn’t match the data he showed it and talked about how this lead to the development of the ideas he was talking about. Pretty graphs that were confusing at first he broke down for us and helped it all make sense.

He then took questions which was great until one fellow decided that he needed to show off. Instead of asking a concise intelligent question he rattled a few ideas off half asking several questions. This fellow wasn’t really after an answer, rather he was performing to the crowd (or perhaps to himself) and it was painful for the rest of us. Poor Dr Blake was left to piece things together and answer things best he could.

He did a great job getting some good answers together especially as he was interrupted with more opinion from the fellow asking the questions. This was doubly annoyed as one of the answers imperfectly covered the question I wanted to ask. I know I have been guilty of showing off when it comes to my areas of interest but it is a trait I hope I have now pruned out of my personality.

The Swinburne University Centre for Astrophysics & Supercomputing does free monthly lectures from February to November. It fills up so book early.

On being Outspoken

I sometimes wonder what it actually takes to be a journo. Naturally a certain proficiency with the written word is required, but after that? Determination, guile and wit? No I think the willingness to be outspoken is the other key ingredient, though the others certainly don’t hurt. When picking a topic don’t be the voice of reason, if talking from a moderate viewpoint no one will listen. To be heard you need to pick an extreme position and defend it at all costs. And the best defense is a good offense, attack the opposition as extremists and the moderates as weak.

This opinion piece in Melbourne’s The Age this morning doesn’t actually follow these rules: http://bit.ly/R0GLM

The opinions are moderate and fairly well reasoned, if in opposition to what I believe. There is understanding of the other side of the coin and even some defense of it. And you know what? I found the article dry and uninteresting, so use to journos adopting an extreme position on topics. At first I was annoyed at what I considered a poorly argued piece with an opposing view to my own. Then I realised the author hadn’t chosen to continue a polarisation of the debate, instead attempting to create common ground. I suddenly respected the author, I certainly don’t agree with her, but here is someone living up to Voltaire.

“I may not agree with what you say but I will defend to the death your right to say it.” née “Je ne suis pas d’accord avec un mot de ce que vous dites, mais je me battrai jusqu’à la mort pour votre droit de le dire.” – Francois-Marie Arouet de Voltaire

Can you use née in that way I wonder? Or is the french specific to family names only?

Indie: Evacuation

Evacuation by Benzido
Freeware, Flash

I love puzzle games, 2D Boy’s World of Goo a prime example of simple but addictive game play, it was a bit easy though. Evacuation by Benzido however certainly isn’t easy, in fact I’m finding it down right frustrating. And like Benzido’s previous game QWOP where you control the legs (and only the legs) of a runner I can’t put it down for long. Say about as long as it takes to walk across the room to pick out my laptop embedded in the wall.

In Evacuation you control airlocks on a space ship invaded by big purple aliens. The aim is to get the aliens out of the ship by opening the airlock doors while keeping the crew within. The crux is that opening a door of a particular colour opens all the doors of that colour and so the puzzling begins. The key is to keep the captain alive, other crew can be sacrificed but as long as your dashing captain survives all is not lost.

Evacuation Game

This however brings me to my major gripe with the game and the frustrating part. When you fail a level you lose all your progress and are thrown back to the beginning. This is very brutal for a casual game such as this and I wonder at the developers reasons for it. Certainly there is a replay level function, but it only lets you play the level you just lost until you restart once more at the beginning. It means more often than not I leave the game for more gentler pursuits until I can be bothered retrying previous several levels to get back to the point i was at.

Frustration aside and on to some minor gripes i found the game resolution a little small on my screen so picking out the doors is more fiddly than it could be. The music starts the grate a little, the same five or six 8bit tones repeated at infinitum. You can turn off the sound but then you lose the satisfying doors and girlish screams when you sacrifice a crewman/woman/it for the greater good.

Certainly well worth having a play with, a tiny flash game that punches well above it’s weight!

Playing with OpenGL

I’ve been playing with OpenGL and Python the past couple of days. So far there is this:

Shooting Stuff

Technical Art

Working for a startup invariably means you end up wearing several hats.  This certainly isn’t a bad thing, you learn new skills and the job is always interesting.  The difficultylies in the fact that you are often thrown in the deep end and told to swim the 100 metres. The current project I’m heading up is no different.

Along with my usual jobs of project manager and lead programmer I am also acting as a character animator. This you will note is not something I have much, if any formal training in.  I understand the technical aspects of character animation, keyframing, IK, skinning and rigging having coded support for many these in my time.  And learning a new program is no real hurdle either, once you understand what it is you need to do you know what questions to ask, whether the answers lie in a tutorial, help, reference or IRC.

So the difficulty here lies in a different and rather new quarter. Character animation is an art though an art that requires a lot of techical knowledge, I know of no other art that requires looking at graphs for example. I am able to play with an animation very easily moving arms and legs with ease.  The tool I am currently using is a trial of MotionBuilder from 3D graphic giants Autodesk so it is bursting in features and is pretty easy to pick up and use. However I have yet to develop that flair that makes animations look realistic or “right”. 

How often do you play with graphs in art?

In the time I have to ship this project I’m not going to learn a smidgen of that magic that professional animators employ to produce their art. And even when I have learnt those techniques, what of the art itself? Where does the technique stop and the artist start?

Django: Restricting the queryset of an InlineFormSet

I’ve been recently working in Django to quickly create some forms for our users and management forms for my staff. I’m still a beginner in Django but it is easy to get something running quickly. As a web framework Django is proving to be quite excellent and it is always a pleasure working in Python.

Today I came up against an small problem that I didn’t find any documentation on. When using the inlineformset_factory for generating inlineformsets based on model ForeignKey joins you can’t specify a queryset so that only a subset of the possible entries will appear. In my case I have a field which marks an entry as deleted which i don’t want displayed to users. My solution was the extend the BaseInlineFormSet class and overload the get_queryset function. This function is called to get all the entires for a inlineformset so by overloading this function I could control which entires are returned.

The overloaded class:

from django.forms.models import BaseInlineFormSet

class BookmarkInlineFormSet(BaseInlineFormSet):
    def get_queryset(self):
        return Bookmark.objects.filter(user=self.instance)
                               .filter(userDelete=False)

The inlineformset is then generated using the inlineformset_factory and setting the formset parameter:

BookmarkFormSet = inlineformset_factory(User, Bookmark, formset= BookmarkInlineFormSet, fields=(‘website’,‘userDelete’), extra=2, can_delete=False)

In this case I set the can_delete parameter to False as I don’t want users deleting any entries. And finally you can use the inlineformset as you normally would:

bookmarkForm = BookmarkFormSet(request.POST, instance=user)

Let me know if this helps you!

Maths: Discovered or Invented?

Science News posted a article discussing the ongoing debate about whether mathematical truths are discovered or invented. Seems the debate has been ongoing since Plato’s time almost two and a half thousand years ago. The reason for this is once mathematicians start arguing over this semantic they start delving into religion and philosophy very quickly. From the article:

Those who espouse discovery note that mathematical statements are true or false regardless of personal beliefs, suggesting that they have some external reality. But this leads to some odd notions. Where, exactly, do these mathematical truths exist? Can a mathematical truth really exist before anyone has ever imagined it? On the other hand, if math is invented, then why can’t a mathematician legitimately invent that 2 + 2 = 5?

The external reality bit is what gets things really messy, as this doesn’t fit with many scientists way of thinking. It leads into ideas of higher powers, more abstract than that of “God” but none the less worrying to women and men that have built their lives and careers around rational scientific thinking.

I personally lean towards the Platonic view that maths is discovered, mainly because of my physics background which firmly grounds my maths in the real world (or not quite real world if i am doing Quantum Physics). Also because invention leads to all sorts of IP (Intellectual Property) problems and I think we deal with enough of those in the Information Tech industry already!

Cashback

I really love offbeat movies, especially romantic ones where the guy gets the girl. Cashback is a very unpretentious movie about a guy losing his girl, and from that his ability to sleep. He decides to take his extra eight hours and take a night shift job in a supermarket. Nutty antics, art and romance follow interwoven with a poignant narration about beauty and love. I found myself relating to in on a quite personal level, seeing a past self in Ben Willis, the heartbroken main character. His commentary on his own pain and suffering conveyed a noble out look on life and made the movie something special.

I didn’t think too much of the best friend however, straying into clichéd american teen softcore porn comedy, not really suiting the mood of the movie in my opinion. The love interest grew on me, though she was never fleshed out enough, as an object of affection for a heartbroken artist she performed admirably.

Four stars * * * *
Movie Poster: Cashback