Saturday, May 28, 2005

Dehighlighting Vim

Although I'm a big fan of the one True Editor , I frequently use a version of vi for editing small files. The vi editor that comes with Fedora is an "enhanced" version of vim. (Don't worry about what the acronyms mean, I gave up a long time ago.) vim has some useful features that go above and beyond vi. For example, vim supports context sensitive syntax highlighting. Thus, if I edit the prototype Fortran program, using

$ vi hello.f

My xterm window comes up looking like this:

      program hello
      write(*,*) 'Hello World!'
      stop ' Goodbye'
      end

with keywords highlighted. This behavior is default in Fedora, but you can select it by creating (or editing) the file .vimrc in your home directory to include the line

syntax on

This is a good thing. However, there's also an annoying thing in the default Fedora Core setup of vim. I've resently been editing a file with a lot of numbers which include exponents. One way to search for these numbers is to search for the exponent symbol, "E". In that case vim gives you something like this:

  0.102332848348E+01
  0.264530189469E+00
 -0.403958800217E+01
  0.648883753760E+02
 -0.182200684198E+03
  0.881612131102E+00
 -0.106720017820E+01
 -0.117890618863E+01
  0.286257745413E+02
  0.871945343502E-02
 -0.214399839048E-01
  0.295824532165E+01
 -0.272516080977E+01

Actually, it's more annoying than that. The E is actually highlighted with a yellow background, but I didn't want to figure out how to show that right now.

This annoying behavior can be corrected by adding:

set nohlsearch

to the .vimrc file.

One more thing: I usually prefer case-insensitive searches, so that searching for "bob" matches "Bob" and "BOB" as well. That requires the line:

set ignorecase

There's a lot more you can do with .vimrc. Here's a sample. I'm satisfied with these simple tweaks, however.

Wednesday, May 25, 2005

You Think?

From our Obvious File, courtesy of the Washington Post:

Bush Expected to Push for a Conservative

Someone needs to go up to the editor: "Son, Dog Bites Man isn't News. Man Bites Dog, now that's News."

Computer Security Might Hit Home

If you don't secure your computer, it just might be that ISP will secure it for you. They won't be subtle, they'll just cut off your Internet access. So be careful out there, fellow computer users, and check your systems for viruses and spyware on a regular basis.

Monday, May 23, 2005

There Oughta Be a Law

From time to time you've probably heard about weird laws on the books in some jurisdictions. For example, under that link you'll find a Kansas law, towit:

* Prohibits shooting rabbits from a motorboat.

Maybe there was once a similar law in Georgia?

Anyway, the Washington Post (register or use BugMeNot) has a story on some of the rather weird laws on the books in the US.

Tuesday, May 17, 2005

Securing Your Windows Machine

IMHO, the best way to secure a computer running Windows is to back up all your data, rip out Windows, and install Linux. But that's just MHO. If you have, or want, to run Windows, the Washington Post has a Flash presentation on securing your machine. It's long, it's tedious, it's helpful. Included are:

  • Running anti-virus software
  • Using a firewall
  • Detecting and removing spyware
  • Using Windows Update

And finally, remember to update Firefox.

Sunday, May 15, 2005

Class and Mobility

