BlogFeed

Categories

  • Default/Other
  • Computers
  • Friends
  • Family
  • Blog Code
  • Website
  • Programming
  • Open source
  • Scouts
  • School/Educational
  • Math
  • Athletics
  • Journal
  • Quasi-philosophic ramblings
  • Site news
  • Informational
  • Quotes
Protection no

Xenial upgrade issues

Back in February, I finally got around to updating my personal laptop to Ubuntu 16.04 (Xenial). I ran into two main problems, that I'm only now resolving:

  • I use XMonad+GNOME, and GNOME wouldn't start up when I did that. Moreover, if I didn't manually run gnome-flashback, my session would be terminated.
  • Occasionally, after resuming from suspend, my fonts would be screwed up -- many characters wouldn't show up at all (though scaling up or down the terminal would usually eventually find some that would)

I've tried off and on to resolve both of these, but only recently figured out what was going on, at least with the first.

In the case of the XMonad problem, it seems to have been twofold. First, I snap my pointer to the middle of the window when I change focused windows. However, the mechanism for doing this (updatePointer) changed since Trusty, which caused my xmonad.hs to fail to compile. I'm not sure whether I got an error about that and just ignored it, or it was silent, but in any case I didn't fix it, so my XMonad was still using an old config. This caused further problems: window managers (perhaps new as of Xenial?) need to tell GNOME when they finish starting up. If they don't, GNOME exits. XMonad's GNOME module shells out to dbus-send to do this, but used incorrect syntax, which in Trusty I think was ignored, but causes dbus-send to bail in Xenial. This was fixed in XMonad upstream in 2014 and in Debian in 2015 (in time for Xenial). This all would have been fine -- XMonad in Trusty would do the wrong thing, and dbus-send would ignore it, and XMonad in Xenial would do the right thing -- except that my config was failing to compile, so I was still using the Trusty XMonad library in Xenial, which didn't work.

Finding all this, naturally, didn't go in this order. I found some syslog lines that seemed pretty suspicious after some hunting:
Aug 31 21:48:29 semmering gnome-session[10200]: invalid value (=string) of "--print-reply"
Aug 31 21:48:29 semmering gnome-session[10200]: Usage: dbus-send [--help] [--system | --session | --bus=ADDRESS | --peer=ADDRESS] [--dest=NAME] [--type=TYPE] [--print-reply[=literal]] [--reply-timeout=MSEC]   [contents ...]
Aug 31 21:48:39 semmering puppet-agent[2064]: Could not request certificate: Failed to open TCP connection to puppet:8140 (getaddrinfo: Temporary failure in name resolution)
Aug 31 21:48:48 semmering bluetoothd[1475]: Endpoint unregistered: sender=:1.12651 path=/MediaEndpoint/A2DPSource
Aug 31 21:48:48 semmering bluetoothd[1475]: Endpoint unregistered: sender=:1.12651 path=/MediaEndpoint/A2DPSink
Aug 31 21:49:59 semmering gnome-session[10200]: gnome-session-binary[10200]: WARNING: Application 'xmonad.desktop' failed to register before timeout
Aug 31 21:49:59 semmering gnome-session-binary[10200]: WARNING: Application 'xmonad.desktop' failed to register before timeout
Aug 31 21:49:59 semmering gnome-session-binary[10200]: Unrecoverable failure in required component xmonad.desktop
Aug 31 21:49:59 semmering gnome-session[10200]: gnome-session-binary[10200]: CRITICAL: We failed, but the fail whale is dead. Sorry....
Aug 31 21:49:59 semmering gnome-session-binary[10200]: CRITICAL: We failed, but the fail whale is dead. Sorry....
Aug 31 21:49:59 semmering bluetoothd[1475]: Endpoint unregistered: sender=:1.10267 path=/MediaEndpoint/A2DPSource
Aug 31 21:49:59 semmering bluetoothd[1475]: Endpoint unregistered: sender=:1.10267 path=/MediaEndpoint/A2DPSink
Aug 31 21:49:59 semmering gnome-session[10200]: XIO:  fatal IO error 4 (Interrupted system call) on X server ":0"
Aug 31 21:49:59 semmering gnome-session[10200]:       after 323 requests (323 known processed) with 0 events remaining.
Aug 31 21:49:59 semmering lightdm[2627]: ** (lightdm:2627): CRITICAL **: session_get_login1_session_id: assertion 'session != NULL' failed
Aug 31 21:50:00 semmering acpid: client 9819[0:0] has disconnected
Aug 31 21:50:00 semmering acpid: client connected from 10334[0:0]
Aug 31 21:50:00 semmering acpid: 1 client rule loaded
Aug 31 21:50:00 semmering systemd[1]: Started Session c30 of user lightdm.

