Free MDB file to MySQL Conversion

December 4th, 2008 by Robert

This week I created a pretty useful tool I’d like to share. I was given an MS Access file (.mdb) and I needed a way to transfer the structure and the data into a MySQL database. I don’t have MS Access and I have no plans to purchase it, so I did a lot of searching to find free tools for getting at the data.

I found a few ways that worked ok, two ways that did what I needed and one that I liked the best. The one I liked the best was MDB Viewer Plus, an exe file that doesn’t need to be installed - you can get the latest version at http://www.alexnolan.net/software/mdb_viewer_plus.htm. I got the 1.5.1 version from another site found through google, but later discovered that I couldn’t get into an mdb file that required a password using that version. Once I went to the source of the program I got the 1.5.3 version and the password authentication worked great. The other program that worked fairly well was called Open Office Base, but exporting the data proved a bit tricky, as I had to first create reports that queried the tables before I could save them as text. I liked MDB Viewer Plus better because exporting a table is very easy, you can do it by clicking a tab with the table name you want to view it, then click the “Export Table” button to export it in one of nine different formats.

So once I got the tables exported from the mdb file into text files, then I looked around for an easy way to get it into mysql. Unfortunately phpmyadmin requires more than just field delimiters to import csv files, but also some character has to “enclose” every field. I did some more searching and found a simple php script posted on the codewalkers site that converted a type of csv file into a bunch of sql insert queries. This looked promising, so I modified it to ignore empty fields, convert dates into valid mysql date format, take tab delimited text as the input instead of semicolon delimited fields (I don’t know where you would get that kind of csv file anyway), and I added a table creation query with a user definable field type. I had a table with over 100 fields in it that I didn’t want to type out, so this was the script I used to generate the table creation query as well as the insert statements.

Below you will see a screenshot of the script with a small example tab delimited text file that I pasted into the main input box:
Example usage of the conversion script
Download the zipped php file here

So the summarize, here are the steps to follow for this MDB file to MySQL transfer or migration:

  1. Use one of the free programs mentioned above like the MDB Viewer Plus to open the Access file and see what’s in it
  2. Save each table as a TXT file (which happens to be tab delimited when you use the MDB Viewer Plus)
  3. Download the php file I put together and shared above, and put it in the webroot of either a web hosting account you have on a remote server (like Blue Host, which I use for this site) or on your local webserver root. If you are interested in installing a free webserver easily you can try XAMPP, which I use on my PC.
  4. For each table you want to add to MySQL, type in the name and default field type (the type that most of your fields will be, so you will have to manually set as few of them as possible afterwards), and paste the tab delimited text of your table (with column names on the first line) into the big input box.
  5. Push the button at the bottom, and then use the first generated sql statement to create your table
  6. Change the field types that don’t match the default (like an autoincrement integer field for the index, or a few date fields)
  7. Then run the rest of the sql statements to populate your table and you’re done:)

Update: I just figured out how to do something that makes the whole process much easier for windows users. Using php you can connect to just about any database that exists, and query it directly. And for Access, an .mdb file counts as a database. So here’s the code to connect to a local mdb file using php on a windows machine:

$db_connection = new COM("ADODB.Connection", NULL, 1251);
$db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)};" .
		" DBQ=C:\Path to mdb file\MyAccessFileName.mdb; Password=MyPasswordHere; DefaultDir=C:\DataDir";
$db_connection->open($db_connstr);
$rs = $db_connection->execute("SELECT * FROM TableName");
$rs_fld0 = $rs->Fields(0);
$rs_fld1 = $rs->Fields(1);
while (!$rs->EOF) { // loop through the result set from the mdb file
    $field1Value    = $rs_fld0->value;
    $field2Value    = $rs_fld1->value;
    $rs->MoveNext();
    // Do something with the data here, like put it into mysql, put it into a file, or print it to the screen
    echo "the first field value is $field1Value, the second field value is $field2Value<br>";
}
$rs->Close();
$db_connection->Close();

