Searching for a tagline since 2001

Site Search

Programming Commitment 2011 Final and Code 2012

Last February, I made a commitment to program more in 2011 and to explore a few new languages in hopes of improving my programming skills. In 2011 I used Shell, PHP, Python, Ruby, Clojure and Haskell, with Ruby, Clojure and Haskell being the new kids on the block. Clojure and Haskell were functional languages I toyed with over September and October mostly as diversions. Currently I could never see me writing anything major in either Clojure or Haskell, but they were interesting to visit and I might go back to them again someday.  

Being mostly a hobbyist programmer ( I do program from time to time in my day job. ) the best thing I got out of this past year is that I actually wrote some code that did something I needed and I also took a Python class through the O'Reilly School of Technology that improved my Python coding. PHP was the other language where I actually wrote some code to improve current projects as well as to scratch an itch when needed. I had hoped to write something in Objective C, Cocoa or Google GO this past year but it just did not happen.  

Overall I think my 2011 programming goal was a good idea and I was somewhat successful over the past year. My goal for 2012 is that I want to continue my programming practice, but I want to spend less time consuming content this year and more time creating. This year's programming goal will be known as Code 2012 and I intend to continue this goal on a yearly basis.                                                                                                                     


Create RSS Feed of Runkeeper Actvities

When I first became a Runkeeper user I was content with having my activities available on the Runkeeper website only.  Once I started running regularly and started to talk with other runners I was eventually asked if my activities were available at any location online.  In my mind I thought for sure that Runkeeper would have a simple RSS feed of my activities.  I had never looked for a feed before because I was posting the activities and did not feel a need to track them.  I was shocked to find that there was no RSS feed and that since the beginning runners had been asking for this feature.  There is no easier way to share activities with other runners than giving them an RSS feed of your activities.  

I looked around to see if anyone else had already written something to build an RSS feed.  While I found a couple folks had tinkered with it, they were either not doing enough or too much.  So I decided to write a PHP script that would scrape the Runkeeper activities and build an RSS feed with a fairly barebones PHP installation.  I am using PHP 5.3, but I suspect this would work with some other versions of PHP as well.  The feed that my script builds is here : http://scott.buffington.me/runkeeper.xml

Because we are scraping the Runkeeper site, I highly recommend you either manually execute this script and redirect it to a file after an activiity is posted or do what I did and setup a cronjob to call the script.  I have mine execute twice a day after times I commonly run.  Be respectful to the Runkeeper website, if not, you may get your script blocked.  There are only three variables that you need to set at the top of the script, those being your Runkeeper user ID, your email address and your name.  Otherwise this should work for anyone that has made their activities public.  This script out of the box will grab your last 12 activities, scrape the json file associated with each of the activities and build an informative RSS feed with a direct link to each activity.  I could have included more, there is a lot of info in each of the json files associated with each activity, but I thought what I included was just enough for an RSS feed.

Note: Running this script from the command line and redirecting the output to an XML file is the intended use of this script.  If you run it from the browser, it will return to the browser after it scrapes Runkeeper.  This is slow and optimally not how this script was intended to be used.  For testing purposes, running in a browser is fine.

Download : runkeeper.php


Programming Commitment Update

We are approaching the last quarter of the year and some may be wondering or perhaps forgotten about my programming commitment goal. Back in February I blogged about wanting to spend some time this year trying out some different programming languages hoping to explore their strengths and how I might use what I learn from them to do interesting things in my chosen programming languages. For anyone coming into this topic new, I am not a professional programmer, but a hobbyist. While I have not abandoned this goal, there is a reason why I have not gotten very far nor posted any updates until now.

