Saturday, June 15, 2013

The 156 Best Episodes of Star Trek

As promised I've gone through the data from IMDB for all the Star Trek series, and found the best episodes across all the series.  I took the top 25% of episodes in each series and combined them.  Then I cut it off to only those episodes that had a rating of 8 or above, which only cut off a dozen or so episodes.  Here are the episodes, sorted by series and then air date.  I'd add you should probably watch any two part episodes, even if they aren't listed, because they are usually both good and important to the plot.  In DS9 the ending arc begins with S7E16, and even though some didn't make the cut, skipping any of those would be madness.

I've previously written some overviews of each series, so maybe couple that with this.

SeriesEpisodeRatingNum RatingsTitle
TOSS01E108.1877The Corbomite Maneuver
TOSS01E118.4854The Menagerie: Part I
TOSS01E128.3806The Menagerie: Part II
TOSS01E148.61042Balance of Terror
TOSS01E188805Arena
TOSS01E228.61083Space Seed
TOSS01E238739A Taste of Armageddon
TOSS01E258.3787The Devil in the Dark
TOSS01E268.1717Errand of Mercy
TOSS01E288.71326The City on the Edge of Forever
TOSS02E018.6871Amok Time
TOSS02E048.6981Mirror, Mirror
TOSS02E068.7845The Doomsday Machine
TOSS02E108.5687Journey to Babel
TOSS02E158.6960The Trouble with Tribbles
TOSS03E028.4665The Enterprise Incident
TOSS03E238.1578All Our Yesterdays
TNGS01E248.1669Conspiracy
TNGS02E038.1697Elementary, Dear Data
TNGS02E088607A Matter of Honor
TNGS02E098.6882The Measure of a Man
TNGS02E168.5834Q Who?
TNGS03E108.2638The Defector
TNGS03E138.4678Déjà Q
TNGS03E158.51019Yesterday's Enterprise
TNGS03E168.1685The Offspring
TNGS03E178.1571Sins of the Father
TNGS03E238.1585Sarek
TNGS03E268.61074The Best of Both Worlds: Part 1
TNGS04E018.6958The Best of Both Worlds: Part 2
TNGS04E078.3570Reunion
TNGS04E118.1583Data's Day
TNGS04E128545The Wounded
TNGS04E148.2607Clues
TNGS04E218.1612The Drumhead
TNGS04E268.3550Redemption
TNGS05E018.2545Redemption II
TNGS05E028.4780Darmok
TNGS05E078.3562Unification I
TNGS05E088.3549Unification II
TNGS05E148.3563Conundrum
TNGS05E188.7771Cause and Effect
TNGS05E238.5662I Borg
TNGS05E248.1533The Next Phase
TNGS05E258.51462The Inner Light
TNGS05E268.2575Time's Arrow: Part 1
TNGS06E018.2587Time's Arrow: Part 2
TNGS06E048.4617Relics
TNGS06E108.2587Chain of Command: Part 1
TNGS06E118.6611Chain of Command: Part 2
TNGS06E128.5593Ship in a Bottle
TNGS06E158.7689Tapestry
TNGS06E218.2538Frame of Mind
TNGS06E258.5546Timescape
TNGS06E268.2499Descent: Part 1
TNGS07E118.6599Parallels
TNGS07E128.3518The Pegasus
TNGS07E158.3577Lower Decks
TNGS07E258.44923All Good Things...
DS9S01E188.7505Duet
DS9S02E088.2337Necessary Evil
DS9S02E148.2337Whispers
DS9S02E198323Blood Oath
DS9S02E228320The Wire
DS9S02E238314Crossover
DS9S02E268.5326The Jem'Hadar
DS9S03E018.2323The Search: Part 1
DS9S03E028317The Search: Part 2
DS9S03E098314Defiant
DS9S03E208.5337Improbable Cause
DS9S03E218.6346The Die Is Cast
DS9S03E268.2299The Adversary
DS9S04E018.6429The Way of the Warrior
DS9S04E028.7653The Visitor
DS9S04E078.3378Little Green Men
DS9S04E108.1302Homefront
DS9S04E228285To the Death
DS9S04E258.1286Broken Link
DS9S05E018.1293Apocalypse Rising
DS9S05E028277The Ship
DS9S05E068.4621Trials and Tribble-ations
DS9S05E148.5312In Purgatory's Shadow
DS9S05E158.5310By Inferno's Light
DS9S05E268.6337Call to Arms
DS9S06E018.4300A Time to Stand
DS9S06E028.6306Rocks and Shoals
DS9S06E058.4288Favor the Bold
DS9S06E068.6341Sacrifice of Angels
DS9S06E138.5541Far Beyond the Stars
DS9S06E188.1283Inquisition
DS9S06E198.3657In the Pale Moonlight
DS9S06E268.1268Tears of the Prophets
DS9S07E068.1248Treachery, Faith, and the Great River
DS9S07E088.4334The Siege of AR-558
DS9S07E168.1276Inter Arma Enim Silent Leges
DS9S07E208.4245The Changing Face of Evil
DS9S07E218.1234When It Rains...
DS9S07E228.5249Tacking Into the Wind
DS9S07E248.2257The Dogs of War
DS9S07E258.4438What You Leave Behind
VOYS01E068.1350Eye of the Needle
VOYS02E188.2330Death Wish
VOYS02E218.1299Deadlock
VOYS03E088.2340Future's End: Part 1
VOYS03E098.1311Future's End: Part 2
VOYS03E218264Before and After
VOYS03E238.3310Distant Origin
VOYS03E258260Worst Case Scenario
VOYS03E268.3397Scorpion: Part 1
VOYS04E018.6370Scorpion: Part 2
VOYS04E088.5357Year of Hell: Part 1
VOYS04E098.3328Year of Hell: Part 2
VOYS04E148.6360Message in a Bottle
VOYS04E168.1246Prey
VOYS04E238.6339Living Witness
VOYS04E258270One
VOYS04E268254Hope and Fear
VOYS05E028.3345Drone
VOYS05E068.5357Timeless
VOYS05E118.1299Latent Image
VOYS05E158.2290Dark Frontier: Part 1
VOYS05E168.2270Dark Frontier: Part 2
VOYS05E228.1284Someone to Watch Over Me
VOYS05E248.4292Relativity
VOYS05E268.3279Equinox: Part 1
VOYS06E018292Equinox: Part 2
VOYS06E048.3319Tinker Tenor Doctor Spy
VOYS06E108.2283Pathfinder
VOYS06E128.6394Blink of an Eye
VOYS06E248.2256Life Line
VOYS06E268242Unimatrix Zero: Part 1
VOYS07E258.3540Endgame
ENTS01E268.5236Shockwave: Part 1
ENTS02E018.5656Shockwave: Part 2
ENTS02E228.3256Cogenitor
ENTS02E238.4726Regeneration
ENTS03E088.6310Twilight
ENTS03E138.4211Proving Ground
ENTS03E188.6229Azati Prime
ENTS03E198.5203Damage
ENTS03E228.6197The Council
ENTS03E238.7204Countdown
ENTS03E248.7223Zero Hour
ENTS04E048.5218Borderland
ENTS04E058.5208Cold Station 12
ENTS04E068.6212The Augments
ENTS04E078.7202The Forge
ENTS04E088.6195Awakening
ENTS04E098.6203Kir'Shara
ENTS04E128.7204Babel One
ENTS04E138.6190United
ENTS04E148.6195The Aenar
ENTS04E168.4190Divergence
ENTS04E188.7360In a Mirror, Darkly: Part 1
ENTS04E198.7327In a Mirror, Darkly: Part 2
ENTS04E218.4227Terra Prime

