End of Life Warning

Just a notice that this blog is coming to the end of it’s life.

When it comes time for me to renew my hosting arrangements in the spring of 2018, I probably will not do it with this provider.

But, don’t despair! All of the content has been transferred to a blog on GitHub Pages. Just amble over to https://clartaq.github.io/yo-dave/. It’s all over there now.

Leiningen passing Invalid Flags to Java Compiler

Just a note about some weirdness in my work process and it’s solution.

A few weeks ago, I started noticing some weirdness in trying to use some tools with Leiningen while developing a program in Clojure. When running tools like kibit, lein would fail with an error from javac about an invalid flag. Initially these flags were for attempts to set the file encoding. And the file encoding kept changing.

Over time, these failures became more frequent. Always about passing an invalid flag to the java compiler. Finally, I was unable to run a REPL, run a program, or build an uberjar.

Long story short, it looks like it was related to the JAVA_CMD environment variable. That had been set a loooong time ago and in fact pointed to the java compiler, not the VM. Simply removing the variable fixed things. Might have worked just by setting it to java rather than javac but I didn’t try it and so far nothing else has broken.

Still don’t know what caused things to get flaky in the first place since this variable was set so long ago.

Rant About JavaFX Ecosystem

Feeling a bit frustrated today, so I thought I would just vent a bit.

I’ve been working on some personal tools. I see some things in other tools that I would like to include in my own. I keep finding that those features that I like are written in JavaScript with that whole mess of an ecosystem. When I look for something similar in Java/JavaFX I find next to nothing.

Why is that? Java is supposed to be the most popular programming language in the world. Tons of programmers working on it for many years. And yet it doesn’t seem to have as many flashy things written.

I don’t always want a web-based thing. Don’t want a half-gigabtye Electron app either.

Maybe there are more Java programmers, but more enthusiastic JavaScript programmers.

I often feel the same way when working in Lisp or Clojure. Working with a demonstrably better language but not getting as far as quickly as someone working with a crap language.

End of rant.

Keeping the JavaFX UI Responsive

It’s common knowledge that the JavaFX user interface tookit is single-threaded. When your JavaFX-based program is doing things that can take some time, you need to run those tasks on a separate thread(s) to keep the interface responsive.

Recently, I’ve been working on a program that can spend a lot of time reading and writing to the disk, but at the same time I want to retain the ability for the user to change views of the UI as the work proceeds. I also want to provide the opportunity for the user to cancel the background task at any time. I thought I would provide a couple of examples of how I did that in the program.

Continue reading

Windows, rsync and permissions

Just a short note on mixing Linux utilities with Windows. I wanted to set up a single button deployment of updates to a static web site. I had been using an rsync script, but it required me to manually enter authentication credentials every time it was used to send updates to a remote Ubuntu server.

I set up public key authentication, but it would not work with the permissions of the key files on the Windows machine where the updates were coming from. After struggling with this for a bit, I finally used Cygwin running on the Windows machine to set the permissions just as I would on a Linux system. After that, things worked fine — it’s a single click script with no intervention required.

Still don’t know how to get this done using Windows only. Too lazy to figure it out.

De-Activating My Evernote Account

It was very unpleasant for me. I’ve been a user of Evernote almost from the beginning, and a Premium user for almost as long. But today I erased all of my notes and deactivated my account. “Why?” you might ask. Let me tell you.

  1. The price increase. Earlier in the Autumn, Evernote announced a price increase. It was pretty substantial, at least for me. At about the same time, they announced that they were moving our data to Google’s infrastructure in order to take advantage of improved economies of scale among other reasons. So they are lowering their costs of doing business but still increasing prices for customers. That just doesn’t sit well with me.
  2. Change in Privacy Policy. The company has recently announced a change to their privacy policy effective 23 January 2017. Now they will have engineers “overseeing” simple AI that better personalizes the way the service works. Put another way, they will have people who read your notes. I just don’t want that. Even though I don’t have anything truly private in my Evernote account (I use SpiderOak for that kind of stuff — medical records, tax records, etc.) I just don’t want that.  My notes belong to me and no one else.

The Evernote approach highlights one of my big gripes about the way a lot of AI research is done these days. I don’t believe there is any real reason for requiring access to user data to “make sure things worked”. It’s a symptom that much current AI is being developed to work for the vendor, not the customer/user. The folks developing this technology are continuing on in the belief that our data somehow belongs to them, not us.

As for a replacement, I haven’t found one that can completely replace Evernote, but have looked at a few.

Getting Existing Notes out of Evernote

The first step in moving to another application was getting my existing notes out of Evernote. Evernote supports a nice export format called ENEX, which is a form of XML. If you have web clips, the exported data contains a bunch of indecipherable gobbledygook from the original web page. In the case of images, the exported notes can contain a lot of data relevant to the in-image search function. The files can be parsed with a relatively simple piece of software if you only want the simpler parts and don’t need to reproduce the original web page.

During the export process, I came across a few bugs. Evernote’s support group was very helpful at fixing the errors and I was able to export all of my notes successfully, even some as old as nine years.

Alternatives

I had used Microsoft’s OneNote in the past on a tablet with good handwriting recognition. When I tried to import my notes this time, it choked. It just couldn’t handle the organization of all those notes and produced something unusable.

Other programs (and there are tons of them) just don’t have the flexibility of Evernote. In the end, I settled on importing my notes into a wiki system. For the type of work I use my notes for, this seems to work fine.

The search goes on for a complete replacement, but I don’t feel crippled in the meantime.

Clojure/Script has Ruined Me for Other Languages

The Elm language is often cited as an up-and-comer for web front end development. I was attracted to it largely because of the compiler’s friendly and extremely helpful error messages. It’s really attractive in many ways.

But when I started looking at examples, I often found myself thinking things like “Why is this so inconsistent?” or “Why is this syntax so complicated?“. And it finally occurred to me that I’ve been ruined by the way Clojure/ClojureScript/Lisp/Scheme do things. I can’t seem to go back.

An Email Server on Ubuntu 14.04

Email is pretty old. It is older than the Internet. Despite the perennial claims that email is “dead”, it is still going strong. It’s also a bit complicated, which is why most folks set up an account with someone else (Yahoo!, Gmail, HotMail, ProtonMail, FastMail, etc.) who can take care of it for them.

However, if you want to host your own server, it can be done. If you are running Ubuntu 14.04 (and only that version at this time), MailInABox can handle most of the setup for you automatically.

It takes care of things like anti-virus, anti-spam, grey-listing, and HTTPS for you. The one area it cannot handle for you is the DNS setup. That’s something that is typically done with the domain registrar. And it seems to be different at each one, although there are tutorials appearing on the MailInABox web site that walk through the process at specific registrars. That was really the only difficulty I had.

There may be other problems getting other email services to accept email from your new server. They each have some arcane heuristic rules that block email before it even reaches their spam filters.

So, if you’re tired of having all of your email read just to send you more advertising, think about setting up your own server. It isn’t that hard anymore.

Serving WordPress over HTTPS with Caddy Server

The Caddy server is a relatively new, easy-to-use server written in the Go programming language. It is very buzzword compliant. But, the nicest thing about it, in my opinion, is that it sets up SSL/TLS (Secure Sockets Layer/Transport Layer Security) certificates automatically from Let’s Encrypt to let you serve a site with HTTPS by default. The project is open source and the certificates are free.

Of course, WordPress is a very popular blogging platform. Caddy provides some guidance on getting WordPress up and running on the server. However, it wasn’t enough for me. Here’s some step-by-step guidance on how I got it working on some of my own self-hosted sites.

Continue reading