Newton Fractal Visualization with Python

I felt like trying something new, so I wrote a Python script to plot Newton’s fractal.

Newton's Fractal (30 iterations, 1500 x 1500 resolution, 1e-6 convergence)

This graphic shows the time to convergence for solving z^4+1 = 0 using Newton’s Method.  The solution to this equation is one of four possibilities, which are represented using the colors red, blue, green, and yellow.  The solution that Newton’s Method returns depends on the initial guess.  I plotted the final solution for initial guesses in the range 0-1 (real, horizontal axis) and 0j-0j (imaginary, vertical axis).  Color depth represents faster convergence to a particular soltion (i.e., brighter pixels represent initial guesses that converge to a solution faster).

The script is based heavily on Listing 7-1 from “Beginning Python Visualization” by Shai Vaingast. It’s a good book with other fun examples, but my code for this problem is here.

1 Comment

Posted by on August 13, 2009 in Alchemy


Tags: , , ,

i can haz fox news?

I understand that journalists need to write catchy headlines in order to trick the public into reading their stories.  Take today’s leading headline, for instance:  “Obama’s first 100: Now comes the hard part” seems to promise some kind of poignant analysis of what’s to come, when really it’s just a rehash of all the Obama news we’ve seen this year coupled with commentary on why Obama’s acknowledging his 100th day at all.

Furthermore, I understand that news outlets often use headlines to misrepresent the content of an article just to get you to click. For example,  “What I learned about my husband in bed” is not the soft-core CNN porn you’re hoping for.

I’m pretty flexible with my news and I enjoy reading a variety of news sites each day.  But given that flexibility, I do not understand why Fox News has resorted to using lol-speak in it’s titles.


(The image in it’s original context is below)


Photographs via Fox News on the Interwebz.

Update: The Fox photo is permalinked here (for now).  Also, the story in question, which doesn’t have the photo, is here.


Posted by on April 29, 2009 in Current Events, Entertainment


Stop Making Blame Partisan

I’m really bored of hearing Fox News and Karl Rove try to mitigate blame away from Republicans after Obama’s State of the Nation Address.

From the Fox News “Fact Check”:

OBAMA: “Regulations were gutted for the sake of a quick profit at the expense of a healthy market. People bought homes they knew they couldn’t afford from banks and lenders who pushed those bad loans anyway. And all the while, critical debates and difficult decisions were put off for some other time on some other day.”

THE FACTS: This may be so, but it isn’t only Republicans who pushed for deregulation of the financial industries. The Clinton administration championed an easing of banking regulations, including legislation that ended the barrier between regular banks and Wall Street banks. That led to a deregulation that kept regular banks under tight federal regulation but extended lax regulation of Wall Street banks. Clinton Treasury Secretary Robert Rubin, later an economic adviser to candidate Obama, was in the forefront in pushing for this deregulation.

Emphasis mine.

Obama didn’t mention the Republicans in that particular excerpt, and the author’s defensiveness seems misplaced. But Obama does frequently make implications about who is to blame for the mess he “inherited”, and about whose beliefs we are “rejecteing”.

In his piece, Karl Rove  picks up on Obama’s implied accusations, repeatedly questioning who exactly the President is blaming.

On Tuesday night, Mr. Obama told Congress and the nation, “I reject the view that . . . says government has no role in laying the foundation for our common prosperity.” Who exactly has that view? Certainly not congressional Republicans, who believe that through reasonable tax cuts, fiscal restraint, and prudent monetary policies government contributes to prosperity.

Rove is nit-picking the term “no role” here, and I understand that it’s a bit of an overstatement, but Republicans created this image for themselves.  Republicans push back on many federal fixes proposed by Democrats, and now they’re complaining about being type-cast. Yes, I believe that (in general) the GOP wants government to be all but absent from fixing society’s woes (“When my house is burning down, I want the market to decide whether the fire department should come save me”), but I have this belief because I listen to Republicans. Barack Obama does not need to plant these ideas in my head because I listen to people like Mr. Rove pushing them all the time.

But beyond that, over his entire speech, each time he did mention “Republicans” it was tightly coupled with the word  “Democrats”.  Obama is giving Republicans the opportunity to take part in what’s going to happen in his first term.  I think over the next four years we’ll see that the smart ones will take him up on it.

Rove story via The Heretik on Shakesville.


Posted by on March 1, 2009 in Current Events


Tags: , , , , , , , , , , ,

Weather Warning

Local Weather Server Crashing

Caught on my phone on the local weather station over the weekend.  I think it has to do with lake effect snow.


Posted by on February 23, 2009 in Photos


Tags: , , ,

Getting Involved in Politics

A quantum of creativity and fun in an extremely busy time of life can keep me going through stress.  So, I’d like to introduce a personal project that I’ve been using as a way to keep balanced between ‘work’ and ‘other’.  It’s a website that catalogs Barack Obama’s Presidential neck ties and other neck wear.  Enjoy.

