Scala Talks at AJUG

January 1, 2010 by dbenn

In 2009 I gave two talks to the Adelaide Java User Group about Scala, the functional object-oriented programming language for the JVM.

The first was an introductory look at Scala in which I:

  • talked about problems with the type systems of languages such as C++ and Python;
  • implemented a Prolog interpreter and compared it to a Python implementation on which it was based.

The second talk was about the Actor model (message passing style) of concurrency.

Here are zip archives containing code and slides for the introductory and actors talks.

The slides and code for both talks are also available from the file area of the ajug-adelaide-announce Yahoo group.

VStar development update

December 31, 2009 by dbenn

VStar development has continued since my August entry after returning from the first Citizen Sky workshop. For the last several weeks, the VStar Development Team has been been making weekly releases that are available via WebStart (TM) from the Citizen Sky VStar Team page (see “Download VStar Now” button).

See also the SourceForge site for more information regarding ongoing activities.

My main focus is still upon code and unit test. Phase plots can be created but further integration with all views is required. This has most of my attention at the moment but numerous other bugs and improvements have also been addressed (see bug and feature tracker).

The plan for the early New Year is to bring phase 1 to an end and move on to period analysis and other functionality.

This and other matters were discussed during the annual AAVSO meeting in Boston in November into which I Skyped for a VStar session. Sara Beck, Michael Umbricht, Grant Foster (developer of the original VStar), and from photometrica.org, Geir Klingenberg and Michael Kran. The possibility of adding photometrica as another data source to VStar was discussed. Grant shared his ideas regarding period analysis algorithms. Michael Umbricht also gave a presentation about VStar to AAVSO meeting attendees.

A  relatively recent development is that along with AAVSO staff members and Michael Umbricht, I’m an author on a poster paper to be presented by Arne Henden at the January meeting of the American Astronomical Society: “Statistical Software Development as an Example of a Citizen Sky Participant Team”.

In February 2010, I will be giving a talk to the Astronomical Society of South Australia about VStar, Citizen Sky, and Epslion Aurigae.

I would again like to acknowledge the ongoing assistance of Sara Beck, Michael Umbricht, Adam Weber, others at AAVSO and Citizen Sky participants who are using VStar.

All the best for the New Year.

CitizenSky Workshop and VStar Software

August 21, 2009 by dbenn

I attended the CitizenSky Workshop at Adler Planetarium in Chicago from August 5th to 7th 2009. CitizenSky is a collaboration between the American Association of Variable Star Observers (AAVSO), amateur astronomers (or “volunteer astronomers”, as one participant suggested) like myself, professional astronomers, and educators to encourage more of the general public to get involved in Science, to become “Citizen Scientists”.

The focus of the workshop was to communicate the fundamentals of variable stars and the observation of such objects (and of one star system in particular) to participants who could then take what they had learned back to their local schools, astronomical societies and other groups. The particular star of interest is Epsilon Aurigae, a strange variable star system that undergoes an eclipse every 27 years that lasts for about a year and a half. You can find out more about Epsilon Aurigae and the ongoing campaign to study the imminent next eclipse from the CitizenSky website.

It’s not an ideal object from South Australia. In mid-December it will be about 11 degrees above the northern horizon in the late evening, and that’s about as high as it gets from Adelaide. Use a program like Stellarium to determine its visibility from your location, e.g.

Epsilon Aurigae (circled) from Adelaide, South Australia, 19 Dec 2009 at 10:30pm
Epsilon Aurigae (circled) from Adelaide, South Australia, 19 Dec 2009 at 10:30pm CDT

On the last day of the workshop I demonstrated the latest revision of VStar, an open source, multi-platform (courtesy of the Java programming language) variable star data analysis application I’ve been developing since early May this year. This software is intended to be an easy-to-use variable star data visualization and analysis tool. The initial motivator for VStar is the CitizenSky project.

