Friday, 19 October 2012

Book Reviews - Medea, Man in the Dark and Beyond Good and Evil

Medea

Medea is an ancient Greek tragedy. Medea's husband leaves her for a princess. Medea is angry and bent on revenge. Furthermore she is banished from the city.

Medea poisons her husband's bride and kills the sons she bore to her husband, before fleeing to safety in another city.

It was surprising to see such a strong female character in such an ancient story, even though that strength of character was sometimes portrayed negatively. She is called a "witch". Ultimately the chorus advises her against murder but that she has the right to take vengeance.

Title: Medea
Author: Euripides, translated by Robin Robertson
ISBN: 9780099511779
Rating: 4/5

Man in the Dark

I had a strange feeling of deja vu when reading Man in the Dark - I think I have read it before and forgotten about it.

This story is about coping with loss and the urge to create stories. The entire book was missing quotation marks which was distracting. There is an entire subplot of a story that the main character is concocting in his head during the hours he can't sleep but then that story is abruptly ended close to the end of the book without any connection to the main story.

The most interesting thing about this book was in fact a movie that it referenced Tokyo Story by the director Ozu.

Title: Man in the Dark
Author: Paul Auster
ISBN: 9780571240920

Beyond Good and Evil

Nietzsche is a towering figure in the exploration of nihilism. A major part of his philosophy rails against the church and its monopoly on ethics.

Although Nietzsche's work influenced Hitler the content of this book at least did not support Hitler's abhorrent views, although I must admit it had a great deal of material that could be misinterpreted or misrepresented. It is possible that Hitler selectively used Nietzsche to suit his own beliefs. Just as Hitler misappropriated other elements of philosophy, culture and science to suit his own ends.

Ricky Gervais portrays this relationship very accurately.

Title: Beyond Good and Evil
Author: Friedrich Nietzsche
ISBN: not available
Publisher: Penguin Classics

Thursday, 27 September 2012

Hills Transport News - October 2012

Let’s Get Moving

Welcome to the first Hills Transport News: the newsletter for public and private transport in the Hills. This newsletter will cover buses, trains, cars, pedestrians and light rail.

My aim as editor is to improve the dialogue between Hills residents so we can work together to improve transport in the Hills. I want this newsletter to provide unbiased, trustworthy and independent information that can be relied upon to start discussions and take action.

My Hills Transport News is a vital new initiative because we need your help. We all need to share our ideas. We all need to talk about transport in the Hills with our friends, neighbours and colleagues. We all need to contact our local members, our local councillors and 131500 feedback.

2012 is an exciting year for transport in the Hills. Over 15,000 new homes are planned for the Hills so improving transport is critical. The North West Rail Link is in the planning stage, work on the M2 widening is continuing and Hillsbus has added a number of new services. There is still more work to be done.

This newsletter will also cover the activities of The Hills Transport Working Group which is working to maximise the benefits of these improvements for Hills residents and requesting more improvements. The Hills Transport Working Group has initiated campaigns such as the M2 Cashback Scheme, consulted with with the North West Rail Link project team and the opposition transport spokesperson. Media coverage of our campaigns includes 2UE, The Daily Telegraph and various local media.

Happy travelling,
Andrew Punch
Hills Transport News editor

Our Voice in the Media

The Daily Telegraph: $5000 a Year for a 90 Minute Trip

The Daily Telegraph ran a case study on a Beaumont Hills commuter, Mr Silva. Mr Silva spends $108 per week, $5000 per year, on tolls and his commute time still takes 90 minutes.

Lobby group Hills Transport Working Group said drivers such as Mr Silva were paying too much for a poor quality service reducing productivity.

"Between now and when the M2 and Lane Cove Tunnel toll roads revert to government ownership in 2046, residents of northwest Sydney travelling to the city daily will pay $120,000 per car just in tolls," Hills Transport Working Group chair James Fiander said. "Every extra hour commuters take to get to and from work along the M2 and Lane Cove Tunnel represents a productivity loss of over $780 million per year for our city."

http://www.dailytelegraph.com.au/news/a-year-for-privilege-of-joining-the-daily-grind/story-e6freuy9-1226275201610

The Daily Telegraph: M2 Cashback

The Daily Telegraph ran a story about congestion on the M2 and the Hills Working Group’s M2 Cashback campaign.

Lobby group Hills Transport Working Group is leading the call for the cashback or compensation scheme.

"Commuters are paying a high price for a service that isn't being delivered," group chairman James Fiander said.

"The road may eventually be better once the widening has been completed. In the meantime the government should provide a cashback scheme to assist commuters."

http://www.dailytelegraph.com.au/news/sydney-nsw/drivers-want-a-return-for-the-pain-of-using-the-m2/story-fnb5f12x-1226275207090

2UE: M2 Cashback