The language I tackled first was Ruby, and while I actually thought Ruby might possibly replace my interest in Python, I quickly discovered why that would not happen now and will likely not ever happen. I have tinkered with Python from a very high level for a number of years for my non-web related programming. As mentioned before, I am pretty happy with PHP for my web programming needs. Python is a language I have started to use for little command line tools and toys and if I were going to explore Ruby deeply it was going to have to scratch that same itch. The problem I ran into is that when trying to learn how to program specific things with Ruby, a large percentage of the content on the web is for Ruby on Rails. I have no interest in in developing anything on the web with Ruby, so that framework was pointless to me. I did explore Ruby for roughly a month, and played around with it, but in the end it just made me want to dive deeper into Python.

So I ended up enrolling in a Python class through the O'Reilly School of Technology. While the class was not out of this world, it did get me thinking more like a Python programmer than I did prior to the course. Before and after the course I have been tinkering with a Python project used for file sharing with a friend (Scott Wood) and continued toying around with some of my own projects. Within the next month we will probably be doing more with our file sharing project, named Gremlin, and perhaps working on some other Python related projects.

Since I have not abandoned my goal of trying out some other programming languages, I have the last quarter of the year to hopefully check out at least two more languages that I have not experimented with before. The two languages I am considering are Haskell and Erlang, neither of which I have ever experimented with. I chose these two because I stumbled across both when initially thinking of trying this experiment. I have not started to seriously look at either language and I am not married to the idea of exploring these two specifically. If by chance anyone reading this has some other language suggestions I would love to hear your thoughts as to why I should explore another language.


Programming Commitment

This year I am committing myself to some of my previous projects as well as some new ones, both silly and serious. I have a goal of learning a handful of new programming languages over the course of the year in the hope that this will help me find creative solutions in my chosen programming languages. Over the last year I explored Google Go and to fulfill a University requirement I learned Visual Basic. Over the past month I have been revisiting and improving my own PHP code as well as exploring the PHP code powering SemanticScuttle, making minor tweaks to the registration logic to better combat bot spam registering and also making some enhancements to the API to meet our needs. The changes I have made are featured in the installation at Taglr, if you would like to help test the project please sign-up for an account. So while I have at least glanced at a few other programming languages over the years and I have been actively doing some programming, this is more about making a concerted effort at being a better programmer.

PHP has always been my preferred choice for web programming, and I have explored a whole host of other languages over the years using them to scratch whatever itch I needed at the time. I am hoping by pursuing this goal that I might find some other languages to use as tools for other scenarios I encounter in my profession and my hobbies. My hope is not to necessarily become proficient with these new programming languages but to explore their strengths and how I might use what I learn from them to do interesting things in my chosen programming language.

The first language I am going to tackle is Ruby. I played around with Ruby on Rails a few years ago, and even wrote a rough blogging tool, but that is where my exploration ended. What interests me most about Ruby is that it is a pure object-oriented language. What little I know about Ruby is that just about everything is an object. I have read that Ruby is syntactically similar to Python and Perl, both of which I have written small programs, but nothing of real substance. Python in the last year or so has been my language of choice if I felt I needed something more than a shell script. I cannot say whether Ruby will replace Python, but I hope learning Ruby will at least enhance my Python programming abilities.

I intend to spend a month or more with each programming language I choose, as someone who enjoys learning new things this activity will mostly be a journey of learning. If along this journey I find a niche for an acquired skill I might devote more time on a particular programming language or project. As a result I do not want to put a number, an order or necessarily choose the other languages at this point, although I do have quite a few ideas.


Buff Updates

Over the past weekend and last several evenings I have been working on some updates to my homegrown blogging software. I removed some of the parts and pieces that were hosted by services, like the post sharing Javascript that I think was supplied by AddThis. Instead I opted to build in sharing tools to the four services I use myself. I also removed the random photo from Flickr and just included a link to the social sharing services I participate on along the top right column. The aim was to remove externally hosted pieces while still providing links and services those tools provided. The most time consuming part was finally making my urls search engine friendly.

Posts from my website can now easily be shared on Google Buzz, Google Reader, Twitter and Taglr.us. Taglr.us is the service you likely have never heard of, unless you follow me on Google Buzz. Taglr.us is a social bookmarking service that myself and a friend are building and that I intend to continue to use and find more interesting uses for during my daily activities. Taglr.us is like Delicious, but with more tagging features, and I personally guarantee that it is not going to disappear anytime soon.

