Friday, December 24, 2010

I have a dream

Anyone who has ever had a job in the IT world or been labeled a "computer guy" can appreciate this.





I hope I haven't offended any grandpas. I doubt it since their "internet" is not working.

Saturday, October 16, 2010

What would you bring?

So the question is "If you went back in time, what are three things you would bring with you?". The rules of the question are, I'm assuming you are going back in time to around AD 1400-1600. Plus, these three things do not have to be of a practical nature. Actually, the real question is "what are three things that would blow ancient peoples minds?".

My three things are: Computer printer paper, BIC pens, and a solar powered digital watch. Notice how I didn't choose a car or computer. The reason is obvious. There wasn't any refined gasoline or electricity back then. So in essence, both items were nothing more than sophisticated petrified rocks.

In those days they had paper. Lots of things were printed on paper. The difference is that back then paper was a valuable resource. Today paper is disposable. Right now, I could take an entire block of printer paper and casually toss it in the trash. That act would have been unheard of in those days. I chose pens for approximatively the same reason. They had pens. They just didn't have pens that wrote as uniformly as ours do. I also chose pens for the same reason I chose a solar powered digital watch. Craftsmanship. In those days, the super engineers would craft the most technically superior watch they possibly could. Only royalty could afford these timepieces. Now a watch that does more and tells more accurate time costs almost nothing. Almost anyone can afford to purchase one of these piece-of-crap Casio watches. So the choice of a watch is almost an F--- you to ancient watchmakers. Our modern technology trumps your primitive genius. Yeah, that's right. I'd go back in time just to stick it to the watchmakers.

So there you have it. What would you bring along? There are wrong answers and there is a quiz. I will be grading it. JK.

Wednesday, September 1, 2010

Honeymoon in Iceland

If you'd rather skip this and just see the pictures, they are here.

Why did we choose to go to Iceland for our honeymoon?

That was the single most asked question asked of us leading up to our wedding. The short answer is we don't know. Several months before we decided on Iceland, I told Heidi that I thought we should have a more conventional honeymoon. I said we can save the exotic trips for other vacations but I would rather just relax on our honeymoon. Somehow I forgot about that conversation later.

The truth is we both were intrigued by Iceland. I thought of it as almost a mystical place. The type of place most Americans do not visit and do not know a lot about. Heidi agreed with that assessment and we came to a decision about going to Iceland rather quickly.

On our final night there, I asked Heidi "What are three words you would use to describe Iceland?". Her words were "wonderful, beautiful, and unexpected". My words were "familiar, unfamiliar, and unexpected".

I chose my words for the following reasons:

Familiar

Actually being physically in Iceland made it seem a lot less mystical. Even though most Icelanders believe in elves, Iceland is very much a modern European country. It has a homogeneous, highly literate population of 320,000 people. In the tourist office, we picked up an English language newspaper called "The Grapevine" that I enjoyed reading. It discussed Icelandic politics and life in much the same way an American magazine like "Rolling Stone" would.

Unfamiliar

For starters the language they speak, Icelandic, is very foreign to Americans. It is the old Norse language unchanged for centuries. It contains 32 letters and does not really sound at all like English. Also, Icelanders (and most Europeans for that matter) do not dress like Americans. As we walked around we played a game of "Guess who's American". It was not difficult. Also, their culture seemed both simpler and richer than ours. For example, they all use the paturnames convention for last names. The person we rented our apartment from was named Gunnar Gunnarsson. That is, Gunnar "Son of Gunnar". Because of that, everyone goes primarily by first names in Iceland.

Unexpected

The most unexpected part of Iceland for me was the four day hike we went on. It was challenging yet doable. Fun yet grueling. The degree that we engaged with our fellow hikers (mostly Europeans) was also unexpected. Towards the end of the four days, we felt almost like a family.

Heidi chose her words for the following reasons:

Wonderful

For Heidi, wonderful really meant a sense of wonderment. It did almost seem surreal at times to think about exactly where we were.

Beautiful

For you Tolkien fans, Iceland has a very "middle earth" quality to it. In that way, it was very beautiful. It is filled with hills, mountains, grassy fields, and volcanoes. During the hike, we both kept expecting run into Gandolf.

