Wednesday, March 05, 2008

Vim-LaTeX, Vim 7.0, and the filetype plugin

Have you noticed that Vim-LaTeX sometimes does not automatically load when you open up a new .tex file?

If you're using Vim-LaTeX with Vim 7 or higher, you may want make sure you have this somewhere in your .vimrc:
" Prevents Vim 7.0 from setting filetype to 'plaintex'
let g:tex_flavor='latex'
Otherwise, some of your .tex files will not automatically kick off vim-latex on opening! In particular, vim-latex is usually only loaded if Vim finds a \documentclass, \begin, or \usepackage in the first 1000 uncommented lines of a .tex file. This change forces it to load for all .tex files.

So, if you're having problems getting Vim-LaTeX to load when Vim opens a .tex file, try making that change (as well as all of the filetype plugin changes to your .vimrc that are documented).

Some alternative solutions:
  • ALTERNATIVE 1: If you don't want to make that change, you can add
    %&latex
    to the top of any .tex file that you want to force to load vim-latex. That is, Vim will still default to using the plaintex flavor unless it sees that comment or commands like \documentclass, \begin, or \usepackage.

  • ALTERNATIVE 2: You can actually add
    % vim: filetype=tex
    OR
    % vim: ft=tex
    to ANY file to force vim-latex to load. (note: you may need to have the modeline option turned on in Vim for this to work)

  • ALTERNATIVE 3: While editing ANY file, you can execute the Vim command (in command mode):
    :set filetype=tex
    OR
    :set ft=tex
    to load vim-latex at that instant.
This post was updated on August 7, 2008.

Friday, February 22, 2008

Get Your Head Around my Blue Morning

Recent NPR Song of the Day tracks for you:

You can stream them from NPR's site (which is linked from each song). I've sent Pandora an e-mail suggesting that they add the songs to their database. On that note, I always get a personal response from one of the people at Pandora whenever I send them a song suggestion. I think that's pretty cool.

Sunday, February 10, 2008

Showing your Grandview Colors...

Outside the Window at Stauf's, a white car was pulled over by a Grandview cop. The white car pulled over near a light, so the cop car stopped in the middle of the intersection. After about five minutes, the cop came out and walked toward the car. A black female was driving the car. After a few minutes of talking to the woman, they asked her to come out of the car, put cuffs on her, and put her in the cop car. She cooperated. No struggle. No argument. No violence.

By this time, two other cop cars had arrived. You can see all three of them in this picture (click for larger).
Here's a zoomed in version that shows the cop car blocking the intersection... (click for larger)
Eventually, the passenger (a black male) moved into the driver's seat, and another cop came and talked to him. After many minutes of talking to him, they asked the black male to get out of the car, and they frisked him (in 14 degree Fahrenheit weather). Eventually they let him get back into the car, but he had to get back into the passenger seat. Evidently, they didn't think he'd be going anywhere anytime soon.

During this whole time, a black child with a little red hat with a light blue winter jacket bounced around in the back seat, trying to figure out what was going on with the adults in the car.

During this whole event, two Stauf's regulars behind me recollected on how the Grandview cops only pull over "ratty cars" and "cars with black people in them". The word "profiling" was used.

Traffic has started to form behind the cop car blocking the intersection.

It'll be interesting to see how long this lasts. Good thing there are three police cars, at least two of which carry multiple police officers.

Like reading my horoscope...

In a comment on a previous post, I got a complaint that all of my new posts are about computer stuff only. Evidently, I'm much more entertaining when I talk about life.

A little after I left my job in Austin to start grad school, my boss left his job to go to grad school. His most recent post really resonates with me. As a bonus, Clay was always more entertaining than me, so I figured forwarding "you all" to his post would be even better than me taking the time to report on life in general.
From Clay's post:
Sundays are tough at the Menlo Park outpost of the Daigle/Box family. The psychology of it all is as follows: LL takes Sundays pretty badly because it means the weekend is almost over. So she regrets how, yet again, we failed to do anything fun or get any skinnier. For example, last night (which was a Saturday), she wanted to go see a movie, but instead we stayed home and ordered Chinese food, which accomplished neither the fun nor skinny parts of her goals. It is also on Sundays that LL notices the apartment isn't tidy and sometimes that can compound the feelings of not getting stuff done.