You can read more about it in the PHP manual at http://us3.php.net/manual/en/function.odbc-connect.php

How to Soothe a Crying Baby

November 22nd, 2008 by Robert

With five small children in the house, we have learned many ways of soothing our children.  One day this week Candice got Nickalus out of bed after a nap and he was screaming and crying uncontrollably.  He wouldn’t let go of his blanket, so she pulled him out, blanket and all.  He wouldn’t take a pacifier or bottle of water, so when she brought him downstairs she stuck a chicken nugget in his mouth.

One thing we have learned about Nickalus is that he finds comfort in food, but Candice was still amazed that he stopped crying so fast.  He immediately stopped wailing and sucked on the chicken nugget like it was a pacifier, while still clutching his blanket.  He must have sucked on it for 10 minutes before eating it, plenty of time for me to take this picture:
Nickalus sucking on a chicken nugget while clutching his blanket

This is meant as a humorous post, but if your child is soothed by food you might try something similar - just make sure you only give chicken nuggets to babies with teeth, Nickalus has 16 teeth now (he’s 19 months old).

We also use many types of wraps and baby carriers to soothe our babies (it’s like holding them but it’s not as tiring and you can have your hands free), like an ergo, a becko, a maytie, a moby wrap, a homemade sling, a maya wrap, rebozo, and a few more that I don’t remember the names of (we have a large collection). Mamatoto is a good resource if you want to learn about carrying babies - with two babies around I usually carry one on my back just to keep them out of trouble!

How to enable SOAP on a LAMP server

November 6th, 2008 by Robert

Note: This post is pretty technical, but there’s a good feeling picture if you scroll down a bit:)

I wanted to use the MSN search API on a VPS (Virtual Private Server) I have setup for a client, but the existing CentOS 5 operating system only had PHP5.1.6 and I needed PHP5.2.1 (at least) with SOAP enabled for the search API to work. So I downloaded all my code files, created a dump of the MySQL database (I had to use mysqldump from the command line for this, as the DB was 147Mb, way over the limit for phpmyadmin to export) and downloaded the db dump. Then I re-imaged the server using the OpenSUSE 10.3 (with plesk) operating system, which I was told would have at least PHP5.2.4 on it by the 1and1 server support person I spoke with.

After the re-imaging process was done (it takes about an hour), I used plesk to easily recreate my accounts, domain, database, and scheduled job. Then I used winscp to upload my gzipped database dump and the code files, logged into the newly created db from the command line through ssh and used the command “source dbdump.sql” from a mysql prompt (and from the same directory as where I gunzipped the dbdump.sql file) to populate the large database in under a minute. I also had to change the ownership of my webroot and everything in it to “default”, since that’s the name of the user I have running my scheduled job which reads and writes to the server. One requirement of running php in safe mode is that scripts can only read and write to files/directories owned by the same user who is running the script. There’s probably a way for me to turn off the PHP safe mode but the workaround was easy so I haven’t messed with it.

