Archive for the ‘Programming’ Category

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.

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.

Kierkegaard and Stroustrup

December 15, 2006

This Lambda the Ultimate post pointed to an interview with the creator of the C++ programming language Bjarne Stroustrup in which he says he was influenced by the 19th century philosopher Soren Kierkegaard. It immediately reminded me of a Kierkegaard quote to which I find myself drawn over and over:

What I need to make up my mind about is what I must do, not what I must know, except insofar as knowledge must precede every action…The vital thing is to find a truth which is truth for me, to find the idea for which I can live and die. Of what use would it be for me to discover a so-called objective truth…if it had no deeper significance for me and my life? (Soren Kierekgaard)

I am still very much in search of this “idea”. I first saw this quote on Julia Watkin’s University of Tasmania website. During the brief time that I knew her, I enjoyed talking with Julia about philosophy and other subjects. Sadly, Julia is no longer with us. I wonder what she would have had to say about Stroustrup’s interview comments re: Kierkegaard?

I went back to Stroustrup’s book, The Design and Evolution of C++ (Addison-Wesley, 1994) to see what he had originally said about Kierkegaard. Here are the relevant excerpts (page 23):

I have a lot of sympathy for the student Euclid reputedly had evicted for asking, “But what is mathematics for?” Similarly, my interest in computers and programming languages is fundamentally pragmatic.

I feel most at home with the empiricists rather than with the idealists…That is, I tend to prefer Aristotle to Plato, Hume to Descartes, and shake my head sadly over Pascal. I find comprehensive “systems” like those of Plato and Kant fascinating, yet fundamentally unsatisfying in that they appear to me dangerously remote from everyday experiences and the essential peculiarities of individuals.

I find Kierkegaard’s almost fanatical concern for the individual and keen psychological insights much more appealing than the grandiose schemes and concern for humanity in the abstract of Hegel or Marx. Respect for groups that doesn’t include respect for individuals of those groups isn’t respect at all. Many C++ design decisions have their roots in my dislike for forcing people to do things in some particular way. In history, some of the worst disasters have been caused by idealists trying to force people into “doing what is good for them.” Such idealism not only leads to suffering among its innocent victims, but also to delusion and corruption of the idealists applying the force. I also find idealists prone to ignore experience and experiment that inconveniently clashes with dogma or theory. Where ideals clash and sometimes even when pundits seem to agree, I prefer to provide support that gives the programmer a choice.

In Julia Watkin’s book Kierkegaard (Geoffrey Chapman, 1997, pages 107-108), she had this to say:

In his use of the Socratic method, Kierkegaard strove to keep his own view to himself through the use of pseudonyms, acting as an “occasion” for people’s discovery and self-discovery instead of setting himself up as a teaching authority or arguing the rightness of his own ideas. I would urge that it is this feature of Kierkegaard’s writing that makes him especially effective in a time when two main tendencies seem to be especially dominant – a pluralism that accepts the validity of all views but stands by the correctness of no particular view of the universe, and a scientific or religious fundamentalism that is rigidly exclusive of views other than its own. Kierkegaard avoids the pitfalls of both trends, and he also does something else; he makes room for truth, both intellectual and existential, through encouraging people to be open-minded, to be aware of the spiritual dimension of existence, and to venture in life as well as in thought.

Although Stroustrup remarked in the interview referred to above that he is “…not particularly fond of Kierkegaard’s religious philosophy”, there is some resonance between his comments and Julia’s analysis.

Embedded Java: Down to the metal

October 18, 2006

