Chris W Jones

Hobbiest Programmer

I was listening to a new (for me) podcast [] about development. The people hosting it are famous rails [] developers but they also talk about other topics.

One of the developers has a side project where he is creating an ORM for this new language Rust []. An ORM is a layer between the database and a language that abstracts away a lot of the details of the database. It usually makes it a lot easier to deal with a database.

I decided to cut my teeth on Rust by trying to contributing to his project.

We'll see how it goes.

It's that time of year again: National Novel Writing Month. The month where everyone strives to write a 50,000 word novel.

I follow a bunch of author's blogs and they all write about this event every year Charles Stross [] , John Scalzi [] , and even Wesley Crusher [].

Last year, I read all about it and decided to try it out. November arrived and my fingers did nothing. Out of my 50,000 word goal, I wrote exactly 0.

This year, I resolved to try again. I must say that I am off to a much better start. There is no way that I'll hit 50,000 words but I'll at least have some. Currently I'm sitting around 1,200. No you can't read it. It's awful. It'll make your eyes bleed.

I didn't plan out a thing so it's, just, pure drivel. It's almost like stream of consciousness writing. So far in the plot though, I've established that the world my two main characters live in has dirigibles and forests where the oceans should be due to a nuclear war in the distant past.

That is all I'll say about it. Once the month is over, I'll update this post with my final word count.

Over the past year or so, I have become much more interested in personal finance. Last summer, I started using a program called YouNeedABudget [] to track all of my spending. Doing that, I've managed to stop accumulating debt. I also have a debt spreadsheet that I use which allows me to snowball [] the payments to my various debts.

As you can see, my minimum payments are around $500 and I'm adding $200 extra towards the debts. The result of this is that I will be completely debt free in a little over a year. Combine both of those and I will be living within my means without any debt next winter. What is a young guy to do with his money then?

The answer, of course, is to start looking at retirement which is a tricky topic. I've been reading a lot about retirement in the past few weeks. I've mainly been looking into one question: How much should I save in order to retire? That is a hard question to answer, it seems. Luckily, I follow some smart bloggers. Mr. Money Mustache covered how much you should shoot for in retirement in his post The Shockingly Simple Math Behind Early Retirement [] . Using his math, I've arrived at a number to shoot for. If I had $1,000,000 in my retirement accounts, Hilary and I could retire and never work another day. That's a big number but thanks to the power of compound interest, I think that it's doable. In fact, I think that I could hit that by the time I'm 60 (maybe even earlier). Why do I think that? I crunched the numbers using Networthify [] . If anything, I think that's a conservative estimate since the stock markets have averaged about 8% growth over time and that graph is assuming 6% average growth.

So that's my next goal: retirement. Hopefully, I'll be able to save enough and even retire early!

For those who missed it, I decided to try following Benjamin Franklin's schedule [].

I think I picked a poor week to try this schedule change. Monday and Tuesday were successful. I felt super productive. I woke up at 5am both days. I had time to workout, check email, and eat breakfast before I started getting ready for work.

Then came Wednesday. I had to be at an exercise at 7am on the dot so I didn't have much time to get relax before getting ready. By the time I made it home in the evening, I was quite tired and not feeling well at all. I came down with a bad cold. I barely made it through work on Thursday after waking up at 6am instead of 5am. I'm hoping to be feeling better this week so that I can try again.

I'm always looking for how to be more productive. This week, I was reading through my news feeds on feedly [] and came across an article from J. Money on Budgets Are Sexy about living Benjamin Franklin's schedule [].

My ears perked up. It's a pretty straight-forward schedule. I decided give it a test run this week. Here's what it looks like from Ben Franklin himself .

I don't know how he managed on so little sleep each night. From experimentation, I know that my body prefers to get around 9 hours of sleep each night. That is when I wake up feeling my most refreshed. However, I usually get around 7.5-8 hours during the week. With his schedule, I'll only be getting around 7-7.5 hours.

The other thing that jumps out to me is that I don't usually work those hours and I can't really change them much. I suppose what I'll be changing this week is when my alarm is set. I'll be waking up an hour earlier to get a little more done each day. Or I'll crash and burn. I don't know which.

I started reading a lot this year about gardening. I grew up with everyone I know gardening. Both of my grandfathers gardened and so did my dad. Everyone was doing it. I feel like maybe I should do it too.

I started out reading a great book on the topic called The Backyard Homestead []. I initially found this book at a book warehouse and talked myself out of it because at the time we were living in an apartment and didn't really have the room to garden. Then I was looking through Amazon one day and wouldn't you know it, the very same book was on sale! I snatched it up this time and voraciously read it.