For quite sometime I have wanted to make my urls more search engine and user friendly. All old links will continue to function, just from here on out the urls will be easier to read from a user perspective as well as being shorter in length. I thought with my blogging history nearing 10 years that I should tidy some things up around here. I hope to incorporate some of these same changes on BrutalDeluxe.us in the coming months. If anyone notices any broken features, let me know in the comments or via the contact link.


Fibonacci Number Sequence in Google Go

I have been mildly interested in Google Go since Google announced the release of the programming language. I toyed some with Go but had not dove in head first. This week I decided that I might like to learn Google Go so one of the first exercises is the Fibonacci Number Sequence. This was not an experiment in using the least amount of code and this may not be the most elegant way to achieve this result in Go, but it works.

package main
import fmt "fmt"
func fiboNacci(n int) (seq int) {
seq = n
if n < 2 {
return seq
}
seq = fiboNacci(seq-1) + fiboNacci(seq-2)
return seq
}
func main() {
for i := 0; i < 15; i++ {
result := fiboNacci(i)
fmt.Printf("%d",result)
fmt.Printf("\n")
}
}

Blog Search Feature -

So Saturday I had a day where all the kids were away and Julie was working her normal weekend hours. I had planned to work on a feature of my blogging software that I have never been happy with. That feature is the search, which only really worked correctly with single word searches. What I discovered is that my PHP programming skills have decayed and my understanding of JavaScript is null and void, not that those skills were very good anyway. Remember I am a hobbyist programmer only, not really my profession. The few hours I spent on the code Saturday virtually were wasted. I spent hours reading about arrays in PHP, not exactly what I had planned. In the end I got a mostly working better search feature. Though I am still not sure I like what I have here, so this project may rear its ugly head again.

I have some JavaScript debugging to do, because if you try and search for something that does not exist in any posts, the form is hijacked and just does not work until you refresh the page. However, the successful searches work great, including a nice sort listing the blog posts first with the most occurrences. This search is still very rough, it works better than my old search feature, but is not 100% really working. I am not sure I like using all the JavaScript I am using, I dig the whole Ajax thing but I worry about it breaking and not being able to fix it.

I kind of thought that I would knock out this feature with PHP5 rather easily and that I could move onto my planned Python programming projects. I never got around to the Python programming at all. If any PHP gurus read this blog and can point me to a great tutorial on building a search feature that searches a MySQL database I would appreciate it. Most of the tutorials I found do a pretty generic search, which is what I originally coded and it did not work well or at all with searches using more than one word. Infact I think my old search feature used more SQL features than PHP. I thought I had read that PHP5 had some added functionality that would make coding a search feature better than ever, using PHP more so than SQL. I could not really find anything that I was happy with or did anything different than I was already doing.


Bruce Springsteen Songs From 2009 Setlists Sum

Buff News Entry

UPDATED 8/24/2009 to include latest setlist. This is the final update, if you want me to continue to update you will have to contact me.

One of my Summer of 2009 goals is to learn Python. My current path for doing this is using Python to handle some of my system administration tasks. I am quite strong in Shell Programming as well as using sed, awk and Perl to complete most if not all of my administration tasks and PHP for all my web programming, so the real challenge is forcing myself to use a new tool to complete tasks I can do with my current set of tools. This of course is a minor inconvenience all for the sake of learning Python. I am looking for other opportunities to practice Python, because the only real way to learn a new language is to use it. I am a huge Bruce Springsteen fan and I finally will be seeing Bruce on May 15th at Hersheypark Stadium for the first time. Wanting to make the most of the moment, I want to make sure I am up on all the songs he will likely be performing. I threw together a Python program that takes all the setlists starting with the Super Bowl performance, processes the setlists into a list with the number of performances of each song Bruce performs on the 2009 tour. I will try and keep this list updated on a regular basis. So far it seems likely that the top twelve songs on this list will be played at each performance.