I on the other hand, don't mind Sundays that much. My low point actually comes on Friday when, yet again, I feel like I didn't make very much progress that week on school or research or whatever else.
(...continues...)

So, go read about Clay and LL's "Furniture repair!".

Friday, February 08, 2008

I've finally done it...

After 15 years, I've finally done it.

I've put set -o vi into my profile.

(Sam Cooke's "A Change Is Gonna Come," performed by James Taylor as in the West Wing episode, plays in the background)

Sunday, January 27, 2008

MacAlly ICEKey and IOGear MiniView KVM Switch

Unfortunately, the MacAlly ICEKey USB Slim Keyboard and the IOGear MiniView Micro USB Plus (GCS632U) KVMP switch cannot work together to give you the full functionality of the keyboard.

If you want to use this keyboard with this switch, you have to live with the fact that your volume and eject keys will never work on the keyboard.

There is a method of emulating the special keys using combinations like pressing and releasing "control" and then pressing and releasing "1".

Interestingly enough, the MacAlly iKeySlim keyboard works great with this KVMP switch. Additionally, while the ICEKey requires driver installation, the iKeySlim does not.

So, there you have it. You've been warned.

NOTE: You may have some luck with this tip I found on macosxhints, but I didn't. Let me know if you get something figured out.

Monday, January 14, 2008

Geek Squad sucks

UPDATE: On January 14, I received a response:
Who sent this to me from info@geeksquadcentral.com?

Thank you!

Sara Yanari
Agent 191
Mission Specialist
Geek Squad Operations - Corporate
Agent191@geeksquad.com
Cell: (612) 919-4855/Office: (612) 291-9689

"Serving the Public, Policing Technology, and Protecting the World"

Want to know more about Geek Squad? Or keep up on the latest info?
Geek Squad Photo Blog: http://www.flickr.com/groups/geeksquad/
Idea Festival: http://www.geeksquad.com/ideafestival
Squad Cast: http://forums....squadcast

There are two possible reasons for this response:
  • "Agent 191" doesn't understand "Reply-To" and delegating of support messages.
  • "Agent 191" might think that my message was some internal joke played on her by other people at Geek Squad.
Either way, "Agent 191" looks a bit like an idiot or an ass (or both). When you see those Geek Squad commercials, these are the people you're dealing with.

I sent a snarky response back (one to info, and one to Agent 191 directly), but I haven't received anything else. So, now when I teach classes to my young engineers, I refer to "Geek Squad" where I used to say "lay people." Snap! (or something)

An e-mail I just sent to Geek squad:
Subject: Complaint: Packaging information of CAT-6 crossover cable

"Geek" squad --

     I purchased a CAT-6 crossover cable of yours yesterday. The packaging surprised me. You advertise yourselves as some sort of elite group of geeks, but the printing on the packaging makes me wonder if any of you know anything about technology at all.

     There are several examples on the front of the package, but one sentence in particular is especially troubling:

"Your geek squad network crossover cable uses an RJ45 connection allowing you to connect between similar types of equipment without the use of a hub; one PC to another PC for example."


     The difference between a crossover cable and a standard patch cable has nothing to do with the "RJ45 connection." For one, both cables use a type-45 "registered jack (RJ)". "RJ45" describes the PHYSICAL connector. That is, it describes the PLASTIC end that mechanically snaps into place when the male version is inserted into the female version.

     The difference between a crossover cable and a standard patch cable is the 8P8C (i.e., "8 position 8 contact") termination type. A patch cable has a T568A termination at one end and a T568B termination at the other end.

     It would be wise for you to change the wording to something like:

"Your geek squad network crossover cable uses an T568A-to-T568B termination allowing you to connect between similar types of equipment without the use of a hub; one PC to another PC for example."
Otherwise, it just simply doesn't look like you know what you're doing.

     When I picked up the cable and saw the text above, I was seriously worried that it would have the 500 MHz bandwidth I needed. Unfortunately, because it was the only one available and I didn't want to terminate my own and risk the crosstalk, I had to buy your expensive cable. My computers came up with gigabit link, so I'm guessing things are fine, but I wonder what I'd find if I walked down the hall and tested these things on a network analyzer.

     Clean up your act, Geek squad.

     Thanks for your understanding --
     Ted Pavlic
A bit much? (yes, I realize there's a typo... I said "patch" once where I clearly meant "crossover")

Sunday, December 30, 2007

File Associations and PATH with MacVim

UPDATE: The newest release of MacVim has a preference pane that lets you "Launch Vim processes in a login shell." If turned on, it should solve the PATH problem suffered by some Vim users.
If you use Vim for OS X or the nascent MacVim, you may have noticed that
  • your PATH is not set correctly (i.e., compilations fail) and
  • Vim is not associated with all of your text files (i.e., it doesn't show up in the "Open With" context menu)
A while ago, I realized that the gvim.app available for download from the OS X Vim site had the potential to solve both of these problems, and so I hacked it to produce:
  • gvim.app (for Vim for OS X) and
  • mvim.app (for MacVim; maybe unneeded if "Launch ... login shell" preference turned on)
To install one of these files, download the archive, unzip it, and move the application into your /Applications folder. If you start Vim from that application, it will open as usual but will have the PATH set as if you were in the Terminal (i.e., it executes a bash login before exec'ing Vim). You should also notice that the new launcher application shows up in your "Open With" menus. Finally, if you put the launcher in your Dock, you can use it to generate new Vim windows, even if Vim is already open.

Saturday, December 29, 2007

PDFSync Inverse Searches in MacVim

Remember the post on doing inverse searches in Vim on OS X? The idea was to drop gvim-pdfsync into
/usr/local/bin
(or somewhere else in your PATH) and then execute
gvim-pdfsync "%file" %line
to do inverse searches in Vim for OS X just like you can in Windows or in other UNIXes. For example, in Skim, under the PDFSync section of the Sync tab of the Preferences, you can put
Preset: Custom
Command: gvim-pdfsync
Arguments: "%file" %line

For MacVim

I thought it might be nice if I published how to do the same thing in the nascent MacVim, which supports servers just like Vim for Windows. Provided that you've installed the mvim shell script somewhere in your PATH, you can setup Skim with
Preset: Custom
Command: mvim
Arguments: --remote-tab-silent +":%line;foldo!" "%file"

or, if you don't like tabs
Preset: Custom
Command: mvim
Arguments: --remote-silent +":%line;foldo!" "%file"

Retro-Approach

Alternatively, if you really liked the gvim-pdfsync approach and want something similar for mvim, put mvimtab-pdfsync or (if you don't like tabs) mvim-pdfsync in your PATH (e.g., in /usr/local/bin) and then setup Skim for:
Preset: Custom
Command: mvimtab-pdfsync
Arguments: "%file" %line

or (if you used mvim-pdfsync)
Preset: Custom
Command: mvim-pdfsync
Arguments: "%file" %line
I hope that helps.

Sunday, November 18, 2007

Frum rhymes with Doom

On the November 15, 2007 episode of Marketplace, they aired a commentary called "Learn a Lesson from the Dark Ages" by conservative demagogue David Frum. I couldn't help but send a response.
This correspondence is regarding "Learn a lesson from the Dark Ages" by David Frum, which aired on Thursday, November 15, 2007.

The argument offered by Mr. Frum is called the "environment Kuznets hypothesis," which is an application of the classic Kuznets hypothesis to conservation. The "environmental Kuznets curve" is a "U"-shaped curve on a plane with conservation on the vertical axis and economic growth on the horizontal axis. That is, with economic growth, conservation decreases until some critical point and then increases.

It's interesting that Mr. Frum uses the Kuznets hypothesis to argue that our salvation comes from focussing on globalization. In fact, the Kuznets hypothesis only matches observational data when looking locally. In developed countries, we do see that economic growth leads to cleaner air and water and increased conservation; rich people embrace their local nature. Unfortunately, the conservation of developed countries comes at the cost of the destruction of the rest of the world. Global energy use and human population growth is still on the rise and global conservation is still falling. Additionally, every species we drive to extinction is lost permanently, so it's hard to imagine that the global conservation-growth curve can ever slope upward.

I worry that Mr. Frum's optimism is not simply outdated but is dangerous. I encourage him to consider taking a more conservative approach to the environment.

In retrospect, I could have said "which erred on ..." instead of "which aired on ...," but I would never want to be accused of sounding snarky...