It all started as the result of a conversation I had with Arne Henden, Director of the AAVSO at the 2008 National Australian Convention of Amateur Astronomers (NACAA) in Sydney. I asked him the same kind of question I ask most astronomers I get the chance to talk with: is there any astronomical software you need developed? I have developed free software (e.g. ACE BasicPICCLIBothers) since 1991, but for a long time I had been looking for a way to apply my software development experience to benefit of the Scientific Community in my spare time. On the one hand I have an interesting and challenging software engineering day job, while on the other, I have a need to do something more than just contribute to a company’s bottom-line.

Arne said that they wanted to do a Java version of an old Visual Basic tool called VStar. This tool is referenced in AAVSO’s online tutorial material, but AAVSO wanted to replace it with a newer version that could be targeted at multiple platforms, not just Windows, in addition to adding new functionality.

Arne, Aaron Price and I corresponded after NACAA and talked about a number of projects including VStar. Initially AAVSO made the decision to develop VStar internally, but several months ago, we started corresponding again and I took it on as a volunteer effort. AAVSO provided Sara Beck as liason, and for the last few months, VStar has consumed my spare time and lead me to appreciate the benefits of energy drinks. I’ve communicated often with several other AAVSO staff and they’re a friendly and encouraging crew, in particular, apart from Sara, Arne, and Aaron: Richard ‘Doc’ Kinne, Matthew Templeton, Rebecca Turner, and Elizabeth Waagen.

VStar is still very much a work in progress but is being implemented in phases starting with basic features such as:

  • input from a the AAVSO International Database, AAVSO download and simple file formats;
  • light curve and mean plots;
  • individual observation inspection;
  • printing, saving.

Much of the above exists and is usable now. There’s a bug list in the project SourceForge tracker that I’m working on currently.

Next will come phase plots, period analysis algorithms, and the intent is to have a plugin architecture so that new algorithms can be added by anyone. Full functionality should be available by around March next year in time for another Citizen Sky workshop at which analysis of data on Epsilon Aurigae will be the focus.

There are no formal releases yet (since VStar is not mature enough yet), but you can download the “bleeding edge” trunk of VStar anytime, or you can download more stable tagged versions. Here are some download options:

To download the latest Vstar archive (tarball):

  1. http://vstar.svn.sourceforge.net/viewvc/vstar/trunk/
  2. Click “Download GNU tarball”

To download the latest VStar via Subversion, issue this command from a shell or DOS prompt, or use a graphical Subversion tool such as TortoiseSVN.

  • svn co https://vstar.svn.sourceforge.net/svnroot/vstar/trunk vstar

To download a specific frozen (or “tagged”) version such as DEV-17Aug2009 (a post CitizenSky workshop version, before new major changes), use a command like this:

  • svn co https://vstar.svn.sourceforge.net/svnroot/vstar/tags/DEV-17Aug2009 vstar

In each case, the top-level ReadMe.txt file tells you what additional Java libraries to download, where to get them from, and where to put them. I would like to include these on the SourceForge site as part of the download, but we’re still trying to determine the legality of that for each library.

Then it’s just a matter of running a batch file or shell script as described in the ReadMe file.

Ultimately VStar will also be available as a Web Start ™ application on the AAVSO web site. Parts of it may also be used as Java applets on the AAVSO web site.

There is plenty left to do. Testers are always needed, so feel free to help out with that. Michael Umbricht, another CitizenSky participant has done a lot on that front already. He is also keen to improve the currently sparse documentation and write tutorial material. Please let us know if you would like to help with testing, proof reading, or if you would like to get involved in some other VStar development activity.

I look forward to the next several months of VStar development!

Programming Quotes

May 19, 2009 by dbenn

Adam Pope recently wrote about Classic Programming Quotes. This reminded me that I’ve collected quotes on this page for several years. Lambda the Ultimate also has a quotes section.

Here are some of my favourites:

If one character, one pause, of the incantation is not strictly in proper form, the magic doesn’t work. Human beings are not accustomed to being perfect, and few areas of human activity demand it. Adjustment to the requirement for perfection is, I think, the most difficult part of learning to program. (Frederick Brooks)

You think you know when you learn, are more sure when you can write, even more when you can teach, but certain when you can program. (Alan Perlis)

Increasingly, people seem to misinterpret complexity as sophistication, which is baffling – the incomprehensible should cause suspicion rather than admiration. 
(Niklaus Wirth)

APL is a write-only language. I can write programs in APL, but I can’t read any of them. (Roy Keir)

What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? (Larry Wall)

Beware of bugs in the above code; I have only proved it correct, not tried it. 
(Donald Knuth)

Any code of your own that you haven’t looked at for six or more months, might as well have been written by someone else. (Eagleson is an optimist, the real number is more like three weeks.)

Niklaus Wirth has lamented that, whereas Europeans pronounce his name correctly (Ni-klows Virt), Americans invariably mangle it into (Nick-les Worth). Which is to say that Europeans call him by name, but Americans call him by value.

Real programmers don’t comment their code. It was hard to write, it should be hard to understand.

A LISP programmer knows the value of everything, but the cost of nothing.

Old programmers never die. They just branch to a new address.

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. (Kernighan)

