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)

2008-02-23

Music - MC Chris - Nrrrd Grrrl

Posted in Geek Stuff, Music, Web Wandering & Opinion at 1:09

Ever seen the Fett’s Vette vid? What about this part of AMV Hell 4?

Well, in case you haven’t, both “The Tussin” and “Fett’s Vette” are by MC Chris and he’s currently running a fan music video contest for his new song, “Nrrrd Grrrl”. (YouTube Results)

You may not know how to make a music video and, while I have the general idea, I don’t have time. Either way, I suggest you drop by his MySpace page and hit the download link in the music player. The song’s pretty catchy and I doubt it’ll be in the player forever.

2008-02-21

The Streisand Effect

Posted in Web Wandering & Opinion at 6:53

Ever heard of the Streisand Effect? It refers to how, as John Gilmore said, “The Net interprets censorship as damage and routes around it.”

Want some examples?

Just a little something I ran across which I thought to be noteworthy.

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