The Fugue Counterpoint by Hans Fugal

8Oct/090

AC_TYPE_UINT8_T and friends

If you get errors like this:

$ autoreconf
configure.ac:110: error: possibly undefined macro: AC_TYPE_UINT8_T
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:111: error: possibly undefined macro: AC_TYPE_UINT16_T
configure.ac:112: error: possibly undefined macro: AC_TYPE_UINT32_T
configure.ac:113: error: possibly undefined macro: AC_TYPE_UINT64_T
configure.ac:115: error: possibly undefined macro: AC_TYPE_SSIZE_T
autoreconf: /usr/bin/autoconf failed with exit status: 1

It probably just means you have an old autoconf. These macros were introduced in autoconf 2.60. But it's probably no big deal if you have a sensible stdint.h.

8Oct/090

EINVAL on sendmsg() to a UNIX Doman Socket

I'm seeing an EINVAL result when trying to do a sndmsg() call to a UNIX socket. The man page says that means that the sum of the iov_lens overflows an ssize_t, but an ssize_t is 8 bytes on this machine and there's only one iov and its length is 671. Last I checked that doesn't overflow anything but a char. What gives? Same code works fine in Linux and when using UDP or TCP.

28Sep/090

SIGABRT and gdb

So you fire up gdb and pepper your code with assert() calls. Then one of your assertions fails and you see this:

Assertion failed: (item_idx < si.slabclass[clsid].perslab), function ITEM, file slabs_items.h, line 78.
Program received signal SIGABRT, Aborted.
0x00007fff83efab16 in kevent ()
(gdb)

Well shucks, you think you're screwed because gdb doesn't seem to have left you in a useful state. So you investigate conditional breakpoints (that are a pain to set and don't seem want to work in inline functions), and generally beat yourself over the head for awhile.

Then you realize that gdb's throwing you out into a different thread, and your pretty backtrace is there for the exploring, you just have to switch to the right thread. Yeah, remember that. Then maybe you can set a breakpoint on the actual assert code (which you can find with the backtrace—it was __assert_rtn() in my case) so you're already in the right thread and just need to go up the backtrace one level to get to debugging goodness.

Tagged as: , , , No Comments
11Sep/095

Rental Deposits

Dear Internets,

I seek your advice regarding rental deposits. We left the property in decent condition and the managers want to not only withhold our deposit but charge us $200 to boot. What are our rights?

When we moved to Las Cruces we got lucky and found a great place managed by a great company, Doña Ana Properties. Somewhere along the line, the property was sold and the new owner switched management to the unscrupulous Mathers Realty. There was much mourning, but thankfully our stay remained uneventful until the end.

When we moved out everyone told us Mathers would weasel out of returning the deposit, so it came as no surprise when we received a bill in the mail explaining all the ways in which they deserved our money more than we did. What was surprising is that they didn't stop at exhausting the deposit, but racked up an additional $200 in charges. They charged $100 for "repairs" such as "a towel [in the bathroom] needs to be removed," "the blinds are broken," (they had been replaced not two weeks earlier and were perfectly fine), "remove the pan from the oven," (all our pans are accounted for—I'm not sure what they are talking about). Then they charged $95 to clean the carpet that we steam cleaned, and $95 for "janitorial services"—we left it clean.

There are a few things I would be (grudgingly) willing to give them: the blinds in the other bedroom that were broken but from normal wear and tear, a modest amount for painting (they charged $150, the lease said "minimum of $50"), a modest amount for "janitorial services", etc. In fact, I'd be willing to let them take the whole deposit (we had written it off anyway, based on their reputation). But I really don't want to send them a check.

Here is the only relevant text of the lease: "As a general rule, you will not be held financially responsible for repairs due to 'normal wear and tear' or routing maintenance. YOU WILL BE HELD RESPONSIBLE FOR THE REPAIR OF DAMAGE DUE TO YOUR NEGLECT OR MIS-CONDUCT." and "The deposit may be applied to recover losses, if any, suffered by reason of the Tenant's non-compliance with this Rental Agreement including non-payment of rent. [...] Refund of your deposit is contingent upon the condition of the rental unit after vacated. The condition of the unit will be compared to its original condition as stated on the check-in list. (i.e. carpet shampooed, cleanliness, condition of walls, damages, etc.). A minimum of $50.00 will be charged for painting upon move-out."

Filed under: Uncategorized 5 Comments
10Sep/090

Publishing Availability

I have a calendaring dream. I want to publish my availability somewhere where people can see it.

My calendaring at work happens on an Exchange server, which works really nicely with iCal in Snow Leopard. I also do some non-work scheduling with iCal. I shouldn't publish details of work scheduling because that has the potential to leak sensitive information. But there should be no problem with publishing availability.

Alas, I can't figure out how to publish the Exchange information from iCal at all. The publish item in the context menu is greyed out. Although that calendar does have "affects availability" checked, I can't see any way to publish that availability for others to see, which kind of defeats the purpose of availability don't you think?

Filed under: Uncategorized No Comments
3Sep/090