In September 2004 I gave a talk to the Adelaide Java User Group (http://ajug.org.au/display/AJUG/AjugAdlMeeting20040920) entitled Embedded Java: Down to the Metal at which I talked about:

The TINI is Java 1.1.6 compatible with respect to the language and libraries, while the Javelin Stamp implements a smaller subset of Java with some deviations (e.g. ints are really shorts, no interfaces, no GC).

At that JUG meeting I demonstrated the Javelin Stamp displaying the temperature from a DS1620 IC on an array of 7-segment LEDs and dumping to System.out, which on the Stamp is a serial port.I mostly use the Javelin Stamp to prototype an application with unfamiliar hardware due to its easy serial-port based progamming and source-level debugging, and because I can write OO code for similar yet slightly different devices (e.g. for 7-segment LED displays that are direct pin to pin, via BCD-to-7-segment IC, or via serial-to-parallel-to-7-segment IC), varying driver code implementation while keeping the interface fixed. It also comes with a nice assortment of Java library code for exploiting the Stamp’s hardware features.

I wasn’t quite ready to demonstrate the DS TINI during the JUG meeting, but have experimented further since. The TINI, like the Javelin Stamp has serial I/O, but in addition, physical interfaces for Ethernet, CAN bus, I2C, DS 1-wire, and iButton. It comes with a similarly rich set of Java libraries (along with the many of the standard Java 1.1.6 libraries including collections and network I/O) for working with its capabilities.

Here’s a link to a simple PLT Scheme (http://www.plt-scheme.org/) servlet (currently unavailable, Jan 2008) that connects to a Java server running on a DS TINI in my home with a DS18S20 temperature IC connected to its 1-wire adapter:

  

http://www.kepler.podzone.net:8080/servlets/david/get_tini_temp.ss 

The TINI is suitable for more ambitious yet relatively resource-low projects. If you want to see even more resource-constrained Java, check out JavaCard for smartcards. I worked on a team that developed a JavaCard VM for a smartcard development and test tool in the late ’90s.Here’s an embedded.com article about some alternatives to C for embedded system development: Java and Ada.

So folks, Java is not just for the desktop or web/Enterprise, but also for the embedded space.

About “Strange Quark’s”…

August 26, 2006

Thanks for visiting Strange Quark’s. In this first post I’ll tell you what I intend to write about and why I chose that name. In the late 80s I ran a “service” called Quark’s Cosmos on Australia’s Viatel, later called Discovery 40, pretty much the same as the UK Prestel (40 column teletext-style) system. The content of Quark’s Cosmos was focused upon astronomical and space mission news.

It was pre-Internet, so news items were distilled from traditional media along with regular snail mail from space agencies such as NASA, ESA, and occasionally NASDA (Japan) and the agencies of other countries such as Russian and India.

A highlight was that I was able to use the forum to provide up-to-date information about Neptune as seen through Voyager 2’s eyes in 1989 because of previous communications with the Tidbinbilla Deep Space Tracking Network near Canberra.

Quark’s Cosmos also had chat boards for these topics plus Sci-Fi and Philosophy along with running the odd astronomical quiz complete with prizes (books usually). Running Quark’s Cosmos was a labour of love and actually cost my wife and I money. Nevertheless, it was fun, rewarding, and appreciated by a lot of people.

With the advent of the Internet, Viatel and Quark’s Cosmos became less compelling. Competing with the richness of the Net became a zero sum game.

Much has changed in the last 20 years, but from a content and presentation perspective, systems like Viatel 40/Discovery and CompuServe were the ancestors of most of what we see on the Internet today. Long before Internet banking was available, Viatel had it for at least one large Australian bank. IRC, ICQ, blogs, all had some counterpart on these systems. The main difference is that the Internet is unbounded, unlike these older systems (and bulletin boards) hence the need for search engines.

I’ve been considering a blog for ages, and wanted to retain the “Quark” theme, but since I and the world in general are stranger than almost 20 years ago, Strange Quark’s place/blog seemed appropriate.

The main topics of interest to me these days are:

  1. Programming paradigms and languages
  2. Low-resource microcontrollers such as PIC, TI MSP430, AVR, 8051
  3. Amateur astronomy (generally sharing the night sky with others, planetary nebulae, the life & work of Johannes Kepler)
  4. Science Fiction books and movies
  5. Philosophy (in particular the Philosophy of Mind)

So, these are the topics I’ll mostly talk about. Anything else will be under clearly different categories. I’m doing this not because blogging is trendy but because I need a writing outlet, and believe I have some worthwhile things to share with others.

Finally, here’s a bit more general background about me:

  • I’m married (I mentioned Karen above) with a 6 year old son Nicholas and a 2 year old girl Heather.
  • I’m a professional developer having worked for Motorola, Freescale, the University of Tasmania, and ISPs (Vision Internet and Internode). Prior to that I was a nurse for the better part of a decade.
  • Several years ago I developed and released the ACE Basic compiler (Amiga) and LittleLisp interpreter (Apple Newton).

My long-standing and slightly antiquated website is at:

http://www.users.on.net/~dbenn

My email address is dbenn@computer.org

Stay tuned for more posts on topics such as:

  • Astronomy and Science podcasts
  • Web-based astronomy software under development
  • Java-based embedded systems
  • TI MSP430F20xx and PIC microcontrollers and rapid development
  • Reflections on personal loss (the odd one out, but something I need to write about).

That’s enough for a first post.