Creating the AstroCalc

My requirements: Being able to do astronomical calculations while observing through my telescope during cold nights while not hurting my night vision.

With a smart phone, I’d have to use touch gloves or take off my gloves to press “buttons” on the screen. And then I’d have the hassle of filter programs to dim the screen and make it red to keep it from impacting my night vision.

With my HP-41, I’d have to use a led light to see the screen.

But with an old red led calculator, I could get all my requirements at once. Except there are few of these old pre-1980 calculators that would be capable of doing all the calculations I need; Date -> Julian Date -> Date, Sun rise/set, Moon rise/set, Moon Phase, Field of View calculations fro various eyepieces, etc. Fiddling with magnetic cards for the HP-67 would not be ideal.


HP-25E to the rescue! Bernhard Emese (Panamatik) has created a true piece of art with his “brain transplant” for the old HP-25 calculators. His HP-25E boast a 100x increase in programming memory, on-board GPS with time, Latitude, Longitude, heading, speed and more as well as a stop watch, chess clock, hexadecimal conversion and much, much more. It’s the ideal calculator for my requirements. Except it still had only 50 program steps memory per program. Although it had the possibility of storing 100 HP-25 programs in a constant memory (not lost when you turn the calc off – unlike the original HP-25), you couldn’t write programs with more than 50 steps. And this was way too small for the programs I need.

Talking to Berhard about the possibility of “stringing together” different “pages” of 50 program steps, we came up with a neat way of solving this issue. By using some available rare codes, the HP-25E can now jump between various programs – potentially creating programs with thousands of programming steps.


And so I embarked on the journey of creating the AstroCalc – the ideal tool for the amateur astronomer. So far, the GitHub repository only includes the calculation of Julian Date from a date and time and the backward conversion, from Julian Date to date and time. With the HP-25E’s possibility of constantly updating the time, this makes writing down the exact Julian Date on my observations a breeze.

I will add the Sun/Moon rise/set, Moon Phase and eyepiece calculations soon. Just check my HP-25E_astro Github page for updates.

I fucking love this calc.

My computer setup

Here’s a HyperList of my current computer setup – for reference in case someone is looking for inspiration:

PC = Samsung NP900X4C

