Brad Lucas

Programming, Clojure and other interests

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 →

Yahoo Finance Quote Download Clojure

June 5, 2017

Overview

Today's post is a final version of the Yahoo Finance Quote Download application written using the Clojure programming language. If you are interested there are three previous versions of this application using Bash, Python and Java.

For the impatient you can find the source for this post in the following git repo.

https://github.com/bradlucas/get-yahoo-quotes-clojure

Continue reading →