1 Comment

Posted by on February 13, 2009 in Current Events, Entertainment


Tags: , , , ,

Your Beautiful Parts

Today Shakesville asks what part of your body is most beautiful/handsome?  It’s a bit awkward to think about, and that’s why I’m forcing myself to answer here.

I think I have to follow suit with Melissa and choose my eyes.  I like their blue (though sometimes I prefer to call them grey), and I have really long eye lashes, which I make wishes on whenever they fall onto my cheeks.

Anyone else care to choose a favorite part/feature of themselves?

Leave a comment

Posted by on January 29, 2009 in Garbage In, Garbage Out


Tags: , , , ,

Pearl Harborer

Last year at Zandperl’s Halloween party we were playing “The Coachride to the Devil’s Castle” (aka Die Kutschfahrt zur Teufelsburg), and we spontaneously came up with the following definition of “Pearl Harborer”:

Pearl Harborer

In the Card Game “Die Kutschfahrt zur Teufelsburg” (“The Coachride to the Devil’s Castle”), a Pearl Harborer is someone who is surreptitiously hiding the “Schwarze Perle” (a.k.a. “Black Pearl”) card.

Brian’s going to declare victory this turn, unless he’s a pearl harborer…

I submitted this definition to Urban Dictionary.

It was rejected.  Superficially, that’s not a big surprise, nor do I care.


What surprised me, initially, was that it took so long for them to get back to me.  I submitted the entry on October 27, 2008, and received my “entry not published” email three days ago.

Peer review is known to take ages, but still I could not imagine why the rejection would be so slow (compared to Wikipedia rejections, which can happen within minutes).  But the real surprise here is that Urban Dictionary has standards at all. The rejection letter came with a link to Urban Dictionary’s publishing guidelines (you may need to sign up to see the link):

As an editor, you decide what gets published. Use these guidelines while you make your decisions.

1. Publish celebrity names but reject friends’ names.
2. Publish racial and sexual slurs but reject racist and sexist entries. 
3. Publish opinions.
4. Publish place names.
5. Publish non-slang words. Ignore misspellings and swearing.
6. Publish jokes.
7. Reject sexual violence.
8. Reject nonsense. Be consistent on duplicates.
9. Reject ads for web sites.
10. Publish if it looks plausible.

So anybody can sign up to be an editor, and some consensus of arbitary/random editors decides which entries get accepted and which get rejected.  According to these guidelines, my entry should have been published.  However, whichever editors saw it disagreed, probably because they didn’t “get” the definition, so now it’s lost to the world forever.

The sad part is that this isn’t so far off from academic peer review.  Sometimes you discover or create knowledge that you know is right, and you try to put it out there but the people reading it don’t think it should be seen, and they reject it, often with little or no explanation why.  If it’s this hard to publish in the haphazard, anything goes environment of Urban Dictionary, imagine how hard it must be to publish in a journal, where entries theoretically have consequences.


Posted by on January 27, 2009 in Alchemy, Entertainment


Tags: , , , , , ,

If Knowldge Were Power

gutlogoLast weekend was the 2009 MIT Mystery Hunt, and it was a grand old time as usual.  I don’t have anything extremely insightful to write about it for a general audience, so I’m going to go list format for highlights:

  • We wrote a national anthem (bootleg version).
  • We built a spaceship/robot.
  • I was reminded again how bad I am at solving puzzles*.
  • I *saw* a lot of cool puzzles that I didn’t get to participate in because I was too busy on something else.
  • I had a lot of trouble sleeping Friday night…  I think it’s because I gave up coffee in mid-December and one D+D medium was enough to keep me going until 4AM.
  • There was a puzzle that required having an XBOX live membership looking up XBOX Live achievement data.
  • The hunt was HUGE — well over 100 puzzles…  Can anyone confirm how many there were?
  • Our team (Grand Unified Theory of Love) is composed of a lot of cool people that I wish I saw much more often.
  • I have a tendency to have very little forgiveness for people not doing what they’re asked with respect to team organization.
  • Tony’s coverage.
  • Zandperl’s coverage.
  • Jeremy’s Intro and Wrap-Up.

* Does anyone have any suggestions for how to fix this?

I was very happy overall, and glad to bring Paul and Sniperbunny along with me.

Turning to the week, I realize that for a long time I’ve been saying “I’ll get to that as soon as the hunt’s over” for a lot of important to-dos on my list…  More importantly I haven’t really started cracking at my recent resolution, which is an indicator that I haven’t personally accepted the gravity of my research deficit.

Update: Weirleader reminds me that I wrote a couple posts about the Mystery Hunt last year.  Apparently my lackluster puzzle solving ability hasn’t changed much in the past year.


Posted by on January 20, 2009 in Entertainment


