Technical notes, my online memory
Friday, June 28, 2013
Python assertRaises exception inside generator
›
So I have a generator and I want to make sure it throws an exception after a certain number of calls. So expected behaviour is this: def ...
Thursday, June 27, 2013
Continuously loop (cycle) through a list in python
›
Thank you itertools: In [7]: a=[1,2,3] In [8]: licycle = itertools.cycle(a) In [9]: licycle.next() Out[9]: 1 In [10]: licycle.next() Out...
Wednesday, June 12, 2013
Disable Java web applet in Internet Explorer
›
Microsoft has joined the good fight to make disabling the vulnerability-ridden Java web plugin easier. They have released a fixit that blo...
Sunday, June 2, 2013
SQL join syntax
›
Jeff Atwood posted a useful memory aid for SQL join syntax , although as many commenters point out there are a number of caveats to using se...
Wednesday, May 29, 2013
Puppet: service checking on OS X without using the inbuilt service stanza
›
Normal service enforcement is easy with puppet, it looks like this for an OS X launchdaemon: class something::myservice { File { owner ...
Friday, May 17, 2013
pdb and gdb conditional breakpoints
›
Use a debugger enough and you'll eventually be in a loop looking for a certain condition. And it's too tedious to walk through all ...
Tuesday, May 14, 2013
python set a variable conditional on another variable
›
Tiny python snippet. If you're doing this: if value: output = value else: output = 'somethingelse' Do this instead: outp...
‹
›
Home
View web version