Unexpected

Even though Heidi had spent a considerable amount of time reading travel guides, neither of us really knew what to expect when we arrived. I think we were both pleasantly surprised by how relaxing the trip was. The hike was physically exhausting at times, but mentally it was very recharging for us.

Random Stuff

Getting to Iceland was simple enough. We took a car, taxi, plane, tram, plane, bus, and bus. A mere seventeen hours passed between the time we left our house in Stephens City, VA until the time we were standing in our Reykjavik apartment.

Every Icelander we spoke to spoke English. Regardless, small language nuances were still a constant source of amusement for us. For the life of us, we could not pronounce anything but the simplest of words in Icelandic. For example, we still do know how to properly pronounce the name of the hike we took (laugavegur). After every attempt, Icelanders would try to correct us but to no avail.

The amusement went both ways, though. A lot of the English translations we heard were sort of awkward. A British woman we met on the hike told us that when she was on a bus tour, on a stop, the guide told everyone over the microphone "You need to use the toilet because you just had breakfast".

When we were visiting Thingvellir National Park, Heidi asked one of the employees "where is the Viking Ship Sculpture?". He had no idea what she was talking about. It turns out this sculpture is in Reykjavik, a good 40 kilometers away. Afterward we laughed about that and compared it to someone going to the George Washington National Forest and asking the park ranger where to find the statue of George Washington.

All of the appliances we used in our apartment were modern. That didn't prevent us from not figuring them out, though. For example, we could not figure out how to get the toaster lever to stay down. To make toast, we would stand by the counter and manually hold it down. At first, I asked Heidi exactly how "toasted" she needed her toast to be.

We also didn't figure out how to lock the door of our first apartment until our last day there. Not a huge deal. Reykjavik has very little crime.

One fun fact we learned was that last year all of Iceland had only 4 fatal car accidents in the entire country. The year before there were 20. Contrast that to 34017 in the US in 2008. Actually, considering the population of Iceland the rate of fatalities to people is on average about .005%. The US percentage is only slightly higher at about .009%. Driving is also a lot more common in the US.

Icelanders are not known for having great diets. They tend to eat a lot of dairy products. They also do eat a lot of fish but often deep fry it. At a local restaurant aptly named "Icelandic Fish and Chips", they deep fried both the fish and the vegetable side dish. It reminded me of a Simpson's episode where Moe opens a family restaurant and advertises a traditional family dinner "deep fried to perfection".

The strangest part of their diet is how much they love hot dogs (pylsur in Icelandic). The most popular restaurant in Reykjavik is a hot dog stand. This hot dog stand is also a point a national pride because Bill Clinton famously ate a hot dog with just mustard there. If you order a "Clinton" you will get a hot dog with just mustard. We ate there three times. Most of the time we had our hot dogs with "everything". Everything included ketchup, mustard, onions, and mayo. They were good.

We tried to save money by making sandwiches at our apartment. We didn't buy a lot of sandwich making ingredients, though. Really we just had bread and a block of cheese. We would toast the bread (by standing next to the toaster) and then put some cheese between it. We ate a lot of these cheese sandwiches. Heidi joked that when she was in college, a place in Harrisonburg advertised "cheese on toast". She didn't think she would be eating them on her honeymoon.

We went out in Reykjavik on Friday and Saturday night. Before leaving our apartment we mixed drinks of Applesine (an Icelandic soda similar to Orange Crush) and Vodka. We didn't have any music to listen to, but Heidi had 8 sample tracks on her Droid phone. So we listened to the "8 songs" several times through.

The weather vacillated between cold and really cold. Actually, the first day it was 70 and sunny. After that, it was between 30 and 50. We purchased hats and gloves so we wouldn't freeze on the hike.

Things were necessarily more expensive in Iceland. One reason is that most everything (except fish) has to be imported. For example, in the US it is possible to go out to a mid-level restaurant and have dinner for two (with wine) for about $60. In Iceland, that same dinner would be around double that. I vowed never to complain about prices in the US again.

Another thing I noticed was how few things were complimentary. I was amused that in a cafe, packets of ketchup were being sold for 10 Icelandic Kronur (ISK). That amounts to about 8 cents.

