Category Archives: Computers

xlock on pm-suspend

I’ve always preferred that my machines be locked when they wake up from sleep/suspend/hibernate/etc., and this has been a little bit of a fuss to hand-configure on Linux of late. The problem is that the pm-utils suite that almost all distributions use isn’t really well suited to triggering a lock, and not everyone thinks it should be able to. The Ubuntu solution follows the “not in pm-suspend” idea, and predictably adds another (bulky) layer of abstraction, using gnome-power-manager lock the screen and call the suspend scripts separately. Because I don’t always call pm-suspend the same way and don’t want an extra thing running anyway, that isn’t an option for me. So, a solution to run xlock on every invocation of pm-suspend that ACTUALLY WORKS is to add an appropriately named file in /etc/pm/sleep.d, like the following:

22lock

#!/bin/bash
user=`finger| grep -m1 :0 | awk '{print $1}'`
case $1 in
    hibernate)
        su $user -c "xlock -mode blank -display :0&"
        ;;
    suspend)
        su $user -c "xlock -mode blank -display :0&"
        ;;
    thaw)
        ;;
    resume)
        ;;
    *)  echo "The xlock-on-sleep script is broken"
        ;;
esac

Remember to make the file executable (chmod +x).
The finger/grep/awk incantation at the top is a cheap (and not entirely proper) way of grabbing the first user on display :0, which is USUALLY the user logged in on what is USUALLY the local X server; sudoing to an appropriate user (and the explicit “-display :0”) is required because the script is run in an environment where the display isn’t visible and the user is always root.
xlock and it’s options can be modified or swapped out for your screen-locker of choice.

(Posting as a reminder to myself, and because I didn’t see a solution when I searched)

Posted in Computers, DIY, General, OldBlog | Tagged | Leave a comment

Gnome 2.28: even more annoying

Despite its many irritations, I’ve been actively tolerating Gnome on my extra machine (running Ubuntu 9.04), with only a few adjustments for the really infuriating things (The “presence” features in OS X/iChat are irritating enough, a half working clone is maddening), and, with those adaptations made, it is a pretty tolerable environment.
…and the GNOME folks went and did something to re-stoke my hate. I use GDM (and a number of other Gnome-dependent pieces, many of which have no compelling reason for the dependencies) on my usual Arch/XFCE4 machine as a matter of convenience and/or preference. In the 2.26->2.28 upgrade (Arch tracks current) the Gnome developers decided to change the way GDM is configured. This change included breaking all existing GDM themes (admittedly, to be more consistent with GTK, which is a good thing, just not graceful), and making it impossible to configure GDM without gconf and/or horrible dbus stunts, which, of course, don’t work on my system. They also seem to have depreciated the “new session in nested window” feature of gdmflexiserver that made GDM preferable to the alternatives… I think I’ll just install SLiM, write a script with Xephyr to replace the nested window feature, and stop whining.

This is an arm of the argument about conventional releases versus Rolling Releases , but brokenness and compatibility issues from holding on to obsolete versions and the issue of occasionally breaking everything with a dist-upgrade/ OS X style point release upgrade still doesn’t seem preferable. This kind of behavior in Gnome is also a big part of why the non-Gnome *buntu distributions (Kubuntu/Xubuntu/etc.) feel like second class citizens; if components inside the Gnome obnoxious-integration umbrella are acting as part of the OS, the other environments are all going to have issues. Apparently Ubuntu 9.10 is built around Gnome 2.28, it will be interesting to see how it all works where everything is done the Gnome way.

This is not to complain about things the GNOME Project does, I do use, and like, a number of their products, especially Evince (which has apparently recently gained annotation features and a Windows port, the two things I most wanted for it). Likewise, the current round of development cycles are cutting a lot of the slow, crufty dependencies out of a number of programs… but I still find their ideas about useless (and forced) integration (see above) and non-configurable interfaces (sane default AND configuration options; it’s not one or the other guys…) incredibly frustrating.

Posted in Computers, General, OldBlog | Tagged , | Leave a comment

N8x0 PowerVR Drivers!

Since the N800 came out there has been a lot of rumbling in the community about the unutilized hardware present in the device (and it’s sibling/successor, my beloved N810). The piece most complained about are the PowerVR MBX 3D accelerator and 5MB SRAM included on the OMAP2420 SoC the device is built around. The explanation has always been a mixture of licensing issues for the drivers, and that the external Epson S1D13745 display controller was better suited to the 800×480 (still unusually high for mobile devices) resolution, despite being rather slow and devoid of 3D-capability.

