Friday, 20 September 2013

SQL and PL/SQL

My new area of (limited for now, but rapidly growing) expertise

So, I started a new job at the beginning of the year, as a software developer for a company which specialises in providing medical aid and insurance solutions, based on the relational database model. We mostly use Oracle's implementation of SQL, which comes equipped with its own procedural language called PL/SQL (this stands for what you might think).

So why Software developer? I wrote loads of computer programs during my Msc and Phd, and so, even without much formal computer programming experience, I became quite good at it. In fact, I rather enjoyed it. Maybe it was the ability the control something as powerful as a  computer, making it do my bidding with a few simple (and many complex) set of instructions. It also turns out that my mind is rather logical, and I "get" how computers think. This means I can fairly efficiently form a program which follows a logical set of steps, and gives me what I want.

Fortunately, SQL and PL/SQL are not the hardest of languages to learn. SQL is way of asking a database what it knows about stuff, and does not have terribly many commands. The trick is knowing how to push your questions to the limits, and to optomise them so the database fetches exactly what you want, and no more, in the quickest amount of time possible. PL/SQL on the other hand, is a procedural language, which allows you to combine procedural statements with what the database knows. It has many similarities with my beloved Matlab, which I used almost exclusively during my time as a research student. 

I am happy to report that my migration into this new role went rather smoothly (despite the stricter working schedule - I think the coffee which our tea lady, who is a maestro, brews - helped a lot here). Also, I feel my training as a physicist has put me in good stead for this job. 

Physics research is the working out and understanding and explaining of how physical systems (which we have no control over) fit together a affect each other, producing certain observed phenomena. In some ways, this vast collection of tables which exist on our system, and link together, with a background set of routines controlling certain outcomes (which by the way I can pretty much fully control - within the confines of business requirements) has a remarkable similarity to this. And when I am able to figure out why data x combined with program sequence y produce a result z, the same "happy centres" in my brain are triggered as when I figured out that the plasmapause being close to Marion Island can trigger the reception of both chorus and hiss there, further confirming result that chorus generates hiss...  

Sometimes I miss the flexibility that being a postgraduate research student afforded me, and the many opportunities it gave me to present and talk about my work (I LOVE public speaking now - and do miss it). But there is something to be gained from working in a structured environment, where the projects last only months, and not 3 years. Also, every so often, pay day rolls around...

Anyway, there may be new posts about how PL/SQL works, as my curiosity about it, and expertise with it, grow.

Friday, 8 February 2013

2012 DA14

So, the title doesn't really say what this post is about, so I'll explain here. Last year, an asteroid was spotted in 2012 and calculation of its orbit showed that the comet would have a close encounter with Earth on the 15th February 2013. How close? 0.09 lunar distances (the distance to the moon), which is just shy of 35 000 km. Thats quite a distance, but in astronomical (and in asteroid near miss terms), its not all that far. The comet is around 59 meters in diameter, so about half a rugby field accross. Thats not huge, but it is pretty big.

Just to put it in perspective, the comet will come within geosynchronous orbit of the Earth, which is where many of the satellites which we use on a daily basis sit. DSTV, GPS and telecomunication satellites all sit in geosynchronous orbit.

Now, don't get alarmed. Asteroid orbits are VERY accurately predicted, and this one WILL NOT impact Earth. Not now, or in any other of its upcoming orbits. I just wanted to let you all know that this hunk of rock will be saying "howzit" next week.

This asteroid is the largest object that has come this close to Earth in recent history, so it is quite exciting for those who are able to photograph such things. 

But, what if this baby did impact Earth. We've (probably) all see a doomsday movie where an asteroid impacts Earth and everyone dies. Well, this would be far less disastrous. In fact, the Earth has had run ins with similar sized objects in the past. For instance, in 1927, a similar sized object exploded in Siberia, Russia. The resulting blast was at least 3 megatons (and estimates say it could have been around 15 megatons, which is 1000 times more powerful than the atomic bomb dropped on Hiroshima), and it leveled 2000 square kilometers of trees.

Another object of similar size formed the Barringer crater in the USA, which stretches about 3 km accross. Below is a picture of this crater:


So, on the day after valentines day, cast your eyes upward, and think about what is going on up there, and how close 2012 DA14 is to us.