Wednesday, July 11, 2012

DIY Climbing Wall


In our backyard we have a pretty nice playset that has been estimated to be at least ten years old and maybe even older.  As such, some parts of the playset are in need of repair or replacement.  Last year, we re-stained much of the structure (some of which looked like it hadn't been stained before) and tightened all the bolts.  This year we had our sights much higher.
The old ramp
The ramp into the playset was starting to fall apart.  Years of water and ant damage were starting to get us worried about the safety of the ramp.  Since I've always liked rock walls, we decided to replace the ramp with a rock wall entrance to the playset.  For our kids' birthdays (both in July), my mother-in-law ordered a rock wall from the original manufacturers of our playset.  It cost $600 and didn't quite fit our playset since it's so old.  We decided to return it (the installer took it back instead of installing it) and decided to build our own.  Along the way, I learned a lot about what to do and what not to do.  Hopefully, this helps some of you if you are ever in this situation.


I started with a basic design in mind.  I would have two 4x4 supporting posts and several boards to mount the climbing holds onto.  I bought:


  • 2 - 8' long 4x4 posts
  • 2 - 8' long 2x12 boards
  • 2 - 8" long carriage bolts w/washers, nuts and caps
  • a 1/2" drill bit (I didn't have one that big before)
  • sandpaper for my sander (I had run out)
  • a 4" paintbrush for staining
  • climbing wall hand holds


All of this stuff cost less than $150.  The other supplies I already had were:


  • a circular saw
  • a small sander
  • wood screws
  • a drill (with drill bits)
  • wood stain
  • a hammer
  • a small level


Day 1 - Sunday evening.  First, we went shopping and bought the wood.  When we got home, I started by measuring the opening that the old ramp was waking up and cutting the 2x12 boards to just under that width.  Next, I measured the height that I wanted the posts to be and I cut those out as well.  I started sanding the boards and posts, but ran out of daylight.


Day 2 - Monday evening.  We took my kids to get the bolts and handholds.  Getting the handholds was the hardest part.  First we went to REI because I know someone who built a climbing wall and they had gotten their holds there, but apparently REI recently stopped carrying them in there stores (sold online only).  After that we called: Fleet Farm, Gander Mountain, Home Depot and finally, Menards.  Generally, I'm not a big fan of Menards, but they did save us from having to order the holds online and having to wait to finish building the wall.  So, we bought the hand holds and bolts there and went home.  I finished sanding the boards and put a first coat of stain on the boards and posts.  The stain is very quick to dry, so I got to start assembling the wall.  I used wood glue and wood screws to put attach the boards to the posts.
The wall after the second coat of stain
Day 3 - Tuesday evening.  I started by putting a second coat of stain on the assembled wall.  After that coat dried, I removed the old ramp from the playset.  It was then that I discovered the colony of ants living in the base of the ramp.  After the ramp was out of the way, I dug out some of the rocks where the bottom of the wall would rest and put the wall in the opening.  I drilled the holes for the carriage bolts through the wall's posts and the posts on the playset.  After securing the bolts, my wife and I started deciding where the hand holds would go.  Attaching the handholds was very frustrating.  The screws that came with the holds were the worst quality that I'd ever worked with.  They would strip almost immediately if I put any more than the minimum amount of torque that my drill had.  If you have a choice, avoid climbing wall handholds made by PlayStar, Inc. out of Janesville, WI.  Or, use different screws as they ones provided are horrible.  Once the handholds were attached and secured, I tested each of them by briefly hanging some of my weight on them.  None of them budged, so I okayed a test climb for my daughter who was eagerly waiting to use the wall.  You can see the results, below.

Daughter, Kate, first time climbing wall
Overall, I'm very pleased with how this turned out and very satisfied to have saved $450 over the price of the manufacturer's climbing wall.  Plus, I always enjoy building things myself and getting to use my power tools is always fun.




Attached and awaiting hand holds


Attaching hand holds


After handholds attached

Tuesday, July 3, 2012

Random Pictures


In honor of having my best month on the blog ever (in terms of page views), I've decided to post some cool pictures.  If you're not interested in this kind of stuff, feel free to skip it.

The first item isn't a picture, but rather a video of my daughter signing the Mahna Mahna song with me.  Every now and then I hear her signing it, which means that I've raised her right.

Link from Link to the Past
This picture is Link from Link to the Past made out of Perler beads.  I've made quite a few 8-bit characters from them, but this is one of my favorites.


This is a portrait that Kate, my daughter, drew of me.  Pretty accurate, I think.
My wife and I saw this deer in our backyard the other day.  Pretty awesome!
This is a small walking trail near our house.  Kate had just said, "We're on an adventure!"

I was behind this Lotus in traffic the other day.  You don't realize how small they are until you're close to them.  I don't think that I'd even fit inside!

These are my kids looking at the penguins at the Minnesota Zoo.

More Perler bead characters that I've made.
Hope you enjoy these pics.  I'm working on a story that I'll post here in the next few weeks, or, if Chuck Wendig posts another interesting story challenge, maybe you'll see on of those on here soon.

Thursday, June 21, 2012

Social Anxiety


If you've read my blog before, you'll realize that I'm a geek, or, if you prefer, a big nerd.  I'm cool with that.  It's who I am.  One of the reasons that I am who I am is because of social anxiety.  In high school, I would escape social situations by playing video games alone at home and only hanging out with the few close friends that I had.  I've always felt anxious in social situations, but only lately have I realized that even though work is obviously a social situation, I don't feel anxiety about going to work or meetings at work.

I started to wonder why this was true.  I thought that if I could figure out why I felt different about work that I could somehow apply that to normal social situations.  So far, the only thing that I can think of is that I don't see the people I work with as social entities.  That's hard to explain; even though I like most of the people around me at work, I guess that I don't feel like I'm there to be social.  I'm there to work.  I'm not a psychologist by any means, so I don't know if that's the right answer or not, but it presents a problem if that's true.  If that's true, it means that I can't apply it to other social situations because I am in those situations specifically to socialize.  I'm also not saying that I don't feel social anxiety while at work.  Running into someone you know just walking down the hall at work is quite an awkward situation for me.  Do I look in their direction?  When should I acknowledge them?  How do I acknowledge them?  I don't know how other people do it so effortlessly.

Just to be clear, the anxiety I feel about social situations isn't just a tiny amount of stress.  It's a nearly crippling, hard to breathe level of stress.  Just yesterday I had a company social event (we bowled at a fancy bowling alley place called Pinstripes).  Before the event, as I was driving there, I was practically in a panicked state.  I was thinking over and over that I didn't have to go and that I should just skip it.  Once I was there, the stress lessened, but I could still feel it in my gut the whole time I was there.

So, what do I do?  I push through the feelings as best I can.  Yesterday, I just forced myself to go inside and talk and bowl and try to have fun.  I still felt terribly awkward the whole time and hope that others didn't pick up on that.  In many social situations (such as parties), I can just stand around and not talk to anyone.  In these situations, I'm afraid that I come off as a pretentious jerk who doesn't want to talk to anyone.  That couldn't be further from the truth.  I would love to talk to people and get to know them, but I'm crippled by anxiety over saying the wrong thing, or not being able to follow social customs.  So, I just stay quiet and out of everyone's way.

Just writing about this is hard.  I don't even know why I decided to write about this at all.  Maybe I'm wondering how other people who have social anxiety handle it.  If you feel like sharing, leave a comment.  Maybe I hope that getting this off my chest will help me deal with the issue.  I don't know.  Sometimes I feel like Raj from The Big Bang Theory, but not as extreme and more general than just not being able to talk to pretty girls.

Friday, June 15, 2012

Story: Crooked Tree


I'm doing another Flash Fiction challenge by Chuck Wendig.  This story totally evolved from what I had first imagined, but I really like where it went and I hope you like it too.

Edit: Added the picture hosted on Chuck's site.  FYI, the image is Copyright Chuck Wendig and I claim no rights to the image.

--------------------------------------------------------------

Crooked TreeMy mother always tells me not to play by the crooked tree, but I can't help myself.  I think that the tree is very interesting to look at and fun to play around and climb on.  She says that the tree is cursed and I don't know what she means by that, but I'm sure that the tree means well.

I know that the tree is dying, but every spring it still grows new leaves and last year a bird had a nest in it.  My father says that the tree will fall all the way down soon.  That makes me sad.  I will miss the tree when it's gone.  The tree is my best friend.

My mother won't go near the tree and refuses to let my father mow that part of the backyard.  She says that the tree is on the edge of our property anyway, so it's fine that the grass is long there.  I like the long grass and shrubs that grow near the tree.  Sometimes I hide in them when I feel like being alone.  My mother is always very cross with me when she finds me hiding from her there.

My father sometimes tries to get mother to let him cut down the tree.  He says that the bad memories will go with the tree.  I don't know what bad memories they are talking about, I only ever remember the tree fondly.  She always refuses, but I don't really know why.  If I didn't like the tree as much as she doesn't, I would let my father take it away.  I'm always happier when he takes the darkness away at night.  I don't like the darkness and he's happy to make it go away for me.  My mother might be happier if she let my father take the tree away.

I'm happy that the tree is still there.  I often wonder why the tree is so crooked, none of the other trees are crooked like that one.  I asked my father about why it was crooked.  He looked very sad and said that something bad happened ten years ago.  I wonder why he is so sad, but I don't ask him about it because I don't like it when people are sad.  I gave him a big hug and that made him happy again.

Yesterday, I heard my parents talking about the tree when they thought I wasn't listening.  They were talking about a ten year old boy named Bobby who got hurt when the tree became crooked.  I felt sad for that boy and wondered if I knew him.  My name is Bobby and it would be nice to know another boy named Bobby.  Maybe he could play with me and my crooked tree.

Wednesday, May 30, 2012

Story: Lovely Hypocrite?


I've decided to try one of Chuck Wendig's Flash Friday challenges.  This week's challenge was to go to use a random sentence generator to generate your first or last sentence in your story.  I got "Will the company suffer the lovely hypocrite?"  I figured that I could work with that, so I wrote the following story.  I hope that you enjoy it!

---------------------------------------------------------------------------------------

"Will the company suffer the lovely hypocrite?" General Mitchell asked. It was clear from his tone that he would not suffer my presence any longer.  Asking the rest of the company showed that he was sure of their answer.  "He has defied my command and has tried to sow dissent into our ranks.  Would you keep him in our honorable company?"

The company responded with growls and many men shouting, "No!"  Their anger didn't intimidate me.  I was in the right and didn't need to fear any immediate violence from them.  The code of conduct amongst the mech companies would prevent anyone from hurting me, for now.  Instead, they would just exile me from the city to roam the wastes.  People survived out there, but just barely.

Mitchell let the growls and yells settle down before speaking again.  "It is decided.  Rex Waters, you will be exiled in the heat of the day tomorrow."  He pointed to two men who grabbed my arms.  "You two take him to his quarters and lock him in.  Stand guard until someone relieves you."

I considered fighting, but I quickly dismissed the idea.  The entirety of the mech company surrounded me and I would be quickly overwhelmed.  They would hurt me, if I started a fight.  I needed to bide my time for an opportunity to escape to present itself.

The men guided me back to my quarters.  Without a word, they pushed me inside.  One of them pulled a pistol out and held me in the corner while the other ransacked my quarters.  Further hope fled as they found my service pistol and the two backups I had hidden.  Smiling at me, they pocketed my guns and left the room.  I heard the door lock.  "At least they didn't take what little money I have," I said to myself.

Knowing that I would need as much rest as I could get, I laid down on my bed.  I must have fallen asleep, as I was awoken by voices in the hallway outside of my room.  I quietly crept close to the door and listened.

"...come to relieve you," one of the voices said.  I recognized the voice of Sergeant Clost, the left gunner of the mech I commanded.

"I doubt the general would send two of Waters' subordinates to relieve us.  Go away before we lock you up with your former commander," one of the guards replied.

Corporal Winters, my right gunner, laughed.  "That bastard is getting what he deserves.  We said as much to the general when he offered us the opportunity to push the traitor out of the gates tomorrow."

Clost chimed in, "I look forward to pushing that backstabber out into the wastes."

The four of them laughed for a moment.  The same guard said, "Welch, you wait here with Clost.  I'll go with Winters to verify that they're legit."

I heard some footsteps, then what sounded like a scuffle and two loud thumps.  A moment later, the door opened.  I saw Winters standing there smiling at me and the bodies of the guards lying in the hallway.

"Move over, Colonel," Winters said, "we need to hide these two before anyone else comes to join them in their fate."

I sidled over so that Winters and Clost could drag the guards into my quarters.  Clost said, "I don't envy the headaches these two will have in the morning."

Winters laughed and added, "Not to mention the beating they'll get from the general when he finds out about this."

They dropped the bodies unceremoniously on the floor, turned to me and saluted sharply.  I smiled for the first time since my confrontation with General Mitchell.  Returning the salute, I said, "So, you're looking forward to pushing me out of the gates?"

The two exchanged amused glances.  Clost said, "The general did offer us that chance, sir."

Winters remarked, "And we did tell him that.  I wish we could see the look on his face when he figures out what happened."

I smiled back at them and said, "Do you two have a plan, or do I have to do everything around here?"

They chuckled.  Winters said, "You are the commanding officer, sir.  We're just a couple of grunts following our commander into battle.  What are your orders, sir?"

I retrieved my weapons from the guards.  Once that was done, I said, "Let's go get our mech and show the general how strong our convictions are.  If the general thinks I'm going let him overthrow the civilian government of the city, he has another think coming."

We raced towards the armory where the mechs were stored.  Since it was night, we didn't run into anyone in the halls and the armory was deserted.  We stopped in front of my mech and I was surprised at how relieved I was to see it.  A mech soldier spends most of his time in his mech.  It was like home to me and I hadn't known if I would see it again.

We mounted up as quickly as possible, but someone came in as we were finishing our pre-mission checklist.  Winters quickly aimed the right arm of the mech and fired one 50 caliber round.  The man's torso exploded into red mist as the round tore through him.

"Well, so much for secrecy," I said as I got the mech moving.  "We'll have company soon, gents, let's get out of here."

I ran the mech through the armory doors and into the same courtyard where I had been condemned earlier.  Clost aimed his arm of the mech back towards the armory and launched a few missiles into the building.  We cheered as I directed the mech to jump the wall of the compound to the sounds of secondary explosions.  The excitement of fighting for a just cause was a welcome change to our previous role of oppressing the people of the city we were supposed to protect.

Thursday, May 24, 2012

Javascript TDD/BDD/Unit Testing


I've been doing some pretty cool stuff at work lately and I think it's time for me to share some of the cool things that we're doing.  Web development isn't anything new, I've been writing HTML since I was 12 years old, but it has changed quite a bit since I wrote my first, very simple, web pages.

Another thing that isn't new for me is Javascript, but I never really got that into it or relied on it to do anything powerful.  Since starting at Best Buy, I've really gotten good at Javascript and have realized that it is quite powerful and can do a lot of good for a website.  I've also realized that it can also do a lot of harm to a website.  One thing that a lot of people omit from Javascript development is testing.  A lot of people consider testing their scripts in the browser to be adequate for their purposes.  I disagree.  Coming from back end systems, I know that thorough testing is very important and I think that this is a component of front end systems that has been lacking across the industry.  That being said, there are ways to automatically test your Javascript without using a browser.

One of the goals of the team I'm on is to introduce an automated testing tool to test Javascript automatically when the project is built.  Our build is written using ant, which I hadn't used since college, but since it's well documented, I didn't have any trouble picking it up again.  Also, I'm using Eclipse as my IDE, so it supports ant syntax highlighting and parsing, which is very helpful.  Ant is very powerful, but since it's written like XML, it can be hard to write complicated constructs like looping and conditions, but we've made it work for us, so far.

I was put in charge of incorporating Code Quality tools into our build.  At first, this was a little overwhelming.  I was just starting to get good at Javascript development and didn't have any experience with testing tools for it, but I started doing research on the internet and quickly found some testing frameworks that I didn't think would be hard to incorporate into our build.  We settled on using Jasmine and I worked on finding a way so that we could call our spec scripts from our build.

This started the frustrating part of our journey.  The people who built Jasmine don't support the different ways to launch the tool (like from an ant build), but only the framework itself.  Okay, I can overcome this, there are some open source tools that I can use listed right on their page.  I started with Jasmine-Node since we were using Node.js for our local web server to test our pages.  I quickly realized that this wouldn't work for us since Jasmine-Node doesn't create a DOM and a lot of our Javascript relies on a DOM in one way or another.

My next attempt was to try Node-Jasmine-DOM.  It has DOM support and Jasmine integration, so I thought I was getting close.  I incorporated it in the build and got it to run in the browser, but there's an aspect to Node development that I didn't realize until it was too late.  Node makes it really easy to use other Node tools as dependencies in the tool you are building.  This is great for reuse, but dependencies are called that for a reason.  One of the dependencies that the Node-Jasmine-DOM tool used had a defect in it and that was blocking our scripts from being tested in the build.  I waited patiently for a couple of weeks after submitting the bug to the owners of the dependent tool, and there was initially some good back and forth about it for a while and someone submitted a workaround for the bug.  I was excited and tried it out on my machine, but their workaround didn't work for mem (in Mac OSX), but worked in Windows.  I went back to the forum and they had closed my defect, so I commented that the workaround didn't work for me and I needed another way to make it work for me.  Another week of waiting without a response and I decided to pursue another way to run our tests.

I started my new search by trying to find a tool that would run Javascript straight from a command-line.  I would do myself what Node-Jasmine-DOM was trying to do (create a DOM and insert Jasmine).  Enter Rhino and Env.js.  I found a blog that had done this before and I was all set.  It took me less than a day to incorporate these new tools into the build and I was immediately running our specs from the build.  At the same time that I was ecstatic to be finally done with this, I was very frustrated that I had wasted so much time trying some of these other tools.

For those curious about what exactly I did, read on.  For those who don't want the technical details, thanks for reading this far!  This next part may not be for you as it will be pretty technical.

Our test target in our ant build does a few steps to run the spec scripts.  The first step is to identify the pages that need testing and has some logic built into it for that.  The next step is to convert these pages into spec runners (example), this means that I needed to insert references to our spec.js files and the Jasmine Javascript files.  Since I wanted to test the Javascript on the page, I just copied the page, changed the extension to *.runner.html and inserted the appropriate spec and Jasmine scripts.

The next step that the build does is to get the list of runner files and run them.  I created an ant macro for this step.  The Build-Doctor guy provided the envjs.bootstrap.js file that I started with, but later customized.  His was very simple and was basically just a for loop that told Envjs to load a page.  I found that that wouldn't work for more than one runner, so I changed it a bit to reload Envjs at the beginning of the loop and then load the runner file.  I also added some console.log entries so that the build is more vocal about what it's doing.

Here's where I got a little bold and changed the Jasmine.js and Env.js files to eliminate some extra console.log calls that I didn't feel were required and I added some in a couple of places where I wanted visibility.  In the end, it looks great in the build and it creates JUnit style reports that our Jenkins CI server can interpret.

I was planning on covering the other major aspect of our build, Freemarker, but this post is getting pretty long, so I'll save that for another day.  Below are some examples of what I did in our build.

This is the macro I wrote in our ant build.
<macrodef name="runRunnerList">
 <attribute name="runnerList" />
 <sequential>
  <echo message="Running files: @{runnerList}" />
  <exec executable="java">
   <arg line="-jar ${dir.lib}/java/js.jar -opt -1 lib/javascript/envjs.bootstrap.js @{runnerList}" />
  </exec>
 </sequential>
</macrodef>
This is the results of running a spec in our build as seen in the terminal.
     [exec] Launching runner: /trunk/bin/debug/_slider/_sliderTest.runner.html
     [exec] 
     [exec] Runner Started.
     [exec] _slider : should have 100 hundred items after the method addItem is called 100 times ... 
     [exec] Passed.
     [exec] _slider : should have 99 items after the method removeItem is called ... 
     [exec] Passed.
     [exec] _slider : should have zero items after the method removeAllItems is called ... 
     [exec] Passed.
     [exec] _slider : should show slider when content extends past the width of the slider ... 
     [exec] ***FAILED***
     [exec] _slider : should hide slider when content does not extend past the width of the slider ... 
     [exec] Passed.
     [exec] _slider : should remove padding from the left side of the viewport ... 
     [exec] Passed.
     [exec] _slider : should add the class bby-slider-item-first to the first item in the slider ... 
     [exec] Passed.
     [exec] _slider : should recieve the second item out of five and the HTML should match ... 
     [exec] Passed.
     [exec] _slider: 7 of 8 passed.
     [exec] Runner Finished.
     [exec] 
     [exec] Done with runner: /trunk/bin/debug/_slider/_sliderTest.runner.html
This is one of our runner files. The highlighted parts are what the build inserts into the file.
<!DOCTYPE HTML><html lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../css/__common/__common.css" rel="stylesheet" type="text/css" media="all">
<link href="../css/_slider/_slider.css" rel="stylesheet" type="text/css" media="all">
<script type="text/javascript" src="../js/__common/libraries.js"></script>
<script type="text/javascript" src="../js/_slider/_slider.js"></script>
<link rel="stylesheet" type="text/css" href="../js/lib/jasmine-1.2.0/jasmine.css" />
<script src="../js/lib/jasmine-1.2.0/jasmine.js"></script>
<script src="../js/lib/jasmine-1.2.0/jasmine-html.js"></script>
<script type="text/javascript" src="../js/specs/_slider.spec.js"></script>
</head><body>
<script src="../js/lib/jasmine-dom/jasmine-dom-matchers.js"></script>
<script src="../js/lib/jasmine-dom/jasmine-dom-fixtures.js"></script>
<script src="../js/lib/jasmine.console_reporter.js"></script>
<script src="../js/lib/jasmine.junit_reporter.js"></script>
<script type="text/javascript">
$(function() {
    jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter());
    jasmine.getEnv().currentRunner_.name = "__common";
    jasmine.getEnv().execute();
})
</script></body></html>
I will note here that most of our runner files have actual content in the body. The specs for this runner insert some test content into the body before the spec is run. The scripts in the body are inserted just before the </body> tag.