I saw `cout’ being shifted “Hello world” times to the left and stopped right there. (Steve Gonedes)

Programming is understanding. (Kristen Nygaard)

Computing Science is no more about computers than astronomy is about telescopes. (Edsger Dijkstra)

 


Lisp’s 50th birthday

October 29, 2008 by dbenn

John McCarthy’s Lisp programming language —is 50 years old (October 2008). Lisp is the second oldest programming language still in use today, next to Fortran.

John McCarthy

John McCarthy

Lisp50 at OOPSLA 2008 celebrated Lisp’s contributions.

I celebrated by giving a talk to the Australian Java User Group in Adelaide about Clojure, a new dialect of Lisp for the JVM.

There’s a lot of interesting material to be found by Googling, but here are a few relevant links:

A decade ago I developed LittleLisp for the ill-fated Newton PDA.

There’s a nice parody song called The Eternal Flame which is all about Lisp, and here’s some amusing xkcd Lisp cartoons:
Lisp still looms large:
  • in Emacs as e-lisp;
  • it has mature free implementations (e.g. take a look at PLT Scheme);
  • and active commercial implementations (e.g. the LispWorks mailing list is very active).
Lisp refuses to lay down and die. In his 1979 History of Lisp paper John McCarthy said:

One can even conjecture that LISP owes its survival specifically to the fact that its programs are lists, which everyone, including me, has regarded as a disadvantage. 

In ANSI Common Lisp, Paul Graham points out that Lisp has always put its evolution into the hands of its programmers, and that this is why it survives, especially via the macro systems as found in some dialects (e.g. Common Lisp, Clojure), which make the full power of the language available to generate Lisp code at compile time.

Irrespective of how widely used Lisp dialects are today, we should continue to remember its contributions to programming: code as data, higher order functions, application of functions to the elements of a list, an emphasis upon recursive solutions to problems, erasure of abandoned data (garbage collection), the Read-Eval-Print Loop (REPL), to name a few.

As for the future, it’s always uncertain. Here are some notes about the future of Lisp from the OOPSLA Lisp50 session, which suggests that Clojure may be a big part of that. Next year’s International Lisp Conference has the working title “Lisp: The Next 50 Years”. 
 
I’ll end with a quote from Edsger Dijkstra:

—Lisp has jokingly been called “the most intelligent way to misuse a computer”. I think that description is a great compliment because it transmits the full flavor of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts.

Abandoning Infantile Beliefs

September 18, 2008 by dbenn

Paul Davies made this comment during a radio interview, with which I wholeheartedly agree:

…one should abandon infantile beliefs based on Sunday school stories and embrace the scientific path which reveals a universe which is even more wonderful than you can imagine and a source of inspiration.

Replacing an iPod Nano’s battery

July 24, 2008 by dbenn

I bought a first generation iPod Nano more than 2 years ago. I use it every work day (see also http://dbenn.wordpress.com/2006/08/27/astronomy-science-podcasts/), but the battery has been on the way out over the last few months. In the end it was holding charge for less than an hour, irrespective of charge time, often dying before my walking trip was over.

Getting it replaced through official channels would’ve cost in excess of AUD $100, about a 3rd of the device’s original cost. So instead, I spent AUD $20 on an iPod replacement battery kit from JayCar (I’ve seen them advertised elsewhere on the web too).

It came with the 3.7V Li-ion Polymer battery (400mAh instead of the original 340mAh), two plastic tools to pry the case open, and a brief but effective instruction sheet.

The most painful part was getting the case open. The plastic tools from the kit only get you so far and I pretty much wrecked mine. My wife Karen and I took turns carefully prying open different sections of the case with a small flat blade jeweller’s screwdriver (not suggested by the instruction sheet, but effective nonetheless), in addition to using the plastic tools.

Once the back of the case was off, the battery was easily removed, and I used a fine-tipped soldering iron to remove the three wires from the PCB, and fine solder to connect the new battery’s wires in place before putting the case back together.

I replaced the battery on the weekend and didn’t have to charge it again until 3 days later. Hopefully this will make my Nano last another 2 or 3 years, by which time it will probably be time for an iPod upgrade. It won’t owe me anything by then, that’s for sure.

Now, all I have to do is stop breaking earphones.

A War, a Grandfather, and a Great Uncle

April 25, 2008 by dbenn

Once again, ANZAC Day is here, a day on which we recall those who in far too many cases died fighting someone else’s battle.

My grandfather, James Melville, fought during WWI in Egypt, Gallipoli, and France. He always struck me as a proud, meticulous man. After the war he worked in several jobs, including on trains in outback Australia. As a child I loved his Scottish accent. I wish I had known him better, talked with him more, not seen him as so “other”. I’ve been a pall bearer for two people: my Grandfather and my Mother, who died 16 years apart.

My Great Uncle, Frank Jagger, served in the German army in that same war. I recall a family member years ago remarking that he and my Grandfather may have been in fighting in the same area of France during the war. I don’t know if this was actually the case or mere speculation, but it probably happened to some. Uncle Frank stayed with us for a short while in the late 70s. He was a real character. After he returned to Germany, I used to help translate his increasingly German letters to my family. He too is gone now.

The saying goes: “Lest We Forget”. Indeed. But please please please, Let Us Not Glorify. War is a terrible thing, something I hope my kids never have to participate in. As Skyhooks put it so well in the 70s: “Horror movie right there on my TV, shockin’ me right out of my brain.”

Those who romanticise war haven’t seen enough death. If you watch a movie like Saving Private Ryan and don’t feel viscerally offended, then the world we’ve constructed has succeeded in numbing you. Anyone who has seen dead people and terrible injury up close and personal (I was a nurse before I was a programmer) understands that War cannot be a clean thing any more than car accidents or cancer. The best way to honour the War Dead is to Just Stop It. Just Get Along. Life’s too short to do otherwise, and as a species we take ourselves way to seriously. We need to get over ourselves and just get on with Living and Learning. There’s no salvation, no Higher Purpose. It’s just Us. Carpe Diem.

Another saying goes: “No Fate But What we Make” (Terminator 2). The only thing we are not free to choose is our freedom to choose (Sartre). Yeah, we’re stuck with one other and we had better make the best of it. As Carl Sagan said “We make our world significant by the courage of our questions and the depth of our answers.” Providing the answer “War” to any question just doesn’t qualify.

 

NACAA 2008 Impressions

April 6, 2008 by dbenn
What impresses me about The National Australian Convention of Amateur Astronomers (NACAA) is that it demonstrates how much can be achieved with sufficient motivation and relatively few resources.
NACAA is convened every 2 years. I attended first in 2002 when it was held in Adelaide. In 2004 my family came with me to Hobart, and in 2006 to Frankston. This year the event was held in Penrith,  Sydney.
Some of the highlights this year from my perspective were:
  • “Probing Pluto’s Atmosphere with a 10 inch Telescope” by Dave Gault. Along with others in Australia (including Blair Lade at Stockport) and New Zealand, Dave’s observations yielded a light curve from which Pluto’s atmosphere — with a pressure measuring in microbars — could be discerned, using only a 10″ SCT and Meade DSI imager.
  • A workshop on light curve analysis using data from automated surveys to look for contact binary star systems. Surjit Wadhwa who ran this excellent workshop also won the best paper award for his work and peer reviewed publications over several years, revealing previously unknown contact binary star systems.
  • Ragbir Bhathal’s “45 Years of SETI”, including an overview of recent optical SETI developments. Whether or not you think that SETI is ever likely to lead to positive results, the technology involved is interesting and potentially useful elsewhere. Not to mention the philosophical questions it prompts us to ponder.
  • Encouraging words from Arne Henden, Director of the American Association of Variable Star observers, about being an amateur scientist in the 21st Century.
  • Entertaining talks such as: giving astronomy lectures on the final voyage of the QE2 (by Ray Johnston), the current state of planetaria worldwide (by Martin George), and examining the possibility that Australian Aboriginals were the world’s first astronomers (by Ray Norris).
  • Useful and interesting ad-hoc conversations during breaks and in the corridor.
There were workshops and sessions to suit a wide variety of interests. You can read more about NACAA 2008 here: http://nacaa.org.au/2008/
In short, a very worthwhile event. I plan to be in Canberra for NACAA 2010.

If the bible is literally true then π is 3 and my odometer is wrong

March 29, 2008 by dbenn

“What is not possible is not to choose.” (Jean-Paul Sartre)

Consider the following:

  • “He made the Sea of cast metal, circular in shape, measuring ten cubits from rim to rim and five cubits high. It took a line of thirty cubits to measure around it.” (1 Kings 7:23). See also 2 Chronicles 4:2.
  • π is the ratio of the circumference (30 cubits) of a circle and its diameter (10 cubits).
  • ∴ π is 3.

Either the bible is literally true, and π is represented as the ratio of the two integers 30 and 10, or π is irrational with a value of around 3.1415926. We recently set up new odometers on our bikes. The manual for the device instructs the user to multiply the diameter of the bike’s wheel by 3.14, yielding the wheel’s circumference. So, for a 700 mm wheel, that’s about 2198 mm for a π of 3.14 and 2199 mm for a π of 3.1415926. But what if π is 3? That circumference becomes 2100 mm.

Now, for say 50 revolutions of the wheel:

  • for a circumference of 2.199 meters we have 109.95 meters (if π is 3.1415926);
  • for a circumference of 2.198 we have a 109.9 meters (if π is 3.14);
  • for a circumference of 2.1, we have 105 meters (if π is 3).

If π is 3, the wheel traverses almost 5 meters less. So is π 3?

Choose

Read more about the π saga than you probably want to in this Gospel of Reason blog entry and follow-up comments.

“It makes sense to revere the sun and stars, for we are their children.” (Carl Sagan)

Consider the following:

  • The world was made by God in 6 days (see Genesis), including all living things.
  • Massive stars exist for millions of years before exploding as supernovae, the only known means by which elements heavier than iron are created.
  • Our bodies contain elements heavier than iron, e.g. iodine.

Either the bible is literally true and the world and us (including heavier-than-iron elements) were really created in 6 days, or the universe really is old.

Choose

“What is not possible is not to choose.” (Jean-Paul Sartre)