Jason Morrison on 2UE ran a story about congestion during the construction of the M2 while leaving tolls unchanged.

Key points that Hills Transport Working Group chair, James Fiander, made:
  • M2 is “reliably bad”, old roads can be worse
  • Why do Hills residents miss out on cashback and need to pay the highest tolls in Sydney, when other areas have cashback - such as the M5 and formerly the M4?
  • Why is the Hills different? We pay our taxes like the rest of Sydney then we pay $5000 per year extra on tolls
  • The situation with the M2 is virtually a monopoly situation
  • The free alternatives have been narrowed, such as Epping Rd
  • Toll discount during construction would also be fair for Hills residents

http://www.2ue.com.au/blogs/2ue-blog/cash-back-for-hills-residents-on-m2/20120220-1thw6.html

In The News

North West Rail Link EIS Released, Cutting 66% of Buses

The Sydney Morning Herald has reported the release of the North West Rail Link’s first environmental impact statements. Both the Sydney Morning Herald article and a North West Rail Link press release state that buses from the Hills to the city will be cut by 66% once the North West Rail Link is complete.

The Hills district will have grown substantially when the North West Rail Link is completed, so the decision to cut 66% of existing services needs to be thoroughly questioned.

The first EIS is available for download from the North West Rail Link website.

http://www.smh.com.au/nsw/sydneys-next-big-thing--and-its-bigger-than-the-bridge-20120404-1wbwk.html


New Hillsbus Services

Seven Hillsbus services have been upgraded and one new service has been added.

Some services on the 610 route to the city have been changed to express services through the Lane Cove Tunnel. These express routes will be numbered 610X. The 619 route to Macquarie Park and 612 to North Sydney have new services.

Routes 610X, 616X, 617X and 618 will soon have new or updated services - check the new timetables.

Hillsbus has started a new route from Rouse Hill Town Centre to the City, the 607X. This service travels directly down the T-way, then down the M2 and Lane Cove Tunnel. The 607X does not go through the back streets of Rouse Hill like the 617X.

Hillsbus has also started a new service to North Sydney from Rouse Hill - the 602. According to Hillsbus it is expected that passengers from Kellyville will save around 25 minutes when travelling to North Sydney.

Unfortunately the 602 service does not go through the Lane Cove tunnel. Travelling from Riley T-way to North Sydney using the 602 is 6 minutes slower than catching the 617X into the city and catching a train back to North Sydney according to 131500.com.au

When the problem was stated, Hillsbus replied: “Hillsbus and Transport for NSW made the decision on the path for Route 602 based on an overall network assessment of how to serve all customers. Hillsbus is aware of the desire for a North Sydney express service and is investigating options how this can be accommodated.”


For more details please visit the Hillsbus website.


Upcoming Meetings

Meetings of the Hills Transport Working Group steering committee are held every second Wednesday. All members are welcome.

This month the meetings will be on the Wednesday: 3rd, 17th and 31st of October 2012.

Please check the online calendar for last minute changes or cancellations. An iCalander file is also available for smartphones and various email clients.

Monday, 24 September 2012

2012 NSW Council Elections

Introduction

You may have missed it but on Saturday, 8th of October 2012 there were elections across New South Wales for local councils.  I was a candidate for Labor in Parramatta City, Caroline Chisholm ward [PDF].

The ultimate results for this ward are unchanged: 1 Labor and 2 Liberals elected. There were swings against Labor and the vote was complicated by the former incumbent Labor councillor standing as an independent.

As the second candidate for this ward it was very unlikely that I would be elected. Labor has never had a second councillor elected. Although a Labor approved independent, Chris Worthington, was elected at one point.

There was a great deal of positive feedback from the community and the whole experience was very valuable.

How Voting Works

First I might outline how the voting works. You might wonder why there were 3 candidates for each party.

There are three council positions, so each group or party to nominate up to three candidates. The top three candidates after preferences are distributed will be elected. The preferences are specified by the voter, groups do not register preferences with the election commission for council elections.

In more detail - to be elected outright a candidate needs 25% plus 1 vote.
This 25%+1 figure may seem a bit odd at first. When three candidates are elected outright the three candidates require a total of 75%+3 votes, meaning only a maximum of 3 candidates can be elected.

As explained in wikipedia the... election proceeds according to the following steps:
  1. Any candidate who has reached or exceeded the quota is declared elected.
  2. If a candidate has more votes than the quota, that candidate's surplus votes are transferred to other candidates. Votes that would have gone to the winner instead go to the next preference listed on their ballot.
  3. If no one new meets the quota, the candidate with the fewest votes is eliminated and that candidate's votes are transferred.
  4. This process repeats until either a winner is found for every seat or there are as many seats as remaining candidates.
When voting above the line the surplus votes in step 2 & 3 are first transferred to the next candidate in the same group / party, then are transferred to the group / party indicated by the preferences.