Thursday, April 26, 2012

Project Euler


I've always had a fondness for math.  I've always been pretty good at solving math problems too.  Today, a friend at work made me aware of Project Euler.  For those of you who don't know (probably most of you), Project Euler is "a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve".  Man, solving math problems with programming?  Where do I sign up?

So, I've begun my struggle to get through the 381 problems listed on the site.  Problems 1 and 2 were easy, things that we had to do in college.  Problem 3 is a little tougher, but still pretty easy.  That's how far I've gotten in an hour.  I'm going to keep going though, I'll update the blog with my progress occassionally.

Spoiler alert: I'm posting answers to problems 1 and 2 below.  Don't read if you're going to attempt this.  I'm using Java as my language of choice to solve these problems.

Problem 1:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.

I first solved this recursively, but was getting stack overflow errors, so I went to the simpler method of brute force.

private static int MAX = 1000;
private static int calculate() {
int sum = 0;
for(int index = 0; index < MAXindex++)
if(index % 3 == 0 || index % 5 == 0)
sum += index;
return sum;
} //end of calculate method

Problem 2:

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...  By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

private static int MAX = 4000000;
private static int calculate() {
int sum = 0;
int first = 1;
int second = 2;
while(second <= MAX) {
int temp = first + second;
if(second % 2 == 0)
sum += second;
first = second;
second = temp;
} //end of while loop
return sum;
} //end of calculate method

There you have it.  Notice that I haven't posted the results of running these.  Gotta leave something to you guys!