Author: Daniel
-
Those One Moments…
Those one moments, the quiet contemplative ones where you are half in and half out of a trance.Those one moments where your mind is just relaxing, not sleeping but not driven to thought.Those one moments where you are so free that you can easily drift from deep profound thought to a light, frothy remembrance of the day’s activities.Those one moments where you want to cry but are not sure if it is out of joy or sorrow.Those one moments where you want to laugh but are not sure if it is out of humor or horror.Those one moments where you want to sing but are not sure if out of comfort and nervousness.Those one moments where you realize you are loved by God, your mother and a stranger that will someday become a good friend.Those one moments when you begin to realize that you are amazing as you and that as you, you do good, all without the glue of your ego to hold it all together.Those where moments when you begin to realize that the things you worry about are trivial compared to the things you take for granted.Those one moments when you feel yourself waking up from the dream of your life and wondering if you should go back to sleep.Those one moments that are between the refreshing excitement of life and the quiet moments.Those one moments that are spent with the people you love while remembering the fun times together.Those one moments… -
The Beauty of a Coded Revolving Door
I have been struggling with a programming problem for a couple of years that I found nearly impossible to solve. (I finally solved it just last week, but that is the point of this posting.) The problem was so overwhelming, and my desire to solve it so strong, that I would ask almost everyone that I had known for a while about it. I had asked programmers, biologists, geologists, physicists and just about everyone else I could think of (except artists and musicians who generally turn their noses up and programming related things). Though I would try to translate the problem into their respective field, they all got the same basic problem.
My primary purpose in asking so many people from so many different backgrounds was in hopes that one of them would spark some idea of a solution that I could run with. To my disappointment, none could offer any real help with the issue. Though, one programmer suggested using an array to store the variables which is eventually what I did and many added to the solution, none offered the big solution that I was hoping for. In the end, I should have expected that the solution would come from dozens of little nuggets instead of a giant lump.
The problem goes like this: There are eight basic virtues. I wish to determine a person’s ultimate virtue, the one that overrides all others, partly because it is fun and partly because it can tell a lot about that person’s perspective and thus why they do what they do.
The best way I know to determine the overriding virtue is to compare the each virtue against each other (a or b) instead of a ranking or other comparison. This method forces the person to decide which virtue is valued most of all in a given context. Such questioning results in a bank of 28 questions containing all the possible pairings (I did not develop the question bank; Origin Systems gets credit for that). In just seven questions, I can reduce the eight virtues down to the single most important virtue. To do this I ask a series of four randomly selected questions that compare all eight virtues, and only the eight virtues.
The first key to the problem was that there could be no overlap: each virtue is asked only once in the opening round. Asking any one virtue twice would defeat the purpose. The second key to the problem—and perhaps the more challenging—is the preference to have the first four questions randomized. If I would have forsaken the randomization then I could have solved the rest of the problem long ago; but what fun would that be? After the opening round, the virtues are then compared in a tournament style: the answers from questions one and two are compared in question five and the answers from questions three and four and compared in question six. The final question, question seven is a comparison of the answers from question five and six.
One of the primary motivators for programming this has been a desire to share the test with others. I could have simply given out the whole of 28 questions but knowing most people the sheer number and complexity of the questioning would have proved foreboding. Instead, I wanted to “hand out” a polished form of the test that could be taken as easily as shared. And, I must confess, at some point I find it difficult to flip through a list of 28 questions trying to remember which virtues have been compared and what the response were.
The solution to providing a randomized tournament questionnaire came while running. (Since my running partner decided to go home to get married, I wish them the best, I have found that I have a lot of thinking time while running and was able to bring together everyone’s input over the years.) Also a major part of the solution and jogging ideas has been my recent massive expenditure of time on learning Action Script 3 (the programming language of Adobe Flash) for another project. Everything came together and here is the final outline of the solution:
- All eight possible virtues are stored in an array (an array is a way to store multiple variable under a single name, like the shoe storage bins outside a play pin: one object, the shoe bin, multiple and separate slots). The array, called myVirtues, looks like this:
myVirtues:Array = ["Compassion", "Honesty", "Valor", "Sacrifice", "Honor", "Justice", "Spirituality", "Humility"]; - The array is randomized using some quick sorting which is by no means scientific and I am sure not that good, but good enough.
- The brilliance that made the whole thing possible is:
pop(). This attribute removes the last item from the array (i.e. takes out the last pair of shoes from the shoe bin). The removal ensures that the virtue cannot be reused and moves the marker to the next available virtue.pop()is ran again with the second virtue stored with the first one in another array calledmyQuiz. - The second array,
myQuiz, is sorted alphabetically before proceeding. This too was a stroke of brilliance inspired from by a friend teaching me calculus. Before the sorting, I was having to double all my coding related to matchingmyQuizwith the appropriate questions; once as a + b and again as b + a because I was not sure which order they would pop out in. By sorting them before the comparison I do not need to worry about the order because they will always be in alphabetical order so I only needed to make sure the valuesmyQuizis compared against were also in alphabetical order. - Once
myQuizis matched to a question number, the question is presented to the user. - At this point, I have come to realize that in terms of programming Google is my best friend for learning things but biology is my best teacher for helping me find solutions. I have found inspired solutions many times by learning how living creatures have developed to overcome obstacles. In my original plan of how to handle round two of questions I was going to create a third array to store the answers in. This turned out to be unneeded by using
unshift()which does the opposite ofpop(): it puts something in first place in the array and pushes everything else back one (i.e. it moves all the shoes down one slot and adds a pair into the first slot). This was somehow inspired by the way the body handles stress though the actual connection between the two escapes me. This technique reduces the amount of code needed by allowing the exact same mechanism that selects the first round of questions to handle the second and all subsequent rounds without modification. The initial array becomes a revolving door for providing virtues until the array is down to its last virtue.
For me, one of the most beautiful parts of the code is the “revolving door” array because that with a single line of code the program knows when it has asked the seventh question:
if(myVirtues.length > 1). The program keeps asking questions until it is done. No extra coding, just plain and simple “end of line.”Thank you to everyone who has ever answered my probing questions about the way things work, without you I would never have found this solution.
- All eight possible virtues are stored in an array (an array is a way to store multiple variable under a single name, like the shoe storage bins outside a play pin: one object, the shoe bin, multiple and separate slots). The array, called myVirtues, looks like this:
-
Teachers: You’ll need it later in life
(I found this in my notes–towards the bottom of the list–next to the note Can I, May I and Can I Go to the Bathroom.)
One of my personal favorites was being told that I would need something later in life. The teacher didn’t know when or how, just that I would. Now that I am later in life I look back on these statement and realized they might as well have told me that at some point I would be shot by a mobster, they just don’t know when or why.The key thing this statement communicates to children is that the all knowing teacher knows that you will need some bit of information but that the children, in their limited knowledge and understanding will need to struggle and figure out, throughout life, how to use the information. If they happen to die before figuring it all out then they will die wondering “how was I supposed to use that incredibly valuable piece of information that no one knew how I would use it?”.
What is tremendously better is what my college algebra teacher was explained to me: “higher math is required not because you’ll actually need it, because you won’t. Higher math teaches you to think differently, that’s why we learn it.” Thus explanation is so much better than “because you’ll need it in some indefinite time in your life for some indefinite purpose.”
-
The (unexpected) blessing of Chat
I remember back when my work first switch to our current email service, Google Apps, from the old antiquated one, a private offering. The old service provided basic email services, 100mb of space and no calendaring or document sharing support. For its time it was normal, compared to now it was dismal. As I was proposing the switch from the old service (which we paid for) to the new service (which was free at the time) I was explaining the benefits of Google Apps: Gmail was a smarter email system, shared calendaring, Docs and Spreadsheets that have only got better with time, Chat to allow instant communication, and of course, Free. I think it was the word “free” that won out in the end, but I remember that Chat was of particular concern. Mostly, the management was concerned that employees would abuse it.
Fast forward four years to yesterday: My work just announced the opening a new location. While the new store will not be open for several weeks (the actual opening date has not been announce) the announcement alone has caused a fervor of activity. There are computers to get ready, inventory to order, people to hire and plans to put down. I, being a remote worker, do not have the normal luxury of roaming in and out of offices to get the answers to questions I have about the opening. How many computer terminals do we need? Who is the store manager? What dates have been announced? How will the new store effect back end staffing? Each of these is a pressing question that needs to be answered sooner rather than later: they each effect a series of other choices that need to be made.
Features such as a live shared calendar are good to be able to track dates on a unified calendar; we are using a Google Spreadsheet to track assignments, record progress notes and completion of tasks. But it is Chat, the Google instant messaging service built into Gmail, that is proving to be most helpful with getting quick responses to simple, but important questions. The one service that we feared would be damaging is invaluable. Unlike email, Chat has a more immediate and pressing presence and allows for quicker back and forth communication and the resolution of additional questions that arise.
This instant communication is good for handling questions, but there is more to it than just question answering. Chat allows remote workers, whether it is me several hundred miles away from the company or the Customer Service Office just a few miles away from the Corporate Office, that help us feel closer together. Close enough to vent our frustrations, tell jokes and even share pictures all the while remaining productive and active in our respective offices. In some ways, I think Chat allows us the benefit of both worlds: distance brings us more productivity because it puts us closer to what each of us manages (the Customer Service people are closer to the warehouse people they work closely with, the Admin people are closer to their records, the merchandiser are closer to their catalogs and I am closer to my phone) while also allowing us to feel a sense of connectedness and camaraderie that improves moral and binds us together.
-
“Outliers” by Malcolm Gladwell
People who have been successful through out history (at least modern history) have been so because of the enormous effort they have put into their success, so argues Gladwell. He suggests that coming from a wealthy background and being born with a high IQ can help lay a foundation for that success but notes that there are more that many people who inherited wealth squander it and that there are more geniuses who have less than noteworthy jobs than those who do. Instead, proficiency and success usually comes after about seizing an opportunity, applying about 10,000 hours of practice and recognizing your cultural legacy. As with Gladwell’s other books, Outliers presents a narrative with a broad collection of story to illustrate his point.
Interesting tidbit: nineteenth century European farmers generally worked about 1200 hours a year. That is 200 more hours a year than hunter/gatherers (and I was always under the impression that we changed from hunter/gatherer to farmer because it was easier). Both of these pale in comparison to the rice farmers of the era who generally worked (and many still do) 3000 hours a year.