Wednesday, October 13, 2010

Traveller character

Neil Calderon (UPP 589AA2)

Str 5
Dex 8
End 9
Int 10
Edu 10
Soc 2

Age: 34

Skills

Astrogation 0
Athletics (Endurance) 0
Carouse 0
Comms 0
Compuers 0
Diplomat 1
Engineer 0
Investigate 0
Medic 0
Navigation 0
Pilot 1
Science (Phsyical) 0
Streetwise 1
Trade 0
Recon 2
Vacc Suit 1

Credits: 87,500


Homeworld: High population and Industrialised

Terms served
  • Scholar (Field Researcher) (yrs 18-22)
  • Scout (Survey) (yrs 22-26)
  • Scout (Exploration) x2 (yrs 26-34)
Career events

Neil Calderon started life on a highly populated and industrialise world. His family was poor and marginalised. Much of his youth was spent on the streets, talking and carousing. Ambition, however, was to grasp him in his later teenage years as his studies demonstrated a high aptitude for scholarly research.

At 18, Calderon enrolled as a researcher and undertook offworld research in lesser known systems. Unfortunately, two years into his contract, one of Calderon's expeditions went dreadfully wrong. He spent 9 months stranded on an unknown and desolate planet, struggling for survival. Eventually, a scout ship that was surveying the area, picked up Calderon and the remaining survivors. On his return, Calderon learnt that his position had been discontinued and he was forced to look for another career.

At 22, Calderon enrolled in the Scouts. Initially he worked in surveying, applying skills from his previous career to his new position. Eventually, however, the experiences of the isolation and necessity for resourcefulness, acquired when marooned a few years earlier, became an obsession. By the time he was 26, Calderon shifted from surveying work to exploration.

Through the course of Calderon's second term as a scout, he met Salwa, a merchant broker. They met by chance on a sparsely inhabited starport. Within a short period of time they had developed a close relationship, organising rendezvous whenever possible.

During Calderon's last term as an explorer, he was involved in a rescue mission of a transport ship. Hastily applying his inexperienced medical skills, he set to work aiding whoever he could. The rescue mission resulted in a disaster. Six crewmen died and two suffered lifelong injuries. One of the remaining crew swore an oath of revenge upon Calderon after
seeing the crew die due to incompetence.

Calderon left the Scout service with the rank of Senior Scout after many years of dedicated service. For services rendered, the Scouts have loaded Calderon a Scout vessel to further contribute to exploration and discovery.

Tuesday, October 5, 2010

Learning a new (programming) language

I'm attempting to learn a new programming language. The main issue here is that F# isn't just a new language, it's a new type of language. There are three main (i.e. popular) paradigms of programming languages: imperative (the one you learn at school), object-orientated (the one most programmers use), and functional (the one I'm trying to learn). Object-orientated is really just an extension of imperative programming, so for me, learning F# is about learning how to re-think how to do things.

I thought I'd try to do the Euler problems like Andrew is doing at a misdirected effort.

My solution for problem 1 in F#:
let multiple x = if x % 3 = 0 || x % 5 = 0 then x else 0

let sequenceOfNumbers n = [1 .. n]

let euler1 numbers =
numbers
|> Seq.map multiple
|> Seq.sum

printf "Result = %i" (euler1 (sequenceOfNumbers 999))
The way I'd do it in C#, however, is:
static int Euler1(int maxValue)
{
var sum = 0;
for (var i = 1; i <= maxValue; i++
if
(i % 3 == 0 || i % 5 == 0)
sum += i;

return sum;
}
Is there really all that much difference? Could I have expressed it in F# in a more functional way? I don't know. Hopefully I can change the way I think about functional programming as I move through the problems.

Monday, August 30, 2010

WPF, TextBox and currency

Getting data to look right in WPF can be a bit tricky. I wanted integers to appear as currency, but without any decimal points. After a bit of stuffing around I went from:
<TextBox Text="StringFormat=C}" />
to
<TextBox Text="StringFormat=\{0:$###\,##0\}}" />

Friday, August 27, 2010

Metaheuristic

I was trying to explain the sorts of algorithms I use at work to a friend the other night. In general, they're called metaheuristics (in particular, I have experience with simulated annealing and genetic algorithms.) I used an analogy of an ordinary heuristic like one that tries to find the shortest path between to points.

Shortest path: Imagine you want to find X marks the spot on a map. However, there are all these barriers in the way and you can't really be sure if the route you're taking will 1) get you there; or 2) get you there with the least steps. However, so long as there is someone/something telling you how far away you are from the X, you should always be able to find the shortest route - if there is one. That's A*.

To describe when to use a metaheuristic, however, I said "well, imagine you don't actually know where X marks the spot is." But it's much worse than that. Imagine you don't really know where it is and no matter which direction you take you don't necessarily or reliably get any closer to X. For example, you start a long way from X; you go ten metres north and you're close; then go twenty metres south and you're just as close. But, actually, the closest you could ever get to X might be five metres east from the start! It just doesn't make any sense. Like someone calling out "hotter" or "colder" seemingly at random when you're trying to find something. They aren't lying to you, it's just really hard to find. If you have a situation like that, use a metaheuristic, or punch them.

Monday, August 23, 2010

WorkChoices and Fair Work Australia

Being a little ignorant of IR policy differences between the ALP and the Liberals, I thought I'd dot-point the similarities and differences they had/have.

Similarities:
  • Can only strike during a bargaining period;
  • Industry-wide (pattern) bargaining is banned;
  • Secret ballot required before industrial action;
  • A single, national industrial relations system;
Differences:
There are more differences - even less significant - however, all the differences are minor compared with the similarities.

The non-voters

I am part of the millions of Australians who don't vote. About 8% of people living in Australia aren't on the electoral roll. There are also about a million overseas who don't vote. Add to that the informal votes, up from 4% to 6% for the 2010 election and you have about 20% of the population eligible to vote who don't.

For a country that rushed in compulsory voting after the massive drop-out 1922 election (60% turnout), I am proud to announce that we're back!

Not that not voting changes anything. How can it? Voting doesn't change anything. Nevertheless, one should not encourage them. It's poor form.

Wednesday, August 11, 2010

Watts Riots started today, 1965


The Situationists had a little to say about the riots.
Let the economists fret over the $27 million lost, and the city planners sigh over one of their most beautiful supermarkets gone up in smoke, and McIntyre blubber over his slain deputy sheriff. Let the sociologists bemoan the absurdity and intoxication of this rebellion.

[...]

Until the Watts explosion, black civil rights demonstrations had been kept by their leaders within the limits of a legal system that tolerates the most appalling violence on the part of the police and the racists [...]

[...]

Looting is a natural response to the unnatural and inhuman society of commodity abundance. It instantly undermines the commodity as such, and it also exposes what the commodity ultimately implies: the army, the police and the other specialized detachments of the state’s monopoly of armed violence. What is a policeman? He is the active servant of the commodity, the man in complete submission to the commodity, whose job is to ensure that a given product of human labor remains a commodity [...]

[...]

The rational world produced by the Industrial Revolution has rationally liberated individuals from their local and national limitations and linked them on a global scale; but it irrationally separates them once again, in accordance with a hidden logic that finds its expression in insane ideas and grotesque values. Estranged from their own world, people are everywhere surrounded by strangers.