Saturday, March 06, 2010

Fallout 3 -- Crash Fixed

I've been swearing at Bethesda Softworks for some time since my Fallout 3 stopped working for no apparent reason, when I upgraded from Vista x64 to Windows 7 x64.

It failed once before and it turned out to be an nVidia video driver update, and a new update fixed it. However it's been over 6 months now and multiple nVidia updates have failed to fix it.

I spent some time this weekend debugging it, and discovered it's some kind of issue with Fallout 3 and DisplayLink drivers. I had tried unplugging my Mimo 7" USB auxillary monitor before, and Fallout 3 had still crashed. It turns out, that it was still crashing inside Fallout 3 when it returned from the DisplayLink drivers. I assume there's some monitor iteration or some other call going on, and it's not happy when something comes back with bounds smaller than the main screen.

Anyhow, if you have issues with Fallout 3 and you have "other" video/monitor drivers, try uninstalling them.

Iterative Collatz in Python (with resume)

I'm assumming there will be a lot of people looking to play with Collatz soon.

Here's a non-recursing version that will resume when you restart it.
Given all numbers to 2^58 have already been checked you might be there a while...

It's trivial to get it to dump a CSV with the steps for graphing, but, this one doesn't do that (but gives you the steps so that you can).

If you don't know what this is for, it doesn't matter.. (but you can google it...)

import os
def collatz(n):
 steps = []
 stAppend = steps.append
 while n > 1:
  stAppend(n)
  
  while not (n & 0x1):
   n >>= 1
   stAppend(n)

  if n == 1:
   break
  n = n * 3 + 1
 return steps

if __name__ == '__main__':
 n = 2
 if os.access('collatz.prg', os.F_OK|os.R_OK|os.W_OK):
  n = int(open('collatz.prg', 'rb').read())

 while True:
  steps = collatz(n)
  open('collatz.prg', 'wb').write(str(n))
  print n, len(steps)
  n += 1