2008-03-12

Humor - If Version Control Systems Were Airlines

Posted in Geek Stuff, Web Wandering & Opinion at 21:44

If Version Control Systems Were Airlines

Just a bit of geek humor that I ran across and felt like sharing. :)

2008-03-08

Interesting History - Charles Fraser-Smith

Posted in Geek Stuff, Web Wandering & Opinion at 17:05

Charles Fraser-Smith - The man who was ‘Q’

I can’t remember how I originally found this page, but I finally remembered to blog about it. For those who don’t know, Charles Fraser-Smith is the real life man upon whom Ian Fleming based “Q” in his James Bond novels. Considering how clever some of his World War 2 spy supplies were, I think any James Bond fan will like this bit of history.

2008-03-03

Quick Tip - GTK RadioToolButton With All Buttons Unset

Posted in Geek Stuff at 12:52

In case you were unaware, GTK+ doesn’t let you set_active(False) on every single button in a RadioToolButton group. One must be pressed at all times.

So, if you want to have a user interface where it’s possible to have none of them pressed (for example, using RadioToolButtons for “Zoom 100%” and “Zoom to Fit” and regular buttons for “Zoom In” and “Zoom Out”), you need to use a little trickery.

self.zoom_100 = self.wTree.get_widget("zoom_100")
self.zoom_fit = self.wTree.get_widget("zoom_fit")
self.zoom_manual = gtk.RadioToolButton(self.zoom_100)

zoom_100 and zoom_fit are the RadioToolButtons as defined in my Glade XML file. The trick is zoom_manual. It is now part of the button group, but I’m not adding it to the user interface.

PyGTK Tab-Completion

Posted in Geek Stuff at 5:37

PyGTK - EntryCompletion hacked up to give nicer tab-completion

While working on a batch organizing tool, I found out the hard way that GTK’s EntryCompletion is not meant for people who want speed. (It’s a memory aid, not a speed aid) I also couldn’t just switch to PyQt or wxPython because they all do basically the same thing.

As such, I hacked the GTK auto-complete up a bit so that it behaves more like shell auto-complete. (It doesn’t do anything until you hit Tab. When you do, if there’s one match, it’s completed. If there are multiple matches, it pops open the normal auto-complete list so you can pick one.

2008-02-27

Setting memory limits on Linux

Posted in Geek Stuff at 0:33

You might not be aware of this, but since some time during the glibc 2.3 era, Linux apparently doesn’t enforce the RSS memory limit. (ulimit -m) My tests seem to confirm this.

As such, the only way I could find to limit a program’s memory allocations was by the VIRT size (ulimit -v)… which can differ a lot from the RSS. (Upon which the “percentage of memory used” value in system monitors is based on, if you weren’t sure)

Bad Behavior has blocked 265 access attempts in the last 7 days.