With the advent of the N900 and it’s non-backward-compatible Maemo 5 OS, there is some fear in the community that the N8×0 devices will be abandoned. The N900 looks like a very cool device, but like many tablet owners, part of the appeal of my N810 was that it wasn’t designed to have a >$50/month cellular data plan. Nokia’s offical (and seemingly very classy) stance is that they will provide support for continued community developed FOSS software for the platform, which currently mostly means Mer, a community firmware/ partial Maemo 5 backport. There are also several other linux-based OS ports to the N8×0 platform, and a burgeoning effort to produce a binary-compatibility-maintaining system software update like the ones Nokia used to produce for Maemo 4 which will hopefully all cross-pollinate sources and keep the platform alive. One only has to look at how long the OpenZaurus (later merged into OpenEmbedded/Ångström) community held on, and how much they accomplished to be hopeful.

The combination of these thoughts? Nokia (and the various other relevant IP owners) announced they will be supplying drivers for the PowerVR to the community in the immediate future. With a little luck the Mer hackers will get them integrated into a release soon, which may contribute to tipping to Mer as the predominant OS for n8×0 devices over the OS2008/Maemo 4 stack Nokia provided.

I depend so much on my n810 I haven’t really been into OS hacking on it, but as it ages and the community firmwares come to the fore I suspect I’ll get more into it (if I have time). Maybe as they get cheap I’ll even end up with one of the “knockoffs” to use as a test platform in the same primary machine/beaterbox setup as my bigger machines.

Posted in Computers, DIY, Electronics, General, OldBlog | Tagged , , | Leave a comment

Epigrams on Programming

My Languages for Computers, Languages for Computing post reminded me of several of the “Perlisms” from Epigrams on Programming, a collection of humorous observations on programming published by Alan Perlis in SIGPLAN Notices 17(9), September 1982. Most of them are still as, or more, relevant now than they were when they were published.

Everyone who deals with computers regularly: GO. READ. THEM.

Some of my favorites:
19. A language that doesn’t affect the way you think about programming, is not worth knowing.
31. Simplicity does not precede complexity, but follows it.
49. Giving up on assembly language was the apple in our Garden of Eden: Languages whose use squanders machine cycles are sinful. The LISP machine now permits LISP programmers to abandon bra and fig-leaf.
87. We have the mini and the micro computer. In what semantic niche would the pico computer fall?
114. Within a computer natural language is unnatural.

The fact that many of the epigrams are contradictory in clever ways just makes them better.

Posted in Computers, General, OldBlog | Tagged , | Leave a comment

Languages for Computers, Languages for Computing

We had a day of playing with Lisp in CS655 in preparation for the next assignment, and, like every time I am exposed to Lisp, it makes me think about one of my favorite ways of classifying programming languages. The dichotomy is is, as above, “Languages for computers” — Languages that directly manipulate the way computers tend to be actually implemented (Like C and FORTRAN, which have admittedly symbioticly pushed the design of modern computers) and “Languages for computation” — Languages built around a computational model (Like ML and Smalltalk). I’m a much bigger fan for the former.

Lisp sort of falls in-between. Lisp is definitely a “Lambda calculus with sugar” language in conception, but it has at various times actually made sense for the hardware it ran on. Initially, Lisp was implemented on the IBM 704; the CAR and CADR nomenclature for the head and tail of a list endemic to Lisp is derived from the way in which registers could be split and addressed on the 704, and is actually a fairly clever way of efficiently utilizing the available resources. This is also probably why Lisp is case insensitive; the 6-bit, Hollerith-card derived BCD character representation used on early IBM machines only had capital letters. Later on, mostly as a response to the AI communities’ love of writing computationally intensive programs in Lisp, which was (and continues to be) extraordinarily inefficient on most hardware, there were several generations of dedicated Lisp Machines, built with a bizarre tagged architecture specially suited to running Lisp code. These are now a well and truly dead breed, as they were expensive special-purpose machines of the kind almost completely eliminated by commodity hardware in the 90s, but did prove that it was possible (albeit expensive and ungainly) to make hardware that suited Lisp the same way most machines are suited to C and Fortran.

The remainder of this post is sort of an expansion of my griping about ML a few posts back, generalized to “computation” style languages. My first objection is partly personal; I’m much more interested in the way computers actually work, than the (admittedly alluring and elegant) field of computational theory, which frankly has very little bearing on the way computers work, and even less on the way they are used. This does lead to an argument that programs should be written to suit the prevailing hardware rather than the programmer, as they will be run many times but only written once, but that argument can be over-applied to any high level language, and can be mitigated by ever increasingly smart compliers. Another reason I don’t tend to take the “computation” type languages all that seriously is that I don’t really believe in attempting to formally verify programs. My observation is that programmers tend to be pretty good at writing what they mean (possibly excluding fringe cases) in any language they are comfortable with, but pretty bad at figuring out exactly what they intend to write, which is a validation problem, usually made worse by attempts at premature verification. There are a couple notable efforts to formally verify non-trivial programs, like se4l, but these conspicuously tend to be written in languages not designed to support formal verification. To the best of my knowledge there aren’t any formally verified programs large numbers of people actually use on a regular basis (it would be cool if there were; please correct me if there are examples, I’d love to see them).