Once I got everything put back together I checked the phpinfo page and I was pleased to see that I now had php5.2.6 running. But when I tried using MSN search it still didn’t work, because SOAP wasn’t enabled. Then I did a bunch of searching and found several people in similar situations but I didn’t find any good answers. I tried to update the php configuration using yum and apt-get, but those commands were not on my system. Then I found an RPM file (from http://rpm.pbone.net) that contained a soap.so file in it, but when I tried to install it I got the message “rpmlib(PayloadIsLzma) <= 4.4.2-1", which I learned was some kind of dependency that wasn't met by my system. I was starting to get frustrated and the kids were playing kind of loud behind me, so I decided it would be best to take a break and try to feel better about it.

So I turned around and saw all 5 of my kids jumping on the couch. It was our basement couch so I didn't mind, but I began to feel better and grabbed my camera. I started taking pictures of them and showing them the pictures, which they enjoyed, so we all had a good time. Here's one with all of them jumping on the couch:

It reminded me of the children’s book, Eight Little Monkeys Jumping on the Bed. The last page (after they all fall off and bump their head and the doctor says “No more monkeys jumping on the bed!”) has them all on the couch and says “But no one said anything about jumping on the couch!”. So later after putting the children to bed I was feeling better and got an idea.

I remembered reading a post which suggested going to the specific operating system home page to get the appropriate version of the rpm file needed, so I searched for the opensuse home page and found http://software.opensuse.org/search, where I just chose my operating system from the dropdown and searched for soap. Actually they have many operating systems there, including RHEL, CentOS, Debian, Ubuntu, openSUSE, Fedora, Mandriva, and SLES. From the results page I just chose the php5-soap rpm for my version of php (5.2.6) and my system (I’m using a 64 bit system so I chose the x86_64 link, I assumed the other link was for 32 bit systems), downloaded it to my PC, then uploaded it to my server, used gunzip to decompress it, and ran the “rpm -i php5-soap-5.2.6-35.6.x86_64.rpm” command to install soap. This file passed all the dependency checks, then put the soap.so file in the right place on my system, and modified my php.ini file. Then all I had to do was restart the apache service and my LiveSearch sample page (using SOAP to interact with the MSN search engine) worked! By the way, for dedicated servers and virtual private servers I’ve had good experiences with 1and1, their server department is usually very helpful and quick to respond to questions or concerns. For shared hosting, I prefer Blue Host (which I use for the good feeling place).

Wild Hawks in my Backyard!

November 4th, 2008 by Robert

Yesterday I woke up in the morning and spent a few moments thinking about things I appreciate. My thoughts naturally moved to the hawks living in the treetops of our neighborhood, because I’d been wanting to get some good pictures of them to share ever since Candice caught them stretched out in the sun a week ago (once I came outside they were gone). So I was feeling good and imagining what they must look like in the morning when they open their wings to feel the sun, and I was remembering the times I had seen dozens of them flying over our house.

A few hours later, after helping get a few groceries inside from the car, I looked up and saw this:

Luckily they posed for me long enough to get a picture:) After they were done stretching, they took off, and I got another good picture of them below:

I love watching the birds. If you’d like to attract some more beautiful birds into your yard you can try using some Wild Bird Food Recipes.

Oatmeal for Breakfast with all 6 Tastes

November 1st, 2008 by Robert

After our first son was born we experienced many health issues that we didn’t understand, which caused us to launch many desires for health and the understanding of health issues. We learned about Dr. Westin Price, who was a dentist that traveled the world to study primitive cultures about 70 years ago. He wrote a great book about what he learned, called Nutrition and Physical Degeneration. You can follow the amazon link to the right to learn more about that book.

I read the book cover to cover and was fascinated by the pictures and stories of people in about ten different primitive cultures where he traveled. In every case the vibrancy of the people was directly correlated to the quality of the foods they ate, and the pictures are a very dramatic illustration. I’m a visual learner so I appreciated all the pictures:)

Later we were introduced to another book called Nourishing Traditions, which is a cookbook based on the lessons learned from Dr. Price and his studies. I was excited about this book and spent a couple years trying out different recipes and learning about foods I had never heard of before.  This is the book I’m referring to:

I wrote about a dozen of my favorite recipes inside the front cover with page numbers so I could refer to them often.  One thing I began cooking everyday for breakfast was some type of grain prepared like oatmeal.  I bought about eight different types of grain and tried a different one everyday for variety.  I narrowed down the list based on what the most people in our family liked to eat (and what was a better price), until I got down to rice, wheat, and oats.  Candice didn’t want the babies to have wheat because it is harder to digest, so then I had rice and oats.  For the past year or so I’ve stayed with oats because they provide more calories than rice (due to their fat content).

I learned from the Nourishing Traditions book that all seeds and grains have built in protection against deterioration (like being digested in your tummy) that is designed to preserve the nutrients until germination.  But if you soak them you can remove this “protection” just like warm, wet soil does.  So I got a hand grinder and ground about a cup of grain at night so I could soak them in water with a little apple cider vinegar (I can’t remember the reason for the vinegar) overnight before cooking them.  The hand mill I had is pictured to the right:

I later got a Nutrimill to save me about 20 minutes of grinding every night.  The result is closer to oat flour than oatmeal, but I appreciate the time savings and the cooked result looks about the same. I use the Nutrimill, as pictured on the left:

During this time Candice began a 3 year apprenticeship with Dr. Shamosh in Phoenix, AZ to learn Chinese Herbology and Indian Ayurveda.  I learned a few things from her studies, including the importance of the six tastes to digestion.  We got a poster that we put up in the kitchen which detailed the energetics of food, including many spices.  I experimented with many different spices in my oatmeal and tried to cover all the tastes, and we all enjoy it now.  It’s still a bit different everyday because I don’t measure anything, but I think that’s part of the fun:)

So here is my latest oatmeal recipe, with estimations as to how much I use of each item:

Ingredients:

  • 1-1.5 cups of oats
  • 2-3 cups of water
  • 1 Tbsp Apple Cider Vinegar
  • 1 Tbsp Coconut Creme, Ghee, or Butter
  • 1 tsp Salt
  • 1 tsp Cinnamon
  • 1 tsp Molasses
  • 1 tsp Raw Sugar
  • 1/2 tsp Cardamom
  • 1/2 tsp Nutmeg
  • 1 tsp Baking Soda
  • 1 tsp Ginger powder (only in the winter when it’s cold, because ginger is warming)

Directions:
First grind the oats and cover them with water and a little apple cider vinegar in a pot or bowl, and stir them up to remove clumps. Cover the pot or bowl (I use a big plate for this) and let it soak overnight. When you’re ready to cook it, put it in a pot, add some more water, and stir to get it mixed up again. Turn on the stove to medium or medium-high heat and mix in all the other ingredients (everything except vinegar since that’s already in). The higher you turn the heat, the faster it will cook, but you’ll need to stir more then. Even on low you’ll need to stir every once in awhile so you don’t get uncooked clumps in the mixture. I’ve learned that I can get it cooked and ready in 15 minutes if I cook it on medium-high and stir almost constantly. If the heat is too high then you won’t be able to keep it from sticking to the bottom and burning a bit no matter how fast you stir, but if the heat is medium or lower it may take 30+ minutes to get to a good consistency (this is based on a typical electric stove in the USA, gas stoves will likely cook faster). I know it’s done when the mixture thickens and looks more like lava than soup- the thickness will depend on the water/oats ratio - if it’s too thin you can cook it longer, if it’s too thick you can add more water. I like it best when the bubbles combine and cause the oatmeal to “burp”.  When I serve the older kids I put a little honey or maple syrup (we call maple syrup “waffle sauce”) on top, but when I feed or serve the babies I don’t add anything.

If you’re wondering about the 6 tastes, they are sweet, salty, sour, astringent, pungent, and bitter. The sweet and salty tastes are well covered in the list above, but here’s how I get the others:
Sour - Vinegar
Astringent - Cinnamon, vinegar
Pungent - Cardamom, Cinnamon, Nutmeg
Bitter - Cardamom, Vinegar

You can learn more about the importance of the six tastes to our healthy digestion (from an Ayurvedic perspective) by reading an article Candice wrote on her site at http://phxherbs4kids.com/nutrition-articles/1-our-digestive-experience-an-ayurvedic-perspective.html.

Last night we were up late and I didn’t grind any oats.  So when the kids woke us asking for food I made scrambled eggs and chocolate milk (not necessarily the best combination, but I was tired and that’s what they asked for).  Our five children (mostly the older three) ate nine eggs and asked for more but that’s all I had so I gave them some toast.  I appreciate my oatmeal:)

How I Created a Good Feeling Day

October 17th, 2008 by Robert

