Archive for the ‘Programming’ Category

Second Citizen Sky Workshop and ASV Talk

September 12, 2010

From September 2nd to 5th I participated in the second Citizen Sky workshop in San Francisco, attended by a mix of professional astronomers, amateur astronomers, and Science educators. The event was held at the California Academy of Sciences (CAS) in Golden Gate Park.

On the way back home I gave a talk about Citizen Sky and VStar to the Astronomical Society of Victoria as part of the yearly ASSA/ASV speaker exchange. I was made to feel welcome by members of the ASV, some of whom took me out to dinner prior to the meeting. I appreciated the opportunity to give this talk, which seems to have been been well received.

The San Francisco workshop was packed with sessions but we had two hour lunch breaks encouraging lots of interaction between participants.

I gave two talks: a practical VStar session and a summary of the VStar Team’s activities. The team gained a few new members during the workshop. See the VStar Team page for more details.

There was plenty of interest and discussion regarding VStar throughout the workshop with a couple of professional astronomers and a new data analysis group (formed during the workshop) planning to make use of the tool for specific projects.

Some Citizen Sky participants adopting the VStar pose after the last session (courtesy Joan Chamberlin, pictured 2nd from left next to the author).

Some Citizen Sky participants adopting the VStar Pose after the last session. Courtesy Joan Chamberlin, pictured to the left of the author.

Use of VStar by a participant with a European locale revealed an important class of bugs that needs to be fixed relating to numeric input when VStar is used on machines configured with non-English locales. It’s something I knew I had to address, but being presented with it by a user has raised its priority in the SourceForge tracker.

The workshop agenda was diverse and, apart from the sessions mentioned above, included topics such as:

  • Update on the status of the Epsilon Aurigae eclipse
  • Disks in astrophysical objects
  • Evolutionary status of the binary based upon recent measurements
  • Analysis of Epsilon Aurigae spectrum monitoring by a college (San Mateo) student team
  • Precision, accuracy, and uncertainty in data
  • Light curves of different types of variable stars
  • Basic and intermediate time series data analysis
  • Choosing topics for Scientific investigation
  • Scientific paper writing

All sessions were captured on video, and will be made available, along with the accompanying slides, on the Citizen Sky website.

One of the CAS roof-top garden domes.

One of the CAS roof-top garden domes.

Participants had the opportunity to see two shows in the CAS Morrison Planetarium, in addition to the premiere of the Citizen Sky planetarium trailer.

Morrison planetarium dome

Morrison Planetarium dome

I also had a bit of time to look around San Francisco and was fortunate to see the Golden Gate Bridge when it was clear of fog. Joan Chamberlin (leader of the Southern Gems Team) and I took a walk on the bridge and had wonderful views of the Bay.

David on the Golden Gate Bridge, September 2010

Author on the Golden Gate Bridge

Attendance at the second Citizen Sky workshop came after months of VStar development in my spare time. It was great to get together again with people I’d met at the first workshop in Chicago last year, as well as getting to know new people.

Dinner out after the last day of the workshop

Dinner out after the last day of the workshop

Other than catching up on sleep, there is still plenty of work remaining to further improve and extend VStar and to apply it to data analysis activities emerging from the second Citizen Sky workshop.

Apart from the palpable general sense of camaraderie, a participant named Bob Miller captured the spirit of those assembled at Citizen Sky via the debut of his song We are the stars, a video of which was played just before lunch on the second day of the workshop.

Bob Miller at Citizen Sky 2

Bob Miller at Citizen Sky 2

Other than catching up on sleep, there is still plenty of work remaining to further improve and extend VStar and to apply it to data analysis activities emerging from the second Citizen Sky workshop.

If you are in the least bit interested, I would suggest monitoring the Recent Posts section of the Citizen Sky site, and of course, feel free to ask me for more information.

I want to say a big thanks to Rebecca Turner, Aaron Price, and AAVSO in general for organising the workshop. It was awesome.

Explaining how computers work with the TEC-1

May 30, 2010

I was recently asked to give a talk to my son’s primary school class about how computers work.

The Powerpoint slides from the talk consist mostly of pictures and towards the end, a small Z80 machine code program (to add a number to itself) for the TEC-1 single board computer.

TEC-1 image from Issue 10 of Talking Electronics Magazine

