Keep Your Hands Off My Holidays, AHA

From an ABC report:

The Australian Hotels Association (AHA) says people should be forced to forfeit some of their annual leave if they do not take enough holidays.

The association says Australians are saving up too much money, while the tourism industry is floundering.

AHA chief executive Bill Healey says people should be forced to cut back their annual leave to 300 hours before each new financial year.

He says the amount of leave accrued by Australians is a liability for businesses.

“There’s $31 billion on business balance sheets,” he said.

“There’s 121 million days of leave that are sitting there and we want Australians to take that leave and to go out and enjoy our great destinations and spend some money, because that’s what’s going to keep the wheels of the economy turning.”

So Mr. Healey would like the government to impose intrusive regulations on Australians for the benefit of his members.

Of course there are legitimates reasons why an employer might wish to restrict the amount of leave their employees accrue, and they should be allowed to restrict them. An employer might believe that their employees are more productive when they take regular holidays, or might not want them on leave for long periods. That decision should be up to individual employers, not the government.

But points to Mr Healey for stating correctly (in accounting terms) that accrued leave is a ‘liability’ for businesses, leaving the implication that it is also a ‘liability’ in the common sense, i.e. a problem that something should be done about.

Not the first or the last rent-seeker inspired by the GFC.

Computer Scientists as an ethical elite

… every culture … needs a kind of self-questioning, ethical elite … Perhaps you see very little link between the Charles of 1267 with all his newfangled French notions of chastity and chasing after Holy Grails, the Charles of 1867 with his loathing of trade and the Charles of today, a computer scientist deaf to the screams of the tender humanists who begin to discern their own redundancy. But there is a link: they all rejected or reject the notion of possession as the purpose of life, whether it be of a woman’s body, or of high profit at all costs, or of the right to dictate the speed of progress. The scientist is but one more form; and will be superceded.

John Fowles, The French Lieutenant’s Woman.

bash command completion for jstack/jps

I’ve only recently become aware of jps and jstack, Sun’s tools for listing Java processes and for producing a thread dump from them. They beat the old ps | fgrep java and kill -3 (and then try to find the log file your thread dump went into…).

You still have to use jps, copy the appropriate pid and then paste it into your jstack command line, which is inconvenient. I decided to implement bash command completion for the pid argument.

Of course that isn’t useful by itself — seeing a list of available JVM pids tells you nothing about which one you want, so I arranged for each pid to be accompanied by the full package name for the application’s main class or the full path name to the application’s JAR file, as provided by jsp -l.

The trick is to give compgen the list of options in the form <pid>#<description>, as it splits the list of options on whitespace, but then to modify the array of options so that each is <pid> #<description> so that the description is interpreted as a comment by bash in the final command line:

_jstack()
{
    local cur prev opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    opts=`jps -l | fgrep -v sun.tools.jps.Jps | sed -e's/ /#/' | tr '\n' ' '`
    replies=( $(compgen -W "${opts}" -- ${cur}) )
    for (( i = 0 ; i < ${#replies[@]} ; i++ ))
    do
    COMPREPLY[$i]=`echo ${replies[$i]} | sed -e's/#/ #/'`
    done
    return 0
}
complete -F _jstack jstack

The code above can be put in your .bashrc file.

A Dialogue

The year 2329. Two humans in ostentatiously futuristic garb are removing a 21st century human from a block of ice.

Future Human 1: “What is your name?”

21st Century Human: “Jake — what happened to me?!?”

Future Human 2: “You have been frozen for 300 years”

Jake: “Thanks for thawing me out — what are your names?”

FH1: “We have chosen names belonging to highly esteemed humans from the 20th century, to make you feel comfortable. You may call me ‘Adolf Hitler’ and my colleague ‘Josef Stalin’”.

FH2: “Do those names comfort you?”

Jake: “Not exactly…”

FH1 (to FH2): “Odd — my research indicates that the person depicted on his garment — ‘Che Guava’ I believe — was of a similar temperament to our namesakes.”

Jake (to himself): “Must be some cultural misunderstanding…”

FH2 (breaking an awkward silence): “You must be in need of nutrition”

Jake: “Yes! What’s on the menu?”

FH2: “My chef excels at preparing kitten — eaten live of course!”

Jake: “My sense of oneness with nature does not allow me to inflict such suffering on an innocent feline!”

FH2 (to FH1): “What is he talking about?”

FH1 (to FH2, chuckling): “Remember, Josef, 21st century humans had not yet mastered the ‘life force’ — Jake is without any protection from it.”

Jake: “What are you talking about? What’s the ‘life force’?”

FH1: “It is an emanation based on principles you would not comprehend, having an effect on the mind such as to produce the scruples you have evinced in respect of consuming juvenile examples of the crepuscular mammal known as Felis catus in a manner inflicting discomfort.”

FH2 (to FH1): “Adolf, it’s a myth that standards of vocabulary have declined in the last 300 years. Stop showing off.”

FH1: “In summary, the ‘life force’, which so many short sighted 21st century scientists scoffed at, is real, and produces a sense of connection with the rest of life and the universe which affects the mind’s perceptions of moral behaviour.”

FH2: “Fortunately, Jake, there were some people who did not dismiss the ‘life force’, and once science had confirmed its existence, we were able to control it. I can assure you that a widening of culinary practice has been the least of the changes which the removal of this effect has wrought on our society!”

Jake: “Now wait a minute — while I once believed in a life force such as you describe, a good friend (who incidentally was later elected first president of the planetary federation, and whose remains are preserved in a barrel of Johnny Walker Blue Label under Nelson’s Column) explained to me that it was impossible for a natural force to have such an effect on the mind!”

FH1 (sneering): “Really? And how did this primitive justify such an opinion?”

Jake: “It is well known that the phenomena of human consciousness appear only at a very high level in the brain’s structure, and are built on top of neural structures whose purpose cannot be discerned other than by correlating their activity to the expression of particular thoughts and emotions, so any force which influenced specific high level processes in a specific direction would need to be ‘aware’ of the structure of the human brain and mind to an implausible degree.”

FH1 (laughing heartily): “That argument is entirely correct! Perhaps your friend alone among 21st century humans possessed true intellect!”

FH1 (to FH2): “Despatch the recovery robots to the London glacier at once — this would be a prize beyond price — I only have 2 litres of Johnny Walker blue left.”

FH1 (to Jake): “Describe your friend’s personal hygiene? — anyway, despite that argument being completely correct, your friend suffered from a failure of the imagination.”

Jake: “So the life force does exist? But that’s implausible!”

FH1: “But you should start believing in implausible things once they have been proven to be true! Once the life force was proven to exist, we discovered it to be emanations from a device left by the alien race who created humanity, buried deep in the mantle of Earth. We speculate that it was designed as an ecological control to force humanity to coexist with other species.”

(Jake is speechless)

FH2: “Of course Adolf, the genetics of our tastebuds have proven more effective in persuading us to keep other species around!”

(FH1 and FH2 laugh and slap each other on the back)

FH1: “Once we had discovered the source, blocking it was an easy matter — let us assist you”

(FH2 produces what appears to be a conical tinfoil hat, already a part of their ostentatiously futuristic costumes, and places it upon Jake’s head)

FH1: “Is that better?”

Jake: “Well, I do feel a bit peckish.”

FH2: “Great!”

Jake: “Can we have some tabbies?”

FH2 (calling): “Fred… get some tabbies!”

Books from India Update

I received the ‘Eastern Economy Edition’ of “Advanced Topics in Types and Programming Languages” last week.

It’s a well constructed hardcover.

The negative points are: - It has an ‘inky’ smell. - The paper is thinner than usual, so you can see the printing on the other side of the page.

Neither is a real problem.

Books from India for the Win!

I haven’t ordered this yet, but www.biblio.com has some tempting deals:

Google Translate is not always so useful

Emboldened by my previous success, I decided to translate the subject of some Chinese-language spam: 卓越的指引管理让战斗力数倍提升

Apparently this means: “Excellent management guidelines several times to enhance the combat effectiveness”

I don’t know if the translation is inaccurate or the subject is poorly written.

It reminds me of the apocryphal story about the translation software which when used from English to Russian and back again translated “The spirit is willing but the flesh is weak” into “The Vodka is good but the spam is raw”.

Google Translate to the Rescue!

I finally got around to ordering a new keyboard for my MacBook Pro, to replace the one which lost a few keys on our last Fedex Day.

I was a little nonplussed by this response via Paypal:

“The seller has provided the following Order Status information for your review: Order Status: 已发货”

So much for taking the supremacy of the English language for granted!

Fortunately Google Translate told me that this means ‘Posted’ — not ‘Running Dog of Capitalism will never see his filthy money again’.

Laptop design stupidity

A relative of mine has a recent HP Pavillion laptop. (I suggested that she get a Mac, but she was concerned about MS Office compatibility).

I was doing some telephone support trying to reattach it to her wireless network tonight. I was ultimately unsuccessful, but I did learn two reasons why HP laptops suck.

  1. HP has their own ‘wireless assistant’ wizard, with a plethora of confusing options, so even my limited knowledge of Windows network configuration was useless.
  2. The laptop has a wireless on/off switch on its front. This switch was in the off position, but the software couldn’t tell that. All it could say was ‘please check the network switch’ — and it didn’t show a picture giving the switch’s location. I had to Google and then describe the location over the phone. It’s a hardware switch when it should be a software switch, and to add insult to injury, its state isn’t even visible to the software!

I am on the front page of cuil!

Well at least my picture is:

Perhaps the Sudbury, Ontario municipal sculptor will use that photo as a reference when they erect a statue honoring Tom Davies…