1280 x 960

In 2008, I resolved to run 1000 miles.  This was a good resolution because it was quantitative, yet long-term, and challenging, yet achievable.  This year I want to resolve to do something that also meets these criteria, but I don’t want to just repeat my 2008 resolution.

I liked the running resolution in particular because I got something tangible out of it.  I’m in the best running shape of my adult life.  I feel good when I run.  I’ve improved my health and fitness.  Now I want to do something similar for my brain.

Recently, I realized that I’ve been learning more at the local trivia night than I have been working on my Ph.D. research topic.  This troubles me.  School is for learning, right?  So what am I doing wrong?  Part of the problem is that graduate research can have little tangible gratification along the way.  There are no grades.  We never feel the sweet release of final exams.  There isn’t always a clear measure of progress.

With that in mind, I wanted to make 2009 a year for learning new skills.  I made a list of goals for things to learn/practice over the course of the year.  It had everything from picking up a new instrument to doing 100 consecutive push-ups. This was a fun list to make, so I’m going to save it in a draft on my blog even though I eventually decided not to make it a part of my 2009 resolution.

Instead, I decided to take the practical route:

In 2009, I will finish my Ph.D. project, write my dissertation, and defend my thesis.

From my current vantage, this seems about as likely as a herd of cats carrying me to school tomorrow on their backs.  From your perspective, on the other hand, it may seem like a cop out to resolve to do something that I am pretty-much on track to do anyways.

But I assure you, this is not going to be easy.  I’ve been working on…  stuff…  for five years now, and I feel I have very little to show for it. Making this thesis happen is going to require discipline, planning, and maybe if I’m lucky, some learning. My running resolution was a success largely because of the logging and reporting I did throughout the course of the year. Completing my thesis will require a similar attention to progress.  I could record pages over time, or just blog more frequently about research, but I’m open to hearing any suggestions for reaching this goal.

What are your resolutions for 2009?


Posted by on January 7, 2009 in Alchemy


Tags: , , , , , , , , ,

I Would Run 1000 Miles

Early in 2008, I made a New Year’s Resolution to run 1000 miles over the course of the year.  I liked this resolution from the start – it was quantitative, attainable, challenging, and spanned the entire year.  There were ups and downs, but with a few days to spare in December I hit 1000 miles (total mileage: 1013 miles).  I’m left with a really happy trend in my mileage over the last 8 years:


I’m ecstatic I’ve been able to incorporate running into my life more substatially every year since I started grad school.  I’m not expecting another 30% increase in mileage for 2009, but I do think I can make good things happen by continuing consistent running.

An unexpected feature of the seasonal mileage pattern for the year was that I actually ran more in the winter-spring season than in the summer or fall:


In this chart, “WS” is the Winter-Spring season (January-April), “S” is the Summer season (May-August), and “F” is the Fall season (September-December).   Compare the winter of 2008 to any other winter and the difference is striking.  My mileage drop off in the warmer months is due to a number of factors — injury, illness, meeting my current girlfriend, but I’m really glad I put those hard miles in early.  Those up front miles made the 1000 mile goal possible.

I’ll close now with a collection of all my running posts from the year, but I promise another post with my 2009 resolution soon.

Running posts from 2008:


Posted by on January 6, 2009 in Alchemy, No Easy Days


Tags: , , ,

I Don’t Think They Saw Jurassic Park

I think I know what I want for Christmas

Subtitle reads “A Fusion of Technology and Personality”.

I finally know what I want for Christmas.

1 Comment

Posted by on December 22, 2008 in Photos


Tags: , , , ,

Scifi Book Meme

A scifi meme, via geekylibrarian.