The New York Times (sell-your-soul registration required, or see http://www.bugmenot.com/), today begins a series on Class in America. I haven't even finished part one yet, but, as every good blogger should, I'll start commenting anyway:

  • An interesting tidbit in the sidebar is Where do you fit in?. Enter your job, education, income, and wealth, and the Times will tell you where you fit in each category. It doesn't, unfortunately, tell you what those four numbers add up to. I mean, am I supposed to hobnob with the people on Martha's Vinyard and send my kids to Princeton, or must I shop exclusively at WalMart and drive Chevy Blazers? Enquiring minds want to know.
  • The paper makes a big deal of social mobility decreasing in this country. However, from the graphics, it's obvious that we are still pretty mobile, and that, while the rich tend to stay rich, the poor aren't bound to remain poor. Note: this graph only marks changes over a ten-year period, 1988 to 1998, so it's not really telling you anything about how your children might do. However,
  • there's also a graphic showing upward mobility of the poor over several generations, for different countries (keep clicking the NEXT button on the last link until you find it. The US trails socialistic Denmark, not as socialistic Canada, and trade-union dominated France, but is head of that traditional class-bound society, the UK. Oddly, the difference is most marked in the first generation. By the fourth generation, it's pretty much evens out.

I guess the Blogger's Oath requires me to draw a conclusion, so here goes: we're not as bad off as the article's lead paragraphs suggest. (I may change that opinion after I read more.) Certainly, the people I've talked to, even on my last trip, don't seem to be any worse off than they were, say, 10-20 years ago, and while you hear them complain, the complaints aren't any worse than they've ever been. Now, I do know some people who used to work for Enron, and they're worse off, but that's a specific case.

So, as I noted before, when people don't think they are hurting economically, they turn to social issues. Which, in the heartland, at least, means more conservative issues. Think about it: Democrats keep telling you you're worse off, but you don't really think so. Republicans keep telling you that things are going to get even better, and, in the mean time, we're going to fix things so this country works like it did in that mythical time when all (OK, all non-immigrant whites) were as happy as the Munchkins after the Witch got a house upside her head. Which way do you think people will vote?

Which means, of course, that the Dems need to change message. I, myself, would start with things like the new Real ID act, the parts of the Patriot Act which say that your library records are open to the government without any special notice, and other privacy issues. But that's just me.

Thursday, May 12, 2005

HG2G Clips

I still haven't seen Hitchhiker's Guide to the Galaxy, but ComingSoon.net has various clips from the movie, and Guide entries that aren't in the movie, including one on "the 21st Century equivalent of hanging around railway stations writing pissy but erudite descriptions of the passing trains." Hmm. Can't imagine what that is.

Oh yes, there's also the So Long and Thanks For All the Fish opening, and a Zaphod Beeblebrox campaign video.

Wednesday, May 11, 2005

Making a Linux Computer Talk

I'm back from the trip. I've got a lot of topics I want to post, but first, today I read an article from this month's issue of Linux Gazette (.net), titled, Shelling your Linux box with Festival, which tells you about a Linux speech synthesis program, Festival.

The article has some neat tricks, such as having your computer read the headlines from the BBC News Feed.

However, what I want to talk about isn't in the article. What I want to do is to create a greeting which can be heard online, such as this one.

It's not too hard. In the Festival distribution is a program called text2wav, which seems to create .wav files. Anyway, this works:

$ echo "Please reed Linux and Things" | text2wav > plsrd.wav

where we have to say "reed" rather than "read", since Festival wants to put the latter in the past tense.

OK, that's a .wav file, which is 66498 bytes. I can compress it into an MP3 file using the MP3-enabled version of sox:

$ sox plsrd.wav plsrd.mp3

which comes in at 6588 bytes. Of course, I should use a politically correct format such as Ogg, but this way more of you can hear the voice.

Festival has other tricks, including a British accent, but I haven't figured out how to use them yet.

Monday, May 09, 2005

Fedora Core 3 FAQ

Hey! A real Linux post!

Here's the link for the Unofficial Fedora FAQ (http://www.fedorafaq.org/).

We now return to our regularly scheduled mishmash.

Wednesday, May 04, 2005

In the Land of the Purple People

Well, as promised, I'm spending the week in Manhattan, Kansas, home of Kansas State University, the Kansas State Wildcats, and Purple Pride, which came well before the Minnesota version.

I haven't been able to post because a hotel reservation mixup knocked me out of the connected world, but tonight I've got a chance to hook up and type. It's been a good trip, so far. The natives are friendly, even though I'm usually wearing my jacket with a small Jayhawk patch. I've walked through Aggieville and lived (though I didn't try this during happy hour). I've made some good contacts here at the department, so we may have collaborations in the future.

Outside the University district, Manhattan is your typical mid-size Kansas town. In the center is a park, which for some reason is only named "City Park". It's not as big as its NYC counterpart, but it does have picnic areas, a swimming pool, baseball fields, lots of grass, and plenty of sleeping Eds and Co-Eds. The area around Manhattan, which is in the heart of the Flint Hills, is green and beautiful. (It's always beautiful, just not always green). It's not Oz, but it's closer to Oz than to the description of Kansas in the Oz books.

I'll be here a few more days, then back to Holyrood, then home. More posts whenever I get time and Internet. Y'all write now, hear?