.editrc Tidbit for ghci

Paul R. Brown @ 2008-12-03T05:48:03Z

The only thing that I lost in the transition between readline in GHC 6.8 and editline in GHC 6.10 was backwards history search in ghci bound to ^R. I use that particular feature quite a bit, so that had a big negative impact on my productivity.

Here's how to get it back. Create a file in your home directory called .editrc with the following contents:

edit on
bind ^R em-inc-search-prev

The analogous setting for forward search (bind ^S em-inc-search-next) doesn't work for some reason, but that's not one that I'm going to miss.

(comment bubbles) 1 comment

LinkedIn Group for Mathematicians

Paul R. Brown @ 2008-11-24T21:38:41Z

I can understand that some might find a bit of irony in a social network for mathematicians, but I created a LinkedIn group for "current and former mathematicians" late last week.

Mathematicians, where my working definition is people who have significant formal training in the form of a Ph.D. or A.B.D. in mathematics or a similar field like theoretical physics or computer science, usually start out with a very narrow career trajectory — academia. Graduate mathematics programs have the job of preparing students to be researchers. There is barely an acknowledgment of alternatives, but the realities of the economy and academic job market will continue to draw (or drive) mathematicians to other fields. (Programs like MISI at UIC, with which I was involved when I was on the faculty at UIC, are a notable exception.)

The reality is that there is no irony. The mathematicians that I know are equally distributed and successful across academia, industrial applications (e.g., quantitative finance, marketing analysis, etc.), and entrepreneurship; but formal training in mathematics isn't one of the axes that LinkedIn or other social networks support for search or networking. I hope that the group is a combination of:

  • a support structure for mathematicians of any age pursuing or just considering non-academic career tracks or even just extra-curricular consulting;
  • a place to share interesting problems and opportunities;
  • a virtual tea time, which I miss.
(comment bubbles) 1 comment

Three Jokes about Mathematicians

Paul R. Brown @ 2008-11-24T07:30:03Z

The first joke is a riddle:

Q: How can you tell an extroverted mathematician?

A: .sǝoɥs ɹnoʎ ʇɐ ʞooן ʎǝɥʇ 'noʎ oʇ ʞןɐʇ ʎǝɥʇ uǝɥʍ

The second joke is a classic mathematician/physicist/engineer tryptych:

A mathematician, a physicist, and an engineer meet up at their 20th college reunion. The physicist asks the engineer how life been, and the engineer says, "It's been great. I reached partner in the firm by 30, have a dozen patents, great kids, a spouse, and a lover. The spouse doesn't know about the lover, and the lover doesn't know about the spouse; so it's all good."

The physicist and the mathematician nod knowingly, and the engineer asks the physicist the reciprocal quesition. The physicist answers, "Life has been good to me, too. I have an endowed chair, a well-funeded lab, a couple of generations of strong graduate students, a spouse, and a lover. The spouse doesn't know about the lover, but the lover knows about the spouse and is OK with the arrangement; so it's all good."

The mathematician and the engineer nod knowingly, and the physicist asks the mathematician about life since college. The mathematician answers, "I've done well. I was hired with tenure right out of graduate school, have a dozen papers in the Annals, and don't have to teach calculus. I have a lover and a spouse, too, and the lover and the spouse know about each other; so it's all good.

The physicist and the engineer stare blankly at their old friend. "So, with the lover and spouse knowing about each other, how is that OK?"

The mathematician responds, "Well, when I'm not with the spouse, they assume I'm with the lover, and when I'm not with the lover, they assume I'm with the spouse. Between the two, I'm able to get a lot of work done."

Neither of these is originally mine. I heard them over conference dinners more than a decade ago, so I'm not sure who deserves credit.

(comment bubbles) 3 comments

@Override Idiosyncrasies

Paul R. Brown @ 2008-11-20T07:07:08Z

Just to prove that you frequently learn something new about a language you're familiar with, I recently learned that the following will compile on JDK6:

interface I {
  void m();
}
class C implements I {
  @Override
  public m() {
  }
}

(It even compiles on JDK6 with -source 1.5, which seems like a bug under the circumstances, but no matter.)

