A Patriot Act

January 22nd, 2005

I watched Mark Crispin Miller’s “A Patriot Act” on DVD last night, per my Dad’s recommendation. Check out its website if you like.

Absolutely tremendous show. It basically paints the Republicans in the White House for what they are: religious zealots trying to merge the church and state. Even though this was performed before the election, watching it now, after, Bush has won, made me a bit depressed. I should be storming Washington right now.

New Years Resolution

December 31st, 2004

To upgrade this website to Movable Type, among other things.

Last-minute hacking with my version of Metacity, and I finally got what I wanted. Basically, I was using xfwm4 for window management, and since it is NETWM compliant, I was supposed to notice no difference at all in GNOME. Except that’s not true, since xfwm4 doesn’t know about gnome-panel, and since a lot of useful hotkeys I want to use in gnome-panel are generally bound in metacity. Plus, the gnome theme manager doesn’t work without metacity. So, shame on GNOME developers, basically. You claim you are compliant, but you aren’t.

But then I did some reading and figured out metacity is actually a bit better than xfwm4 anyway, just that some of its features are hidden in gconf and other places. Also, someone has coded a neat app called devil’s pie which lets you manager your windows at a very fine-grained level, which I like… though it is a bit buggy right now, it shows promise.

So, the main thing I was annoyed by is vertical/horizontal maximize. xfwm4 has this working fine, and I’m quite used to it. Metacity doesn’t treat it as a “toggle,” so if you hit maximize vertical button twice, you just sit there with a maximized window… it doesn’t switch back and forth. I find this annoying since when I have vim windows open, sometimes to see more I just quickly maximize vertical rather than scrolling down, and then toggle it back afterwards.

Someone coded a patch to this. You can find it on bugzilla here at Bug #113601. Unfortunately, no one has written a “proper patch” that also works with session management and such, but I don’t really care, I wanted this patch to get back to work. So, in order to jive with my Ubuntu system, I created some debs with the patched version of metacity.

more vim

December 19th, 2004

nonsense, but useful nonsense:

if you have tags working, cd into the directory with the tags and hit something like:

vim -t env_alloc

vim will automatically open to the file with that symbol. Nice.

Other nonsense:

:ab #d #define

vim abbreviations, make it so whenever you type #d it will be replaced by #define

you can actually execute a proper shell from vim, just use the :shell command.

finally, there is a “confirm” option for the substitute command, so:

%s/foo/bar/gc will globally replace foo with bar and confirm each replacement.

Finals: Phase I over

December 14th, 2004

Only two more to go.

In other news, my Averatec laptop almost broke again today when I had it on my lap and it almost fell off. I caught it last-second, but this damn laptop is so small that sometimes I don’t even realize how close it is to being off the edge of my lap!

The thing has been working better and better. I got a program called fvcool which can send the Averatec into “low-power mode”, which means that the CPU gets sent HLT instructions and “powersave signals” on idle. The result is that it runs a lot cooler and saves more battery power, but at the expense of “real-time” apps like movie playing and even some MP3 playing, so you can’t have it on all the time.

The only bad thing about this laptop is sadly a trivial thing: the paint job. We all know laptops (except the TiBook/AlBook) are made of plastic under the shiny silver finish, but we wish that that silver finish would never come off. However, Averatec apparently used cheap paint, and so there are “palm prints” under where my palms have rested near the keyboard, as well as already a couple of spots (on the corners of my laptop) where the paint has rubbed off just from getting in contact with things. Kinda sad, because high-quality paint isn’t exactly expensive. Regardless, I’ll just have to paint it myself (or have M help me)… it might be a bit of an ordeal, but I think it’s possible to do. I’d just have to figure out a smart way to cover the LCD, keyboard and touch pad… maybe I can get M’s help when I come to that juncture.

Maybe I’ll switch this laptop’s color to something a little less “blah” than silver–a really shiny black would be awesome, I think.
In addition, I fixed some of my nasty X issues, so now my machine doesn’t hard lock ever. So that’s good too.

Now I gotta get studying for Basic Algorithms… fun fun.

Retchmail

December 12th, 2004

So, ESR always talks about how fetchmail is the best UNIX program on the planet: well-written, standards-compliant, stable, etc.

That’s why I use it (with procmail) instead of downloading messages with something like evolution or thunderbird. Basically, evolution isn’t standards compliant and so it doesn’t deal with my mail server well, and thunderbird is ugly.

But evolution does let me use normal mail spools, which fetchmail and procmail can deliver to.

But fetchmail is annoying in some ways. For one, it stores passwords in clear text, in the /etc directory, and ESR thinks that’s good enough. If you don’t want to run daemon mode (like me), since I want to be able to quickly download the latest e-mail, that means plain text passwords in my home directory. I’ve written a shell script fetchmail wrapper that gets around this restriction so my password is never stored on my hard disk at all, but only passed from my keys to fetchmail directly, but what a pain, really (I wrote this a few weeks ago).

Now the other thing is that i have four mail accounts and it serializes access! Jesus! It doesn’t open up connections to each of my accounts, stick messages in some buffer and then write them to disk serially. Instead, it does wait-request-wait-request for each message of each account in order, and then at the end of a message download it actually delivers the message to procmail. So that means it takes me about 30 seconds to check mail on my four accounts, whereas it could take as long as my slowest account (pixelmonkey), which is about 10 seconds.

So, I just found it funny that someone got so fed up with this that they wrote retchmail. Here’s a quote, and a link:

quote:

Eric S. Raymond’s Fetchmail is a full-featured, robust, well-documented remote-mail retrieval and forwarding utility intended to be used over on-demand TCP/IP links (such as SLIP or PPP connections). It supports every remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP, KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6? and IPSEC.

