Daddy, what’s the biggest number?

September 2nd, 2010 | creative, technical

googol

Daughter: Daddy, what’s the biggest number?

Daddy: Well, there’s no such thing as the biggest number, they keep going forever, but you know how 10 has 1 zero behind it and 100 has 2 zeros behind it? A googol is 1 with 100 zeros behind it… and a googolplex is 1 with a googol zeros behind it!

Daughter: Can you count to a googolplex?

Daddy: Never ever. Even if you had all the computers in the world counting for a million years you couldn’t even come close.

Daughter: What if they made a googolplex computers?

Daddy: Then it’d be no problem!

Appendix: If you’re like me, you’re wondering just how high could all the world’s computers count in a million years? Given 1 billion computers at 3GHz that’s 109 computers * (3 x 109) cycles * 106 years * 365 days * 24 hours * 60 minutes * 60 seconds = 1032, or a third of the way to googol. So 3 million years for a googol. That means 1 with 3 million zeros years to get to googolplex!

4 comments

Thrift and Economy, Denial and Sacrifice

August 13th, 2010 | axiomatic, cultural, economic, historical, political, spiritual

harding

“Let us call to all the people for thrift and economy, for denial and sacrifice, if need be, for a nation-wide drive against extravagance and luxury, to a recommittal to simplicity of living, to that prudent and normal plan of life which is the health of the Republic. There hasn’t been a recovery from the waste and abnormalities of war since the story of mankind was first written, except through work and saving, through industry and denial, while needless spending and heedless extravagance have marked every decay in the history of nations.”

Warren G. Harding’s speech during the Depression of 1920 quoted by author Tom Woods in a lecture on the fallacy of federal stimulus.

2 comments

Zombies in Pop Culture

October 31st, 2009 | cinematic, cultural, spiritual

zombieland

I’m striving to understand the zombie phenomenon. I admit my exposure is fairly limited, as I’ve only seen Dawn of the Dead (2004), 28 Days Later, I Am Legend, Red State, played the Plants vs. Zombies game, and viewed the trailer for Zombieland. I haven’t read Max Brook’s quintessential Zombie Survival Guide nor have I witnessed a zombie march. So I sit here on Halloween night making speculations about why zombies are such a popular part of contemporary culture. I’ve come up with the following themes:

Life and (Un)Death

Various movies treat the precise zombie condition somewhere on a spectrum between biological and supernatural, but in nearly all, it’s clear that zombies straddle two phases of existence. The Judeo-Christian belief in the general resurrection is an unspoken inspiration behind the macabre. Is there a realm beyond this life? Most of us would like to say yes. Is it a nice place to be? And is the transition painless? Zombies say no.

Pandemic

The constant threat of Swine Flu pays the bills for the evening news and Big Pharma. Everybody knows its going to happen someday, the question is the vector of contamination. Before pigs, it was birds, so the next logical step is fluid-exchange from flesh-eating humans. The blood motif ties closely with the recent vampire craze, possibly a future post. The “could I be next?” question plays to our deepest fear of helplessness.

The Apocalypse

We’re fascinated with doomsday. I often find myself daydreaming about what survival tactics I’ll take after it all falls apart. The uninfected people in zombie movies seem to find themselves adapting to a new status quo unlike anything we currently imagine. They coalesce in to wandering tribes of survivors pooling resources and ammunition. It’s good role-playing for civilization preparedness.

Terrorism

Zombies have no fear of death. They are on a path of self-destruction bringing down as many others as possible. Maybe that’s why people find it gratifying to see them mercilessly killed—a vengeful outlet on all the suicidal idiots of the world.

1 comment

Middle School QBasic vs. Killer Coding Ninja

May 21st, 2009 | technical

Just got code-pwned by my coworker yesterday. Below, you’ll see the difference between a mechanical engineer and a computer scientist’s approach to the same problem. The elegant solution is to use recursion: a function that calls itself.

The Brute Force Middle School QBasic Programmer Approach:

-	function getPath($selected) {
-
-		// search entire menu structure for key matching $menu_name
-		// return array with each level of menu path
-		// a recursive function would be cool here, beyond my ability -dw
-
-		$level[0] = getMenu('all');
-
-		foreach ($level[0] as $key[1] => $level[1]) {
-			$path[1] = $level[1];
-			$path[1]['key'] = $key[1];
-			unset($path[1]['sub']);
-
-			if (false) {
-				// first level is not allowed to be a match
-			} elseif (isset($level[1]['sub'])) {
-				foreach ($level[1]['sub'] as $key[2] => $level[2]) {
-					$path[2] = $level[2];
-					$path[2]['key'] = $key[2];
-					unset($path[2]['sub']);
-
-					if ($selected == $key[2]) {
-						break 2;
-					} elseif (isset($level[2]['sub'])) {
-						foreach ($level[2]['sub'] as $key[3] => $level[3]) {
-							$path[3] = $level[3];
-							$path[3]['key'] = $key[3];
-							unset($path[3]['sub']);
-
-							if ($selected == $key[3]) {
-								break 3;
-							} elseif (isset($level[3]['sub'])) {
-								foreach ($level[3]['sub'] as $key[4] => $level[4]) {
-									$path[4] = $level[4];
-									$path[4]['key'] = $key[4];
-
-									if ($selected == $key[4]) {
-										break 4;
-									} else {
-										unset($path[4]);
-									}
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-
-		return $path;

The Killer Coding Ninja approach:

+
+	// {{{ getValues()
+	/**
+	 * Returns the properties of a specific path segment, minus any children.
+	 * @param	{string}	id		The unique id of the path segment
+	 * @param	{array}		values	All properties of the path segment
+	 * @return	{array}
+	 */
+	function getValues($id, $values) {
+		$retval = array('key' => $id);
+		foreach ($values as $key=>$value) {
+			// don't include any submenus
+			if ($key != 'sub') {
+				$retval[$key] = $value;
+			}
+		}
+		return $retval;
+	}
+	// }}}
+
+	// {{{ getPath()
+	/**
+	 * Recursive function to return the path of a section.
+	 * @param	{array}		menu		The menu to iterate over
+	 * @param	{string}	selected	The id of the ending path segment to find
+	 * @return	{array|false}
+	 */
+	function getPath($menu, $selected) {
+
+		foreach ($menu as $path_id=>$path_vals) {
+			if ($path_id == $selected) {
+				return array(self::getValues($path_id, $path_vals));
+			} else if (isset($path_vals['sub'])) {
+				$path = self::getPath($path_vals['sub'], $selected);
+				if ($path != false) {
+					array_unshift($path, self::getValues($path_id, $path_vals));
+					return $path;
+				}
+			}
+		}
+		return false;
+	}
+	// }}}
Add comment

Hip to be Square

April 19th, 2009 | creative, technical

facebook_avatar
When Facebook rolled out their latest redesign a few months ago, I was simultaneously pleased and upset with the round avatar treatment, but couldn’t explain why. My right brain said “Kudos fb, so smooth, fillet the blue sky!” While my left brain said, “width: 49px; margin: 9px; carry the 7; error;”

As I’ve thought about it more, with both sides of my brain, I’m formulating a theory: In the context of bulleted lists, especially where the avatar is being used as a giant bullet, alignment is crucial. Our eyes need to verify that everything lines up, because if it doesn’t, that probably means something like a nested reply. In the x dimension, we need to confirm that the bullets are directly on top of each other. And in the y, the top of the bullet needs to be in line with the top of the text—the closer to a fixed interval the more pleasing the rhythm.

Corners make this quick check easier, fillets make this harder. Corners deliver a fixed point of comparison, fillets demand us to make two tangents.

twitter_avatar

When Twitter surpasses Facebook as the next social medium, I’ll attribute it to this seemingly insignificant design decision.

2 comments

Hot New Tricks With Gmail

December 20th, 2008 | creative, technical

gmailNext month, I start a brand new job at Mailtrust, a locally-created email hosting company in the University Mall, recently bought by Rackspace of San Antonio, a household name in web-serving. Since accepting the offer, I’ve been taking more notice of the features so many of us have come to love in Gmail. They just rolled out a few amazing upgrades through “Labs”. If you click on the green test tube beaker thing at the top of your Gmail screen next to your login name, you should be able to scroll down and turn these on:

  1. Send SMS text messages to cell phone numbers through Google Chat - Dec 10 - Especially hot for me to be able to send love notes to my hot wife since our plan charges 50c per message. I mean, of course she’s worth 50c, but why pay if you don’t have to?
  2. To-do List - Dec 8 - In addition to making nested to-dos, you can convert email messages into to-do list items with a click and assign due dates to items.
  3. Styling themes - Nov 19 - I like the ninja.
  4. Google calendar now syncs with Outlook and iCal - Nov 25 - Not exactly a Gmail labs feature, but related in the category of being awesome. See next item.
  5. Display Calendar and Docs in sidebar - Oct 27 - Another important step in synchronizing the fully integrated online office. Can’t wait until MS Office totally disappears.
1 comment

Multilingual Morning for Methodist Moms

November 12th, 2008 | cultural, historical, local, spiritual

Founders of Blacksburg United Methodist Church

Founders of Blacksburg United Methodist Church

This morning, while holding the door open for preschool at Blacksburg United Methodist Church, I was able to greet various parents and kids with “howdy”, “good morning”, “guten tag”, “buenos dias”, and “dobre dien”. I was waiting to see the mom to whom I could have said “salam alaikum”, but she must have come through another door. Now that I’m looking it up I’m realizing that I can also say “god morgen” (Danish), and I’ll probably need to ask the many Asian moms what I should say in their respective languages. A new dad also asked me a question in some kind of Scandinavian/Germanic accent.

Could the 18th century Scotch-Irish/German founders of Blacksburg United Methodist Church have possibly had the slightest idea how many cultures would be served by their preschool ministry? The door to this church is so wide. Kudos BUMC!

1 comment

Previous Posts


  • categories

  • recent comments