I'm sure that this was discussed ad nauseum by the JSR-175 expert group and then subsequently when @Override behavior was overridden for JDK6, but this seems wrong if you ask me. (I'd argue that the JLSv3 concurs.) The @Override annotation, under the JDK5 interpretation, indicates the replacement piece of code in the superclass, along with all of its side-effects. Implementing a method on an interface does not change behavior and requires no more attention from the developer than an understanding of the contract that the interface represents. If anything, an @Implements annotation would have been a better choice than mucking up the @Override annotation to better align with the murky definition of overriding in the JLS.

To make things more confusing, the current JDK6 documentation is incorrect. The JDK6 API documentation says the same thing as the JDK5 documentation does, but JDK7 API documentation describes the JDK6 behavior.

(comment bubbles) 1 comment

Binding nxml-complete in Aquamacs Emacs

Paul R. Brown @ 2008-11-15T06:22:35Z

The folks who bundled up nXML mode for inclusion with Aquamacs Emacs did think to include the useful schemas bundled with nXML mode, e.g., for XSLT 1.0, but I can't figure out why they didn't bind nxml-complete (context-sensitive, schema-driven completion and suggestion) to a keystroke. (If memory serves, C-Return used to work.)

It's an easy fix, but I always forget just how to do it. As a reminder to myself or a hint to others, the fix is to add the following to ~/Library/Preferences/Aquamacs Emacs/:

(add-hook 'nxml-mode-hook
	  '(lambda ()
	     (define-key nxml-mode-map "\C-c\C-c"
	       'nxml-complete)))

My preference is for C-c C-c but yours may be different. In any case, that's about as blissful as editing XSLT gets.

(comment bubbles) 0 comments

Pseudoscorpions in the Mushrooms

Paul R. Brown @ 2008-11-13T08:13:55Z

I was cleaning up some Chanterelle mushrooms (bought from this guy) for dinner tonight when a tiny bug perched on one of the caps caught my attention. On closer inspection, it looked like a tiny scorpion barely a few millimeters long, sans tail. Considering its size, I was amused when it took an aggressive posture and waved its tiny claws at me as if to say "You want a piece of me?" Since we switched over to doing most of our non-meat shopping at the local farmer's market, I'm accustomed to finding insects and arachnids in our produce (sure beats eating poisoned food...), but this one was unlike anything else I'd run into. This picture (generously CC 2.0 by-nc-nd licensed by amanky on Flickr) gives a sense for the appearance and size:

Finger and Pseudoscorpion

It turns out that there are a whole order of these little arachnids called pseudoscorpions, and they're common in leaf litter (which is where the mushrooms grow), among other places. The thing that I think is oddest is that I spent a good portion of my childhood knocking around the Pacific Northwest backwoods and never noticed one before now.

Chanterelles

I tried to keep the little guy (or gal?) around in Kid#1's plastic bug jar, but by the time I was done cooking dinner, it had found its way out through one of the air holes. The mushrooms were delicious at any rate.

(comment bubbles) 1 comment

Random Slice of Fatherhood

Paul R. Brown @ 2008-10-29T04:50:29Z

Kid #1 has done a few interesting things lately.

After having trouble with waking up very upset and not able to explain herself on and off for the past several months, she's talked to me about a couple of her dreams:

  • A group of friendly giant spiders (the size of dogs) taught her to climb trees even if there are no branches close to the ground to grab onto.
  • A large cricket was poking people, but not in a mean way. She accidently broke one of its legs off while dancing around, but it still kept on poking people.

I had been thinking about getting a copy of The Phantom Tollbooth to read with her as a first bedtime story with a relatively small number of pictures (and because she'd appreciate the humor in it), but I don't want to inject any more surrealism into her three-year-old mind.

The other interesting thing is that she's apparently learning to read. I was doing some online banking, and she wandered over and asked me "Why does it say 'bank' up there?"; when I asked where, she pointed to the word "bank". This is not entirely surprising, since we play phonetic games at the dinner table and read to her (by her request) morning and night, but I wasn't expecting it to start happening. The downside is that the wife and I will have to come up with ways to obfuscate our conversations that don't involve spelling words.

(comment bubbles) 0 comments

All Posts contains 399 items in 57 pages of 7 items each:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57