Posted in Computers, General, OldBlog | Tagged , | 1 Comment

XMOS

I ran into an ad for development boards from XMOS the other day, and, being generally curious about unusual little processors, read up on them. The architecture they are using sounds like a really good idea to me, and I hope it’s as well executed as it is clever. Some of the cool stuff:

Programmable hardware – they call it “Software Defined Silicon”, it appears to be FPGA-like programmable switching setups between the cores, and some programmable features in the IO blocks.

Static scheduling – This is my bet for the way to solve the memory latency problem that continues to be my favorite candidate for “the next big problem in computing”. Caches and parallelism can only hide so much, and caches are responsible more than their share of uglyness.

LLVM-based tools- I’ve been working with LLVM for LARs, and there is a lot of similarity to the designs. I’m pretty well convinced now that LLVM is a Good Thing and the programming environment they built with it sounds promising; it appears to be C, extended with features to better support thread concurrency and the programmable I/O stuff.

The biggest worry is they don’t seem to actually have their chips in any high profile devices, which may just mean they haven’t been around long enough, and may mean there is some hidden problem with their products that I haven’t caught on to yet.

I don’t have enough free time and energy to think its a good idea to drop $100+ on a dev kit which will sit unused on my shelf “until I have time”, nor do I have a project for which it would be appropriate, but I’d love to to sit down and play with one of their dev kits (the little credit-card boards are cool, but the one with the QVGA touchscreen is way cooler…) and see if it really is as good as it looks (One of the many cool project ideas I doubt I’ll ever get to: I’d love to try to port a conventional(ish) OS to these things in a way that actually took advantage of the architecture (I’m thinking tricks with a microkernel across threads), both for the porting experience and because it would be a good (predicted) future of parallel programming playground. There is a review of the fancy kit with the screen above, and it sounds like the software tools (at least at the time of the review) and documentation are still a little rough, but they seem to agree its a promising idea, and do note that XMOS seemed to be aware of the issues and showed signs of moving to solve them. Definitely a product to watch.

Posted in Computers, Electronics, General, OldBlog | Tagged , , | Leave a comment

ML and Music

I’ve been working on figuring out ML for an Advanced Programming Languages assignment. ML is a peculiar language, so it’s been taking some time, and when I’m spending hours staring at blocks of text I tend to get more into music as a complimentary activity. Both are turning up things worth sharing.
ML:
Functional programming has always confused me; as a computer engineer it strikes me as a deeply unnatural thing for the computer to do (what the hell does it look like in memory? — I mostly know and it isn’t pretty), and it isn’t a terribly natural paradigm for humans (although I will grant that is would likely be no more of a contortion for someone not accustomed to programming than any other paradigm). I guess there is a reason the deeply functional stuff tends to be mostly limited to “interesting” languages that are mostly outside the mainstream. I can “feel the power” on a lot of fronts; the ability to completely describe functions as input/output pairs is cool, recursion is natural and easy, and the type system is nifty, but it all still feels a little uncomfortable to me.
Music:
I’ve spent the last couple weeks on a Hyper Crush kick . Pandora brought me Hyper Crush off an A Kiss Could be Deadly derived station a while ago, and it took me a while to make up my mind about them. They make INCREDIBLY catchy, ostentatiously course, and somehow still incredibly geeky techno-influenced hiphop, which is either absolutely brilliant or unforgivably obnoxious. Aside from endless energy and spectacular synthesizer work, their songs are laced with a vast and remorseless collection of samples from and references to bits of pop-culture ephemera from the 1960s onward. Just to name a few, one track begins with a sample from The Shangri-Las “Leader of the Pack”, and another borrows its background from “Crazy Frog”. Both mixtape releases (Both available legitimately free online, but buried behind some flash obstructions) are shot through with samples from West Side Story, The Wizard, Back to the Future, and a wide swath of 80s and 90s video games. It is the pure sound of geeks letting their hair down, and it feels damn good.

To compliment the loud, I started listening to The xx yesterday, which I actually learned about from the music section in the back of last week’s The Week, which is usually too pretentious to pay attention to. Their debut album xx is unbelievably complex and nuanced for a first effort from a group of 20somethings. The lyrics are often male/female harmonies (I like the female vocalist’s voice much better, but thats par for the course with me), which are not necessarily the same words or timing for both voices but remain in harmony none the less. The lyrics are also quite subtle, one could reasonably make it through the entire album without realizing it’s mostly about sex. The coolest thing to me is how much they play with negative space; the crisp gaps are as much a part of the music as the instrumentation itself. There really isn’t any standout track, good or bad, on the album, so just go listen to any random track.

Posted in Computers, General, Music, OldBlog, School | Tagged , | Leave a comment

Paper Submission +1

Got another conference paper out last night, half an hour before the deadline. I’m again the third author, but this time I am there for contributing content, not just huge amounts of editing. This is a better paper than the one that didn’t make it in at SuperComputing; our focus is more on the theory behind the LARs desing and it’s many interesting implications, and the polish is much better. The venue is also more appropriate, this paper is out to IPDPS, who have a better track record taking things as “out there” as this one, both because of their editorial process and focus.

It’s great to be working with committed people; both my co-authors and our advisor were there and working to make it better until 11:45 at night when we finally got it squared away and submitted.

Posted in Announcements, Computers, General, OldBlog, School | Tagged | Leave a comment

Apple’s Flatland Asthetic

I’ve found something very offputting about Apple’s much touted UI design since around 2001 (the advent of OS X), and have never quite been able to put my finger on what the issue is, until I came across this series of articles by Bruce “Tog” Tognazzini, the founder of Apple’s Human Interface Group and one of the Distinguished Older Persons of the HCI world. He calls the problem the “Flatland Asthetic”, which he patly describes as “The new Apple seems to subscribe to the the belief that visual simplicity equals actual simplicity.” To put this more aggressively, Apple designs interfaces that are elegant until you use them in non-trivial ways. The biggest way in which this is offensive is where they have actively re-introduced problems long solved by hierarchy in computing, usually by taking away directories (folders. Whatever nomenclature you prefer) in places a consistent interface would allow them. I would also say the problem extends further back that Tog is giving credit for; even the much maligned one button mouse can be explained as an instance of the same ethos.

For some real-world examples, a few days ago I was watching my father use his G5 Tower (OS 10.4), trying to shuffle through a pile of icons which automagically piled themselves one on top of the other in the upper right hand corner of the (shockingly full) desktop, a behavior broken in exactly the same way as Windows 95. He then went to find an application in the dock… which had “elegantly” scaled down to near-illegibility because he had a non-trivial number of applications open or pinned (side-gripe: I still don’t like the confusing commingling of running applications and shortcuts, but with it being in Windows 7 as well now, it looks like I’m in the minority). Generally, any place where the UNIX-derived presumption “Everything is a File, and all files can be manipulated in the same way” is violated, I get unhappy (which explains my contempt for iTunes/iPhoto style “manager” programs as well).

I concede that some of the problems have been remedied, at least a little bit, in the most recent versions of OS X, with features like the the drawers (to use the CDE phrase, I have no idea what Apple calls them) in the dock. I would say these are band-aid solutions over a festering problem with mentality.
I’ve had my (obviously not entirely solitary) rant, now I’ll go back to my customized, bewildering to all others XFCE environment…

* a phrase I’m found of, borrowed from Brian Aldiss and Roger Penrose’s White Mars, the first half (or so) of which is excellent.

Posted in Computers, General, OldBlog | Tagged , | Leave a comment

Preaching to the Choir

The Bruce Schneier talk in the previous post was quite good; he is an excellent and entertaining speaker (an hour without any sort of slides or visual aids!), but was a little disappointing because he was very much preaching to the choir. Most of the (nearly auditorium-filling) audience was made up of upper-level CS students, and CS/EE faculty who are for the most part well versed (especially the many attendees with cognitive science background) in the high level conception of the perceived security/actual security/security model paradigm he discussed. The talk would have been excellent for a less focused audience, but I would have enjoyed hearing his thoughts on some interesting specific topic, either technical (his work on Skein?), or high profile (Chemically improbable liquid bomb plots? C6H12O6 + H2O2 ===> 6CO2 + 18H2O does not an airliner-destroying bomb make…), or a topic which he has not thoroughly saturated the geek news channels with his thoughts on. Several of the other attendees I spoke with afterward felt the same way. This is just a particularly strong instance of a general problem; the people who would get the most from a high-generality talk don’t know to come, and the people who do know to come already know the material. I have no idea what the solution is, finding and engaging the potentially interested on campus is nearly impossible (the noise levels are too high), and offering only highly technical seminars seems to violate the egalitarian ideal of public talks.

In other announcements, DorkbotLex#6 will be this Saturday (2009-09-18) at 4PM in room 101 of the Reynolds Building (349 Scott Street), with the following topics:
* “Twitter Cutups” Patrick Morissey
* “Propoganda Machine” Aaron Miller
* “Biofeedback software” Matt Ward
as always, it should be cool.

Posted in Computers, General, OldBlog, School | Tagged | Leave a comment