According to the Science Fiction Book Club, these are the 50 most significant SF & Fantasy Books of the last 50 Years, 1953-2002. Bold the ones you’ve read, strike the ones you hated, italicize the ones you couldn’t get through, asterisks for the ones you loved (more asterisks, more love), exclamation points for the ones you own.

  1. The Lord of the Rings, J.R.R. Tolkien!
  2. The Foundation Trilogy, Isaac Asimov
  3. Dune, Frank Herbert
  4. Stranger in a Strange Land, Robert A. Heinlein
  5. A Wizard of Earthsea, Ursula K. Le Guin
  6. Neuromancer, William Gibson
  7. Childhood’s End, Arthur C. Clarke
  8. Do Androids Dream of Electric Sheep?, Philip K. Dick
  9. The Mists of Avalon, Marion Zimmer Bradley
  10. Fahrenheit 451, Ray Bradbury
  11. The Book of the New Sun, Gene Wolfe
  12. A Canticle for Leibowitz, Walter M. Miller, Jr.
  13. The Caves of Steel, Isaac Asimov
  14. Children of the Atom, Wilmar Shiras
  15. Cities in Flight, James Blish
  16. The Colour of Magic, Terry Pratchett
  17. Dangerous Visions, edited by Harlan Ellison
  18. Deathbird Stories, Harlan Ellison
  19. The Demolished Man, Alfred Bester
  20. Dhalgren, Samuel R. Delany
  21. Dragonflight, Anne McCaffrey
  22. Ender’s Game, Orson Scott Card**
  23. The First Chronicles of Thomas Covenant the Unbeliever, Stephen R. Donaldson
  24. The Forever War, Joe Haldeman
  25. Gateway, Frederik Pohl
  26. Harry Potter and the Philosopher’s Stone, J.K. Rowling
  27. The Hitchhiker’s Guide to the Galaxy, Douglas Adams
  28. I Am Legend, Richard Matheson
  29. Interview with the Vampire, Anne Rice
  30. The Left Hand of Darkness, Ursula K. Le Guin
  31. Little, Big, John Crowley
  32. Lord of Light, Roger Zelazny
  33. The Man in the High Castle, Philip K. Dick
  34. Mission of Gravity, Hal Clement
  35. More Than Human, Theodore Sturgeon
  36. The Rediscovery of Man, Cordwainer Smith
  37. On the Beach, Nevil Shute
  38. Rendezvous with Rama, Arthur C. Clarke
  39. Ringworld, Larry Niven
  40. Rogue Moon, Algis Budrys
  41. The Silmarillion, J.R.R. Tolkien
  42. Slaughterhouse-5, Kurt Vonnegut
  43. Snow Crash, Neal Stephenson!***
  44. Stand on Zanzibar, John Brunner
  45. The Stars My Destination, Alfred Bester
  46. Starship Troopers, Robert A. Heinlein
  47. Stormbringer, Michael Moorcock/li>
  48. The Sword of Shannara, Terry Brooks****
  49. Timescape, Gregory Benford
  50. To Your Scattered Bodies Go, Philip Jose Farmer

Yeah…  I wish I had read a lot more of these.  I tried the lord of the rings but didn’t make it too far.  I may try #49 on recommendation from my advisor.


Posted by on December 18, 2008 in Entertainment


Tags: , , , , ,

It’s Trampling Time

Less than three weeks after reporting three preventable deaths on Black Friday, the media is back to feeding the holiday shopping frenzy.



Um.  Yeah.  There are 10 days left until Christmas.  And if you don’t shop, like a lot, before then…  you don’t want to know what happens when the clock reaches zero.  You really want to know?  Well, it involves toothless elves who don’t like the sound of tortured squirrels writhing in pain half as much as they like giving you a root canal before they chew your arms off.  That’s right, they eat your arms, bones and all, with no teeth.

There are two types of headlines that are popular this year:

“OMG There Are Sales!  Hurry Or You Might Not Get 25% Off This Merch That’s Been Marked Up 50%!”


“OMG There’s A Recession!  Maybe You Shouldn’t Be Shopping So Much?”

We just can’t win.

1 Comment

Posted by on December 16, 2008 in Current Events


Tags: , , , , , ,

Confidence Week 3 – Emergence Day

Two years ago I started this blog with a post about Confidence Week, which falls during the week of Thanksgiving and reminds us to be confident in who we are and how we feel.  I haven’t had a chance to wear anything super ostentatious this week, but it has been an interesting week in terms of apologies.

Being confident doesn’t necessarily correlate to apologizing less.  Rather it’s about expressing regret and empathy for violating someone else’s comfort zone while simultaneously maintaining your own.  This is tricky to due genuinely, but in the end I think it makes the apology more sincere.

So this week, I’m trying to focus on addressing my own needs and the needs of others (where appropriate) simultaneously.

Thanks again to Jason for the original holiday suggestion.
Leave a comment

Posted by on November 26, 2008 in Garbage In, Garbage Out


Tags: , , ,

A Nebraska Divided

There are two states that can divide their electoral votes in a presidential election:  Maine and Nebraska.  This year, Nebraska actually exercised this ability due to heavy Obama support in Omaha.  Thus far, however, I have not found a mainstream news source that reported this (CNN, for example, lists the state as being in the McCain column).

Thankfully, O’Foghlú just put me on to the awesome NPR electoral results map, which does report 1 out of the 5 Nebraskan electoral votes as going to Obama.

This is special.  Nebraska is strongly Republican, like always.  Not only did Obama swing all the swing states, he tipped the balance in a staunch republican stronghold.  I wonder how the election results would be different if all states could split their votes?

(for an explanation of the splitting system, see NPR)

Update: On closer inspection, I see that CNN’s election results do list the electoral vote breakdown for Nebraska.  I must have missed it earlier.  In any case, I like NPRs coverage better.  Note that you can also get the break down for the 2000/2004 elections by changing the URL.

1 Comment

Posted by on November 19, 2008 in Current Events


Tags: , , , , ,