Why a Party?

One of the excellent things about council elections is that they are relatively cheap. For the price of a car someone can mount a decent campaign for a council ward.

State or federal campaigns are much more expensive.

With so much accessibility to independents why would anyone stand or vote for parties such as Labor or Liberal? Standing t tfor a major party means that you are part of a team.

If the party has had success in the past then a candidate can continue the successful policies. Many of the supporting people who made a previous term successful can be turned to for advice. This can include current or previous councillors in the ward and surrounding wards.

The reputation of a party can persist beyond a single term, as can the issues that a party stands for. For example most people would recognise that Labor generally stands for social justice, environmental preservation, heritage preservation and cultural improvement (whether we achieve it is a different question).

In comparison it is often difficult to ascertain even whether an independent is conservative or progressive. Independents have more to communicate about their platform because there is less familiar territory for voters.

Party councillors are also accountable to party members whom live in the electorate. Thus there is a structure in place for feedback to councillors from the local community. Independents need to create this structure themselves.

I welcome the fresh voices that independents bring to local councils but there are also different benefits to established parties.

Campaign

The campaign was off to a slow start. The former Labor councillor for Caroline Chisholm, Paul Barber, was unhappy about not being preselected. It took him a long time for him to decide that he wanted to withdraw from the number 2 position, then it took a long time for him to formally withdraw. He finally decided to run as an independent.

Shahadat asked me to run as number 3, while Paul Barber still had rights to the number 2 position. I was happy to do so and expressed that if there was someone better suited I would be happy to give it up too. Talking to other people the issue of female representation was raised, so I suggested to Shahadat that a woman should take my place if someone suitable could be found.

As it worked out Paul Barber dropped out, so I ended up in number 2 position and Deborah May was in number 3 position.

Realistically Deborah and I had no chance of winning. Labor has never had a second party candidate in Caroline Chisholm ward. Although Chris Worthington was successful as a Labor-approved independent. Chris is a Labor party member.

I was hopeful that the Greens candidate, Annie Nielsen, may have a chance this time but more about that later.

Shahadat and his wife Jintana were very organised. Shahadat and I focussed on shopping centres rather than door-knocking due to the limited time available. Shahadat carried most of the load - with extra shopping centre visits, train stations. We managed to send out two leaflets using only volunteers. The volunteers were very reliable.

The campaign was a very positive experience and I learned a great deal about the organisation that is required for a campaign.

Technology

The heavy-lifting of the campaign was still traditional electioneering. Mail-outs, posters and shopping centres were the most effective forms of communication.

I set up a Facebook page for the campaign and Sameer set up a website for the campaign. I used material that had been already approved for other brochures, so authorising the material would be as fast as possible.

I did an experiment with paid advertising on Facebook and Google adwords. The most important feature when using these tools is geographic targetting. Both Facebook and Google offer targetting down to the suburb level.

I found that geographic targeting worked quite well but there was some overflow into completely unrelated geographical areas such as Melbourne. We received 300 likes. A foul-mouthed conservative called Gary made a few comments which related to the local area, so obviously the advertising was effective at targeting the local community. Thanks Gary for validating my advertising!

During the campaign the posters at my home were vandalised with racist graffiti and I received a letter which in context threatened vandalism against my car. In addition other volunteers who had posters in their yard had threatening phone calls.

Fortunately security equipment is now cheap and widely available. I installed security lights in the driveway and two video cameras - one overlooking the car and one overlooking the signs. I bought a cheap video capture card from a local computer shop.

The ubiquity and cheapness of this equipment meant I could exercise my democratic right to ran as a candidate and to support the party that I choose.

Results

The final results are available from Elections NSW. The primary count was available by about 8pm on the night of the election, the final count including quota distribution was not available until the following Thursday.

Labor received 21.07% of the formal first preference vote - which is 4 percentage points less than the required 25%+1 votes. The former Labor candidate turned independent, Paul Barber, received 9.50%. In the previous election Paul achieved 33% as the Labor candidate - the current total of the two, 30.57%, is about 3 percentage points lower.

The Greens achieved 8.80% of the formal first preference vote - which is down from the 11% that Annie Nielsen achieved as an independent.

The informal vote was 1,100 - or about 6% of the total vote. Our scrutineers estimated that about half the informal votes had the intention of voting Labor. The possible 3 percentage points would not have had an impact in this election but in a number of cases it could make the difference.

There was a swing against Labor - in fact there was a swing against Labor in most councils in New South Wales - many people were positive but there were a number of people who expressed dissatisfaction.

Voters can usually separate levels of government, I don't think consistent swings observed across New South Wales would occur unless there was resentment at a state or federal level.

Although Labor and other progressive candidates did not make any progress at this election, at least we retained the council position - which a number of other wards did not.

Greens, Preferences and Informals