Activities

Our first five days in Iceland were spent in Reykjavik. Reykjavik is Iceland's largest town and roughly 60% of the population lives there. While in Reykjavik, we ran in a 10K, participated in Icelandic Culture night, went on a Bike tour, went swimming, and did get to see the "Viking Ship Sculpture". Since the downtown area of Reykjavik is roughly the same size as downtown Winchester, VA, we walked everywhere and never once got lost.

The 10K was on Saturday morning. Our approach was to "not break any records". We ran together and finished in around 55 minutes. Right at the end of the race, a guy pushing a stroller (possibly American), passed us. I told Heidi I didn't want us to get beat by a stroller guy. So I sped up and passed him. He must have heard me because he too started speeding up. In the end, I did beat him, but it took an all out sprint.

Swimming is the Icelandic national pastime. Unlike Americans and baseball, most Icelanders do swim. Therefore, there are a lot of community pools. We went to one after the 10k called (in English) the "West Town Pool". It was big and inexpensive. It had an Olympic sized pool, 5 hot tubs, and a steam room. The temperature in the hot tubs went from "warm bath" to "scalding" (105 degrees).

Hot water is plentiful in Iceland because of the volcanoes. Instead of heating water, all hot water is piped up from the ground. Because of that, in some areas, cold water is more difficult to produce.

Another reason we felt comfortable walking everywhere in Reykjavik was because on Friday we went on a guided bicycle tour around the whole city. One of the highlights was biking past international pop superstar Bjork's house. We also ran past her house on Saturday during the 10k and we could see her at the window watching the runners.

Saturday night was Icelandic Culture night. This is a once a year event and is sort of like Winchester's Apple Blossom festival. It was very neat for us because we met an Icelandic couple. They used their connections to get us into a somewhat exclusive bar (we didn't have to wait in line like other people did). Playing that night was the band they (and some other Icelanders) considered to be the "best band in Iceland". We asked them "even better than Sigur Ros?". Sigur Ros is an Icelandic indie band well known in the US. There response was "We don't really like Sigur Ros". The band we saw was named "Salin". I would compare them to perhaps "Genesis" or maybe "Men at work". Comparisons were a little difficult considering their lyrics were in Icelandic, though.

We stayed in two different apartments in Reykjavik. We stayed in the first apartment for 5 nights at the downright reasonable rate of $520. This place was small but cozy and perfectly located near the City Center. The owner of it actually lived in the apartment right next to ours. He and his wife were very nice.

His wife, Annuk, recommended the Icelandic National History Museum to us. It is located at the University of Iceland (close by in Reykjavik). We went and it turned out to be a really fun, informative place.

His business partner, Gunnar, was the guy who rented the place to us. He was a very nice, honest guy. At no charge, he stored our extra suitcases for us while we were on the hike. Also, his directions for getting us into the apartment after we arrived late Wednesday night were extremely detailed and spot on. Very much appreciated.

The second apartment was a lot more expensive and a lot swankier. We only stayed there one night after the hike was over. It was almost like our reward after the spartan-like food and lodging on the hike. It was a very fun place, but honestly we were just as happy at Gunnar's place. It also sort of felt like cheating after the way we lived on the hike.

In the small world department, while buying hats for the hike, we met a couple from Arlington who live mere blocks away from Heidi's old apartment.

We also met a couple of guys from Cincinnati on Friday night. They told us they would stay up all night to watch us in the 10k Saturday morning. We never saw them again.

Our final activity before returning home was the Blue Lagoon. The Blue Lagoon has been described as the "Disney World of Iceland". It is a huge, geothermally heated pool of mineral water. It was fun but neither of us could possibly spend more than a couple of hours there. It is very touristy. Days before we went, another tourist in Reykjavik described it as "Heaven". I told Heidi "I hope Heaven is not a big bathtub".

The Hike

The most memorable part of the trip for both of us was the hike. Before the wedding, Heidi was more apprehensive than me about doing a four day hike on our honeymoon. I was more Pollyanna about it which probably frustrated her a bit. It helped my cause that Annuk (our neighbor in Reykjavik) told us the hike was easy. It turned out she was only partially correct.