OS = Ubuntu Linux (16.04) (

Shell = zsh (

Terminal = urxvt (

Text editor = VIM (

Document production = LaTeX (

Programming Languages

Mail User Agent = mutt (

  • Mail filtering = mail_fetch (from GMail accounts)

SMTP client = msmtp (

Instant communication = Weechat (

HP-41 link = pc41 (

Newsreader (RSS) = Newsbeuter (

Window Manager = i3 (

Information display = Conky (

Browser = Qutebrowser (

Office suite = LibreOffice (

Presentation viewer = Impressive (



Tech stuff: Julia, Vim & Vizardry

Been doing lots of tech stuff lately. Here’s a sharing of some highlights.

Through the years I’ve been programming in more than a dozen different languages. Since many years I have more or less settled on Ruby besides my HP-41 projects programmed in FOCAL and MCODE. Now and then I get this urge to learn a new programming language, and after an extensive search for something neat, I finally landed on Julia. I’m trying her out while reading the book, “Getting started with Julia Programming Language“.

The book is good. The programming language seems excellent. It boasts a complete GitHub-based package system to extend the language with various modules. Although it’s a general purpose language, its strength lies in maths and natural sciences. It’s very fast and with a pretty clean and natural syntax. You can even do straight forward math like this:

f(x) = 2sin(3x)^2

And by then executing the function “f” with x as 0.8, you get the answer straight:


There is a chance I could be falling in love here 🙂

I’ve also been doing lots of work on my Conky setup resulting in this as my “bare” desktop:


If you have any questions about scripts or conky setups, just ask by leaving a comment here.

Then there is VIM – perhaps my the tool I use the most. I’ve been using VIM for writing everything from HyperLists and notes to e-mails, short stories and books since around 2001. It’s a fantstic text editor. But it lacks a good package manager for add-ons :-/

But then I found Vizardry. Using Pathogen as a base to install extensions, Vizardry will let you search for add-ons, install it with a breeze and remove it just as easily. If you’re a VIM user, this is a must. Go get it! You will thank me 🙂

HP-41: The Periodic Table of Chemical Elements

Have your HP-41 right where it should be (in your hand) and unable to find the Internetz to look up nifty details of obscure chemical elements? Worry no more, the solution is here, the HP-41 program, “PERIOD”.


The program will display:

  • Atomic number, Name and Symbol
  • Group, Period and Block
  • Atomic Weight
  • Property (Alkali metal, Noble Gas, etc.)
  • Type (Gas, Liquid, Solid or Unknown)
  • Occurrence in nature (Primordial, From Decay, Synthetic)
  • Melting Point, Boiling Point (in Kelvin)
  • Year of discovery (“OLD” if known in ancient times)
  • Electron Configuration
  • Atomic Radius (empirical and calculated)
  • Origin (Big Bang, Cosmic Rays, Small & Large Stars, Large Stars, Large Stars & Super Nova, Super Nova and Man Made)

You will find the ROM pages, program listing and element details on the Github project page. It is also included in the HP Museum’s “HP-41C Software Library“. Enjoy 🙂

Code is up

… on Github.


Got around to putting my most useful programming projects up on You can now easily get the newst versions, repost bugs, read the source code and fork the code to make your own version.

The projects that are up so far are:

  • npcg – the random encounters and NPC generator for the AMAR RPG
  • hyperlist.vim – the VIM plugin to easily and effectively manage HyperListS
  • hypergraph – the tool to make graphical representations of HyperListS
  • mailfetch – collect mail from different imap accounts, filter and store locally
  • imaptools – Client-side tools for imap mail
  • pc41 – Facilitating serial/USB connection to an HP-41 calculator

The next project up will probably be my collection of HP-41 programs found on this site.

Update (2015-08-28): I have now put all my relevant HP-41 related programs up on my Github page. The pages and links on this site is now updated to point to my Github projects.

Reverse Polish Notation explained

The Youtube channel “Computerphile” has some cool videos. This one explains very well what Reverse Polish Notation (RPN) is and how it works. The concept is central to the traditional HP calculators, something dear to my heart 🙂

Notice how I am drifting away from blogging about Scientology. Scientology blog posts generate a hell of a lot more action than any post on RPN of HP calculators. But it’s the logical evolutions as Scientology drifts away into the sunset. The church is dying and anything of value in the subject itself will find its way into the common pool og human knowledge. And all will be fine.

It’s the feeling

In my talk at HP Norway, I covered my history as a calculator enthusiast. I got my first calculator (a TI-57) when I was 13 and my first HP calculator (HP-41CX) a few years later. I started collecting as an adult, and in 2008 eighty-nine of my ninety calculators got toasted when the building where we had our offices burned to the ground.


A couple of months before the fire, the Norwegian national TV interviewed me and showed my collection. Lots of people saw it. Shortly after the fire, the TV host Petter Skjerven came back to do a “part 2” where he asked me how I felt after the fire. We were standing in the ruins when I told him I felt great.

A couple of weeks before the fire, I had a dream where I had all HP-calculators ever made in mint condition. That saddened me – because the game was over. You see, the point about collecting the calculators, apart from actually using them, is to COLLECT – not to HAVE. So, I had 8 years of fun behind me when the fire struck. And then I had at least 8 years of fun ahead. It felt great. After that second show, people started sending me their old calculators. And now I am almost beck where I was. Except my HP-01 is hard to replace. And my HP-37E had the lowest serial number recorded. Priceless. Oh well. I started to rebuild my collection, and I have calcs now that I never had before – like the gifts I got from HP after my talk; an HP-70, an HP-25C and an HP-10. All rare items.

One important personal point I touched upon in my talk was how I am driven by feelings. The feeling for the unknown, the feeling of learning something new, of discovery, of the vast sea of interesting knowledge, the thrill of learning Einstein’s theory of relativity before I got my first calculator, the excitement of making a self-modifying program on a TI-59 that I borrowed from a friend of mine. The joy of synthetic programming on an HP-41. And the nerve wrecking feeling of reading aloud when I was in high school. The thrill of girls, of the first job, of travelling abroad, of meeting with interesting and amazing people. The emotions, the fun. This is what drives me. And collecting old calculators rejuvenates many tingling, captivating and entrancing rushes. I love it.

This a big reason why I make music, artwork, meet and talk to new people, travel, read, play, point my telescope to the stars and live life as I do. I am a feeling-junky. This is also why I blog.