Song Performed
--------------------------------------------------------------------------
BORN TO RUN ==> 59
WORKING ON A DREAM ==> 59
AMERICAN LAND ==> 58
BADLANDS ==> 58
JOHNNY 99 ==> 58
OUTLAW PETE ==> 58
LONESOME DAY ==> 57
THE PROMISED LAND ==> 57
THE RISING ==> 55
WAITIN' ON A SUNNY DAY ==> 55
SEEDS ==> 52
HARD TIMES ==> 43
RAISE YOUR HAND ==> 43
LAND OF HOPE AND DREAMS ==> 38
DANCING IN THE DARK ==> 37
RADIO NOWHERE ==> 36
OUT IN THE STREET ==> 33
KINGDOM OF DAYS ==> 32
TENTH AVENUE FREEZE-OUT ==> 27
THE GHOST OF TOM JOAD ==> 27
THUNDER ROAD ==> 27
GLORY DAYS ==> 26
NO SURRENDER ==> 24
ROSALITA ==> 23
TWIST AND SHOUT ==> 23
THE WRESTLER ==> 21
BOBBY JEAN ==> 20
MY LUCKY DAY ==> 20
SHE'S THE ONE ==> 20
HUNGRY HEART ==> 19
SPIRIT IN THE NIGHT ==> 15
YOUNGSTOWN ==> 15
BECAUSE THE NIGHT ==> 14
PROVE IT ALL NIGHT ==> 14
THE RIVER ==> 14
JUNGLELAND ==> 13
TRAPPED ==> 10
WORKING ON THE HIGHWAY ==> 10
GROWIN' UP ==> 9
I'M ON FIRE ==> 9
NIGHT ==> 9
CANDY'S ROOM ==> 8
DARLINGTON COUNTY ==> 8
I'M GOIN' DOWN ==> 8
MY LOVE WILL NOT LET YOU DOWN ==> 8
AMERICAN SKIN ==> 7
CADILLAC RANCH ==> 7
DARKNESS ON THE EDGE OF TOWN ==> 7
ADAM RAISED A CAIN ==> 6
COVER ME ==> 6
DETROIT MEDLEY ==> 6
MURDER INCORPORATED ==> 6
SEVEN NIGHTS TO ROCK ==> 6
ATLANTIC CITY ==> 5
BACKSTREETS ==> 5
GOOD LOVIN' ==> 5
MONY MONY ==> 5
SOMETHING IN THE NIGHT ==> 5
FOR YOU ==> 4
JACKSON CAGE ==> 4
RACING IN THE STREET ==> 4
RAMROD ==> 4
SHERRY DARLING ==> 4
THE E STREET SHUFFLE ==> 4
THE TIES THAT BIND ==> 4
BE TRUE ==> 3
BORN IN THE U.S.A. ==> 3
DOWNBOUND TRAIN ==> 3
GIRLS IN THEIR SUMMER CLOTHES ==> 3
GOOD EYE ==> 3
IDAS SOMMARVISA ==> 3
KITTY'S BACK ==> 3
MUSTANG SALLY ==> 3
PROUD MARY ==> 3
RENDEZVOUS ==> 3
SANTA CLAUS IS COMIN' TO TOWN ==> 3
SURPRISE SURPRISE ==> 3
THIS LIFE ==> 3
BURNING LOVE ==> 2
DU SKAL IKKJE SOVA BORT SUMARNATTA ==> 2
E STREET SHUFFLE ==> 2
FACTORY ==> 2
HANG ON SLOOPY ==> 2
I FOUGHT THE LAW ==> 2
IF I SHOULD FALL BEHIND ==> 2
INCIDENT ON 57TH STREET ==> 2
IT'S HARD TO BE A SAINT IN THE CITY ==> 2
JANEY DON'T YOU LOSE HEART ==> 2
LONDON CALLING ==> 2
LOOSE ENDS ==> 2
MOUNTAIN OF LOVE ==> 2
MUSS I DENN ZUM STDDTELE HINAUS AKA WOODEN HEART ==> 2
PINK CADILLAC ==> 2
POINT BLANK ==> 2
ROCKIN' ALL OVER THE WORLD ==> 2
STREETS OF PHILADELPHIA ==> 2
SURPRISE, SURPRISE ==> 2
THE FIELDS OF ATHENRY ==> 2
THIS HARD LAND ==> 2
TWO HEARTS ==> 2
WHO'LL STOP THE RAIN ==> 2
WILD THING ==> 2
YOU CAN'T SIT DOWN ==> 2
YOU NEVER CAN TELL ==> 2
4TH OF JULY, ASBURY PARK ==> 1
634-5789 ==> 1
96 TEARS ==> 1
A RIANXEIRA ==> 1
AN DER SCHOENEN BLAUEN DONAU AKA THE BLUE DANUBE WALTZ ==> 1
BACK IN YOUR ARMS ==> 1
BAD LUCK ==> 1
BOOM BOOM ==> 1
BORN TO BE WILD ==> 1
COMA GIRL ==> 1
DESDE SANTURCE A BILBAO ==> 1
DOES THIS BUS STOP AT 82ND STREET? ==> 1
DRIVE ALL NIGHT ==> 1
DS VOGELLISI ==> 1
EN YNDIG OG FRYDEFULD SOMMERTID ==> 1
EXPRESSWAY TO YOUR HEART ==> 1
FADE AWAY ==> 1
FIRE ==> 1
FLOWER OF SCOTLAND ==> 1
FROM SMALL THINGS ==> 1
GIVE THE GIRL A KISS ==> 1
GOOD ROCKIN' TONIGHT ==> 1
GOODNIGHT IRENE ==> 1
GREAT BALLS OF FIRE ==> 1
GYPSY BIKER ==> 1
HAVA NAGILA/BLINDED BY THE LIGHT ==> 1
HEAT WAVE ==> 1
HUMAN TOUCH ==> 1
I AIN'T GOT NO HOME ==> 1
I WANNA BE SEDATED ==> 1
I'M A ROCKER ==> 1
I'M BAD, I'M NATIONWIDE ==> 1
INDEPENDENCE DAY ==> 1
INTO THE FIRE ==> 1
JERSEY GIRL ==> 1
LAND OF 1000 DANCES ==> 1
LIKE A ROLLING STONE ==> 1
LITTLE LATIN LUPE LU ==> 1
LONG WALK HOME ==> 1
LOS PAJARITOS ==> 1
LOST IN THE FLOOD ==> 1
LOUIE LOUIE ==> 1
MARY'S PLACE ==> 1
MY CITY OF RUINS ==> 1
MY GENERATION ==> 1
MY HOMETOWN ==> 1
PRETTY WOMAN ==> 1
QUARTER TO THREE ==> 1
QUEEN OF THE SUPERMARKET ==> 1
RED HEADED WOMAN ==> 1
ROCKING ALL OVER THE WORLD ==> 1
ROULETTE ==> 1
SEVENTH SON ==> 1
SEVILLA TIENE UN COLOR ESPECIAL ==> 1
SHA LA LA ==> 1
SO YOUNG AND IN LOVE ==> 1
STREETS OF FIRE ==> 1
SUMMERTIME BLUES ==> 1
THE DARK END OF THE STREET ==> 1
THE FEVER ==> 1
THIS LAND IS YOUR LAND ==> 1
THIS LITTLE LIGHT OF MINE ==> 1
THUNDERCRACK ==> 1
TOUGHER THAN THE REST ==> 1
TRAVELIN' BAND ==> 1
WELL MAY THE WORLD GO ==> 1
WOOLY BULLY ==> 1
YOU CAN LOOK ==> 1
YOU REALLY GOT ME ==> 1


