Yo-Dave

Things I'm Likely to Forget

De-Tabifying

There is probably no more boring task in programming than processing a file to replace tabs with spaces or doing the reverse and replacing spaces with tabs. And yet it has started religious wars that have raged for years in various programming communities. This “tabifying” or “de-tabifying” is not something I have to do frequently, but every once in a while, I need to convert tabs to spaces in some text.

Autosave Functionality in ClojureScript

Most programs provide an “Autosave” feature these days. The feature gives the user a chance to minimize the amount of work lost due to some unforeseen mishap, like a sudden power outage. When I write a program in Clojure that requires such a feature, I have the entire Java library at my disposal. I usually create something based on a ScheduledExecutorService – something that watches for a change in the document then allows a certain amount of user inactivity to pass before automatically saving the document.

Note-Taking

Changing jobs in 2005 caused me to switch from taking notes on paper to doing it electronically. My new employer provided a tablet PC with a stylus running Windows and OneNote. Taking notes on that system with excellent handwriting recognition was a revelation. The tablet was pretty clunky by today’s standards, but it worked well. It was particularly useful for generating meeting notes in real time and projecting them during meetings.

Moving Away from Collate Notes

Collate Notes has received my praise in the past. I even paid for it. Shortly after that unusual event, development seems to have stopped. And it still has numerous shortcomings. The most annoying problem is that periodically, it says my trial period has run out, and I need to enter the activation code (again). And since it’s closed-source, I have no recourse but to submit bugs and make feature requests to a developer who seems to have gone silent.

The Best Coffee Roasters

There was an article that I came across recently that listed the 25 “best” coffee roasters in America. The report included lots of companies I had never heard of and only a few of the ones I believe rank up there with the best. As you may know, I have some opinions about coffee, mostly that it is about flavor, not caffeine. Also, I strongly prefer specific methods of preparation to others.

Using Caddy Server as a Proxy for a Web App using Sente WebSockets

I created a simple web app, called clajistan. Purpose The purpose of creating the app was two-fold. I wanted to have a little app to act as a “placeholder” on a very lightly used virtual server. To learn how to use WebSockets (sente) behind a proxy server (Caddy). Desired Performance The program displays a simple web page, written in ClojureScript, with a few statistics about the server, written in Clojure:

Closing Branches in Mercurial

As a lone developer, I have a workflow that I believe is pretty typical. Most of my development work happens on the “tip” of the “default” branch. It’s just easier to do work on fixing small bugs or adding minor features there. For more significant, more difficult pieces of work, I usually create a “feature branch.” I do this with the expectation that if things get messed up too badly, I can delete the branch and start over without affecting the readiness of the default branch.

CWiki-Next

For the past few months, I’ve been beating my head against a brick wall. The problem was that I was trying to get an all-server-side wiki built using Clojure. It actually works pretty well. I’ve been using it for personal information for months now. It works well except for one aspect, arguably the most important – editing new or existing content is not that pleasant. It’s all a variation of Markdown, which is nice.

Notes on ClojureScript Regular Expressions

There’s an old saying about regular expressions – paraphrasing: “If you try to solve a problem with regular expressions, you then have two problems.” Even though regular expressions are present in most programming languages, I have never become particularly proficient with them. Those that I am most familiar with are the Java version. Since ClojureScript compiles to JavaScript and runs without the Java underpinnings, it’s version of regular expressions are different.

Using Anonymous Functions in the Clojure/Script Thrush Macro

The other day, I was putting together a sequence of operations to transform one piece of text into another form of that same text. The functions took a text argument, and the result was a slightly tweaked version. Put all those functions together to get the fully transformed result. What could be more natural than to string those pieces of code together with one of Clojure’s threading macros: ‘->’ or ‘-».