Crowd-sourcing Lost Pet Retrieval

We had our landscaper over yesterday and he was doing an awesome job of getting the yard all cleaned up.  While he was working hard, I was trying to get through my homework.  After an hour or so I decided I needed to take quick a break and play DJ Hero with my step-daughter.  I went upstairs and started jamming.

We were playing for a bit and I noticed that the dog was not in his cage and I couldn’t remember seeing him for the last few hours which was unusual.  We began searching the house with absolutely no luck.  It was about to be dark so we decided to drive around the neighborhood and see if we could find little Charlie.  He usually doesn’t go very far so we thought driving with the windows down and calling for him would do the trick.

I didn’t and we spent the next hour and a half driving through all of the neighborhoods near our house.  We had no luck with that either.  We went home to gather our thoughts and try to come up with a plan to get him back.

Charlie Please Come Home!The next morning we got up early and started again.  Lots of our very helpful friends expressed their sympathy and gave suggestions while we had been sleeping.  We took all of it, we called the humane society and animal control, but they hand’t seen him.  Next we posted an advertisement on CraigsList and created some printed flyers.

We went through the entire neighborhood and put flyers at every entrance or exit for our subdivision!  We literally must have put up at least 40 flyers.  We were excited to see people out with their dogs coming up and taking really close looks at the flyers!  We were very hopeful that the beautiful sunny day would bring about a rescue.

By late afternoon we still had not heard anything!  We were all starting to lose hope again and went back to being very sad and missing Charlie.  On top of this the clouds started to roll in…  A massive storm hit our part of town and obliterated all of the signs that we had put up.  We decided that we’d head to the pound the following day and try to remain hopeful.

During dinner my Fiancée was feeling hungry and sad and decided to check her iPhone for email.  It was there that she found a message from someone that claimed to have found Charlie!  She immediately called and talked to a very nice girl that said she had seen him with one of the neighbors.

She had seen the advertisement on CraigsList and thought to let us know that she had seen Charlie with some of the neighbors.  How amazing is that?!?

To say that the last 24 hours have been a pretty crazy emotional roller-coaster is an understatement, but we’re happy to have the crazy little lion home!

read more

Using My Developer Brain Instead of My Math Brain

Tonight I had a huge flashback to high school after trying to help my step-daughter finish her math homework.  She had a problem where she was supposed to figure out which combination of operations could be used to solve the problem.

15 _ 3 _ 17 _ 11 = 205 You would replace the _ spaces with either addition, subtraction, multiplication or division.

After a few minutes of discussion we decided that she should try a few combinations and see if she could figure it out on her own.  She tried about 20 combinations and then started to get a little frustrated.  In an effort to help I decided that I would try to put together a quick Excel sheet that would compute the answer.  I quickly found out that it’s difficult to get Excel to evaluate formulas dynamically.  It works great if the numbers change, but terrible if the operators change.

This is where my flash-back kicked in.  I remember many times in high school where I was having problems math homework and would go write myself a pascal program to solve the problem.  I never was great at math, but I could break it down into small steps and brute force my way through!

Tonight, I did that again.  I put together a quick console application in C# which generates a permutation and then utilizes XPath to create a dynamic equation and evaluate the result.  If the result matches 205 it can stop.  Otherwise it must try another permutation.

Is there a more elegant solution to this problem in C#?



  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     class Program
  10.     {
  11.  
  12.         public static double Evaluate(string expression)
  13.         {
  14.             return (double)new System.Xml.XPath.XPathDocument
  15.             (new StringReader("")).CreateNavigator().Evaluate
  16.             (string.Format("number({0})", new
  17.             System.Text.RegularExpressions.Regex(@"([\+\-\*])")
  18.             .Replace(expression, " ${1} ")
  19.             .Replace("/", " div ")
  20.             .Replace("%", " mod ")));
  21.         }
  22.  
  23.         static void Main(string[] args)
  24.         {
  25.             List operations = new List();
  26.  
  27.             operations.Add("+");
  28.             operations.Add("-");
  29.             operations.Add("*");
  30.             operations.Add("/");
  31.  
  32.             double output = 0;
  33.             int ctr1 = -1;
  34.             int ctr2 = 0;
  35.             int ctr3 = 0;
  36.             string math = "";
  37.  
  38.             while (output != 205)
  39.             {
  40.                 ctr1++;
  41.  
  42.                 if (ctr1 > 3)
  43.                 {
  44.                     ctr2++;
  45.                     ctr1 = 0;
  46.                 }
  47.  
  48.                 if (ctr2 > 3)
  49.                 {
  50.                     ctr3++;
  51.                     ctr2 = 0;
  52.                 }
  53.  
  54.                 if (ctr3 > 3)
  55.                     ctr3 = 0;
  56.  
  57.                 math = "15" + operations[ctr1] + "3" + operations[ctr2] + "17" + operations[ctr3]+"11";
  58.                 output = Evaluate(math);
  59.                 Console.Write(math + "=" + output + "\n");
  60.             }
  61.             Console.ReadKey();
  62.         }
  63.     }
  64. }