I am very excited to share this story, because it’s the kind of story I want to have everyday. Yesterday I decided in the morning to look for things that felt good (to pay attention to and think about) and only do things that felt good to do. And here is how it went:

In the morning Candice took the older boys to kindergarten and stayed to volunteer in Demitri’s class as she does every Thursday.  So I got to spend a couple hours with Eden and the babies (I guess they are toddlers now but we still call them babies) after sending off the older boys with Candice.  Eden wanted me to read her several books after breakfast, so I read to her while she sat on my lap with one hand while feeding the circling babies with the other (they are like birds, they take a bite and swallow it while walking around in a circle, then start again).  They finished the pot of oatmeal mush I made for breakfast after I read about 3 books to Eden, so then we all went to the basement.

I wasn’t inspired to work right away when we got to the basement (where my computer is), but I did read a few articles about google adsense (something I’ve thought about adding to this blog for awhile now).  I was pleasantly surprised to find that my old account I created over a year ago was still active so after reading a few success stories I created a medium rectangle of ads to put at the bottom of each single post.

Then the babies began crying so I got them an open bag of sunchips from the day before and they were happy again:)  I told Eden to hold it and share with them, but after she was done Nickalus grabbed the bag and joyfully tore it all the way open to get the crumbs.

After Candice got home at 10am I had a snack and decided to start working.  I had a page full of random notes from the long discussion I had with a client on Monday about his project but it felt better to focus on performance of the application, since that was what I think mattered most at that point.  There were a few web pages that were taking way too long to load because of the large data sets that were being queried.  So I took one page at a time and added timing functions around each database query in the code and was very surprised at what I discovered.  I learned that it was taking over 7 seconds to populate a single drop down with about 20 different values, for example.  I had fun with it, like playing with a crossword puzzle or rubiks cube.

A few hours later the page that took half a minute to load before took 2-3 seconds and another page that never fully loaded before (it always timed out because the script took longer than a minute to run) was being fully loaded in under 5 seconds.  Just when I was wrapping up my client called and I was able to share with him the progress I made.  He had experienced the slow pages and was excited to hear the good news - “How did you do it?” he said, like I had performed a miracle.

So that was how I created a day full of good feeling experiences yesterday, by consciously looking for things that felt good to think about and do.  I think I’ll try it again!

How to allow up and down arrows to navigate your form fields

October 5th, 2008 by Robert

I learned something pretty cool last week. I fielded a request from a client who wanted to be able to use the up and down arrows on his keyboard to navigate a rather large form on the site I created for him. I believed it was possible but I had never done it. So after doing some research I figured out how to do it. Below is a simplistic version (put your cursor in one of the text boxes below and push the up or down arrow keys to move between them):

1-1 1-2 1-3
2-1 2-2 2-3
3-1 3-2 3-3

The HTML for the simple table is as follows:

<table border="1">
<tr>
<td>1-1</td>
<td><input id="ItemCost11" onkeydown="return checkKey(event,3,3,'ItemCost',1,1)" maxlength="30" name="ItemCost11" size="3" /></td>
<td>1-2</td>
<td><input id="ItemCost12" onkeydown="return checkKey(event,3,3,'ItemCost',1,2)" maxlength="30" name="ItemCost12" size="3" /></td>
<td>1-3</td>
<td><input id="ItemCost13" onkeydown="return checkKey(event,3,3,'ItemCost',1,3)" maxlength="30" name="ItemCost13" size="3" /></td>
</tr>
<tr>
<td>2-1</td>
<td><input id="ItemCost21" onkeydown="return checkKey(event,3,3,'ItemCost',2,1)" maxlength="30" name="ItemCost21" size="3" /></td>
<td>2-2</td>
<td><input id="ItemCost22" onkeydown="return checkKey(event,3,3,'ItemCost',2,2)" maxlength="30" name="ItemCost22" size="3" /></td>
<td>2-3</td>
<td><input id="ItemCost23" onkeydown="return checkKey(event,3,3,'ItemCost',2,3)" maxlength="30" name="ItemCost23" size="3" /></td>
</tr>
<tr>
<td>3-1</td>
<td><input id="ItemCost31" onkeydown="return checkKey(event,3,3,'ItemCost',3,1)" maxlength="30" name="ItemCost31" size="3" /></td>
<td>3-2</td>
<td><input id="ItemCost32" onkeydown="return checkKey(event,3,3,'ItemCost',3,2)" maxlength="30" name="ItemCost32" size="3" /></td>
<td>3-3</td>
<td><input id="ItemCost33" onkeydown="return checkKey(event,3,3,'ItemCost',3,3)" maxlength="30" name="ItemCost33" size="3" /></td>
</tr>
</table>

