Thursday, December 25, 2008

BibTeX Bibliography Style File (BST) for Engineering Applications of Artificial Intelligence (EAAI)

The Elsevier journal Engineering Applications of Artificial Intelligence suggests that authors use the elsart-harv.bst BibTeX bibliography style (BST) file to match its Harvard-style author-year reference format. However, elsart-harv.bst does not match the conventions used in EAAI proofs. In particular,
  • EAAI proofs use "Thesis" (instead of "thesis")
  • EAAI proofs surround the volume of an "in proceedings" entry with commas (instead of periods)
  • EAAI proofs use "vol." (instead of "Vol.")
  • EAAI proofs don't put any space between abbreviated parts of author names (but they do keep the hyphens in hyphenated abbreviations)
So I modified elsart-harv.bst to match EAAI conventions. My modified form is: To use it, just download it, place it in the same directory as your compuscript, and change your
\bibliographystyle{elsart-harv}
line to
\bibliographystyle{elsart-harv-EAAI}
Of course, elsart-harv-EAAI.bst is still natbib compatible.

[ NOTE: More-advanced users may prefer my elsart-harv-EAAI.patch. ]

Tuesday, December 23, 2008

Our 2008 solstice photoset on Flickr

Check out our Solstice 2008 photoset on Flickr. There are a lot of nice shots of Fritz:
Isn't Fritz cute?
Including a video or two, like this one:
That's one cute dog.

Thursday, December 11, 2008

Making MacVim work with Vimperator's external editor feature

Because I'm a vim user, it's naturally for me to use vimperator on top of Firefox.

Today I posted a tip on vimperator.org that helps me use Vimperator on my MacOS system. I'm reposting that tip here.

To make a long story short, try an editor setting like
:set editor='bash -lc "mvim -f \$*" mvim '
or (if you prefer gvim)
:set editor='bash -lc "gvim -f \$*" gvim '
Then you should be able to hit CNTRL+I to launch an external editor for textareas. There are simpler solutions and explanations below.



Shelling out to external commands is hairier in OS X than it is on other platforms.

In my case, I use MacVim, which includes a script mvim that can be called as
mvim -f ...
so that the script will wait for the GUI to exit before it exits. This functionality is identical to the gvim found with other Vim distributions (including older Vim distros for OS X).

My mvim script is in /usr/local/bin. Unfortunately, the PATH environment variable that sits behind user processes has to be set in an special ~/.MacOSX/environment.plist file, and the default PATH does not include /usr/local/bin. If you don't believe me, try
:!env
As you can see, those environment variables are very different from the ones you'd expect in a "login shell." You could go add an appropriate environment.plist file to match your login shell, but then you'll have to keep it up-to-date after every change to your shell profile. As a consequence, it's probably a good idea to
:set shcf='-lc'
Then you'll notice that :!env gives you more expected results. However, Vimperator won't run the editor unless it can find it in what Firefox thinks is the PATH, and so shcf won't help you.

A simple solution is to
:set editor='/usr/local/bin/mvim -f'
For most people, this solution will be perfect. However, some will notice that their favorite utilities (e.g., /opt/local/bin/par or /sw/bin/aspell) will not be accessible in the editor (unless the environment.plist file is modified).

So the final solution is to use bash as your external editor, and have it operate as a login shell that calls your editor of choice.
:set editor='bash -lc "mvim -f \$*" mvim '
Here, bash calls mvim and passes "mvim" as $0 and everything following bash as $1, $2, and so on...

Make Vimperator's "Y"ank behave like Edit-Copy

Because I'm a vim user, it's natural for me to use vimperator on top of Firefox.

Today I posted a tip on vimperator.org that is derived from a suggestion someone else made on the vimperator mailing list. I'm reposting that tip here.

Vimperator has no choice but to copy selected text using the functions provided to JavaScript by Firefox. Unfortunately, these functions sometimes do not provide the expected behavior for certain types of lists, PRE environments, etc.

To make sure that "Y"anking results in the same thing as using Edit->Copy, add the following to your .vimperatorrc:
js <<EOF
mappings.addUserMap([modes.NORMAL], ["Y"],
"Yank the currently selected text",
function () {
buffer.getCurrentWord();
events.feedkeys("<C-v>" +
(/^Mac/.test(navigator.platform) ?
"<M-c>"
: "<C-c>"), true);
setTimeout( function () {
liberator.echo("Yanked "
+ util.readFromClipboard(),
commandline.FORCE_SINGLELINE);
}, 20 );
});
EOF
The code should work well on all platforms (even the Mac, with its "M" key). If it isn't working perfect for you, increase that final "20" until the behavior works how you'd like it.

Monday, December 08, 2008