The "failed to register" bit seemed suspicious, and Googling that found some errors other people had due to not calling the gnomeRegister startupHook. I seemed to be using gnomeConfig and leaving it with its default hook, so that seemed unlikely, but grabbing the source package and looking at XMonad/Config/Gnome.hs found that registering involves using dbus-send. (Observant readers might note the dbus-send error in the logs. I'd seen that and grepped around for the bad usage, but hadn't found it -- in part probably because the text files with the bad form had been changed since then. I also didn't realize until later that "string" and "literal" were both actual literal arguments.) I tried running the command by hand, and it seemed fine, so I decided to try deleting the compiled files, in case those were wrong somehow. That gave me the error about updatePointer, which I Googled and found the change in syntax. After fixing that syntax error, everything (with XMonad) was fine again. Yay!

The font error, on the other hand, I pretty quickly found other mystified people with the problem months ago, but a distinct lack of folks with a good solution. There's some rumors that switching to Linux 4.8 helped, but there seemed to be mixed success and (I think) last I'd checked it wasn't easy to, so I hadn't bothered. Somewhat more recent reports suggest it's now in apt as the hardware enablement kernel and some folks have gone months without issues, so I guess I'll give that a shot soon and see if it helps.

If it does, and I don't have any more issues in the next couple weeks, probably I'll update my personal desktop too.

Categories:

  • Computers
  • Open source
  • Journal
  • Informational
Protection no

Versioning objects in a Django application

For a project that I've been working on, one thing that I've wanted was the ability to version objects in a Django application, and then go back to old versions and revert or see who made changes. I did a bit of research on what's available to this so I didn't have to implement it myself. In the hopes of saving other people even that effort, I'm posting those (somewhat cleaned up) notes for others to use. The short form is that I picked django-reversion. I haven't yet regretted that, though I definitely haven't used it much yet.

The main things I was considering are:

  • License: if I'm going to use something, I'd kinda prefer it not be "all rights reserved". Just about any OSS license would work, though.
  • Activity and sustainability: I'd like a project that isn't going to break in a couple of years when Django makes a backwards-incompatible change. To this end, I prefer something with recent changes, but also one that's been around for a while (it's hard to tell the difference between "one month old project that will be around in two years" and "random weekend project", but it's a little less likely to disappear if somebody has been actively developing it for years).
  • Documentation: while I'm willing to read the source (and often will when I find bugs or just want to figure out how to do something weird), when getting started I like to have documentation available.
  • Design: this one's a bit wishy-washy. Does the design feel clean, performant, etc.? More than anything else, this is an attribute that I found without really expecting to use it to pick my system.

The information in here is largely from late May, though I did check "latest commit" dates (with the exception of django-reversion, they hadn't really changed --- AuditTrail did grow a partial copyright statement, though).

django-revisions

This app is sometimes known as django-versioning instead (e.g., in the docs), which probably isn't a great sign.

  • License: Berkeley 2-clause (?)
  • Activity and sustainability: First commit August 2010, last commit March 2011. My pull request from May to fix the names in the docs hasn't been acted on at all (as of posting this in July).
  • Somewhat limited documentation

In terms of the technical aspects:

  • Store every version in the table with the model
  • Provide accessors for getting the most recent version
  • Appears not to support linking to a "bundle" (an object, not a version) --- see https://github.com/stdbrouw/django-revisions/issues/5
  • Performance may be an issue --- https://github.com/stdbrouw/django-revisions/issues/9
  • It's not immediately clear to me how to make the admin also save the old version

AuditTrail

  • License: unknown
  • Never had a real website or source code repo, AFAICT --- just a page on the Django wiki
  • Activity and sustainability: first "commit" August 2007, last "commit" August 2010 (except a comment clarifying the license of a bit of the code)
  • Very limited documentation --- just the aforementioned Django wiki page
  • Design: store versions in a shadow table per-model

django-fullhistory

  • Listed under "Models, database, history, trails" on Django resources page
  • License: GPLv2
  • Activity: first commit August 2008, last January 2010

On the technical front:

  • Store all versions of all models in a single table, using JSON
  • Metadata (time, editor, some other stuff) stored unpickled

django-reversion

  • License: Berkeley 3-clause
  • Activity: first commit September 2008, last July 2011 (was April 2011 in May)
  • Decent-looking documentation

On the technical front:

  • Store all versions of all models in a single table, pickled
  • Metadata (time, editor, comment) stored unpickled
  • I'm a bit concerned that the "here are the changes that have been made" view might be too slow; as long as we limit to editor and time this should be fine

Conclusion

As I mentioned, I picked django-reversion (after a brief trial of django-revisions, which I decided wasn't working out). I think the high-looking chances of actually being updated and decent docs convinced me. In terms of design, I think I prefer the shadow-table-per-model approach of AuditTrail, but...

So far, the django-reversion upstream looks active and responsive, which is nice (though I haven't had to file any bugs or pull requests yet, so I could be mistaken).

Categories:

  • Computers
  • Programming
  • Open source
  • Informational
Protection no

UChicago Splash: Splash itself

A couple months ago was UChicago Splash. I already wrote a post about the logistics of the visit, but I promised to write something about the event itself.

Splash itself was very different from MIT Splash.

I taught the same Copyright class that I taught a couple years ago at MIT Splash. It went much worse than the first one had. I failed to really get the people who'd shown up interested in the material, which was unfortunate. I've heard since that that's a really common at UChicago Splash (and, in partial contrast to that, that it has been getting much less of a problem more recently). I'm inclined to think that a lot of it was lack of preparation, and my general suckiness at teaching, but who knows.

UChicago Splash felt much more... authoritarian... than MIT Splash has to me. One of the things that I frequently hear people (admittedly, mostly admins, since that's who I interact with most) say is cool about Splash is how much freedom the students have. They're left on a college campus for a day, with no real commitments. There are classes, of course, and the photo... but nobody's taking attendance at anything, and nobody will really yell at them if they go wandering around Kendall Square.

UChicago held a snack in the middle of the program, and dispatched volunteers to help guide the students to it. So far, so good --- I figured this was just a "go stand in the hall, and tell people where it is when they ask, and make some occassional announcements for people who didn't realize snack was next". I got the impression, however, that the UChicago folks intended to be more... assertive, however. One of the UChicago admins drew her foot across the hallway and said to one cluster of students something along the lines of "Y'all are guests here. This is my school, and you need to do what I say. You're not to cross this line. You should go to snack, down there." I really can't imagine one of the volunteers doing something at MIT --- much less one of the senior MIT ESP admins.

UChicago Splash had a lot of visitors, too. In addition to Diyang and I from MIT, Dan (LU CEO), mshaw (Stanford ESP and Chair of the LU Board of Directors), J.D. (some sort of Stanford ESP affiliation?), and two more Stanford folks came. At seven people, it would not surprise me at all if the visitor's travel cost more than the rest of UChicago Splash did (the latter being budgeted for about three thousand dollars). I'm not really sure who was funding all the travel. Diyang and I were funded by MIT ESP. I assume the last two Stanford folks were funded by Stanford ESP. I assume that J.D. was self-funded (though Stanford is possible), and Dan was presumably funded by LU (self-funded is conceivable, though seems unlikely). For mshaw, I'm really not sure --- any of LU, Stanford ESP, and self-funded seem reasonably likely.

I can definitely believe that Dan's travel was worthwhile --- I think he spent most of the week before in Chicago helping out, which seems likely to be worthwhile, not to mention getting to know one of the chapters better. For the rest of us, it's a lot less clear to me. I don't really feel like I contributed much in the way of useful insight or needed labor to UChicago, nor did I really feel like I got much in the way of useful insight out of the visit. Admittedly, some of that may have been due to grumpiness about the logistics and my teaching leaving me not particularly predisposed to taking good ideas away, and not having put much of an effort into talking to people. Similarly, it's certainly possible that the other six visits were more useful.

Part of the reason that I felt like I wasn't contributing very much is because I felt like I didn't have much to do. Check-in was pretty hectic, and I felt useful then (or, at least, for the part of it that I wasn't frantically doing last minute class prep for...). After my class (which was during the first period), I rarely felt like I had much to do. Partially, I think UChicago just had plenty of volunteers --- the teacher lounge / volunteer HQ seemed to generally have tons of people. Partially, on the occasions when they needed volunteers and I offered, they just couldn't use me --- I'm not totally sure why. I think there was some component of not knowing may way around campus and thus being less able to do stuff; there was also, I think, so vibe that the visitors were too important to use on simple stuff, I think. I'm not sure why that was. Admittedly, I suppose there's been a similar vibe at MIT Splash sometimes --- that if there's any security volunteers around, admins are "too valuable" to send off on some task, even if the admin seems happy to do it and the security volunteer seems uninterested. It's sort of vaguely bothered me, though I don't know if there's anything to do about it (or if we should --- maybe we really are too valuable to squander...?). (Relatedly, I feel like at MIT Splash there's a tendency for admins to stand around chatting, leaving the useful work to volunteers. It seems sorta rude to the volunteers, but, again, I'm not sure what to do about it. Also, I'm far from blameless...)

Anyway, UChicago Splash. It was... kinda fun?

[ The first half of this post was written months ago; I finally got around to finishing it off tonight. ]

Categories:

  • School/Educational
  • Journal
Protection no

CAPTCHA's

I think I tend to be entertained by things that work, but seem sorta ridiculous. For example, I remember being entertained by some of the proofs in the Mathcamp complexity theory classes, where you prove that, say, multiple tapes aren't very useful (which in complexity tends to mean something like "doesn't change whether something is polynomial or not"), because you can simulate them while "merely" squaring the running time of your algorithm. Sure, it's still polynomial, but... that seems like a big difference practically...

Anyway... Today's paper for my security class, which talks about the economics of CAPTCHA's, amused me for somewhat similar reasons --- I'm not used to papers for my security class focusing on cost, even if in practice human labor is cheap enough that "how much do CAPTCHA's make accounts cost" is much more important than the basic "can you make computers break them at all" (answer: maybe, but people don't really bother, because that costs more than using humans).

Categories:

  • Computers
  • School/Educational
  • Journal
Protection no

ET Retreat

This weekend 'twas ET retreat. It was pretty fun. Unfortunately, I spent Friday night and Saturday morning tooling on 6.828 (much spent finding a stupid bug where I wrote roughly "n > NDIRECT" instead of "n >= NDIRECT"...), so I didn't get to do fun stuff Friday night, and didn't do the Saturday afternoon activities (due to a mixture of still tooling and being tired from staying up the night before).

A highlight of the trip was Alioth teaching a bunch of Thetans how to contra dance. It was sorta fun to help out with that a bit, but helping people who hadn't done Contra before. It went... reasonably well. There were definitely some false starts in teaching some calls, and the calling wasn't as smooth as some I've heard, but given the inexperience of the dancers and the teacher/caller, it went pretty well. Everyone seemed to enjoy it, too.

I also spent some time in the hot tub with Alioth and Sally (and, for some of the time, Mark), which was fun.

Categories:

  • Journal

Alex·Dehnert