The total distance we traveled in four days was 54.3 kilometers. Each day we did between 12 and 16 KM. At the end of each day we stayed in huts setup to hold between 50 and 70 people. Staying in the huts sort of felt like being at summer camp. That is if summer camp was filled with a lot of Europeans.

We carried all of our stuff from hut to hut in our backpacks. Therefore, our food had to be light. We subsisted on trail mix, bars, and freeze dried meals. The meals actually tasted a lot better than we thought. We estimated our daily caloric intake to be between 1300 and 1800 calories a day. Not a lot.

The first day we arrived at the base camp in Landmannalaugar around 1 PM and started hiking around 3. Each subsequent day, we would start around 930 AM and arrive at the next hut between 1 PM and 3. Therefore, we had a lot of downtime. It was both strange and wonderful to have a lot of free time without access to a phone, Internet, or obligations of any sort.

The terrain on the hike varied greatly. A lot people made the comment that they could "take a picture every 5 minutes". The one constant was the total lack of trees. We didn't see a single tree until the last day and those were planted by man. We did see both glaciers and volcanoes. We walked through both streams and hardened lava fields.

The hike wasn't extremely difficult but it was intense at some points. There were a lot of hills in some parts. Also, we had to cross a few streams barefoot. That is more difficult than it sounds since the water was icy cold and fast. The bed was filled with sharp rocks. On the second day, Heidi fell into a stream while trying to jump onto a rock. Thankfully, we were near the hut at that point.

There was a core group of people who did all four days with us. They were the Spanish girls, the Danish girls (Rie and Louissa), the Germans (Max and Soloman), the Dutch guys (Dietrich and Sebastian and their father), and the French guys. We all got along well together. We played cards together and talked.

They all knew English fairly well. Even so, they liked learning new words and phrases from us. Max had never heard anyone call a coffee cup a "mug" before. At first, he thought we were talking about the "unseen, crawling things that you find in your sleeping bag" (bugs). We told him he could also use "mug" to refer to an ugly face.

The Danish girls taught us a new version of the card game "a**hole". In it 10s clear instead of 2s and Jokers are the highest value card. Her and Louisa were surprised when we told them it is primarily a drinking game in America. We were surprised by that.

We had a nice, long, intelligent conversation with the Dutch guys on the last night on a wide range of topics including vehicle emissions and the global recession. They told us that the Dutch government bailed out ING in much the same way the American government bailed out AIG.

Would we do Iceland again? Absolutely. In so many ways it was a memorable trip for us. It also whetted an appetite for more foreign travel in the future. Stay tuned.

If you've made it this far, I commend your diligence. Here are the pictures.

Wednesday, June 9, 2010

One Heck of a Deck

Full pictures found here.

For those of you scoring at home, I have finally finished building the deck. Here are some stats for all the deck-building fantasy leagues out there.

I started on April 4th and finished on June 8th. So it took me a little over two months.

The total cost was $914. That includes all the tools I "had" to purchase. The materials probably cost ~$600. I still think this is cheaper than what any contractor would charge.

It's a 12ft x 12ft deck. It consists of 26 2x6 boards on top.

It's sealed with Thompson Water Seal. Sealing it took about 30 minutes.

Would I do it again? Yes. But not right now. Now I want to relax and enjoy it a bit. Just kick back and enjoy a nice beverage while gazing at the hill.

Tuesday, June 1, 2010

Truth tables in Clojure

In an effort to learn Clojure, I'm working through these 99 Lisp problems.

One of the challenges found on there is to display a truth table for any arbitrary boolean expression.

So given an expression such as this:
(and (or :a :b) (nand :a :c))

In an imperative language, such an expression would look like this (pseudo-code):
((:a or :b) and (:a nand :c))

The challenge is to produce an output table which looks like this:
:a = true, :b = true, :c = true, :result = false
:a = true, :b = true, :c = false, :result = true
:a = true, :b = false, :c = true, :result = false
:a = true, :b = false, :c = false, :result = true
:a = false, :b = true, :c = true, :result = true
:a = false, :b = true, :c = false, :result = true
:a = false, :b = false, :c = true, :result = false
:a = false, :b = false, :c = false, :result = false

To make this happen we need several pieces.

