Weird X-related backtrace

I just ported this app to gtk-2, and now I get a segfault when I close it while a file’s open. Check out this weird backtrace. Any ideas on how to resolve this are welcome.

(gdb) bt
#0 0x089921bb in ?? ()
#1 0xb6c0ebcd in XQueryExtension (dpy=0x8990df0, name=0xb72adb5d "GLX",
major_opcode=0x898d6d0, first_event=0x898d6d0, first_error=0x898d6d0)
at QuExt.c:46
#2 0xb6c01f2b in XInitExtension (dpy=0x8990df0, name=0xb72adb5d "GLX")
at InitExt.c:49
#3 0xb71c46d1 in XextAddDisplay (extinfo=0x82e7508, dpy=0x8990df0,
ext_name=0x898d6d0 " !\231\bI", hooks=0xb72b23a0, nevents=17,
data=0x898d6d0 " !\231\bI") at extutil.c:108
#4 0xb727bdb8 in __glXFindDisplay (dpy=0x8990df0) at glxext.c:329
#5 0xb727c535 in __glXInitialize (dpy=0x8990df0) at glxext.c:1104
#6 0xb727d73d in __glXSetupForCommand (dpy=0x8990df0) at glxext.c:1246
#7 0xb72787c6 in DestroyContext (dpy=0x8990df0, gc=0x82f4890) at glxcmds.c:458
#8 0xb7343dcc in gdk_gl_context_unref (context=0x82f4480) at gdkgl.c:192
#9 0xb734478c in gtk_gl_area_destroy (object=0x8762598) at gtkglarea.c:174
#10 0xb6aece1f in g_cclosure_marshal_VOID__VOID (closure=0x82a8700,
return_value=0x0, n_param_values=1, param_values=0x8990df0,
invocation_hint=0xbfa00ca8, marshal_data=0xb7344730) at gmarshal.c:77

[Gentoo] My day job

Since I just finished up an ebuild for the next-generation application of what I do all day, I thought you might like to see what it looks like. What you’re seeing is a zoomed-in picture of part of a protein. The electron density is in blue, and green and red indicate where there’s too little or too much actual atom present for the density. The big cross things are waters.

The atom bonds in the pic look a little jagged because I haven’t gotten its antialiasing working yet (works fine on OS X, FWIW).

Keep in mind this is pretty much state of the art in my field — it’s using gtk-1 and glut rather than tcltk, or home-rolled widgets.

(Click for bigger version)
coot -- an X-ray crystallography modeler

The program is called coot. Unfortunately, it won’t enter the tree until I fix rpath issues with ccp4, a huge bundle of apps that this depends on.

[Gentoo] Do we have a vision?

Lance today brought up the lack of a global vision for Gentoo. He suggests that the council come up with one; another promoted idea would re-create a “visionary” position similar to what Daniel Robbins used to do. Both ideas sound alright, but the question is: Does Gentoo need a created, artificial vision? Or is it more of a living organism that just flows in directions based on what its parts do?

I’m of the latter opinion, as you may guess. Accordingly, I think Gentoo doesn’t need to create a vision but already has one. We just don’t realize what it is, because we haven’t put the pieces of the puzzle together. We need to construct a collection of microscopic goals and ideas, then let them coalesce through discussion into a global Gentoo vision.

Over the past couple of days, I’ve been reading a speech by Richard Hamming of Bell Labs called “You and Your Research.” Hamming tells his audience how to do truly great work; Nobel-quality work. The answer sounds simple: Only work on important problems, and don’t let the small stuff distract you.

Hamming said this about how the size of your vision relates to how high you need to advance in the project:

I went to my boss, Bode, one day and said, “Why did you ever become department head? Why didn’t you just be a good scientist?” He said, “Hamming, I had a vision of what mathematics should be in Bell Laboratories. And I saw if that vision was going to be realized, I had to make it happen; I had to be department head.”

When your vision of what you want to do is what you can do single-handedly, then you should pursue it. The day your vision, what you think needs to be done, is bigger than what you can do single-handedly, then you have to move toward management. And the bigger the vision is, the farther in management you have to go. If you have a vision of what the whole laboratory should be, or the whole Bell System, you have to get there to make it happen.

The same idea applies to Gentoo. Perhaps people with a global vision should get together and talk about their ideas for a Gentoo direction. Who’s got one?

[Gentoo] Ripping MP3’s with Sound-Juicer

Came across a couple of posts on Google about how to do this, so I can actually get songs onto my iPod. It seems like it’s purposely made impossible to figure out by yourself.

1. Make sure you’ve got gst-plugins-lame installed.
2. Read this and set up a new sound profile. Make sure you check the “Active” box.

Alternately, some random J5 guy recently posted about MP3 for free from Fluendo.

[Gentoo] Packaging science apps