Since we're living in a town home, we have a little bit of backyard space now. It's not much but I've got about 10 square feet of usable space. I wanted to plant something this year but the area I wanted to use wasn't ready so I settled for some container gardening. I grew some basil, another herb, cat grass for the cats. It went pretty well until I forgot to water them for a single day. That particular day, the temperature got into the 100s so that was a bad day to not water them. I tried to resuscitate them but was unsuccessful.

Next spring, I'm planning on using my little bit of space to plant a few things. I'd like to plant spinach, broccoli, and a tomato plant.

I'm starting yet another class this week. This time, the topic will be other programming languages. Up until this point in my college career with UMUC, we have only used Java.

While Java is quite powerful and can run pretty much everywhere, it is certainly not user friendly. I certainly wouldn't use it for any trivial project. Or really any project where I can avoid it.

I was hoping that we would learn contemporary languages like Go, Scala, or Clojure. Instead we'll be covering C++, Ada95, Java, Lisp, and Prolog. I know that at least the syntax of lisp and prolog is carried through to some more modern languages so that's alright.

As I reviewed the schedule, I'm surprised that we only have two coding assignments and one is in Java. For a course that is supposed to teach us other languages, we'll be doing very little actual programming in these other languages. It will be up to me to figure them out and write programs in them, I guess.

I'll be teaching myself again with little help from my school other than a general direction to go. What else is new?

I've been thinking a lot about authentication for my library website, Bibliophilium. It started out with do I need any? And moved to, how should I manage it? To how far do I want to take this?

In Rails development, there is a golden standard library for authentication. It's called Omniauth []. Everyone seems to use it. It integrates with other services like Facebook and Twitter allowing signin from them through OAuth. OAuth is just the mechanism where you click “Login with Facebook” and a new window pops up where Facebook asks if it's OK to login to the site. There are tons of guides out there for getting it setup with a Rails application.

On the other hand, there is a simple library from Thoughtbot called Clearance []. It doesn't have many guides. Mainly because it's simpler. It only uses email/password to login. There are no bells and whistles to go along with it.

I also looked in to using a lower level authentication engine called Devise []. Omniauth is actually built on top of Devise. My main qualm here is that I feel like it takes me even more into the weeds.

So here I am. I'm at a crossroads. Do I go with simple for me or easier for the users?

I think I'm going to take the middle road and use Omniauth like everyone else. I tried using it once before but read way too much about the OAuth spec so got scared away from it. I like avoiding handling people passwords though which using a Facebook or Twitter logins would allow me to do.

In my data structures class, we've been talking about things like Linked Lists and Search Trees.

One thing that I've noticed in common with most of these structures is that they're made up of nodes.

A node is just a simple way to store data. In a linked list, a node will also store a reference to the next node. In a tree structure, it will store references to its parent node, as well as child nodes one to the left and one to the right.

A linked list has a head and a tail (first and last elements). In the version I wrote for class, I made a doubly-linked circular list. That's a fancy way of saying that each node kept track of the next and previous and the tail element kept a reference to the head and vice-versa.

class ListNode attr_accessor :next, :prev, :value

def initialize(nodevalue) value = nodevalue end end

In order to keep track of the head and tail elements, I used what's called a sentinel node. That's a special node in the list with a value of null.

sentinel =

That makes for a linked list that looks like this:

It's the basis for all array type storage.

The next topic that we covered was trees. Specifically, we discussed the various Binary Search Trees. Don't be scared of the words Binary and Search in there (or even tree). It just means that the tree data structure is sorted.

See how each node on the left is less than the one above? And every node on the right is greater than the one above it? That's what makes it a binary search tree.

There are several different kinds of these trees because one of the biggest things that effects how long it takes to find a given element in the tree is how tall it is, called its height.

In the tree that I've drawn, the height is 3. I started at the root element (5) and walked down the longest path to the bottom. That's the easiest way to determine the height.

To try to minimize the height, there is a way to rotate the tree around a different node. In this tree, we've got a pretty balanced tree already. However, we could rotate the tree and choose 4 as our new root. That would make the tree look like:

It's not much of a difference since it still has a height of 3.

So far I've been doing pretty well in this class. I'm looking to finish strong. Next week is the end of class.

I'm blogging at you this week from Louisville, KY where I'm in town for the wedding of my oldest and closest friend.

I also started my next class for my Computer Science degree. It's a Data Structures and Algorithms class. This type of class has been talked up all over the Internet as the most important class in a computer science degree. I'll update you all my thoughts on the class as it goes.