Tuesday, June 11, 2013

Michael Jackson's Moonwalker for Sega Genesis

https://www.youtube.com/watch?v=-N68qvYFpTA

I watched someone play this for about an hour last night.  Keep in mind that this is a real game, made with Michael Jackson's consent. 

It involves him collecting children (from trunks of cars among other places), his monkey bubbles jumping on his head and guiding him, and an inexplicable Conan O'Brian-esque celebrity mouth bit.

Tuesday, June 4, 2013

Replacing a bad hardwired speaker cable with a jack

I have a pair of Logitech X-230 computer speakers that have served me well for close to 10 years now.  One issue is that the cable that runs from the speakers to the computer is hardwired in.  Recently, a wire failed and I was left with mono sound.  While this was fine for fireside chats, music sounds much better in stereophonic sound.

I decided to open up the speaker and see how feasible adding a jack would be.  The layout was simple enough.  I identified where the wires connected to the circuit board and used a multimeter to determine which wire went to which part of the plug (tip, ring, bottom).  I labeled the circuit board with my findings.

I then closed up the speaker and debated what to do.  I could have easily just spliced in a new wire.  The problem was I didn't like the idea of ruining a new wire, and I liked the idea of a jack for future flexibility.

The problem was I hadn't soldering in 10 years, and even then I had no idea what I was doing.  I decided to learn how to solder and attempt this as a first project.