I was just looking at my recent commits via CIA and noticed that I’ve packaged 15 new apps since Thursday, in addition to doing fonts for Xorg 7RC4. If you haven’t read this before, you may have missed my constant rants about how much science apps suck to package. The number greatly belittles the work that went into it.

A quick summary of the new apps:

Caver: Finds paths from protein cores to the surface to figure out how stuff gets in there
Maxit, Validation, PDB-Extract: Fixing PDBs (Protein Data Bank), converting to and from mmCIF
Sparky: NMR (Nuclear Magnetic Resonance) assignment and integration
Eden: Crystallographic electron-density refinement tool
Ortep3: Plots anisotropic B-factors (In human words, atoms vibrate differently in different directions)
Platon: A multipurpose crystallographic tool — calculates data from SHELX output, also graphics, etc
MAID: Automatically fits alpha-carbon chains to electron-density maps, with up to 85% accuracy

For those of you counting, the rest of the 15 come from dependencies of the above apps.

[Gentoo] XKB working!

After bugging people for an hour or so, I finally tracked down svu in #freedesktop to ask about my XKB issues. He got them figured out in probably 30 seconds.

Here’s the final setup to emulate the old en_US with my itouch keyboard and a compose with my menu key:

Option "XkbModel" "itouch"
Option "XkbLayout" "latin" #this changed
Option "XkbOptions" "compose:menu,lv3:ralt_switch" #this also changed

The changes were layout from en_US to latin, and adding the lv3 section to options. I never would’ve thought of trying latin; I figured it was some permutation of ‘us’ I was messing up. And the option is also quite obscure to me.

Thanks, svu! I don’t have $4.99, but hopefully this is good enough. =)

[Gentoo] XKB changes in xorg 7

I finally figured out why my XKB stopped working. It’s because of the xkeyboard-config files that were merged in around RC1/RC2 — some of the symbols files were deleted, including mine.

I was using en_US, a very convenient setup that allowed me to have accented/umlauted characters by hitting ralt+:, then the letter, or ralt+[, then the letter. I’ve looked around but I can’t find any alternative that works the same. Both the intl and alt-intl variants in the us symbols file basically suck for being usable, imho, because of the weird symbols they stick on the right side by default.

Any ideas for getting my en_US functionality back?

[Gentoo] Cleaning up “empty” font directories

Lots of programs (mkfontscale, mkfontdir, fc-cache, etc) keep metadata information in the same directory as the fonts. That information is regenerated upon installation of any new font or removal of any existing font in that directory by the ebuild, which then changes the MD5 sums and modification times of all that metadata. This means portage won’t automatically unmerge it, so we need to create a function to do so.

This function, called cleanup_fonts(), checks for a font directory with only metadata files in it. If it discovers any, it deletes them. I’d appreciate a couple more eyes on the code to make sure it’s sane, because it’s already in x-modular.eclass.

You can assume FONT_DIR is already set and sane at this point. It contains the names of each subdirectory in /usr/share/fonts/ that this particular package installed into.

Sorry about the lack of indentation; it doesn’t work by default, and I couldn’t figure it out in less than 10 seconds.

cleanup_fonts() {
local ALLOWED_FILES="encodings.dir fonts.cache-1 fonts.dir fonts.scale"
for DIR in ${FONT_DIR}; do
unset KEEP_FONTDIR
REAL_DIR=${ROOT}usr/share/fonts/${DIR}

ebegin "Checking ${REAL_DIR} for useless files"
pushd ${REAL_DIR} &> /dev/null
for FILE in *; do
unset MATCH
for ALLOWED_FILE in ${ALLOWED_FILES}; do
if [[ ${FILE} = ${ALLOWED_FILE} ]]; then
# If it's allowed, then move on to the next file
MATCH="yes"
break
fi
done
# If we found a match in allowed files, move on to the next file
if [[ -n ${MATCH} ]]; then
continue
fi
# If we get this far, there wasn't a match in the allowed files
KEEP_FONTDIR="yes"
# We don't need to check more files if we're already keeping it
break
done
popd &> /dev/null
# If there are no files worth keeping, then get rid of the dir
if [[ -z "${KEEP_FONTDIR}" ]]; then
rm -rf ${REAL_DIR}
fi
eend 0
done
}

[Gentoo] typespeed — Can you type random commands faster than your friend?

Polvi pointed out this strangely addictive app. There are choices from Unix commands to Spanish words and more.

I played it twice, and here’s how I did:

Top10 (score) (name) (level) (cps) (tcps) (typoinfos)

1. 562 donnie VeryGood 5.600 5.945 5.79% IT Person
2. 532 donnie VeryGood 5.295 5.505 3.81% Human

cps would be commands per second, so I’m floating around 5-6. Funnily, IT people apparently have more typos than regular humans.

You can also go it solo, if you swing that way.