Transparency

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

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

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

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

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?

Havoc Pennington’s essay on UI design

I just found this essay on UI design and am surprised I never read it before. Some of the stuff Havoc says rings particularly true, and also confirms the need for some of the ideas I have for Glade-3 (ideas which, I think, will push UI design into the user’s hands, and exploit the end-to-end principal in the world of graphical software development; this is only one of the key points–my ideas also have other implications that, I think, are good for Linux applications in general).

In my spare time, lately, I’ve been drafting out these ideas, and I think soon I’ll have them clear enough to send a “brainstorm announcement” to the glade-devel mailing list. God I wish I had more time for this stuff!

Computational consciousness

I’m working on this philosophy paper, and am having a bit of a brain struggle. The paper I read makes a very strong point for a model of consciousness that is computational (functional), so that, for example, it is conceivable that a sufficiently advanced computer (or group of computers) could replace the brain and serve the same role (i.e. I’d still have conscious experiences, etc.)… but this is very hard for me to accept at a “gut-reaction” level. Although it would be very easy for me to write a paper defending Dennett’s claim, I am going to have work through this to figure out what is wrong with it (I am convinced something is wrong with it).

A quote Dennett cited (attributed to Fodor) made me laugh out loud and receive stares in this quiet lounge: “If, in short, there is a community of computers living in my head, there had also better be somebody who is in charge; and, by God, it had better be me.”

I have to re-read, and re-read, and outline, and re-read, and maybe, eventually, write.

Laptop returns, cpufreq actually works

My Dad’s really awesome sometimes. In a previous post, I talked about how my laptop’s screen cracked due to a friend’s drunken behavior. Well, my Dad did me a favor and swapped the old HD out of my broken laptop and put it into the new one I got. So now I’m running Linux as if nothing broke.

Here’s another crazy thing… I thought my laptop didn’t have cpu frequency scaling support, but I was actually wrong. It’s just that I didn’t have all the kernel modules I needed loaded. It turns out I can scale the CPU on this laptop from 400mhz up to its max of 1.7Ghz! This is awesome because power consumption goes way down, laptop stays cooler, etc.

Plus, someone wrote an excellent piece of software to do this scaling automatically depending on load and remaining battery power. Temperature readings still come in as 0 degrees celsius, but I decided temp readouts are unnecessary anyway. The BIOS does a good job managing the fan. Yay new laptop! Back to work on my paper.

gob2: Building GObjects easily in C

I’ve been playing with a preprocessor called gob2, which I only recently discovered. I found it because I actually had the same exact idea as the author. I was reading the Gnome 2 Developer’s Guide, and realized that although GObjects are nice and handy when they are already coded (as in all the widgets in GTK), they are actually a pain in the ass to write from scratch. Tons of boilerplate code, tons of macros you need to code to keep yourself sane.

So, I thought, what if some code produced all this boilerplate code for me? Someone already had the idea. It’s called GOB (or gob2), the GObject builder. Check it out.

What’s so nice about it is that it tries to have the feel of Java or C#. So, check out this definition of a new GtkWidget which counts the number of clicks it receives. If you run gob2 gtk-button.gob, it will produce gtk-button.{c,h} with all the proper GObject boilerplate code you’ve come to expect coding by hand.

Much nicer than doing that from scratch.

What’s strange is that more GTK+ developers aren’t using this. On the gob2 mailing list, the author claims it is used in gnome-vfs, but doesn’t it seem like it should be used by a lot of developers? (Granted, it’s not as nice as using gtkmm/C++ I guess, but there are still people declaring objects in C out there).

On stupidity and drunken behavior

So, night before last I came home and hung out with some friends. We were a bit drunk, my roommate and Sak were fooling around and Sak slipped and fell on my bed. Problem was, my laptop was right underneath him, and so the LCD screen cracked. Bad, bad situation. Turns out repairing it would be more $$$ than the amount I paid for it in the first place, so I’m not really sure what to do on that front.

It’s a shame… I really was getting used to that laptop. I mean, I’ll probably just re-purchase the same one, but I dunno what’s gonna happen exactly.

In other news, I was playing with Glade 3 earlier today and decided that it really needs some work done on it. I would love to hack that project a bit if I had time. I mean, if someone can produce something like Gambas for Linux, then some sort of RAD tool for GTK is possible. I know the two aren’t really comparable (Glade uses libglade to dynamically load the GUI from XML files, Gambas is a “better VB”, i.e. a full environment), and that a lot of developers scoff at RAD tools for GTK, but I don’t think properly designed RAD tools are about “dumbing down UI design.” I think they are really about making UIs easier to design quickly, so that you can spend more time on the code that does stuff.

Also, I was checking out Mainsoft, with their product MainWin for J2EE. Interesting approach. They take Microsoft IL code and compile it to Java Bytecode. This means that for now, while Microsoft doesn’t support platforms other than Windows for .NET, you can actually convert take a .NET project and make it run in the JVM. I wonder if it works…