The javascript function used is as follows:

<script type="text/javascript"><!--
function checkKey(event, numRecs, numCols, myName, myRow, myCol) {
      var key = event.keyCode;
      var bSetFocus = false;
      var myId = '';
// if the left arrow has been pressed and we're not in the first column
      if( key == 37) {
            if (myCol-1 > 0) {
                  myId =  myName + myRow + (myCol-1);
                  bSetFocus = true;
            }
      }
      // if the up arrow has been pressed and we're not in the first row
      if( key == 38) {
            if (myRow-1 > 0) {
                  myId =  myName + (myRow-1) + myCol;
                  bSetFocus = true;
            }
      }
      // if the right arrow has been pressed and we're not in the last column
      if( key == 39) {
            if (myCol+1 <= numRecs) {
                  myId =  myName + myRow + (myCol+1);
                  bSetFocus = true;
            }
      }
      // if the down arrow has been pressed and we're not in the last row
      else if( key == 40 ) {
            if (myRow+1 <= numCols) {
                  myId =  myName + (myRow+1) + myCol;
                  bSetFocus = true;
            }
      }
      if (bSetFocus) document.getElementById(myId).focus();
} // end checkKey function
// --></script>

In my code I generate the HTML using PHP so when I pass the number of records to the checkKey function (3 in this example) it is the number of rows returned from a database query, and the current row for any given row of the table is the counter in a loop I use to print the table.

By the way, if you want to allow for the left and right arrows to move left and right in a form, you can do that by expanding the checkKey function to look for key code 37 (left arrow) and key code 39 (right arrow), and you’ll need to implement a column ordering scheme (like the counter I used for the rows) so you’ll know where to take the cursor.

Four Direction Code
(submitted by Mr Arrows below, but the comment fields do not accept code so I put it in the main post. I actually had trouble putting two working code samples in the same post so I just updated the main example above to include the left and right arrows)

My Gymnastics Mushroom

October 2nd, 2008 by Robert


I got my mushroom today, and I love it.  It’s been 7 years since my last gymnastics competition (as a collegiate gymnast at ASU, see www.sundevilgymnastics.com for a look at that program).  I got one from Amazon, similar to the one in the picture.
It may take a little while for my wrists to get used to the pressure again, but I am very happy about it - it feels good to move.  The kids were all excited too, but it may be awhile before they make it all the way around:)

Nov 1st Update: My coach from college (Scott Barclay) saw this post and suggested I compete in the next Rocky Mountain Open on Pommel Horse. That is mainly a collegiate competition that is open for anyone to compete. This coming January is a bit soon for that since we just moved across the country, but I’m thinking that in January 2010 I can plan for it. I figure if I get back in shape physically and get a good circle, I’ll be able to do one of my old routines once I get there. We have a park nearby with bars I can swing on with my kids to build up some callouses again, so I expect to be able to do it:)

Nov 22nd Update: I learned after about a week that if I didn’t warm up sufficiently, my wrists would hurt too much to do any circles (or at least enjoyably). So after a week off to let my wrists recover I started doing some pullups on my chinning bar, dips on my kids’ monkey bars, leg raises, and a type of yoga that I can’t remember the name of - just to get warmed up so I could do some circles. Today (after warming up) I did two sets of 20 circles and just about passed out.

