Brad Lucas

Programming, Clojure and other interests

Markdown Mode Is A Win

June 10, 2017

I previously mentioned reviving this blog by starting to use Cryogen.

Cryogen works by compiling your posts created in Markdown into HTML using the theme and configuration settings you've setup. This is great because I can edit everything in Emacs just as I do for nearly everything else.

Here, I've been using org-mode for nearly all lists, plans and documents for a very long time. With the discovery of Markdown Mode for Emacs) I've found a new balance. With keystrokes for expanding and moving around your Markdown document that are familar to the org-mode user I've found the new mode is making creating these blog posts as comfortable as when I was creating documents in org-mode.


Continue reading →

Blogging With Cryogen

June 9, 2017

I recently revived my blog by building it with the static site generator Cryogen. Working primarily in Clojure these days made using Cryogen a nice fit.

Benefits

  • Static site generators let you create posts in your own editor using a simple markup language such as Markdown
  • Because Cryogen is developed in Clojure you have a software package you can edit if you'd like
  • All the basics are included including support for tags, rss feed files and commenting with Disqus

Setup


Continue reading →

Nearly Hit but Watch What You Think

June 8, 2017

Story

So I took the early train today. Earlier than I usually do and as a result I was both croggy and rushing. While I was coming down the hill and about to cross through the parking lot at the train a car rushed by with what seemed like little care as to where I was.

Now I titled this post partially with the words nearly hit but to be honest that wasn't the case. What really was the case was that I think the car should have stopped or at least slowed because of where I was. Normally this seems to be the polite behavior of drivers around here and for a moment I was put back as the car rushed around the corner and I continued walking in a fashion to prove how close I was.

I think I muttered something under my breath and it might not have been all that nice. Then, because I was rushing I pushed on and as I reached the stairs I noticed the car pulling into a spot down the way along the track. Ah, I thought they are trying to catch the train. Well, that explains their behavior somewhat.

Now, back to me. Another part of the story is time and one's sense of it. When you commute you get these very fixed goals in your head revolving around the train schedule. You also learn how long it takes for you to walk to the train and as it happens you whittle that walking commute down to the shortest possible amount. So I left by looking at the clock and starting the game of getting to the train in my allotted amount of time. Today was no different than any other and I was cutting it close. Not running close but just the exact amount.


Continue reading →

Importing Java Classes in Clojure

June 7, 2017

Talking to Java

Clojure is hosted on the Java Virtual Machine (JVM) and as such can access Java libraries and classes quite easily. Some of Java is built in so to speak and included in Clojure. Look inside of the clojure.java.io namespace. A good example is file which returns a java.io.File object.

These and other examples are useful to understand. But, what if you have an external Java library which you'd like to use. Here is an example:

Apache Commons Lang

The commons lang library provides among other things a host of utilities for working with the Java API. Let's pick something within it that we'd like to use from within our Clojure program to demonstrate the process of working with an external Java library.


Continue reading →

Yahoo Finance Quote Download Summary

June 6, 2017

Overview

As a final post about the new Yahoo Finance quote download page and how to access the historical data I thought to offer a bit of a summary.

The four previous posts with examples for Bash, Python, Java and Clojure are available at the following urls. Please visit them if you have just arrived at this post without seeing them. At the very least, read the beginning of the first one for more details on the issue with the new Yahoo Finance download data page and the technique to call it programmatically.

Bash


Continue reading →