Sunday, February 07, 2010

Perfectly inquisitive...

Let us define a "perfectly inquisitive scientist" as one who has no distractions, never gets bored with what they are doing and simply lives for the thrill of the next discovery. If we were to give this perfectly inquisitive scientist an infinite amount of resources and an infinite amount of time, would they reach the same end point regardless of where they started?

In other words... all science starts with an observation, and the best science starts with a, "huh... that is strange...". Different scientists are going to have different starts in life and will start out with a different set of observations.

Since one discovery can lead to another, given infinite time, resources and effort, will their respective starting points cause them all to converge on the same point? If so, are infinite time, resources and effort even required? Or could those quantities possibly be finite?

Wednesday, January 27, 2010

iPad Joke

Customer: "Do you happen to have a Thai version of the iPad?"
Genius: "Yes, we call it that iPad Thai."

*rimshot*

Sunday, January 24, 2010

Where the crazy ones are...

Picture yourself back in 2001. The Taliban runs Afghanistan and harbors Al Qaeda. Al Qaeda attacks the US. This was an act of war.

Pop Quiz time: What would you do?
Answer: Defend your country, duh!

How would you defend your country? You would go after the enemy, right? Of course you would!

So who is the enemy? The attackers, and the ones who provided them safe harbor, duh!

So that would be the Taliban and Al Qaeda right?

Uhhhh, well... not exactly...

If you were U.S. President George W. Bush, that would be Saddam Hussein. Leader of the ruling Ba'ath Party in the country of Iraq.

(sound of record needle scratching) WTF?!?!?!?!

Now that it is 2010 and details are starting to trickle out, things are starting to make a *LOT* more sense. As it turns out, apparently 'ole George W. Bush felt that he was on a mission from "god". Not the tongue-in-cheek "let's rally the troops" kind of mission from god.

No...

He was on a *REAL* mission from god. "the world is ending in a blaze of glory and I was elected to fulfill biblical prophecy", kind of mission from god. His book of bronze age fairy tales (a.k.a the "Bible") said so!

Holy s***!

We spent a *TRILLION* dollars and over 4,000 U.S. lives chasing the fairy tales of a deluded ex-drunk frat boy?????


Tuesday, January 19, 2010

Hey Demorcrats - Nice job losing Ted Kennedy's seat...

I will keep this one short and sweet...

Democrats have been playing wet nurse to Joe Lieberman and anyone else who wants to line up and whine for attention. Now they had better freaking not be surprised that they lost one of the most reliable seats in the Senate!

When will you get the message that people elected you to make *BOLD* progress on a progressive agenda? Not rock back and forth sucking your thumb and wringing your hands worried you might have annoyed someone. Quit being afraid to make enemies and do what people elected you to do ya crybabies!

Republicans passed the Bush tax cut using budget reconciliation. You do *NOT* need 60 votes to get strong health care reform or anything else for that matter.

Grow a pair and do what needs to be done! I think you will be amazed at how much support it will earn you.

Tuesday, January 12, 2010

Google's New Approach to China

Way to go Google! Now it is up to China to decide how they will respond. Quite a pickle for them.

If they concede to Google, who has stated that they will no longer filter search results, then unfiltered access to the Tiananmen Square incident will finally be available within mainland China. On the other hand, the notoriously prideful Chinese government can tell Google to piss off, and look far worse.

Either way, the good guys win one this time :-)

Thursday, December 24, 2009

Getting the most out of Python range()

I am doing a small data analysis project and figured it was a good time to learn a bit of Python. One of the requirements was that my data analysis range go from a start to a finish value in certain increments. The range() built in function was perfect for this, except that it stops prior to the last value. For example, for range(10, 25, 5), the values 10, 15, 20 would be produced. I needed 10, 15, 20, 25.

The obvious fix for this is to add the increment value to the stop value: range(start, finish+increment, increment). Unfortunately, this falls flat when the difference between your stop and start values is not a zero modulus of the increment value. For example, range(10, 23, 5) would produce the values 10, 15, 20, 25 based on the obvious fix, and that goes past the finish value.

The proper fix is the following (broken up into two lines for readability):

mod = increment - ((finish - start) % increment)
range(start, finish+mod, increment)

The astute will notice that all this "magic" really does is bumps up the finish value so that the difference between the finish and start is a zero modulus of the increment. For situations where the difference between the finish and start value is already a zero modulus of the increment, this solution effectively implements the "obvious fix" above.

The same thing could be done by simply adding the increment value to the finish value only when the difference between the finish and start value is a zero modulus, but that requires an "if" statement to detect that situation. My solution replaces multiple lines of code, or an awkward looking conditional (does python even do conditionals???), with a nice clean mathematical statement that works for all situations.

Tuesday, November 24, 2009

Theories and Laws...

I am amazed at the number of people who do not know what the word "theory" means... Maybe this will clear it up.

Hypothesis - educated guess that may or may not be backed up by facts. When most people say "in theory" they really mean "I hypothesize that...".

Theory - A way of explaining why something works the way it does, backed up observational/experimental results. The Chilton's guide for my car is the theory manual behind the operation of my car. The theory of gravity attempts to explain why gravity works the way it does. A book on computer science is the theory guide explaining how your computer works. And so on...

Law - A description of a phenomenon, but does not explain the "why". A train schedule is an example of a "law". It explains when the train will arrive but has no power to explain why the train got there on time. The "law" of gravity explains why your head hurts when someone drops a brick on it, but only the "theory" of gravity explains why the brick dropped downwards, instead of just floating there in space.

Last but not least, in case it is not obvious, theories are never promoted to "law" status. They are totally different things.

Theories explain "why", laws explain "what"...