read more

July Monsoon Sunset Panoramics

Wow, this year has been incredible for sunsets in Tucson!  I can’t remember a year where there were so many incredible photo opportunities.  I’m thinking that next year I should just put all of my shots into a single blog post as it will probably be more visually powerful.

Here are a couple more that I took with my iPhone 4 and Panorama.

...

Taken right behind my house

Taken from the Rillito bridge (Alvernon & River)

Taken from my driveway facing due East!

read more

Crowd Sourcing the Eden Family Tree

I had the awesome idea a few weeks ago that I should build an online crowd-sourced family tree web site.  Like with all business ideas your first task is to see what’s going on with your competition.  I began by doing a few searches and found to my dismay that there is already someone doing it, and doing it quite well.  That site is http://www.geni.com/.

Eden Family Tree

Eden Family Tree

To continue my research I thought I should give the site a spin. They allow you to quickly add TONS of details about any family members.  After you add a few you can quickly build your entire tree by connecting to Facebook and inviting your family members to participate.

In my case I had already utilized Family.Show to build out a tree a few months ago.  So I quickly imported my data into Geni and began to fill in the additional info that Family.Show did not support storing.

After only about 30 minutes I have a HUGE family tree built out, and Geni is already matching family members in my tree to potential overlaps in other member’s trees!

Eden Family Map

My family so far

It seems that I have quite a varied background like most Americans.  I have ancestors from Canada, Ireland, United Kingdom, Germany and much of the north-eastern United States.  All this and I’ve only been able to trace my roots back to the late 1700′s.

I’m very excited to see what I’m able to find with the help of the rest of my family!

read more

What I learned in Behavioural Science class (wk 2)

Wow, I’m really excited about all of the cool stuff I’ve been learning in school this week. I thought, rather than posting all of my homework assignments I would just pick one that was the most interesting. I don’t want to annoy people with floods of writing!

————————
The seemingly insignificant act of hearing and seeing a baseball hit by a bat, moving to catch the ball and then catching it in a glove actually requires the use of almost every part of our brain!

First we see and hear the ball being hit by the bat. The sight of the bat about to strike the ball is first registered in the Occipital Lobe inside the Cerebral Cortex. It’s possible that these images are also processed by the temporal lobe. Next the sound from the bat would arrive and would be processed by the Temporal Lobe. At this point another function of the Temporal Lobe would also kick in which is motivation so that the rest of the body and brain will be motivated to expend the energy necessary to catch the ball. This in turn would cause the Medulla to start preparing the body for some potential stress of moving by altering the respiration, heart rate and blood pressure. A goal in the Frontal Lobe has now been set to catch the ball.

During this preparation process our subject is monitoring the ball’s direction, speed and velocity as well as also utilizing the Parietal Lobe’s spatial and mapping functionality to try to predict where the ball will come back down. This way the body can move to the proper location and not need to dive or slide to catch the ball. Efficiency is of key importance is most of the brain’s operations.

Next, the Cerebellum will utilize its ability to control movement to get the subject walking or running over to where it believes the ball will be landing. After getting into the right position the Cerebellum will use another function to adjust reflexes and balance for the entire body to ensure that the subject does not fall over or drop the ball. After the ball is caught the Medulla will begin sending signals to the body to let it know that it can now begin relaxing.

As you can see from this short description almost every portion of the brain is utilized during this process. Hopefully this gives you a view into how diverse, flexible and powerful the human brain really is.

read more

Panoramic Monsoon Sunsets From Tucson Arizona

I don’t tend to whine a lot, but when I do it’s usually about being hot. I have a lot of energy and it usually manifests itself as sweat! Luckily Tucson has the most amazing sunsets during the hottest and most humid time of year. These help me ignore that I can’t stop sweating unless I’m hiding inside with the air conditioning set to 75.

Here are a few panoramic photos I took from my house that show of one of the things that makes Arizona an amazing place to live! These were shot with my iPhone and stitched together using AutoStitch.

Be sure to click to see these larger!

IMG_0642.JPG

Taken 7/16/2010

IMG_0708.JPG

Taken 7/19/2010

read more