Dave’s Archives

Has he gone yet?

Bouncy bouncy

May 25th, 2008 · No Comments

When my housemate told me of his scheme for constructing a physics simulation, I did the only decent thing I could. I stole his idea. I turned to my copy of Serway and Beichner (a ~1600 page physics book that I keep under my pillow for just such emergencies) and sat down to work out how to get 2D circles to bounce off each other in the expected manner. Not that anyone has actually seen two-dimensional circles bouncing off each other in everyday life, what with the universe being three-dimensional and everything, but somehow we still have a conception of what it would be like if it were possible.

This took a surprising amount of math (much of which was admittedly due to a series of mistakes). Collisions must preserve overall momentum and energy, and the direction of acceleration must be determined by the angle of collision. And it's nice if you can remember the quadratic formula, and work out which of the two answers it gives you is the right one in this circumstance.

Eventually I got it working, using a combination of C++, KDevelop, CMake, SDL and OpenGL, all of which I was using for the first time in years, or in some cases ever. My housemate valiantly tried to suggest the use of autopointers, but I was all learned out at that point. So, having triumphed in two dimensions where others have merely succeeded years or decades ago in three dimensions, I now have a little black window containing 20 or so blue circles of various sizes (and virtual masses) bouncing around and hitting each other.

The algorithm assumes for the moment that a given circle can collide with at most one other circle in every discrete time unit. When multiple simultaneous collisions occur, at least two circles become entwined - partially overlapping. They constantly "collide", in each and every time unit, each time alternating direction with respect to each other but never gaining sufficient velocity to escape. They each just vibrate back and forth. The net effect is that they become a combined object, which exhibits angular momentum. The two balls spin around each other, with the "heavier" one making less pronounced motions than the "lighter" one. And I haven't even tried to model angular momentum yet.

The next step will be allowing for multiple collisions with the same object in the same time unit, which should theoretically stop this from happening. But I might just have to preserve the current version.

→ No CommentsTags: Geekdom

Not quite so hairy anymore

April 3rd, 2008 · No Comments

It's 2008 - just about time for my haircut, so I reasoned. Suffice it to say, I no longer look like Medusa, though it possibly hasn't purged the inner evil. I had thought about getting my head shaved for charity, since not only would I be contributing to the general good, but it would also be far cheaper. I didn't, because I'm me and I frequently don't take my advice.

On another note, I was somewhat taken aback at being asked, during this delicate surgical operation, if I had any children. Either I sound more experienced and generally wiser than I should, or I just look old. Scariest of all is the possibility that this is no longer an odd question to ask someone my age.

→ No CommentsTags: Escapades

Redeployment

April 2nd, 2008 · No Comments