I was making a large electronics purchase from Sparkfun, and so included a soldering iron and 3.5 mm stereo jack in the order.

If you read the comments on that jack they are pretty bad.  The only other choice at Sparkfun was this jack.  Note that the first one is panel mount which meant it had a nut to hold it in a hole drilled in a panel.  The second one would have to be held in place internally somehow.
This animatronic parot gave its life
so I could listen to Manowar



I watched a lot of soldering tutorials, and read some stuff.  Then I found some solid wire from some old network cable I had, as well as some stranded wire from an old talking parrot toy I had.  I made some splices and soldered them.  With that I declared myself the world's foremost authority on soldering *.

The first order of business was removing the hot glue holding the audio cable in place.  Following some internet advice I used some acetone and it released the cable immediately.

I cut the cable giving myself about 8 inches to work with inside the speaker.  I tested the part that would remain inside the speaker to make sure the broken wire wasn't in there.  I also stripped the ends of the other part so that I could use it for testing.

A quick note, there are three wires in a stereo audio cable.  Right and left channel, and then a common ground.  The ground is often bare wire twisted around the outside of the other two wires which serves as a shield.  I just twisted up that part of the ground wire, with no regard for interference inside the speaker.

Now I had to install the jack.  I drilled a hole in the side of the casing and put the jack in.  However, as the comments had forewarned, the jack was not deep enough to fit through the wall.  Actually it was just about perfect depth to fit, but with no space left over for the nut.

I thought about gluing it in place, but ended up drilling a slightly larger hole and then by pure luck having the nut fit perfectly in there.  I then could screw in the jack to the nut.  Once it was screwed in it was pretty much locked in place.  This meant I had to do the soldering inside the speaker.

For some reason only the ground tab had a hole to thread the wire through.  I probably should have drilled holes for the other two.  It took about 3 hours to solder the wires on.  Including soldering the first one on the wrong tab and then having to unsolder and then resolder it.  The angle of the case made it very difficult to get the iron in a good position.  The ground and another tab were quite close and I kept getting bridges between them.  The ground wire with its holey tab took about 10 minutes.

I did a final test with the multimeter to make sure there were good connections from the solder points on the circuit board all the way to the bare ends of the audio cable.

I closed everything up and just about had a heart attack when an audio test revealed the left and right channels to be mixed up.  Then I remembered that I don't care about the channels being correct, and as a result the speakers are physically on the wrong sides.

I must say the end result is about a billion times more professional looking than it should be.






Secret soldering expert?
* Note "the world" is the name I call my house.  Even then this is a tenuous claim, as I believe my cat may have substantially more soldering knowledge than it is letting on.

Friday, May 31, 2013

List of animals with fraudulent diplomas

http://en.wikipedia.org/wiki/List_of_animals_with_fraudulent_diplomas
Colby Nolan is a housecat who was awarded an MBA degree in 2004 by Trinity Southern University, a Dallas, Texas-based diploma mill, sparking a fraud lawsuit by the Pennsylvania attorney general's office.

Thursday, May 23, 2013

Monday, May 20, 2013

IMDB Ratings

They are remastering Star Trek TNG and releasing them on bluray.  They just released season 3 and I was looking through them.  One of the first things that I noticed was how many great episodes were in that season.  Seasons 1 and 2 had some good episodes, but it felt like most of the season 3 ones were great.

This wasn't that surprising; I've often stated that in each Star Trek series the first two seasons tend to be the worst.  As I constantly feel the need to evangelize Star Trek I wanted to see what the top episodes were and list them here.  I found that the IMDB had individual user ratings for each episode.  I almost didn't notice they had a simple page with all the ratings on there and was about to write a script to scrape them from the season pages.

I copied that data and began to work on ways to present it.  I wrote some gnuplot scripts for a few graphs.  I wanted to ultimately make graphs for each of the five series.  The problem was preparing the data for each plot was rather time consuming.  I decided to write a perl script to do that.

The script went well, and I decided I was on roll so I might as well make it download the data itself.  I ended up with likely my most robust script ever.  Every show has a IMDB id like: tt0092455.  You can either put that in the file, or pass it to the script as an argument.  It generates a directory for each show, and puts all the raw data files in there, along with 3 graphs.  I suppose I could have made it so that it takes multiple ids and runs each, but it's so easy to just paste them into a file and just type 'perl imdb.pl ' down the column and save that as a shell script.