Kids and Programming

Buff News Entry

Part of what interested me in computers at a young age and continues to interest me in them to this day is using the computer to create something. For me it does not get much better than when you want to do something with the computer and some code and you begin creating and seeing results. Over the years the biggest road block for me has been coming up with ideas of something I need to program. I would probably program a whole lot more if I could convince myself to reinvent the wheel more often. Sometimes I just like the wheel so much that I cannot bring myself to start from scratch on it, if you know what I mean. Still, a large part of the motivation to host a blog in the era of Facebook is that I created this place, right down to the software I blog with. It is sort of like the guy driving the car where he rebuilt the engine from scratch.

My first real exposure to computers was probably video games, somewhere along the line I decided I wanted to know how the games worked. The curiosity to know how to program computers occured right away and I am not sure why, I just wanted to know how to do it. This is a pretty common story for most of my friends that work in the IT field. Computers were not so common in the household when I was growing up. Most households did not have a personal computer, mine did not. My exposure was through my brother, the very few friends who had one and finally the terrible computer classes we had starting in Junior High. I wanted to know how to program the computer and I want my kids to at least have a basic understanding of what is behind that computer game, music player and web browser. Perhaps one or all the kids might actually decide they want to learn more and do some programming of their own. If not, that is cool too, but at least they will have had the opportunity.

