Content from 2009-08

Quick Code Post

posted on 2009-08-25 20:04:17

I'm hoping to get back on track with my blogging (and following other folks blogs) in the next few days. I wanted to post this code real quick though before I forget about it. I've had a lot of fun playing with lisp lately and have written...4 silly, small scripts in the last week.

- The first goes through 12 months of CSV call logs from AT&T to find out the 5 people I spend the most minutes talking to.

- The second recurses through a directory running an external program to find the bpm on each one and logging the difference from the current BPM in id3 tag to a file. It's 90% done, I just have to clean up some of the output parsing from the external process. Very rarely, my cl-ppcre regex doesn't match. Silly corner cases.

- The third takes a directory of 20 or fewer *.ogg files, maps them to keystrokes and I'm working on a simple loop so that they play in a spawned "ogg123" whenever I press said keys. The main hold-up at present is that (read-char) blocks while waiting for a #\Newline and (read-char-no-hang) gave me some other error I forgot.

More on all that later. Some M3U files (playlists) I had laying around weren't importing into a different mp3 player. The reason? They weren't using absolute pathnames. My solution was hackish but I coded it, fixed them and moved on with my life in about 3-5 minutes. Hard to argue with that. And the code:

(defpackage :fix-m3u
(:use :common-lisp))

(in-package :fix-m3u)

(defun fix-m3u (path)
(let ((new-m3u (make-array 16 :adjustable t :fill-pointer 0)))
(with-open-file (in path)
(loop for line = (read-line in nil) while line do
(let ((abspath (concatenate 'string "/home/redline/music/" line)))
(vector-push-extend abspath new-m3u))))
(with-open-file (out path :direction :output
:if-exists :supersede)
(loop for line across new-m3u do
(format out "~a~%" line)))))

Back For More

posted on 2009-08-20 21:46:18

Today has been better than the last few days. I may be coming out of my emotional coma which would be convenient since school starts next Monday. I got some lisp written and I'm sketching out some fun stuff to work on and talk about here soon.

A lot of my struggle lately has been feeling overwhelmed by how much I want to know and my failure to find the time and energy to absorb some of it.

I feel like I'm learning to learn at 23. I know a few things about that.
1. It's not going to be fun.
2. It's about being disciplined, setting measured goals and meeting them.

In the past, I'd gotten bogged down on personal programming\CS learning goals and tried to restart elsewhere or change the goals to regain momentum. No more resets. Persistence is the name of the game.

Though I'm smart, I spent most of the years between 12 and 22 not committing myself in academics and pursuits of the mind. In some regards, I feel like I'm playing catchup. That's what some of this "I feel like I'm learning about learning" stuff is about. Picking the discipline back up. Because the fact is, the only way to really master Computer Science on the level I want to is to put in at least 10,000 quality hours.

I'm not a genius and I don't want to be. I want a fair amount of work/play balance. Of course, CS is in many ways play for me. That said, I want to be more like hackers like Slava Pestov, Luke Gorrie, Per Vogsnen, Edward Kmett and Wren Thornton. I respect each of them for different reasons but they all understand the field on a pretty broad level. I'll keep working in that direction because I want that breadth. It'll take a while...but it took them a while. Hell, aside from Slava I think all those folks are over 30. It's worth the investment though. Thinking about the issues is just too fun.

Note to self: Just remember, you don't know how brilliant you can be. You won't ever be von Neumann...but don't get convinced that you're stupid. Or a failure.

More soon...

An Update on Updates

posted on 2009-08-13 20:49:05

Dear Friends,

I appear to have entered into a coma. I'm not depressed, sad or grieving but I am a victim of constant exhaustion and perpetually low energy. I expected to only need rest the two weeks after classes wrapped up and then be able to spend 3-4 weeks "playing". Playing meaning working on things that I like, Lisp, Haskell, reading CS books, weekly blogging and the like.

This has not come to pass. Instead, I'm on vacation and very blob-like. Some of this has to do with my father's passing. What I'm sure of is that I need this time and that growing as a person, learning more about code and so on, will disappointingly have to wait.

A lot has been happening (nerd news-wise) and the tabs in my browser have filled back up. It's not up to the record number of spring semester (200+?!?) but I hope to dump out a few linkposts and clean out the cruft over the next week or so. Before classes start back up. Oy vey.

In the meantime, I'm missing you folks.

PS: My berrics bracket is totally f-ed. Thanks a lot, Chris Haslam! ;)

Almost 23

posted on 2009-08-05 21:50:33

Tomorrow will be my 23rd birthday. Frankly, it's hard to believe that August has arrived. These summer weeks seem to be flying by. That said, I'm reasonably excited and much less stressed about my birthday than I was earlier this week. There are a host of reasons I stress over my birthday but I'll talk about that another time. Maybe tomorrow. :)

There will be a little get together at the apartment starting at 9 tomorrow evening. Nothing too particular, mostly video games but with the potential to include skateboarding, programming, music, movies and other nerdery.

Friday night Teresa and I see Devon for the first time in a while and then Saturday we're going on a week long vacation to Charleston and Williamsburg. It should be awesomesauce. Hopefully, I'll get some more Common Lisp code written.

Tonight is sort of the last hurrah of my dear friend Burke being in town. He's going back to Indiana to complete his studies at Purdue before Teresa and I will be back from vacation. He had been in town for a summer internship at McKesson. Tonight will likely involve: Sushi, Skateboarding, Music/Code/etc in that order. Good times.

Unless otherwise credited all material Creative Commons License by Brit Butler