I remember observing one of my teammates who was very good at pommel horse but he didn’t have huge muscles. At the time I reasoned that pommel horse doesn’t take much strength based on that observation, but we were little kids back then - now I know that it does take some strength, even for pommel horse:)

Dec 10th Update: I did 30 circles in a row yesterday. I think I’ll take the top off and put it on the floor once I can do 50 circles easily in the elevated configuration. I figure I’ll be in good shape when I can do 75 circles with the top on the floor. I remember having a “50 circle club” and a “75 circle club” in college, and I was the only one in the “75 circle club”. Of course that was circles on the pommel horse, not a mushroom - that’s why I want to put the top on the floor, to more closely replicate the circle I’ll need on the horse.

Dec 13th Update: I did 40 circles today, but after 35 I was barely making it around. I’ll need to pick up speed before I take off the top and put it on the floor :)

Dec 16th Update: I was feeling good last night and did 45 circles after a short warm up. I’m hoping I’ll get to 50 this week, and then I’ll see how many I can do with the top on the floor.

Dec 18th Update: I made it to 50! I was really pushing it after about 40, but determination wins over weakness:) I’ll take the top off when I try it next.

Dec 23rd Update: I took the top off and tried doing circles with the top on the floor. After about five tries I was able to do six in a row, while Demitri and Eden took turns rolling each other around in the base.

Dec 25th Update: Yesterday I made it to 15 circles with the top on the floor, but when I tried to stop I was going too fast and hurt my pinky toe pretty bad (it turned purple).  Based on my previous experiences with twisted ankles, I tried soaking my toes in warm salt water for 15 minutes.  That helped a little bit, but it still hurt too bad to put my shoe on and walk on it.  So later I made a healing paste (made from turmeric and salt, see link above for more details) and covered my toe with it.  I was happy when I awoke this morning at 3:30 to assemble Christmas gifts and it was starting to feel a bit better.  By the time I went back to bed at 6am I was walking on it without problems, and later when I got up to see the kids open gifts it felt good enough to walk around in my shoes again.  It has continued to feel better all day, even when I spent some time raking leaves outside.  I am very impressed, since I hurt that same toe on the trampoline when I was about 10 years old and it was several days before it really felt better then (I think all I did back then was ice it).

Jan 7th 2009 Update: I was feeling good this morning and decided to do some mushroom circles again. After warming up with a set of dips and some jumping on the mini tramp I bought Candice for Christmas I cleared some space (amidst the toys that have filled the basement since Christmas) and made it to 20 with the top on the floor. I had a few false starts before I decided to focus on my extension, that made a big difference - circles on the floor are not possible (at least not more than a few) without good extension. I hear a baby awake, time to make lunch:)

March 1st 2009 Update: Yesterday I warmed up with some jumping on our mini-tramp and playing with the kids, then I cleared a space and did 26 circles before slipping on part of a rug that flipped up over the mushroom top. I had intended to do 30, but I guess I was going fast enough to pull up the end of a rug (it’s rather thin) and slipped on it. Next time I’ll make sure I clear out the rugs as well as the toys.

Oct 25th, 2009 Update: We moved twice since the last update, and now we are living back in Phoenix, within driving distance of Aspire, where the current 20+ member ASU men’s team practices. Scott let me come and play on the equipment a bit recently (during open gym) with a couple of my kids, and we had a great time. I was inspired to get my body in shape so I could do more when I go next time. So this past week, after about 7 months “off”, I got back on the mushroom again (after warming up sufficiently), and did ten circles. I figured I could do that everyday, so I planned on increasing the number of circles by 5 everyday.

By the third day I began slipping off the mushroom (I was trying to do 20 at this point), and since my hands were sweaty I tried putting baby powder on them (I don’t have chalk, but we’ve had baby powder on hand at my house for the last 7 years). This dried my hands (and made them smell pretty good too!) but it actually made it harder to stay on, not easier. I guess baby powder helps baby butts get smooth, not just dry. :)