git whereami

Update: I added git branch -a so that you can actually see where you are, and --since='2 months' so if your repo is huge like mine it doesn't take 2 seconds to run. (The actual value of --since will probably need tweaking for your situation.)

Here's the awesome git trick of the day:

# in ~/.gitconfig
[alias]
w = !git branch -a && git log --branches --oneline --graph --decorate --simplify-by-decoration --since='2 months ago'


$ git w
* 0bfd287 (refs/remotes/git-svn, refs/heads/foo) commit message
| * 0b5d8d4 (refs/heads/bar) another commit message
|/
| * 575185a (refs/heads/baz) YACM
|/
* b98de6b (refs/remotes/origin/master, refs/remotes/origin/HEAD) YACM
* eadfbbe initial commit message

If you're lucky enough to have a recent version of git, the --decorate option doesn't print out the boring refs/{remotes,heads} stuff by default.

Filed under: Uncategorized No Comments
24Aug/096

Terminal Merge Conflict Resolution

A very important tool in the toolbox of any collaborating developer is a merge conflict resolution tool. OS X has the fantastic FileMerge, there are various graphical tools for linux like kdiff3, but I have yet to hear of one for the terminal. There's vimdiff, but it is really not up to the task of merge conflict resolution (doesn't handle 3-way diffs). There's probably something in emacs, just because there's always something for emacs. Emacs users please enlighten me, I'm not above using emacs for merge-conflict resolution. Might even be the gateway drug.

It doesn't seem overly hard (at least, no harder than writing kdiff3 or FileMerge) to make an ncurses tool that will take a 3-way merge and let you efficiently choose A, B, or edit for each diff section. Can it really be that nobody has done it yet?

22Jul/090

Turabian

Long ago in the days of yore (1937), Kate Turabian, the dissertation secretary at the University of Chicago, wrote a booklet of guidelines for student writers. Fast forward seventy years, and you get the excellent "A Manual for Writers of Research Papers, Theses, and Dissertations."

Turabian is still listed as the author. It says "revised by Wayne C. Booth, Gregory G. Colomb, Joseph M. Williams, and the University of Chicago Press editorial staff." I think that's a bit ironic, like attributing a Wikipedia page to whoever made the first revision. But I don't worry myself about who wrote what in this fantastic tome.

The part that Turabian probably wrote, and has probably been heavily edited, revised, and updated since 1937, is the style guide. It's everything the student writer would need to know about the Chicago Manual of Style, including how to cite internet sources, with a much more reasonable price tag. That right there is a good reason to buy the book.

But for me, the best part of the book was not the style guide, though it will definitely be an important reference as I finish my dissertation, but the writing guide in Part 1 which I understand is new to this edition and is adapted from "The Craft of Research" by Booth, Colomb, and Wililams. I won't say it answered every question or definitively told me everything I ever need to know about writing a dissertation. But compared to other books and websites on writing a dissertation, it was lucid, concrete, and very helpful. Maybe I'm just a literal kind of guy and needed some concrete steps to follow, even if they're not perfect steps. But this part of the book helped me finally come to a comfortable structure and tone for my dissertation. I found what I want to say and how I want to say it and how to organize what I want to say largely thanks to following some steps outlined in this writing guide. But it did come from within, they didn't hand me the answers on a platter. This is good I think, because I think the answers are different for different people and certainly for different disciplines, and also because I would have just ignored it if they had.

The writing section, at least, is slightly geared towards what I'd call the soft sciences (whether or not that's an accurate term), but not terribly so and not to the point that you can't make the in-flight adjustments to your hard-science needs.

Excellent book and well worth the $17. But be sure you get the 7th edition. And forget about buying the Chicago Manual of Style ($50+) unless you're going to be an editor or something.

Filed under: Uncategorized No Comments
22Jul/090

mp3m4b

I wrote a script to do what Audiobook Maker does without the GUI. i.e., convert a bunch of mp3 files into a monolithic but chapter-enhanced iPod audiobook.

http://github.com/fugalh/mp3m4b

Enjoy!

Filed under: Uncategorized No Comments
15Jul/090

Encoder mailbox not found

My PVR-150 that I got used from eBay would occasionally spaz out and complain "Encoder mailbox not found" when trying to load the firmware. It happened when I first got it, then didn't happen for months, then happened again and went away with a reboot, then happened and wouldn't stop until I switched PCI slots.

Then it worked, for about an hour, and puked with "Encoder firmware dead!" or something like that. Something was dead, anyway. I took this as a sign that it wasn't a driver or IRQ problem, but a bad card. (Yes, I'm rather thick.) So I got a (supposedly) new card from eBay for just a few more dollars than the original used one cost. It has been working for several days without complaint, so I think it must be a bad card.

But if you want to try your luck with this PVR-150, I'll be happy to mail it to you. Maybe it was a problem with my VIA motherboard.

And most importantly, for those of you out there searching for "encoder mailbox not found", it may just be time to get a new card. If not, try switching PCI slots.