1. a "not and" predicate function. This returns "true" when "and" would return "false" and vice-versa.
2. A way of getting all of the distinct keywords out of our expression. For the example expression, this would return :a, :b, :c
3. A way of generating all of the combinations of "true" and "false" for as many keywords as were in the expression. For example, [true true true], [true true false], [true false true], etc.
4. A way of substituting "true" or "false" for each keyword for the purpose of evaluating the expression.
5. Putting it all together to print out the truth-table with the results.

1. nand is easy. It is simply the opposite of "and".
(defn nand [a b]
  (not (and a b)))
(nand true true)
"false"

2. The keywords-seq function traverses through each nested list within the expression and returns a flat, distinct set of keywords
(defn- keywords-seq [expr]
  (letfn
      [(keywords
        [expr]
        (lazy-seq
         (if (empty? expr)
           '()
           (cond
            (seq? (first expr)) (keywords (concat (first expr) (rest expr)))
            (keyword? (first expr)) (cons (first expr) (keywords (rest expr)))
            :else (keywords (rest expr))))))]
    (sort (seq (set (keywords expr))))))
(keywords-seq '(and (or :a :b) (nand :a :c)))
"(:a :b :c)"

3. For all the combinations of "true" and "false" needed for a truth table, I used the selections function from clojure.contrib.combinatorics. For example:
(use '[clojure.contrib.combinatorics :only (selections)])
(selections [true false] 3)
((true true true) (true true false) (true false true) ...

4. To substitute "true" or "false" in place of keywords, I created a replace-all function. This takes a map of keywords with "true" or "false" as values and substitutes them into the expression, returning the expression with the substituted values.
(defn- replace-all [smap coll]
  (lazy-seq
   (if (empty? coll)
     '()
     (let [coll (replace smap coll)]
       (if (seq? (first coll))
         (cons (replace-all smap (first coll)) (replace-all smap (rest coll)))
         (cons (first coll) (replace-all smap (rest coll))))))))
(replace-all {:a true :b false :c true} '(and (or :a :b) (nand :a :c)))
"(and (or true false) (nand true true))"

5. Now for the good stuff. Let's put all this stuff together and print out the truth table. The main thing this function does is zipmap together the keywords with each "true"-"false" combination sequence. Once we have this map, we can use it to evaluate the expression to produce the result. We do this by running "eval" on the result of sending that map and the expression to replace-all. Then, we print out a formatted string of each input value with the result.
(defn print-truth-table [expr]
  (let [kws (keywords-seq expr)]
  (do
    (println (str "expression: " expr))
    (doseq
        [kwm (for [p (selections [true false] (count kws))]
               (zipmap kws p))]
      (do
        (doseq [m (into (sorted-map) kwm)]
          (print (format "%s = %s, " (first m) (second m))))
        (print (format ":result = %s" (eval (replace-all kwm expr))))
        (println))))))
(print-truth-table '(and (or :a :b) (nand :a :c)))
"
expression: (and (or :a :b) (nand :a :c))
:a = true, :b = true, :c = true, :result = false
:a = true, :b = true, :c = false, :result = true
:a = true, :b = false, :c = true, :result = false
:a = true, :b = false, :c = false, :result = true
:a = false, :b = true, :c = true, :result = true
:a = false, :b = true, :c = false, :result = true
:a = false, :b = false, :c = true, :result = false
:a = false, :b = false, :c = false, :result = false
"

For a point of reference, let's run this with the two classic truth tables. That is, a single "and" and a single "or".
(print-truth-table '(and :a :b))
"
expression: (and :a :b)
:a = true, :b = true, :result = true
:a = true, :b = false, :result = false
:a = false, :b = true, :result = false
:a = false, :b = false, :result = false
"

(print-truth-table '(or :a :b))
"
expression: (or :a :b)
:a = true, :b = true, :result = true
:a = true, :b = false, :result = true
:a = false, :b = true, :result = true
:a = false, :b = false, :result = false
"

Even though I'm sure my Clojure code is sub-optimal in a variety of ways, it still works and wasn't too difficult to implement. I could not imagine having to write this in traditional, imperative language such as Java or C#. It would surely take a lot more code to say the least.