I'm pretty happy with the script.  It handled the real word data of a variety of shows quite well.  Which is frankly amazing considering this regex is in it:
$fileline =~ m/\s+(\d+)\.(\d+)\s+(.+?)\s+(\d+\.\d+)\s+(\d+,?\d*)\n/

Here's the script, and the source for the 0 of you that are interested.

I ended up compiling a list of 32 shows, both my own favorites and popular ones from the internet.  Here is a gallery of all the graphs.

http://imgur.com/a/gO68p

This one is a straight forward scatter plot of every episode.  There is a linear regression line plotted showing the general trend.  Note that in all the graphs the seasons fall entirely to the right of the grid line they are labeled at.  In other words the first episode of season 5 is directly on that dotted line, the rest of season 5 is to the right.

The average rating of each season.  Not weighted by number of reviews.  Also note that none of these graphs start the y axis at 0, which exaggerates difference between points.

Here I took the top quarter of best episodes and bottom quarter of worst episodes and counted how many of each were in each season.


I still will have to do some comparison between the Star Trek series and post that.

Sunday, May 5, 2013

Chaos Theory

I wrote this overview of chaos theory for a class, and figured I'd post it here.  It's written for the audience of my professor, but you can gloss over the more technical parts.  The first half is mostly a historical overview.


Chaos is a condition where a deterministic system, governed by a set of simple rules, can lead to erratic, seemingly random results.  This is because tiny variations in the starting conditions are amplified many times and become significant.  While this may seem like a logical thing, it was only recently discovered and accepted.  The history of science is about discovering the laws that govern the natural world, and it was long accepted that simple laws lead to simple consequences.  The idea of chaos as an innate property of natural systems was so revolutionary that even its discoverer avoided the idea.

Chaos theory was discovered largely by accident.  The story begins with the ancient Greek philosophers who came up with the term chaos as a contrast to cosmos, their name for order in the universe.  The word chaos meant an empty abyss that existed before creation.  The term was used at the start of the Bible which is translated to "without form and void" to describe the state of the universe before God created the world, and with it order.

In the late 16th century, Galileo developed his laws of motion.  These laws seemed to govern all the motion in the world.  This set off a series of discoveries of simple laws that explained a wide range of phenomena.  Galileo was followed by Kepler who came up with laws that very accurately described orbital mechanics.  Kepler described orbits as ellipses that had the planets speed up as they moved in closer to the Sun.  After Kepler, Newton arrived and drew the connection between earthly phenomenon and the heavenly movements of planets.  His insight was that the same set of laws described all motion.  The same force that pulled an object to the ground on Earth kept the Moon in orbit in space.

Newton also cast the die for all modern science.  He invented calculus as a tool to help explain the constant change that governs nature.  He came up with a differential equation that described all motion:
`F = ma = m cdot {dv}/{dt} = m cdot {d^2s}/{dt^2}`
where: `F` is force, `m` is mass, `a` is acceleration, `v` is velocity, `s` is displacement, and `t` is time.

Newton's few simple laws described the vast array of motion observed.  His technique of finding a differential equation to describe a system, and then integrating it was the prototype for science for hundreds of years.  With this technique scientists could predict future states based on known initial conditions.  Following Newton's lead gave rise to whole new fields: Fluid mechanics, elasticity theory, kinetic theory, thermodynamics, and electricity & magnetism are all examples of fields that resulted from Newton's way of doing science.

Newton published his blueprint for science, the Principia Mathematica, in 1687.  For the next 200 years it described all motion observed in the universe.  However, in the late 19th century flaws with Newtonian physics began to emerge.  One flaw was the fact that light could only exist as a propagation of a wave.  Yet, Newtonian physics said that on observer riding at the speed of light should see light standing still, but still oscillating as a wave.  Einstein explained this paradox by developing special relativity.  Special relativity said that time and length are relative, and not unchanging as dictated by Newton.  This was the first of three major challenges to Newton's world view of absolute laws.

The second challenge came from the study of electrons in the atom.  It was shown that electrons could only exist in discrete orbits.  When the electron changed from one orbit to another it made a quantum leap, never existing in the space between.  While these two revolutions took place early on in the 20th century, the third took longer to be accepted.

The story of the third revolution begins with the same orbital mechanics that were so instrumental in creating Newtonian physics to begin with.  Describing the orbit of one body around another is known as the two body problem.  The differential equation describing it was solved by Newton by converting it from a nonlinear to a linear problem.

The similar problem involving three bodies was, however, unsolved for many years.  Mathematicians eventually simplified the three body problem into a problem with two large bodies in a circular orbit, and a small particle-like third body.  This was known as the restricted circular three body problem.  Unfortunately, even the simplified problem proved intractable.