TEC-1 from Issue 10 of Talking Electronics Magazine cover

My wife and I created a short video showing the program being entered and executed multiple times via the TEC-1’s hex keypad.

As I told the kids during that talk, if you want to understand how a computer really works, you need to get close to the machine-level and talk about processors, memory, buses and so on. So we did, and despite leaving out a lot of details, I think the idea of going from X = X+X to a sequence of simple instructions and a numeric representation palatable to a Z80 made some sense to many of the kids, and at least provided a source of fascination to most. Apart from that, I think it was fun.

We also spent a lot of time talking about the extent to which computers now pervade our lives and how much we take that and the people whose ideas and work made it all possible for granted, including Babbage and Lovelace, Leibniz, Boole, Turing, and so many hardware and software pioneers.

Like many hobbyists in the 70s, 80s and beyond, the idea of building a simple computer from components in a kit was alluring. I’ve been doing paid software development for almost 30 years but was a hobbyist for more than a decade or more before that. I was introduced to the Joy of Computing in Year 10 due to the purchase of a PDP-11/04 by my school (Norwood High in Adelaide) in the late 70s. Along with a love of astronomy that continues to this day, I maintained an interest in programming throughout the 80s, during which time I was a nurse. I eventually decided to convert one of my hobbies into a profession, but still maintain the attitude of a hobbyist, developing open source software such as my current project: VStar.

My hope is that I’ve instilled in at least some of those kids a hunger to know more about computers and programming.

Scala Talks at AJUG

January 1, 2010

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

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

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

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

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.

Replacing an iPod Nano’s battery

July 24, 2008

I bought a first generation iPod Nano more than 2 years ago. I use it every work day (see also https://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.

PIC C Library on Sourceforge

May 8, 2007

My PIC C library is now on Sourceforge. I’ve developed and used this library for my own projects in conjunction with the Hi-Tech PICC Lite compiler on and off for a few years now. It’s been sitting on my laptop for personal use, and I thought it was time to make it available for others to use.

Making picclib available is my first experience of Sourceforge, and a fairly pleasant one. The documentation is quite reasonable, although it helps to have some background with Unix, ssh, CVS/Subversion etc. I chose Subversion as I’ve been using it for my own projects for awhile now.

There’s plenty of Sourceforge features yet to explore. I’ll certainly use it for future projects.

On the importance of pure research

January 14, 2007

I recently finished reading the book Engines of Logic (2000) by Martin Davis (apparently published as The Universal Computer in some countries) of Davis-Putnam SAT-solver algorithm fame, a book about the origins of computer science from the viewpoint of the mathematicians who founded it, in particular: Leibniz, Boole, Frege, Cantor, Hilbert, Godel and Turing.

Leibniz had the notion that it ought to be possible to be able to write down ideas in a language (he called this a universal characteristic) such that “serious men of good will” could sit together to solve some problem by calculation using an algebra of logic he referred to as the calculus ratiocinator.

Despite attempts at such a language and algebra of logic by Leibniz, it was ultimately the work of his successors that gave rise to the logic that made automated computation possible.

Of Leibniz’s work Davis said that “What Leibniz has left us is his dream, but even this dream can fill us with admiration for the power of human speculative thought and serve as a yardstick for judging later developments.”

In the epilogue, Davis had this to say:

The Dukes of Hanover thought they knew what Leibniz should be doing with his time: working on their family history. Too often today, those who provide scientists with the resources necessary for their lives and work try to steer them in directions deemed most likely to provide quick results. This is not only likely to be futile in the short run, but more importantly, by discouraging investigations with no obvious immediate payoff, it shortchanges the future.

These days, universities and it seems, too many aspects of society are becoming shackled to the oft-times short sighted and petty expectations of business, as if it mattered as an end in itself. We would do well to pay attention to history.

On the subject of history, it occurs to me increasingly that most of what we study is in fact historical in nature. Incremental advances in computer science, software engineering,  astronomy, and Science in general are mere blips on the vast landscape of accumulated knowledge. When I read books such as Engines of Logic and The Art of Electronics, I am overwhelmed by the contributions of countless scientists and engineers over decades, to say nothing of the work of the founders of Science such as Copernicus, Galileo, Kepler, Newton, and Einstein.