You are currently browsing the category archive for the 'Technical' category.
With the aid of a couple of helpful blogs (here and here), I have managed to get command-line email-sending capability via sendmail going, at least as long as I’m on UCSD campus:
$ sudo postfix start
$ sudo postconf -e myhostname=
$ sudo postconf -e relayhost=
And sendmail just works now! Pretty cool, eh?
UPDATE: it’s a bit tricky to get Bcc: effects with sendmail, but I’ve found a way to do it. Specify all the addresses that you want to receive an email as arguments of sendmail, and then include an explicit From: line in standard input. For example:
*** Filename: sendmail.test ***
To: Jane Doe
From: John Doe
Subject: bcc test
(put what you want here)
*** End file sendmail.test ***
$ sendmail abc@def.com vw@xyz.com < sendmail.test
Since switching from PC to Mac three years ago, probably the single most annoying user-interface feature on Mac has been the loss of flexibility in using Tab and Shift+Tab to move focus: to buttons and menus in web browsers, and between buttons in pop-up dialogue windows.
Thanks to Tony Spencer, I am now able to do this! It’s a simple setting: in System Preferences, select Keyboard & Mouse > Keyboard Shortcuts. At the bottom of the window there will be a button for changing Full Keyboard Access from Text boxes and lists only to All controls. Selecting the latter will give you full flexibility of changing focus with Tab and Shift+Tab.
One other crucial tidbit: on pop-up windows, when you have moved focus to a non-default button, in order to select that button you need to press Space rather than Return/Enter.
Amazing that it took me three years to figure this out…!
I’m using the Papers program for the first time, on a 30-day trial basis. It seems like one of those programs whose benefits aren’t totally obvious until you really have been using it for a little while. The problem for me has generally not been having papers scattered on my hard drive — I already have a “papers” directory for this — but rather things like multiple copies and, most crucially, BibTeX export. I’m banking on BibTeX export saving me enough time to make Papers worth it for that feature alone. Some thoughts:
- Computational linguistics conference proceedings papers should be obtained through the ACM repository
- Psycholinguistics journal articles work well through Google Scholar.
- JSTOR doesn’t work yet
- The journal Language can be obtained through Project MUSE.
- I prefer Skim to Preview for PDF reading. Cmd-Alt-O will open the currently displayed paper in Skim.
I’ve decided that the best get-started tutorial for WinBUGS is this one:
http://mathstat.helsinki.fi/openbugs/data/Docu/Tutorial.html
Also, kudos to Yarden Katz for publishing a webpage on how to use WinBUGS under Darwine on OS X:
http://web.mit.edu/yarden/www/bayes.html
(of course, I am actually using JAGS for most things these days.)
I’m learning how to use JAGS for a variety of hierarchical Bayesian models. I had a bit of trouble figuring out how to install it on my Debian (etch) server, so I thought I would share how I got it to work (thanks to Brian Ripley and Martyn Plummer for suggestions):
# 1. configure and install JAGS
./configure --with-jags-modules=/usr/local/lib/JAGS/modules --libdir=/usr/local/lib64
make
make check
sudo make install
# 2. install rjags
sudo R --with-jags-modules=/usr/local/lib/JAGS/modules/ CMD INSTALL rjags_1.0.3-4.tar.gz
And this worked. Critical was to make sure that the JAGS .so files wind up in /usr/local/lib64.
I downloaded iPhone 2.0 onto my first-generation iPhone yesterday. I seem to have avoided some of the hiccups that others complained about. I’ve only had time to explore the new iPhone a bit, but my top 3 impressions:
- Zenbe lists are pretty cool, and fill the function gap left by the fact that iCal doesn’t have to-do lists on the iPhone.
- iCal now has multiple calendars. Hooray!
- Camera now says “Camera would like to use your current location” — yech. Has iPhone been geotagging my pictures? I don’t want this. At least I can say “no” now, but it’d be nice to be able to turn this off by default.
I’ve found that xzgv is pretty nice!
I’ve said before how much I like the streamlined browser Skim. One of the best parts is that it will auto-reload PDFs that change on disk (e.g., when you recompile a LaTeX document into a PDF). I just found out how to make it even better, so that Skim never asks you whether to reload, it just does it automatically:
$ defaults write -app Skim SKAutoReloadFileUpdate -boolean true
Voila!
For a long time I have been unsuccessful at using the crossref field in BibTeX properly for the situations where I need it most: when I have multiple chapters in an book consisting of an edited collection of articles in my database, and I want to provide book-level information through a cross-reference. I always got the error
Warning--empty booktitle in <your_favorite_key_here>
which was rather frustrating.
However, I’ve finally figured out that for a book or proceedings, you need to specify both title and booktitle fields in the book entry. Most of the time the contents of these fields will be identical. Looking back at the Guide to LaTeX, this is a no-brainer, but it stumped me for a very long time. May this blog post save you similar agony!
Read about it at http://www.macosxhints.com/article.php?story=20060825072451882.
After much searching I have finally found how to use BUGS (Bayesian Inference using Gibbs Sampling) on OS X. Thanks to Tom Palmer for this document, which explains how in a few easy steps.
Instructions taken from here:
- Click to select one of the files for which you’d like to change the associated default application
- Press Command+I to open the Get Info window
- Under Open with select the application you’d like to use
- Under Use this application to open all documents like this click on Change All… and follow the prompts
One cool thing I just found out is that emacs has version control integration. Most things are bound to C-x v <key>. Some useful commands:
- C-x v i: add
- C-x v v: commit (followed by C-c C-c once you’ve written your comment)
- C-x v l: view log
- C-x v =: view diff with repository version
A more complete list can be found here.
I’m pretty psyched about my iPhone but there are a few simple things that would really improve it. Here’s a running list:
- A functioning To-Do list. I’ve been using Toodledo as a web-based to-do list, but it’s not the same thing as having on your phone.
The ability to send text messages to multiple recipients at once.- Improvements to the Calendar functionality:
- Ability to customize event recurrence as in the OS X iCal application.
- Ability to distinguish among multiple calendars, as in iCal as well.
- A search function for email
UPDATE: as of mid-January 2008, we can now send text messages to multiple recipients. Good for Apple!
Apart from R, I do most of my research programming in Java. There are two major reasons for this:
- The Stanford NLP lab group I was in during grad school programmed in Java, and old habits die hard.
- Java has some very nice IDEs — IntelliJ and Eclipse.
One thing that bugs me a lot about Java, though, is all the type casting that you need to do. I got very excited when Java 5 introduced generics, and I use them so much that I need few casts in my programs. But then I got exposed to Ocaml and type inference. What a language! What a feature! It is the closest thing I’ve ever seen to being able to say that if your program will compile, then it will work properly.
With the right IDE available, I would give up Java and adopt Ocaml right now — (1) above I can deal with, but (2) is hard to leave behind. Sadly, no language with type inference seems to have a functioning IDE with the same power of IntelliJ or Eclipse. Anyone out there reading this blog who feels inspired, go and work on Eclipse integration for Ocaml! Here is the list of critical IDE features I’d want, in order of importance:
- Safe rename
- Safe move
- Auto extraction of functions/expressions
- Quick navigating to types (or functions, modules, etc. in Ocaml)
- Outline views
- Integration with debugger/output (e.g., cross-referencing of error messages to code lines across windows)
- Auto-generation of code—we’d need a lot less of this in Ocaml or the like.
The best prospect right now may be ODT…
I write almost everything in LaTeX. In Windows I generally previewed the output as Postscript using Ghostview, but OS X is much more PDF-oriented. I’ve found this terrific little PDF viewer called Skim, which I like more than anything else for LaTeX output. The key reason is that it will automatically reload the PDF file any time it changes on disc. That means you can work with just two or three windows — the text editor, Skim, and maybe a terminal window — and always have a pretty up-to-date view of your document.
Better yet, you can automatically switch focus from a terminal window to Skim with Applescript:
osascript -e ‘tell application “Skim” to activate’
This means you can construct a shell script that automatically compiles your LaTeX document into PDF and then shifts into Skim so that you’re looking at a freshly updated version. Pretty sweet! The only thing left is to figure out how to bind this set of commands correctly into Emacs…
I just learned about flyspell for on-the-fly spell checking in LaTeX. It’s not perfect, but still pretty sweet!
One of those “howdoI”s I come across all the time is how to manipulate PDF files, e.g. concatenate several, from the command line without too much pain. The best tool I’ve found so far is Pdftk. My favorite command is concatenating several PDFs together:
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf
For a while I had been living without color-coding in my OS X X11 xterm windows to distinguish directories from executable files from other files. A bit of playing around got me color-coding back, though. Try the following in your .bashrc:
# color
export TERM=xterm-color
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