Sadly, due to seemingly increasingly frequent downtime at bur.st, I've shifted Dave's Archives over to a paid service - Jumba. In the process, I've discovered to my amusement and mild shock that one doesn't actually need to use the command line anymore in order to set up a website on a Linux machine, even if you have PHP web applications with database backends. Jumba (and, I'm informed, most other web hosting services that run Linux) lets you use a web-based interface called cPanel to manipulate just about everything you could possibly want to manipulate. It even has a web-based file manager built in, which actually works in Konqueror. It even has an add-on called Fantastico, which will install and configure web applications (like WordPress) with little more than a couple of button clicks on your part. I've shifted the entire site - database, theme and other miscellaneous settings - without even glimpsing the command line.

I suppose a few seasoned web developers are raising their eyebrows wondering how I managed to find a rock large enough to hide under for the last five years, or for however long this sort of thing has been going on. This is a new thing for me. My brain associates "using Linux" with either GNOME, KDE or the command-line, the first two of which are (generally) irrelevant if you're accessing the computer remotely. Nostalgia be damned. I have seen the light, and it is good.

→ No CommentsTags: Geekdom

Corporate websites

February 28th, 2008 · No Comments

Trawling through the sites of three hundred or so ICT companies gives you a new perspective of capitalism. It's a perspective I could have done without.

It's not the graphics-heavy sites, or the menus that pop up in inconvenient places, or the occasional horrifying overuse of flash. It's the way in which corporate PR people stretch the laws of reality trying to make their firm stand out in the crowd while simultaneously studiously avoiding any reference to what it actually does. How do they manage it? The amount of effort that designers of ICT websites go to in pursuit of this infuriating paradox must be extraordinary.

To give you some context, I'm building a list of companies to contact regarding a software engineering industry survey. The companies should therefore be involved, in some small way at least, in software engineering. The list I'm working from is a list of ICT companies, many of whom merely supply software or provide other support services.

Do you think you can tell, just from looking at a company's website, whether they make software or not? The very companies whose core business created the "information superhighway" seem pathologically unable to inform us of such fundamental facts. Some sites, it should be noted, are very well done and tell you exactly what you need to know. Others - often the ones with sleeker graphics - try exceedingly hard to tell you nothing at all, using terms like "innovation", "solution", "dynamic" and "changing environments". They might indeed provide the most innovative solutions of anyone in dynamically changing environments, but what do they do? They seem to imply that if you don't understand what they're talking about you don't deserve to be viewing their site.

→ No CommentsTags: Research

Just so you know

February 6th, 2008 · No Comments

I present to you the Frivolous Theorem of Arithmetic:

Almost all natural numbers are very, very, very large.

→ No CommentsTags: Geekdom

Ponderings of sanity

January 31st, 2008 · 1 Comment

There are many things to be said about debating in online forums. One, that you learn early on, is that it doesn't take much effort to find the fruitcakes. It really doesn't. The people who firmly believe that the World Trade Centre was brought down by explosives, as evidenced by the "indisputable fact" that it "fell faster than gravity", because just look at that YouTube video. The people who believe you're going to hell not just because you don't believe in God, but because you haven't performed the 54-day version of the "Rosary Novena" (a type of prayer) and that TV shows made since the 1960s are so unforgivably immoral that they must be the work of Satan Himself. The people who equate taxation with slavery and socialism with atheism. The people who believe that oil is not derived from ancient organic matter but instead is simply "produced" by the Earth's core. The people who proudly challenge you to disprove their three-paragraph thesis on why the entirety of science on evolution and cosmology is flat-wrong and the literal Biblical account is the only possible alternative.

One person I encountered had a pet theory on the nature of photons (particles of light): that each in fact comprises an electron and a positron in orbit around each other. Facts, such as the one where photons have no mass, unlike electrons and positrons, do not pose a hindrance to such theories, I've discovered. The idea, more generally, that experts in the field have been looking into this sort of thing for quite some time, publishing multitudes of peer-reviewed journal articles along the way, is of little concern.

Not that I'd wish to put you off online debating, but as you're encountering these varied and interesting specimens, you're bound to pick up a few insults, depending on what fascinating theory you're being unreasonably sceptical of. As a change of pace from the usual names I get called - leftist, liberal, socialist, atheist (which at least is true), materialist or totalitarian - I've recently been called a "Bushbot". This is an interesting and somewhat disturbing thought, considering some of the stuff that's popped up in my George Bush "Out of Office Countdown" off-the-wall calendar.

Not even Bush though can match some of the wisdom of the Internet, which I've decided to share with you:

"In addition, the Earth is continually producing oil, because "Peak oil" was a carefully crafted myth. Oil does not come from dead dinosaurs as you skulls full of mush have been brainwashed to believe."

"Scientists are usually the last to know about anything"

"A price chart is how I make my living....It represents truth."

"A truth to point, all the Atheists I know have no children and it is always due to thier Atheistic mental state as compared to normal (spiritual) people. I know 7 Atheists; three couples. Sure many Atheists do produce children but certainly a large number possessing the Atheistic mind, refuse and will therefore generally NOT pass on either their genetic or social make up to the younger generations."

"The constant social and technological progress resulting from the constant advancement of the metaphysical mind set means that we now have societies full of people, some of whom now can survive to adulthood with all alorts of personal shortcomings. This obviously includes Atheists."

So now you know.

→ 1 CommentTags: The Fringe

The “S” word

January 31st, 2008 · 1 Comment

The circus surrounding the word "sorry" in Australia is, I think, part of the fine legacy of John Howard's very special brand of politics. By adamantly refusing to say it he only helped to entrench it as a symbol of what was missing from his worldview. The argument of course was that "we" weren't responsible because it was previous generations who took Aboriginal kids away from their parents, creating the Stolen Generation. The argument appeals to conservatives here because (one gets the impression) they'd rather wash their hands of the whole thing, and attribute the current socioeconomic status of many Aborigines to some unspoken racial inferiority.

So Howard took a lot of time and energy explaining precisely why he didn't have to say sorry. He expressed regret, of course, but you can't interpret that to mean "sorry" if the person explicitly says it isn't. He even managed to say that he apologised, while still arguing that this technically wasn't the same thing as being "sorry". At that point most people realised that the game was up, but Howard's stubbornness had created momentum in the reconciliation movement. Now, in the first term of the Rudd government, the "S" word simply has to be said. There's no way around it. I'm not one for symbols, generally speaking, and there are lots of practical things to be done to help achieve equality, but in Howard's reign this one symbol has become so important in so many people's eyes that it could easily drive a wedge into attempts at reconciliation.

Rudd, I assume, knows this. You'll notice he hasn't come out and just said "sorry". No, he had to pick a date for it to be said (February 13, in case you missed it), as though it were an occult incantation that only works when certain astronomical bodies are properly aligned. He wants people to Know that the Word has been Said. It has to be stage managed. And he probably wouldn't mind if his audience was mentally prepared to give him a standing ovation for it, which might not happen if it just popped out in a press conference.

At least by saying it the word itself should cease to be an issue, and we can perhaps endeavour to do something to improve Aboriginal health and education, for instance.

→ 1 CommentTags: Politics

In honour of the person who found my blog…

January 21st, 2008 · No Comments

I present the Kenyan tourism campaign, which due to certain recent events may be seen in a rather unfortunate light.

→ No CommentsTags: Nastiness

What matters in this election?

November 13th, 2007 · No Comments

There's an online poll on the ABC's 4 Corners website regarding the election. The first question asks "In the last two weeks of the campaign what do you see as the SINGLE most important issue?" You are given a choice between "Economy/Interest rates", "Climate change", "Industrial relations", "Education" and "Health".

Important for whom? Us or the politicians?

But what's really missing from this picture? After the intervention in the Northern Territory to impose the Libs' ideals of capitalism and individualism by force on the Aboriginal people, after the ongoing mandatory detention of people whose only "crime" is trying to escape their wartorn homelands for a better life in Australia, after the "Pacific solution" in which these people suddenly became so unimaginably dangerous that they were not even allowed to set foot on Australian soil, after our continuing support for the catastrophic war in Iraq, after the two-faced bribery of Saddam Hussein to the tune of $300 million, after the detention and even deportation of Australian citizens for being unable to produce a passport, after the introduction of terrorism legislation that bulldozes some of our most basic legal rights, after witnessing the opacity and unaccountability of ASIO and the AFP in their roles under that legislation, after the introduction of "control orders" to bypass the legal system and impose sanctions on people for whom there is no evidence of guilt...

Can we not, just once, put aside the ridiculous charade of deciding who can manage the economy better and focus on the real world?

→ No CommentsTags: Politics

Window focusing

October 16th, 2007 · No Comments

The user interface of OS X has many things to commend it. Its click-to-focus function is not one of them.

OS X, by design apparently, lacks a click-through capability. As far as I can tell there is no way to enable it. This generally means that when you click on a window to select it, the window itself will be blissfully unaware of the event. If you want to press a button in an unselected window, you must click once to select the window and once again to press the button.

As far as I can tell (and I could have missed something here), this is designed to prevent you activating some random hideous piece of functionality by accidentally clicking off the edge of the selected window, on the window underneath. However, while in certain somewhat undesirable states of mind, this subtle obstacle can become unimaginably irritating.

But surely Dave, can't you just get used to double-clicking to press a button in an unselected window?

But I damn well shouldn't have to! What if you have more than one screen (something that OS X in general handles quite smoothly)? The whole rationale falls to pieces. You have multiple screens so that you can rapidly switch your attention between multiple windows without worrying about the mechanics of the window manager. That's not to say I haven't tried getting used to it, but unfortunately OS X provides only a subtle visual distinction between selected and unselected windows. It's rather counterintuitive to have to modify your actions based on the colour of the buttons in the top-left of the window.

Even if I did get used to it, I'd still be screwed because if you double-click on an unselected window, the window receives a double-click event, not a single-click, and something unwanted is bound to happen. For instance, my text editor (Smultron) lists the currently-open files down the left side of the window. If you single-click on a filename, that file will be displayed. If you double-click, the file will be displayed in a whole new window. That in itself is a perfectly reasonable and useful thing for a text editor to do, IMO, but couple it with OS X's window management and it can become a headache.

What you actually have to do is click once to select the window, wait a prescribed amount of time, and then click again to do what you wanted to do. Gah...

→ No CommentsTags: Geekdom