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