I like New Years resolutions. Sure they’re kind of cheesy and I always tend to make similar resolutions each year (run more, get better at guitar, write more music, update Mount Saint Awesome more regularly, etc.) but I still enjoy the excuse to take stock and think about things I want to be doing.
A lot of what I want to be doing is making things and in order to stay focused on that I’m going to steal an idea from the brilliant Jonathan Coulton (of Code Monkey fame!) and try to do A Thing A Week. While Jonathan did this entirely with songs I’m going to branch out to include almost anything that I can create within the 1 week time frame. This might involve building a guitar pedal or brewing a beer or making some art or creating a small web app or piece of software or even… writing and recording a song. I have a bit of experience with this schedule from the early days of Mount Saint Awesome. Back when I first started the comic I was VERY dedicated to posting a comic every Monday and I stuck with that schedule for over a year. It really helped me improve as a cartoonist. Here is the first comic I posted and here is one of the later plot based comic I posted (this was less than 1 year of comics, but still a noticeable difference.)
The first thing I’m going to try is building an HTML5/JavaScript game. I’ve been doing web development for a long time now but I’ve never built a game and it seems like a good excuse to play with some new HTML5 stuff, plus I’d really like to get more serious about JavaScript. If all goes to plan I will have a game to show off here next Monday!
Lately I’ve been getting more and more into playing chess. I had played a bit with my dad when I was a little kid but hadn’t really thought about it much since. Then a year or so ago I started playing online chess with some friends at work. I was REALLY bad and lost constantly. Since then I’ve been studying and playing a lot more and I think I’m getting better and I’ve really been enjoying the process. If you’re interested in playing me, I play as dschwantes on chess.com.
But this post isn’t really about me learning chess. It’s more about a game I played a few weeks ago.
I had convinced Eileen to go play chess in a coffee shop with me one Sunday evening. We were just going to play a very friendly, open game because she doesn’t really play and last time we played she got really mad that I beat her (and refused to play chess with me ever again). We were sitting at a table next to a family with two young children, maybe 4 and 6 years old and as we started our game, the older child kept craning his head over to our table. Eventually his willpower failed him and he just came straight over and sat next to Eileen, asked what she was doing, and started suggesting moves.
His parents came over to apologize (and retrieve their stray child) and the father explained that he had started to introduce his son to chess a little while ago. Eileen and I were just having a friendly game so we ended up inviting the kid to play “on Eileen’s team” and his parents helped them pick moves too. It was a completely casual game with everybody helping to look for the best moves for both sides and none of us (adults included) were particularly strong players.
The kid couldn’t sit still for 30 seconds and spent the whole game wiggling around and leaning on Eileen and looking at the board from different angles but the game kept his attention, which was really impressive. It wasn’t the game I had planned on playing but I think we all had a lot of fun. It felt good to help entertain a kid with something productive and it was just a genuinely enjoyable encounter with some random, nice strangers in a coffee shop.
I just finished writing and recording a fun keyboard-heavy powerpop song called In My Head and in an act of self indulgence I’d like spend a blog post going over some of what into the song. (Pro tip: You can scroll down and start playing the song while you read the rest of this!)
With this song I wanted to just write something straightforward and not get hung up on trying to write anything super technical. I ended up with a simple intro - verse - chorus - verse -chorus - bridge - chorus structure and I tried my best to not overthink the lyrics (more on those later). By not getting bogged down worrying if my basics were interesting enough I was able to get a solid chord progression and structure down and then build off of it.
recording
The song started with just guitar recorded over a click track. Rather than trying to set up and mic an amp I ran my guitar through my homemade overdrive pedal and then a clean amp model in Garageband. Once I had my basic structure down I went in to write drum parts. I wrote the drum part by hand placing events on the piano roll set to a drumset sound. I’m sure there are better ways to do this, but it worked for this song and I like the freedom I get by beind able to hand pick every hit in a beat.
I stressed out about my bass tone a bit during this recording session. Usually I need to run my bass through an amp and mic it to get anything remotely usable, but I wanted to get some parts down imediately and plugging in wasn’t an option at 11pm. I plugged directly into my recording interface (an M-Audio Fast Track Pro) and then just put one of the fuzzy Garageband bass effects on the tracks and the sound was actually ok so I ended up keeping it.
From there it was time to play with keyboards! The paino parts are all pretty simple, mainly just to add some depth and tone to the song. I had a lot of fun writing some cool little counter-melodies on the synth. I’ve always had a soft spot for bands like Zolf the Rock and Roll Destoyer and Motion City Soundtrack so I really enjoyed being able to write some really poppy synth driven stuff.
lyrics
And now lyrics. Like I said, this song was an exercise in not overthinking things. I just sort of wrote the first things that came to mind so this song ended up overtly being a generic pop sound with vauge romantic sentements. That said, the ideas for the lyrics came from watching Doctor Horrible’s Sing-a-long Blog and from spending a weekend home alone when Eileen was out of town.
chorus
Well I can’t get you out of my head
I dream about you when I go to bed
I can’t get you off of my mind
And I don’t mind
I can’t get you out of my head
I keep replaying every word you said
I’d like to give you some of my time
If you don’t mind
The deep insight here is that I had a bunch of songs from Doctor Horrible stuck in my head for a long time. They’re really good! You should seriously watch it. That’s honestly the extent of the depth of that chorus, I just kind of took the theme of having something stuck in your head and presented it in a general enough way to make for a good, hopefully catchy, pop chorus.
verse 1
Well I’ve been spending too much time
Home alone on my couch drinking too much wine
Watching TV and waiting for
You to come here and walk right through my door
verse 2
Now I don’t eat and I barely sleep
I don’t know how much longer I can keep
Walking through these empty rooms
Before I pick up my phone and call you
I wrote a lot of the music for this song over a weekend when Eileen was out of town so when I was looking for lyrical ideas for the verse I decided to just use the theme of being home alone and again present it in a vague way to make it sound like semi-romantic pop. I did take some liberties with the concepts. For example, there was no wine consumed that weekend but it’s harder to find good words that rhyme with whiskey. I did watch copious amounts of TV, mostly The Guild, and I don’t really do a good job of feeding myself or going to bed at a reasonable time when I am left home alone, so there is some truth to these words. I wasn’t as happy with the vocals I got when recording the verses. I just couldn’t seem to get a tone I was totally happy with, but I don’t think it’s too distracting.
the song
I’m really proud of how this song turned out. I had a lot of fun with the style and its always rewarding to hear a completed project that has some complextiy to it. If you don’t want to travel all the way over to Soundcloud to hear the song, you can listen to it RIGHT HERE!
Well, this writeup is a bit late. I wanted to write about Darwinning right after I launched it but here we are.
So, what is Darwinning?
Darwinning is a Ruby Gem built to help people write genetic algorithms. I got into genetic algorithms while taking a machine learning course during my masters and I’ve had a casual interest in them ever since. I even wrote a comic about them! I have also been enjoying Ruby lately, so I wanted to learn how to build a Gem. This project was started to satisfy both of those interests.
I also played with the Ruby unit testing framework, RSpec, for the first time with this project. The test coverage for Darwinning isn’t great, but at least it’s a start.
So, how do I use Darwinning?
Darwinning is totally available via RubyGems so you can install it the same way you would install almost any Gem:
gem install darwinning
Once it’s installed you can make use of the Population, Organism, and Gene classes to build your own genetic algorithm based programs.
Here’s an dumb example of how you might use Darwinning to solve a pointless problem:
Let’s say for some reason you need a set of 3 number that add up to 15. This is a strange problem to have, but let’s solve it anyway.
classTriple<Darwinning::Organism@name="Triple"@genes=[Darwinning::Gene.new("first digit",(0..9)),Darwinning::Gene.new("second digit",(0..9)),Darwinning::Gene.new("third digit",(0..9))]deffitness# Try to get the sum of the 3 digits to add up to 15(genotypes.inject{|sum,x|sum+x}-15).absendendp=Darwinning::Population.new(Triple,10,0,0.1,100)p.evolve!p.best_member.nice_print# prints the member representing the solution
This code declares an organism class that inherits from Darwinning’s Organism parent class to represent solutions. Then we create a population of these solution organisms and evolve the population until a solution meets the fitness threshold or the generation limit is met.
So, what else can I do with it?
If any of this sounds remotely interesting to you, please check out the project on Github. I’m always happy to take good pull requests if other people want to contribute. I haven’t been very active lately because I’ve been spending a lot of time on this website and my wedding website, but I do keep an eye on the project.
Welcome to the new Dinosaurs Eat Everybody blog! The old site/blog was an interesting mess of custom PHP and some custom build hooks into a Word Press blog and though it worked pretty well but I was tired of maintaining stuff in PHP so when my old hosting was about to expire I decided to move to a VPS and build something new. The result is what you see before you today.
This new site is built mainly on Sinatra with Jekyll mixed in for some blogging functionality. I didn’t really need any sort of content management system for most of the site so there is no database behind it and I’m using flat files (mostly just handwritten JSON) for anything that seems dynamic.
The interesting part was adding a Jekyll blog to an existing Sinatra site. Jekyll is super easy to set up on its own but I didn’t want it to run the whole site. I wanted to be able to serve dynamic pages if I wanted. With some help from this blog post it was actually pretty easy to get things up and running. That post is a bit out of date but still very helpful.
To add Jekyll to Sinatra I first just created a new Jekyll site in a seperate directory and copied it over into a jekyll_blog/ folder in the root of my Sinatra project. I then removed the .gitignore, the default.html layout and the whole css/ directory (after moving the Pygments syntax.css into my main stylesheet directory) from the new Jekyll directory. I also adjusted the _post.html layout to not have a layout of its own by just removing all the YAML Front-matter from the file. This is because I want Sinatra to handle the layouts for everything.
The real meat of this is a custom function in the /blog route:
This just calls the jekyll_blog(path) function whenever you go to a page that starts with /blog/ and that just pulls the html content of either the post or the Jekyll index.html and puts into the <%= yield %> in my Sinatra erb layout.
This is a pretty simplistic solution and I want to add better 404 checking and a way to pull the post title out for use in the page title, but it gets the job done by pulling out the content of the post html file generated by Jekyll and putting it into the content container of Sinatra. Now all my layouts are handled by the same file and all my CSS comes from the same source.
While I like the idea of being able to write my blog posts in Markdown and from whatever editor I want I also wanted to have some sort of web based editor for my posts so I’m trying Prose. Prose is basically a web based editor for Github files (which is where all the content for this site resides anyways. It lets me go in and create new posts through a pretty nice looking Markdown editor with preview. It also helps with syntax and media uploading (though I haven’t tried that yet). I’ve included a _prose.rb config file that sends me right to the _posts/ directory of this project when I’m working on it:
I think that the transiton from a really polished, very user friendly system like Word Press to something more technical like Jekyll will be interesting. I feel like I still need to work some kinks out of the system and I’m still not totally won over by Prose but it has been really fun to set this up. I’d also like to add comments through Disqus soon. Hopefully now I’ll make this work worthwhile and actually write a few blog posts every now and then.