Oh, you were asking about RETCHMAIL. Sorry.

RetchMail is the world’s most stupidly fast POP3 retriever.

It is almost completely unlike fetchmail: RetchMail lacks features, isn’t particularly robust (although it won’t delete a message until sendmail says it was delivered okay), has nearly no documentation, and is actually fast.

5. Is RetchMail standards-compliant?

Quick answer: HA HA HA HA HA HA no.

Just to be extra clear about this: yes, it is morally wrong for us to have written RetchMail, and it is morally wrong for you to use it. But try it, it’s really fast!


Heh, that’s open source; it’s all about choice. Here’s a link.

Transparency

December 11th, 2004

I read this on a Gentoo forum today about Alsa’s DMIX plugin:

quote:

I mean, why can’t they make a _transparent_ software mixer? Why must every software be “updated” and “configured” to support the software mixing thing? Why on Earth couldn’t they make a plugin that needs no attention from the actual software, but just lets the software open and open the sound device? Why must mplayer, arts and others _know_ about the dmix plugin and _select_ it? That is not transparent.

The guy is right on. This is one of Linux’s main problems. Although we have as a hacker tenet to never reinvent the wheel, we also have a shitload of libraries and ways of doing things, and sometimes it leads to this awful situation: where you want to get software mixing of audio to work, but it will only work if you enable a mixing plugin in each application.

Library, woe is me; at least vim has lots of plugins

December 6th, 2004

At the library for yet another full day, reading operating systems papers. This time, however, I kept getting really bored (can you blame me?), and I kept thinking about so many other things. They take so long to read, so much attention… I have so little to give. I don’t even have my laptop here, and I only spent the last 30 minutes on a computer.

This is my “break,” searching for vim plugins:

ZoomWin for maximizing a buffer temporarily, MiniBufferExplorer for switching buffers (Matt would probably like that one), Project Explorer for “favorite files”, ShowMarks for finding marks you set in a file, SearchComplete’s tab completion for searching (s/bla/bla2/g), cppcomplete for code completion (Matt says it rocks, like intellisense for C/C++/Java)…

I think I’ll actually install most of those (provided they work as advertised).

I think for C# programming all one needs to do is modify JavaBrowser and cppcomplete the recognize all of C#’s syntax, and we’d be all set C#-wise. Hell, maybe I’ll even do it next month.

Programming

December 4th, 2004

While programming today, I came up with some nice vim bindings. If you use vim, and want tags-powered “intellisense-like” stuff, use this. Also thrown in there are hotkeys for :Tlist (indispensible vim plugin) and saving quickly (I save often, so I like to have a single key in either normal or insert mode).


" intellisense - yea well close enough
noremap <F2> mz<C-w>1]
noremap <F3> <C-w>c`za
noremap <F4> <C-w>11_

" for insert mode, goes back to unmatched brace
" so it's good for function prototype lookups
inoremap <F2> <ESC>mz 999[(b<C-w>1]

" tlist hotkeys
noremap <F8> :Tlist<CR>
noremap <F9> :TlistUpdate<CR>

" save hotkey for normal and insert modes
noremap <F10> :w<CR>
inoremap <F10> <ESC>:w<CR>a

Algorithms and vim

December 4th, 2004

I spent about 5 hours today doing algorithm homework/studying. I like that class a little more now, even though some of it is a pain. Divide and conquer and dynamic programming actually are powerful concepts, once you get a feel for them.

Then I came back to my dorm, ate some food, and played with vim for literally 2 hours. I guess that was a waste of time, but I learned so much about this editor. Now I feel I can be twice as productive when I code. Especially with all the stuff I implemented for prototype previewing in my vimrc, and with all the support for ctags vim always had but I never used. Wow, this is one powerful programmer’s editor.

Matt has been telling me that I should use emacs with vi emulation (viper), and then I’ll get access to all that great emacs stuff. Maybe. I have nothing against it, except that emacs seems like an operating system unto itself. Eh, it doesn’t matter I guess, I just need to know one of the two well. They are both portable, and run on all major platforms.

The Human Computer

December 3rd, 2004

Computer scientists have a lot to learn and realize.

For one thing, computers aren’t the center of the universe. What may be an ideal for computer scientists may not be an ideal for normal people. And very often, computer scientists affect normal people because everyone uses computers (or at least, everyone will).

All these computers sit around on our desks, we only use a fraction of their power at any time. Right now, I am typing this blog entry, using less than 1% of my CPU’s power. Theoretically, it could be doing things–helpful things, things that will make my life easier. It could be doing smart analyses of what I’m writing and try to predict what I’m going to do next. It could be some sort of extension of my mind, helping me produce better work. Instead, it sits there idle, useless. Glorified typewriter.

There have been many innovations, but the “humanity” of computers has been lost. We shouldn’t be designing our lives around them… they should be designed around US. The way the human mind works needs to be complimented. I should not change my ways for the computer, except if in changing them it makes my life easier, less complicated, and makes me more powerful as a human being.

These should be enabling devices. They surely have the potential to be enabling devices. But right now, in many ways, they disable us. We are restricted by the rules programmers place on us. We live under a sort of “law of code” which Lawrence Lessig describes in his books. In addition, the gov’t and other groups seek ways to use computers to control people.

Computers need to become more like us, so that they can seem familiar, useful, but at the same time, a whole lot more powerful. What computers have that we don’t have is speed, time (CPU time), and infinite storage. What we have that computers don’t have is the ability to reason about our experiences in very flexible ways. Wrapping a computer’s speed and storage capabilities around our own flexible abilities as conscious beings would mean a very powerful harmony.

Why are we still talking about how to isolate faults, or make device driver subsystems better, when this human element is so sorely needed, and would be so well appreciated?