depth first search

“We can only see a short distance ahead, but we can see plenty there that needs to be done."

Normal

I wrote a Python class for manipulating normal distributions. I use it as part of some code for GMMs (https://github.com/stober/gmm). I was looking for code that supported conditioning and marginalization on arbitrary indices. There didn’t seem to be any out there so I wrote this to fill in the gap (at least for Python).

This Week in Microblogging

  • I like the Google Reader redesign. #contrarian #
  • Trying hard to boost my VORDM (value over replacement data miner). #
  • UT's investment in MyEDU is a real sign of weakness for the company. Can't find real investors so they need back room deals from friends. #
  • Me: Ok, I'll admit that I like Eurodance music.
    Siri: …
    Me: Don't judge me! #
  • In the "rerunning experiments in a panic" stage of preparing this presentation. #
  • So Google Reader has both share and +1 buttons? What's the difference? #
  • I don't eat before presentations, preferring instead a diet of coffee and fear. #
  • Currently reading through my old tweets like I'm a lonely person. #sosad #
  • At #funfunfunfest http://t.co/imGD4u7Z #

This Week in Microblogging

  • A bad day is having to use sed to correct the format of a Python pickle file. #
  • I need some new music. What should I be listening to? #
  • @jrhorn424 Reddit: ಠ_ಠ, mostly. in reply to jrhorn424 #
  • @HoratiuGratianS Listening now. I like it. in reply to HoratiuGratianS #
  • Listening to Grace Jones dub. Lots of good güiro beats. #
  • Really hoping NPR doesn't run another enraging story during today's commute home. #
  • I'm not saying I'm going to, but if I were to make a list of my favorite things Flight Level 390 would be on it. http://t.co/yayKCrGQ #
  • Is there an in depth piece on why tuition costs are rising so rapidly? Anyone out there on a budget committee commenting publicly? #
  • Also, I tweeted many moons ago about whether there's a good long form piece about the Big 12 turmoil. This month's Texas Monthly has it. #
  • A&M left for a variety of reasons, but the Longhorn Network seemed to be the final straw. #
  • If I'm honest, the only productivity "trick" that works for me is a combination of structured procrastination and fear. #
  • Idea: Maybe colleges and universities should play moneyball. Focus on high value instead of expensive faculty/staff/administration. #

In a Pickle

I like IPython, but I’m not sure I understand it, and my lack of understanding has caused me some pain recently when a pickle file (Python object serialization for the uninitiated) would not open. I’m not even sure I’ve figured out how to reproduce the problem, but I did find a very simple example of some code that runs fine in Python but not IPython:

Running this with

python ipickle.py

gives:

stober[~/Dropbox/workspace/gist]{laptop}$ python ipickle.py
<__main__.A instance at 0x10cc37bd8>

Running the same thing with IPython

ipython ipickle.py

produces decidedly different output:

 
stober[~/Dropbox/workspace/gist]{laptop}$ ipython ipickle.py 
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/Users/stober/Dropbox/workspace/gist/ipickle.py in <module>()
     16     pickle.dump(A(), open("A.pck","w"))
     17 
---> 18     a = pickle.load(open("A.pck"))
     19     print a
 
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.pyc in load(file)
   1376 
   1377 def load(file):
-> 1378     return Unpickler(file).load()
   1379 
   1380 def loads(str):
 
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.pyc in load(self)
    856             while 1:
    857                 key = read(1)
--> 858                 dispatch[key](self)
    859         except _Stop, stopinst:
    860             return stopinst.value
 
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.pyc in load_inst(self)
   1067         module = self.readline()[:-1]
   1068         name = self.readline()[:-1]
-> 1069         klass = self.find_class(module, name)
   1070         self._instantiate(klass, self.marker())
   1071     dispatch[INST] = load_inst
 
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.pyc in find_class(self, module, name)
   1124         __import__(module)
   1125         mod = sys.modules[module]
-> 1126         klass = getattr(mod, name)
   1127         return klass
   1128 
 
AttributeError: 'FakeModule' object has no attribute 'A'

This Week in Microblogging

  • rdio:spotify::mercurial:git #
  • Number of commits is the new source lines of code. #NOCnotSLOC #

This Week in Microblogging

  • TIL that Amazon is a really crappy place to work. http://t.co/MS38UVsj #
  • My knowledge of Python namespaces magically falls apart whenever I try to put anything into "packages". #
  • Finally upgraded to an iPhone so now I can Foursquare like it's 2010. #

Quote of the Day

What’s going on here? The answer, surely, is that Wall Street’s Masters of the Universe realize, deep down, how morally indefensible their position is. They’re not John Galt; they’re not even Steve Jobs. They’re people who got rich by peddling complex financial schemes that, far from delivering clear benefits to the American people, helped push us into a crisis whose aftereffects continue to blight the lives of tens of millions of their fellow citizens.

Yet they have paid no price. Their institutions were bailed out by taxpayers, with few strings attached. They continue to benefit from explicit and implicit federal guarantees — basically, they’re still in a game of heads they win, tails taxpayers lose. And they benefit from tax loopholes that in many cases have people with multimillion-dollar incomes paying lower rates than middle-class families.

This Week in Microblogging

  • Given the extent of the student loan debt on http://t.co/HT3nEgxj I'm wondering if Wall Street is the wrong target. #

Quote of the Day

No one wants to die. Even people who want to go to heaven don’t want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life’s change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.

Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma — which is living with the results of other people’s thinking. Don’t let the noise of others’ opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

Quote of the Day

College debt shows up a lot in these stories, actually. It’s more insistently present than housing debt, or even unemployment. That might speak to the fact that the protests tilt towards the young. But it also speaks, I think, to the fact that college debt represents a special sort of betrayal. We told you that the way to get ahead in America was to get educated. You did it. And now you find yourself in the same place, but buried under debt. You were lied to.

If I were a career academic in a senior position the dynamic present here would give me pause and instigate some serious soul searching.