UPDATE:  It has been brought to my attention that Labor could have won on its own if there was a run-off between Labor and the conservatives. The conservatives could not have won the third council position in this election.

Labor received 21.07% of the first preference vote. The conservatives received a total of 60.63% of the vote. After the 50% is removed (it should be 2 more votes as well) the conservatives are left with 10.63% of the vote - assuming all the preferences flowed to one candidate with no exhaustion.

The preference swaps were still helpful for comfortably reaching quota.

To make up the difference to reach quota we need about 673 votes. We could not have made up this difference without the solidarity of both the Greens and Paul Barber.

Paul Barber's preferences were helpful and Paul did the right thing in honouring the preference swap in his how-to-votes.

Strangely despite Paul Barber being a former Labor candidate and a preference swap in the how-to-votes, only 507 votes out of the progressive total of 1,717 came through to Labor. 137 votes went to the Liberals and an enormous 900 votes were thrown away (the voter's preferences exhausted). This shows that nothing can be assumed in an election.

Labor received 404 votes directly from the Greens and 94 went to Paul Barber. 852 votes were thrown away by being exhausted. This is somewhat understandable as the Greens and Labor are distinct parties, although there is a certain amount of overlap on some issues.

In some other council areas Labor did not preference the Greens to reduce informal votes or because no preference swap deal could be reached. Actually the preference swap deal only covers the how-to-vote - it is ultimately the voter's numbering that determines preferences in a council election, even when voting above the line.

There are a few good reasons why it makes sense to do a swap in Caroline Chisholm: Annie is a good progressive candidate who would make an excellent contribution if elected to council, the Greens in Caroline Chisholm ward are very friendly and professional, and it stretches the imagination that we would gain more votes through reduced informals than we gained from the swap with the Greens.

Progressive candidates also need to keep solidarity because an exhausted progressive vote is effectively a vote for the conservatives. I am hoping that next election Labor will be in a position to return the help we received from other progressive candidates.

Labor could not have maintained the current council position without the preferences from other progressive candidates - otherwise we would be facing three conservative councillors.

Written by Andrew Punch.

Thursday, 30 August 2012

e-tax 2012 on Mac and Linux FOI Part 2

I have received a reply to my freedom of information request for the source code of the etax client. The letter is dated the 9th of August 2012, but I have been too busy to blog about it because I am a candidate in the upcoming Parramatta council election. I also have not had time to reply to it.

In short it was refused.

It was a two page letter (I will scan it later) but the key paragraph is:
"I consider there is an increased likelihood of hacking if the source code is released and the serious ramifications of this outweigh the public factors in favour of release. I have therefore exempted the source code from release under Section 47E of the FOI Act."

In my appeal I will point out that various open-source software is developed with the source code publicly available and is just as secure as closed source equivalents - for example Apache and Linux. I will point out that Apache is used by the majority of webservers and Linux is widely deployed without any greater number of security issues.

Another key paragraph is:
"Section 11C of the FOI Act requires the office to publish details of information released under the Act on our website and make the information availble to the public unless it would result in the unreasonable release of personal or business information or it would be unreasonable to publish the information. If we were to release the code to you, we would be obliged to release it to the general public also."

While this is true that section 11C subsection 3 does require the release of the material, no mention is made of section 11C subsection 1c and subsection 2 which states that the Information Commissioner may make a determination that the information should not be published to the general public.

So my avenues of approach will be:
  • Appeal on the basis that numerous open-source projects are as secure as closed-source projects
  • During appeal clarify that request is only for etax client
  • I was also referred to a press release stating that a Mac OSX client is planned for 2013 but a cross-platform version was promised in 2007 - how can we be sure a Mac OSX version will be completed
  • Consult with the Office of the Information Commisioner to get a publication exception, so there is no chance of source code falling into the hands of "hackers"
  • If this FOI request fails, then launch a new FOI which requests a list of Windows function calls which are used during the pre-fill and lodgement processes
I have 30 days in which to appeal for a review by the ATO - so the 8th of September 2012. I have 60 days in which to appeal for a review by the OIC - so the 8th of October.

Friday, 17 August 2012

Why We Don't Need a Gold Standard

The Reserve Bank of Australia prints money in Australia. In the days of the gold standard you would be promised a certain amount of gold for each note - that is no longer the case. Now that the Australian economy is bootstrapped, the value of the Australian dollar is in the transfer of goods and services. i.e. that you can walk into a shop, get in a taxi and the Australian dollar would be accepted.

Think about a barter system. I have apples and want bananas. Ok I find a banana farmer and swap. But what if the banana farmer doesn't want apples, but wants a taxi ride? Well then I need to find a taxi driver that wants apples that will give the banana farmer a ride, so I can get my bananas.

Or we could just use money. Then I give money to the banana farmer, sell my apples to the taxi driver and the taxi driver charges the banana farmer. No requirement for a "gold standard" - the value of the dollar is what you can buy with it.

Tuesday, 14 August 2012

Using ISO 8601 Date on Ubuntu

Ubuntu ships with GNU's date version 8.13, which has an option --iso-8601. This is a great format for appending to logs. It is internationally unambiguous and english sorting order is the same as chronological order.

Unfortunately this option is not documented in Ubuntu's man page or info page for date.

The example output of "date --iso-8601=seconds" is
 

2012-08-14T20:40:55+1000


Alternatively with GNU date you can use "date +%FT%R:%S%z". 

Of course there is always the POSIX standard "date +%Y-%m-%dT%H:%M:%S%z"

Friday, 13 July 2012

e-tax 2012 on Mac and Linux FOI

Applicant Details


<removed>



Description of Documents

Access requested: Photocopies

This freedom of information request is for the complete source code of the e-tax 2012 computer program. Any encryption keys or passwords should be redacted.

Source code is defined as “...any collection of computer instructions (possibly with comments) written using some human-readable computer language...” [1]

An encryption key is defined as “...a piece of information (a parameter) that determines the functional output of a cryptographic algorithm or cipher.” [2]

A password is defined as “a secret word or string of characters that is used for authentication, to prove identity or gain access to a resource.” [3]



Background

The purpose of this freedom of information request is to improve interoperability between e-tax and non-Windows operating systems (such as Apple Mac OS X and Linux). There is no intention of modifying the e-tax software or interfacing directly to ATO servers.

Australia has one of the highest rates of tax agent usage in the world [4]. Enabling the 7-14% [5] of computer users who use a Mac or Linux to use etax would be helpful in lowering this figure.

In addition the tax commissioner announced in 2007 the ATO were developing a cross-platform version. "Looking even further ahead we will redevelop e-tax to make it compatible with any computer system that has internet access." [6] I am trying to help the Australian people and the ATO by doing this patch in my spare time.

UPDATE: e-tax 2012 on Mac and Linux FOI Part 2

References


  1. http://en.wikipedia.org/wiki/Source_code
  2. http://en.wikipedia.org/wiki/Encryption_key
  3. http://en.wikipedia.org/wiki/Password
  4. http://www.news.com.au/money/money-matters/most-australians-still-use-tax-agent/story-e6frfmd9-1225845045302
  5. http://en.wikipedia.org/wiki/Usage_share_of_operating_systems#Web_clients
  6. http://www.ato.gov.au/corporate/content.aspx?doc=/content/83847.htm

       

Thursday, 12 July 2012

Pillars of Social Justice

Universal healthcare is a fundamental pillar of social justice. If someone is too sick to work, then how can they obtain the money to pay for treatment, so they can get better, so they can work again? Without universal healthcare there is a catch-22 situation.

Similarly free or low-cost education is a critical pillar of social justice. I am talking about vocational training or practical training, as much as school or university. Again this prevents a catch-22 situation. If a job requires education and that education is expensive, then how is someone going to get that education? They need a job to get education to get a job.

The biggest other pillar of social justice is fair work conditions.This includes a fair day's pay for a fair day's work but also includes factors such as work safety, control and stability. Worker's compensation is particularly important: if the employer is making a few extra dollars here and there by unsafe working conditions, then it makes sense that the employer should pay if an employee is injured. This is the case even if the employer did not condone the unsafe activity.

Monday, 9 July 2012

Book Review - Tao Te Ching

I was a little disappointed in the translation of this book. I can see the brilliance that is in the original but it is burdened by a fairly unpoetic translation. The positive side is that this translation is very accessible. The introduction gave an example of an "academic" translation and Star's-style of translation. Although the academic translation was harder to read, it showed the poetry of the original much more accurately.

What I would like to read is an annotated version of the academic translation.


Title: Tao Te Ching
ISBN: 9781585426188
Author: Laozi. Translated by Jonathon Star
Rating: 3/5

Tuesday, 19 June 2012

Book Reviews - The Illiad and The Odyssey

The Illiad

The Illiad is a war epic set during the final year of the siege of Troy. Following the story of Hektor (fighting for the Trojans), with story threads of Achilles and Odysseus.

This story is the 3BC equivalent of an action movie. There is loads of hacking and slashing and kicking arse. If you like that kind of thing you may like this book.

The translation was easy to read and not pompous.

Title: The Illiad
Author: Homer. Edited by: Lattimore
ISBN: 9780226469409
Rating: 3/5

The Odyssey

Unlucky Odysseus is stuck away from home for ten long years after the end of the Trojan war. Meanwhile numerous ill-mannered, brutish suitors pursue Odysseus' wife, while Odysseus' nearly adult son is powerless to act. Finally Odysseus returns to kick some arse.

This is a story of Odysseus' cunning, wisdom and strength. His courage when even the gods seem against him.

The translation was clear, easy to read and not pompous.

Title: The Odyssey
Author: Homer. Edited by: Rieu
ISBN: 9780140449112
Rating: 4/5

Saturday, 2 June 2012

C++ vs Java vs Python

Whatever your job it is important to use the right tool, so the job can be done quickly and you can go home on time. For a software engineer no tool is more important than programming languages.

Which programming language to use frequently descends into something akin to a religious war. I will try to steer clear of this mode of argument. A programming language is simply a tool.

To declare any bias upfront - I am primarily a C++ programmer and I frequently also write Python. I have dabbled in Java but have not done a great deal with it.


Syntax Complexity


In terms of syntax complexity, I hate to say this as a C++ programmer, but C++ is far more complex than Python or Java. C++ has a grammar which is much more context sensitive than Python or Java. Part of the complexity of C++ is that it is really four programming languages in one: core C++, template metaprogramming, C and preprocessor.

I find Java slightly less complex than C++. There is no preprocessor, templates are very limited and obviously there is no C legacy.

In my experience Python has the simplest syntax. The amount of syntax I have to memorise and recall in Python is much smaller than Java or C++.

This is all personal opinion and impressions. You may believe me because I am a C++ programmer, yet I am saying that Python is best and Java is good. Can we have a more objective measure though?

What about looking at each language's full grammar in EBNF-like format? Python has a short specification of about 116 lines. In comparison a Java specification (see section 18, via stackoverflow) is about 545 lines long. Finally C++ comes in at 987 lines.

Although it is difficult to objectively measure a language syntax's complexity, these measures give some idea.

Libraries

Libraries can truly make or break a language. Libraries can paper over problems with the language itself and prevent reinventing the wheel.

Python has built-in object oriented support for dates, compression, retrieving web pages, sending and receiving email, manipulating paths, csv files, command line options, INI style configuration files, threading and more. A large number of third party libraries are available using easy_install.

Java does have built-in support dates, threading and path manipulation utilities. Apache Commons provides many of the features that are built-in to Python: compression, CSV reader, command line options and INI style configuration files. Apache HTTPClient provides a way to retrieve web pages. Although there is no central repository there are an enormous number of open source and commercial libraries available for Java.

C++ and Boost cover very few of these common use cases. Boost supports dates, path manipulation, command line options, INI style configuration file and threading. It is also possible to write a CSV reader in C++ using boost::tokenizer. Compression, retrieving web pages and sending & receiving emails are not supported.

C++11 moves some of the features from Boost into the language itself and there are third party libraries which fill some of these voids. C++ also integrates easily with C libraries, such as libcurl for retrieving web pages.

The advantage of using C libraries is that there are thousands of C libraries. The disadvantage of using C libraries is that you are back using procedural programming for that specific library, unless you wrap the libraries in an object oriented layer yourself. In addition the C libraries have no knowledge of exceptions, so may not clean up correctly if there is an exception.

Databases

Databases are critical for almost any back-end business application.

Java has by far the best native support. JDBC is a standardised interface and is widely supported by database vendors. A JDBC to ODBC bridge is included with the JDK. Others can be easily installed by adding the jar to the classpath.

Python is a bit more mixed. Python has a standardised interface, however it generally relies on third parties to write drivers for C based drivers. Most vendors have not provided Python drivers. Even an ODBC driver is not built-in. A number of drivers are available, most through easy_install. There are some duplicates of some drivers and it is not always easy for a newbie to determine which one is still being actively developed. For example there are six different ODBC drivers, two different MySQL drivers and nine different PostgreSQL drivers.

C++ support for databases is also a bit mixed. There is no support for databases in C++ or Boost. OTL supports accessing Oracle, ODBC and DB2-CLI from C++. Databases other than Oracle or DB2-CLI are only supported via ODBC.

Functional Programming

Wikipedia states that "In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data"

Python supports various aspects of functional programming. With the map() and reduce() functions. The itertools library is also included in later versions. Iterators, list comprehension and generator expressions are included in the language syntax and are faster than map() or reduce() in most cases.

Lambda functions are included in the language syntax. Lambda functions can be useful for "glue" logic: for example extracting the nth element from a list or a property from an object. However lambda functions are slow, like all python functions, limited and often not as clear as a separate function.

C++ STL includes template functions similar to python's map() such as  transform(). It is possible to pass an object with an operator(), so the function can be executed very efficiently as an inline function.

Boost supports lambda function programming using some complex template programming. When Boost.Lambda works it is very useful but when it stops working it can be difficult to debug.

The C++11 now supports lambda functions in the language syntax.

I have not had any experience with functional programming in Java but I should note that Hadoop, one of the first MapReduce frameworks was written in Java.



Consistency

Python is really rather good with consistency. Iterators are widely used and all iterators are consistent. There is one preferred way to do most things.

C++ is fairly consistent but there are some oddities. A number of those oddities are due to C++'s C heritage, particularly with respect to syntax. Others are simply design deficiencies: for example in the STL the fstream classes take C-style character strings, rather than C++ std::strings (this has been fixed in C++11).

Java is quite consistent with syntax and the libraries are quite consistent. However iterators are somewhat inconsistent. For example the CharacterIterators interface is very different to the Iterator interface.

Memory and Speed

In my experience C++ is the most frugal with memory. Python is not too far behind considering it is a dynamic language. Java is probably the least frugal with memory but if the program is written properly there is usually no problem.

Java and C++ aren't too far apart in terms of speed, although C++ seems a bit faster for some tasks. In comparison Python can be painfully slow for various types of processing. In the example linked a highly optimised python version took 4.55s but a naive Java version took 130ms. Projects such as pypy may improve the situation

All three languages have sufficient performance in terms of memory or speed that it would not be a top priority for most application. Other issues such as library support, existing codebase, database support, familiarity and developer time are higher priorities.

Conclusion

I am happy to use all three languages. I use C++ and Python most frequently. I haven't seen as many of the dark corners of Python and I am most familiar with C++.

Database access is really easy in Java, most of the code bases I work with are already in C++ and python is great for just hacking things together quickly while being able to actually read it later.

Wednesday, 16 May 2012

Brother QL-500 on Ubuntu 12.04

It looks like the newest Ubuntu 12.04 breaks the Brother QL-500 printer driver.

After a lot of fiddling, including trying to use Brother's official driver, I found a solution.

Based on this forum post I edited /etc/cups/ppd/QL-500.ppd, changing "rastertoptch" to  "/usr/lib/x86_64-linux-gnu/cups/filter/rastertoptch". This is slightly different to the change in the forum post, but it is the same idea.

Update: it appears that a recent update has moved rastertoptch to /usr/lib/cups/filter/rastertoptch

Monday, 2 April 2012

Book Review - The Theban Plays (Oedipus)

Well known to sniggering psychology students, Oedipus is the fictional king of Thebes who famously kills his father and marries his mother.

Oedipus spends his life trying to escape his fate. His true parents even cast him into the wilderness when he is a child to prevent his destiny. However destiny conspires against Oedipus and he cannot prevent his fate.

Oedipus is appalled by his own accidental actions and resigns himself to exile. His daughter Antigone accompanies Oedipus. Antigone's care and protection for her (now blind) father Oedipus shows that from dishonour and despair; honour may spring forth.


Title: The Theban plays : Oedipus the King, Oedipus at Colonus, Antigone
Author: Sophocles. Edited by: Lattimore, Grene
ISBN: 978-1-85715-093-3
Rating: 4/5

Tuesday, 20 March 2012

Book Review - Casino Royale, Live and Let Die, Moonraker

I read this trilogy after finding it at my local library. I thought it would be a bit of a daggy read, so I took it home.

I was impressed with the general quality of the writing. I was a little less impressed with the lack of political correctness.

There is some degree of misogyny and poor race relations (e.g. the chapter N****r Heaven in Live and Let Die). Having said that the presentation of woman in particular is much more positive and capable than most Bond movies.


Casino Royale

When a communist leader attempts to gamble himself and his organisation out of debt, the powers that be decide to send their best gambler. Of course their best gambler is Bond that we all know and love.

It is quite refreshing that the villains are quite happy to shoot our hero or beat him up, rather than selecting some over the top method of doing him in.

I was surprised how good this book was and it was not at all "over the top".

Rating: 4/5

Live and Let Die

Bond is out for revenge against SMERSH, so he is chasing a shadowy figure called Mr Big.

Although Mr Big does go for the slightly complicated method of dispatching Mr Bond it is somewhat justified - he doesn't want to leave a mess after all.

Rating: 3/5

Moonraker

Moonraker is a more typical Bond story. A mysterious multi-millionaire offers to build a ballistic missile on behalf of Great Britain - what could possibly go wrong?

From the strange, diabolical attempts on Bond's life to the incredible way he saves all Brittania and his own skin, this story is pure Bond.

Yes Moonraker is well written and exciting but it is also a little over the top.

Rating: 3/5


Title: Casino Royale, Live and Let Die, Moonraker
Author: Ian Fleming
ISBN: 9780141187419

Wednesday, 14 March 2012

Book Review - True Believers

True Believers is an accessible history of the Federal Parliamentary Labor Party, however the narrative is a little dull.

As a political tragic I found the book compelling, however True Believers is not particularly effective at presenting an interesting narrative. I believe this is due to the lack of linkage to the impact on Australian society. Most of the book is "Caucus this and Cabinet that". Perhaps an outsider would have been better at focusing on the Australian public's perspective.

The book The Great Crash by Sexton is proof that political history does not need to have a dull narrative.

Rating: 3/5

Title: True Believers: The Story of the Federal Parliamentary Labor Party
Author: Faulkner and Macintyre
ISBN: 9871865085272

Going Native 2012

I recently viewed some amazing videos from the Going Native 2012 conference. I would thoroughly recommend the videos for C++ developers on all platforms.

There is substantial coverage of the new C++11 features and clang. Even though this conference was sponsored by Microsoft the majority of the material is common to all platforms.

Specific videos I would recommend are:

If you have time I would also recommend the end of day round up: Interactive Panel: Ask Us Anything!

Update: the question  in Interactive Panel: Ask Us Anything! at 1:16 regarding tooling is very enlightening, particularly Carruth's (clang) answer at 1:20 Looks like Java-like analysis tools are coming through.

Wednesday, 29 February 2012

William's Train Story

This is a story I made up for William.

William, his sister and his mummy and daddy climbed out of the car. They were going to the show on the train.

William and his family walked from the car to the train station. William's daddy went to the ticket window to buy everyone a ticket.

William, his sister, his mummy and his daddy came down the steps to the platform. Everybody was waiting for the train. There was a screen that showed when the next train was coming.

William and his sister remembered to stay behind the yellow line and not run on the platform. Trains are very big and can be dangerous.

Finally the train arrived. William held mummy's hand and William's sister held daddy's hand. Getting on the train can be tricky, and there is a gap between the train and the platform where it is easy to fall down.

Now everyone was on the train. William and his sister looked out the window at the trees whooshing past. Sometimes the train would stop at a station to pick up more passengers going to the show.

William and his sister explored the train. William explored the top level and his sister explored the bottom level. They both met again at the other end of the carriage.

Eventually the train reached the show. William and his sister stepped off the train, holding their mummy's and daddy's hands. William, his sister, mummy and daddy climbed the stairs out of the station.

William's family met Summer, Will and their parents, then went into the show.

Tuesday, 28 February 2012

Rebecca and the Case of Too Many Butterflies

This was a story I made up for Rebecca.

It was Rebecca's birthday. Rebecca was blowing out the candles on her cake when she made a wish that she could see lots and lots of butterflies. Rebecca blew out all the candles on her cake.

Rebecca went to school with her brother and her mummy.

Later that day Rebecca returned home from school. When Rebecca's mummy opened the door the hallway was filled with butterflies. Rebecca looked in every room in the house: every floor, every wall, every ceiling and everything else was covered in butterflies!

Rebecca went to sit down on the couch, but there were butterflies on the couch!

Rebecca went to sit down on another seat, but there were butterflies on the seat.

Rebecca went to have a drink, but there were butterflies on the cup and butterflies on the juice. She tried to have something to eat, but there were butterflies on the bread and butterflies on the butter!

Rebecca decided to get ready for bed. She went to have a bath but the bath was full of butterflies. She went to brush her teeth, but there were butterflies on the toothbrush and butterflies on the toothpaste!

Rebecca decided to go straight to bed, without having a bath or brushing her teeth. But as soon as she went to her bedroom she saw that there were too many butterflies on her bed!

"There are too many butterflies," said Rebecca. So Rebecca opened the back door and said to the butterflies, "please butterflies could you go outside."

Rebecca held out her finger. Each butterfly landed on her finger and she gave it a kiss before it went outside.

Rebecca and the Butterflies

This is a short story I made up for Rebecca.

Rebecca and her mummy were on the way to school, when Rebecca saw a beautiful white butterfly. Rebecca and her mummy followed the beautiful white butterfly to the park. In the park there were lots of white butterflies. Rebecca took out her camera and took a photograph.

Rebecca and her mummy continued to walk to school. When Rebecca met her friends at school she showed them the photograph of the white butterflies.

Friday, 10 February 2012

Book Review - Company Man

Company Man



Company Man is an exciting thriller, which explores the moral ambiguity of the modern age. Nick, a CEO of a company in a rustbelt town, sacks half the workforce in order to save the rest. In the aftermath he shoots a stalker that he believes is coming for his family.

Choices are made. Layoffs or close the whole factory. Call the cops or clean up the body.

The alternating views of the police were also interesting. The cops were lazy slobs during the stalking phase, progressing to formidable opponents while covering up the shooting. Meanwhile Nick's own conscience was catching up with him.

The twist in the end was interesting. Although I had thought of the ending as a possibility, there were so many threads and possibilities it was not predictable.

Company Man held my interest throughout the whole book, was an exciting thriller and presented a few interesting moral choices, without judging the choice in itself - it simply presented  the consequences. Finder managed to make it possible to connect to most of the characters. In many ways all the characters were victims and all the characters were villains.



Rating: 4/5

Joseph Finder. Company Man
ISBN: 9780752868882