However, I was determined to do my 20 circles so I reasoned that if I keep my balance well enough in my circles and maintain tight form, I should be able to do as many circles as I want. So I focused on staying tight and level in my swing and was able to do 20. I had the idea this week to challenge the current ASU team to a circle contest (on the pommel horse, not the mushroom), so I am working towards that goal now.

Nov 21st 2009 Update: I got up to 74 circles on my mushroom early this week and subsequently planned to be at the team practice on Saturday for a circle contest. I learned that I could stop slipping off the mushroom by washing my hands and drying them beforehand. Today was the circle contest, my first time on a pommel horse in probably 5 years. Add me as a friend on facebook to see a video of my circles on the horse. I only made it to 46 on the horse, but I had a great time getting the team psyched up. Now I will take of the top off my mushroom and do circles with it directly on the floor. I plan to go back to the gym for a rematch once I can do 75 with the top on the floor, in a few weeks.

Dec 11th 2009 Update: I got up to 41 circles with the mushroom top on the floor early this week and then I realized that even from the beginning I was bending my legs in the back to keep from scraping the ground with my toes. I realized that my wrists need to be more flexible for me to be able to keep my legs straight and extended fully. So I will take my own advice and spend more time stretching than doing circles for the next few weeks. I hope to get to 75 with the top on the floor within a month or so, but I want to do circles with good form.

Source Control Feels Good

September 29th, 2008 by Robert

Today I want to sing praises for source control.  I was working on an inventory application this morning, putting a few final touches on the display of the data to make it more crisp and clean looking.  In this application I used the extjs grid view library (see www.extjs.com for more info) to display the data so the columns could be resized dynamically and it would look and act more like excel than a web page.  Unfortunately something I did this morning caused the column headers to get left justified and lose connection with the centered data, and I lost the scroll bars even though the data was bigger than the box (div) containing it.

After digging myself in a hole and getting angry and frustrated, my wise wife Candice convinced me to take a break and have lunch.  After she helped me move up the emotional scale a bit (and I had a good lunch), I was able to figure out why everything went crazy - it was because I took out my carefully calculated container sizing code and set the width and height to “auto”.  But at the time I was so excited to find a way to make the size exactly match the contents that I had deleted my calculations (eight different calculations, 2 for each of 4 different data grids).  This is where source control came to my rescue.  I use bazaar (see http://bazaar-vcs.org/) to save changes to my code, so once I figured out (based on my log entries) which revision I had deleted the code that I needed, I typed this simple command to create a text file with the code that I had deleted from 3 different files:

>bzr diff -r156..157>heights.txt

(bzr diff shows the differences between versions, -r156..157 specifies the two versions I want to see the differences in, and >heights.txt causes a text file called heights.txt to be created in the current directory with the results of the request)

The I just opened up the created text file and copied over the code that I wanted to put back in my current files, and created a new version with a command like this:

bzr commit -m “restored column header centering and scrollbars by setting the div height and width explicitly using calculations based on the number of records to display”

This whole procedure took a few minutes and felt good, because it saved me an hour of recreating the code while kicking myself for deleting it.  I love source control :)

My Easy Button

September 27th, 2008 by Robert

Hello again,

After a several month hiatus I’ve been inspired to add to this blog again.  I will start by introducing my easy button.  I’m including a picture of it below for those in other countries who aren’t familiar with Staples or their USA based advertising themes.  I mentioned it to a client of mine in the U.K. and although they have staples there he hadn’t heard of it.

When you push the button there is a recording that says “That was easy!” - I have it on my desk and push it whenever I figure out a solution to something or get done with a task I set for myself.  It helps me to feel confident that I can do anything, because everything is easy once I figure it out:)

Candice has one in the kitchen, and I tell Kayin (our 6 yr old) to take mine with him whenever he complains that he can’t do something - like when he says he can’t get to the next level in a video game.

If you go to staples.com and search for easy button you can get one yourself if you want - they even have one in spanish now.

Easy Button