Jake is the oldest at 7, which is probably just the right age to start introducing some basic programming concepts to him. He and Riley both love gaming, Riley got her own Leapster for Christmas this year. I stumbled upon a pretty interesting little game that teaches some very basic programming concepts, concepts I was certainly not exposed to at age 7. Light-Bot has some interesting puzzles that eventually require you to create functions for repetitive actions in order to complete the puzzle. Jake spent about an hour with Light-Bot and enjoyed the puzzles; at first the functions were confusing but he was using them after having them explained. For now this is a nice start as he and his sisters continue to master their keyboard and mouse skills. I have some other ideas to perhaps spur further interest later on, but I will wait until we venture down those paths.


Java I Hardly Knew You

Buff News Entry

I never call myself a programmer in my day job. Sure I do program from time to time but it is part of my System Administrator duties and never would I list my day job as a programmer. I do some programming in my spare time but overall most of my programming experience over the past 10 years has been with shell scripting, a little C and C++ thrown in and PHP for web development. I could throw in some other languages that I checked out (Python and Ruby) and the Perl that I use as a command line tool more than I have as a programming language. When asked last week at my day job if I knew C or Java I responded that I know C from the hobbyist perspective and that I would not pursue a profession at this time as a C programmer. As far as Java, I wrote a Java applet or two in 2003 when giving the language a look but I spent no more than a few hours coding Java.

That being said Java and I have crossed paths quite a few times over the years. Some of my primary duties used to be with WebSphere and a host of other applications I have installed or supported over the last few years seemed to have some Java tied in somewhere. I have installed and updated Java so many times that I have lost count. Shortly after I was asked whether I knew C or Java I was told to start learning Java. Along with my System Administration comes the UNIX user support duties that often means those involved with building the product we sell to run on UNIX systems, Windows and even Mainframe need a tool to do something. I have also had my hand in supporting and improving the packager and installer for the product. I suspect a Java piece is wanted for some task and I am going to be taxed with writing it.

One thing I will say about my current employer is that I am encouraged to expand my knowledge. While my day job is not what I would call perfect, I am afforded time to learn other IT skills without being made to feel as if I am doing something wrong. Something I experienced hands on and to the extreme with a former employer.

Over the past week or so I have been exploring and toying around with Java, writing dozens of programs to do mostly trivial little tasks. I need to learn to walk before I can run. Coming into Java now that it seems to be a mature language, I am really impressed. I would go so far as to say I am enjoying learning Java and I could see me doing future projects in Java rather than some of the other programming languages I used in the past. It is obviously too early for me to say it is my language of choice but I am enjoying adding it to my toolbox.


Code Comment

I noted this comment has a word that would be great to include in the scrambled word of the day.

# Obtain an array of the current generations; the array
# will be ordered lexicographically according to generation
# number.

Look for it in the rotation