In the late 19th century a mathematician and physicist named Henri Poincaré attempted a novel, and largely geometric, solution to the three body problem.  He invented a concept called state space.  A state was all the information one needed to calculate the future of a system.  State space was the collection of all possible states.  Using state space, Poincaré could map a system and study its behavior from a fresh perspective.  Additionally, Newton's differential equation, F=ma, gives a vector field in state space.  This vector fields shows what an object at any given location will do from there.  By following the vector arrows one can start an object in state space and follow its path to learn how it will behave.

Poincaré attempted to plot the three body problem through state space but discovered a shocking revelation.  He found that the paths of the bodies crossed each other infinitely many times.  This meant that a given starting location had two possible paths that would lead to very different behaviors.  Which path a body would take depended on tiny variations in the exact starting location.  Here was a deterministic system where tiny changes to the initial conditions would lead to wildly different behaviors, the first glimpse of chaos.

Chaos theory is inherently interdisciplinary, and has seen application to a wide array of different problems in unrelated fields.  Fractals are a well known visualization of chaos.  The Mandelbrot set is the most well known fractal.  The rules for generating it are simple.  Begin with the complex number plane.  For any given complex number c in the plane, follow the iteration:
zn+1 = zn2 + c, with z0 = 0.  If this sequence remains bounded then c is a member of the Mandelbrot set.  By coloring the Mandelbrot set black against a white background one can see a border of infinite complexity.  Zooming in on any portion of the border only shows more complexity.  The difference between a number falling inside or outside the Mandelbrot set is infinitely small.

Fractals also show another sign of chaos.  When zooming in on the border, the same patterns appear at every level.  The same distinctive Mandelbrot shape is visible no matter how far one zooms in.  The same is true of other areas where chaos governs systems.  Graphs of heart rate variations and Internet traffic flow show the same overall pattern when one zooms in, a result of chaos.

The double pendulum is another simple example of chaos in action.  A pendulum is described exactly by Newton's F=ma.  Given the position and velocity of a pendulum one can predict exactly how it will behave in time.  Adding a second pendulum to the end of the first, however, brings chaos into the problem and makes it intractable.  When started from a high position, the double pendulum behaves erratically, with the second pendulum swinging around the first seemingly at random.  However, the double pendulum is governed by the same F=ma as the single variety.  It is simply a result of chaos that tiny imperceptible differences in the starting conditions lead to wildly different behaviors.

Another example of the practical benefits of chaos are cryptographic hashes which are used in storing passwords, and just about every other use of cryptography in computers.  Cryptographic hashes take a piece of data as an input and then output a small, random, but deterministic, key.  In effect, they give a fingerprint to data.  To be useful, they must have something called the avalanche effect, which says that any tiny change to the input should result in a large change to the output.  Changing a single bit in the input data will result in a totally different hash.  This allows hashes to serve as proof that data hasn't been tampered with.

Chaos theory had a long journey from a mythical concept, to something that was deemed to only represent the unknown aspects of nature, to an accepted innate quality of the universe.  The man considered to be the discoverer of chaos in its modern form, Poincaré, found the idea so shocking that he largely ignored it.  It was decades before his discovery would begin to turn up useful results.  However, it is now indisputable that chaos is a fact of nature.  Further, it is indisputable that chaos theory has been invaluable, having applications from weather prediction to computer security.  It deserves its title of the third revolution of the 20th century.

Saturday, May 4, 2013

President Obama Can Shut Guantanamo Whenever He Wants

http://www.slate.com/articles/news_and_politics/view_from_chicago/2013/05/president_obama_can_shut_guantanamo_whenever_he_wants_to.html
If Obama declared hostilities at an end, the Guantanamo detainees would be no different from people who were washed up on U.S. territory by accident, like shipwrecked sailors. Those who pose no danger to the United States (about 86 of the 166), and cannot be returned to their countries, could receive refugee status under existing laws. Those who are known to be dangerous could be arrested under criminal law. If I am correct that section 1027 is unconstitutional, both groups could be brought to the United States. The detainees we cannot convict would be released. That may be politically unpalatable but it is legally unimpeachable.

Thursday, May 2, 2013

12 Million Americans Believe Lizard People Run Our Country

http://www.theatlanticwire.com/national/2013/04/12-million-americans-believe-lizard-people-run-our-country/63799/
Do you believe that shape-shifting reptilian people control our world by taking on human form and gaining political power to manipulate our societies, or not?
Are there seriously people that don't know this?