Two Guys Arguing

Long Walk After the Sun – Challenge

Posted in challenge by benjaminplee on 05.28.09

This question popped into my head the other day out of nowhere but sounded really interesting.  It may involve, but is not limited to, programming, geometry, 3d data visualization and astronomy.

Setup: At 12:00 AM, January 1st, 2009 a man is standing in his front yard.  That morning, as soon as the sun breaches the horizon, he begins walking at a constant rate in the direction of the sun.  He walked all day, always in the direction of the sun, until nightfall when he stops and sleeps.  He does this every day for an entire year.  As the sun climbs higher in the sky each day, he always walks in the direction of the sun relative to directly above his head (assume he has a magical sundial that is very accurate).  Oh, and he can walk on water and through mountains (terrain doesn’t slow him down nor stop his motion).

Challenge: Given he lives in downtown St. Louis, Missouri, and that he walks at a constant rate of 3 miles/hour, where will the man be sleeping on December 31st, 2009 after the sun has set?

Bonus points for solutions that can compute his final location based on an arbitrary starting location and/or walking speed.  Averaged sun rise and sun set times can be used, but using some historical monthly/daily averages would be even better.  Also the changing location of the sun’s arc during the year could/should be taken into consideration.  I can imagine this is a fairly hard problem, but it seems doable with some effort.  I will make an honest attempt at solving it myself, but if anyone is up to the challege, please post your thoughts and findings.  I found the problem interesting b/c several “easy” answers jump out initially but without the math, I can’t be sure which one if any are true (will he end up in the same place?  somewhere near the equator? at a pole?  go in circles?

Leading by Bleeding – my tech map

Posted in questions by benjaminplee on 05.26.09

Below is my take on a tech map (see previous post).  I had a hard time knowing where to draw the line (languages? librarys? tools?  processes and ideas?) and how to sort them.  I decided on three main areas.  “Bleeding Edge” are things that are popping up in Google Reader lately and/or things that seem to be gathering some traction are sound interesting.  “Working” are the main things going on day to day.  “On the way out’ aren’t things I think are going to be gone in a year or two , but things that seem to be less new and interesting news surrounding them.  Right or wrong its my take and I am a bit sad by the lack of knowledge in the bleeding edge area.  I am going to have to work on that.

Ben's Tech Map

Ben's Tech Map

Hopefully the words are legible in the image.  What do you think?

TECHnc Cleveland 2009 and Ignite

Posted in Uncategorized by benjaminplee on 05.25.09

A great friend of mine is helping coordinate a rather cool event coming up in June in the Cleveland area.  TECHnic as he is calling it is going to be a big summer picnic bringing together anyone who has an interest in technology (namely the members of several Cleveland area technical user groups) for a day of music, food, and nerd talk.  If you are interested, you can find more info here.

A few other friends have mentioned going Ignite events in their home cities.  The basic premise is that a group of people present 5 minute presentations where they have only 20 slides which automatically switch every 15 seconds.  From what I can tell, they end up with some pretty interesting talks.

I would love to attend/help put together an event like either of these in the St. Louis area but with my current travel schedule I don’t know if I could.  Maybe in a couple of months.

Leading by Bleeding

Posted in questions by benjaminplee on 05.25.09

Tonight Chad Fowler posted on twitter an interesting comment and link to a blog post by David Copeland and his take on his knowledge of technologies; from the bleeding edge to those “on the way out”.  His post was inspired by an exercise in Chad’s new book, The Passionate Programmer, which is on my list of books to read in the very near future.

My initial reaction was three fold:

  • Annoyance that I couldn’t mark more of them in yellor or green.
  • Happiness that I had at least heard of or had some very basic knowledge in almost all of them.
  • Curiosity on how he had picked his list, why he had not included some others, and why he had placed some where he had.

I intend to fill out a similar personal survey tomorrow which I will post … but until then I leave this question to anyone who reads this:  What would yours look like, and what things would you remove/add/move if you were doing it?

Obviously any such list could contain any number of items depending on your background and scope (what do we include?  languages?  ideas?  patterns?) but a few that I thought were missing off of the top of my head were:

  • Silverlight
  • Adobe AIR / Flash
  • JavaFX
  • RCP applications
  • SOA
  • Web services
  • Haskel
  • Ruby
  • Functional programming
  • Agile development practices (Lean/XP/Scrum)
  • Hibernate or other ORMs (e.g. ActiveRecord, iBatis, etc)
  • UAT libraries / tools (e.g. Selenium, WebDriver, WebRat, Wati[R|J|N])

It really is hard to know where to stop.  Quickly it feels like a corporate skills inventory list that eveyone updates when they are hired and then never again.  We will see what the guys at work can come up with tomorrow and then see what my personal sheet looks like.  If you do one of your own, can think of something thats missing or just have a thought … please leave a comment.

At the very least, it was a very thought provoking post.

starting in the box

Posted in configuration, linux by youngnh on 05.19.09

So how does this thing work? Well, it runs on a Dell Optiplex I keep under my desk.

I run Fedora 10 on my day-to-day laptop and absolutely love it. That’s why, after months of collecting dust (and a few very short weeks of running MINIX, but that’s another post) I popped the Fedora 10 LiveCD into my Optiplex’s drive and…waited. If I was dead-set on Fedora, I would still be waiting today because, for some reason, the LiveCD never finished loading.

My box being as old as it is, I took a stab in the dark and guessed that my hardware just wasn’t up to par with the latest Fedora drop. Shame.

This was around the turn of the year, and at that same time a group of very bright gentlemen that I work with had resolved to learn Haskell. Following along, I dove into the Haskell community a bit and became very impressed with the things that Haskellers had to say about Arch Linux. I burned a quick CD, installed it and played around with it a bit.

The Arch Linux LiveCD isn’t anything fancy. The more time I spend on my laptop, though, the more I find myself shutting things off or disabling notifications or swearing at software when I find I can’t do either. My tastes run towards the simple and substantive. Software is one thing I feel that, with increase in quality, should decrease in weight.

Arch Linux starts you off very low to the ground. The full install doesn’t even give you X11, much less a Desktop or windows or Minesweeper, which is disorienting. One thing that delighted me, however, was that it set me up with the filesystem of my choice, XFS. I remember very sharply that Fedora did not give me the option to install the XFS file system out of the box.

My daily programming touches maybe 10-20 userspace programs and I installed those about as quickly as I could think of them. With a package manager, though, it makes great sense to me to only install the programs I need when I need them. Anything else is just taking up space and processor that it doesn’t need to.

Beyond that, Arch Linux’s wiki was an invaluable and easily navigable resource. I spent about 12 hours over one weekend setting up my box. My final effort was installing stumpwm. In 12 hours of installing and configuring, it was the first program that gave me a wince of trouble. Turns out, though, that there was an active forum post on the Arch Linux forums that night discussing the very problems I was having. A few posts later and I not only had a sweet, minimal, emacs-like window manager installed, but I felt like I had left behind some advice useful to anyone who might follow in my footsteps.

After the Arch Linux installation, I had a CouchDB instance and sbcl to run my imagined lisp scraper. I just needed to (1) make my box visible to the internets and (2) fill it up with data.

Tagged with: , , ,

of stats and scraping

Posted in lisp by youngnh on 05.13.09

This all started when I wanted to share some stats I had been calculating privately with the rest of my fantasy baseball league.

Last season I wrote a handful of emacs lisp functions to scrape Yahoo!’s fantasy baseball site with the intention of having a status update on my team every time I opened an emacs session to do my days work (The faithful among us will note that I am far out of my depth and Doing It Wrong if I actually close my emacs sessions at all, much less doing so every morning. Duly noted). So I had the raw numbers within my reach.

I decided that a CouchDB database was the best place for this data to live. Its new, so there’s cool points for making something useful with it, but more than that, when retrieving data from a CouchDB instance, it is returned in JSON format. That decided it for me. Javascript is a language near and dear to my heart. Just about every developer in my league has been in web development, so they’ve all hard-won some twisted semblance of competence in the language, and if that experience had scarred them irreparably, then just about every other major language out there has a JSON library. Best of all, data has a public http url for easy access (The CouchDB quarter will say here that CouchDB is RESTful, which is kind of a sly techo-descriptive pun as CouchDB’s slogan is “Time to Relax”).

With data in CouchDB, anybody could get access to my data (Yahoo!’s data), manipulate it, and make something cool for themselves. The driving forces behind CouchDB, though, hold even more potential. Users could write Javascript functions and upload them back to the database and then everyone would have the cool thing instead of everyone having their own cool things. CouchDB calls itself a database, but it can host code, keep revisions of data, and serve documents. “Excuse me, but you got your wiki in my GitHub”, if you will. If your users have some ability to write code, the applications that can grow out of a single CouchDB instance are enormous. However, nothing would sprout in my database if I couldn’t put data into it.

This was a bit of a problem as all of my fantasy baseball code was written in emacs lisp. Emacs can invoke programs from your system and redirect their output to one of its buffers. My code leaned heavily on this feature to invoke wget, using it to handle sessions and cookies while I slurped up pages from our league’s site, and then used emacs’ extensive buffer search facilities to ferret out and collect the data I was interested in.

In order for the web site to be useful at all, it would need to be updated daily (something that Yahoo! itself has a spotty track record of). It would have been possible to cron a task that started emacs and executed my emacs lisp scripts, but, again, those faithful among us would be wincing in pain at the thought of opening and closing emacs so often. Its not an elegant solution.

I settled on using Steel Bank Common Lisp to solve my problems. It adds threads and function scheduling to the Common Lisp toolkit. I decided I would start an SBCL image and keep it running for the duration of the season. I would schedule a function to run every morning that would scrape stats and then insert those stats into a CouchDB database. It would work beautifully, harmoniously. The faithful would be pleased. Problem was, I had never used Common Lisp like this before. My exposure was limited to starting up an image, hacking around until I produced some string or file or number useful to me, and then I shut it down and went on my way. I had no right to expect that I could keep a SBCL session running for 182 games during the summer.

If I did not have a touch of mental illness — a little miswiring in my wetware subroutines — I might have let that thought stop me, and my next few posts would be about a wonderfully prosaic, conventional and dull system written in Java. It won’t be.


Get every new post delivered to your Inbox.