Archive for the ‘english’ Category

eliminate mouse wheel clicks

July 14th, 2007

As much as the mouse wheel was a good idea, making it a clickable button was a *bad* idea. The mouse wheel is more sensitive than the left and right buttons, and it has too many jobs. Newer mice also do horizontal scrolling, which makes it even more flexible. Pushing down the mouse wheel to click has always been uncomfortable, for the simple reason that it *moves* in other directions beside down, it's not static.

When the mouse wheel was introduced, it was de facto a third button, and so the "natural thing" was to just make it that, adding to the scrolling functionality. Of course, the old Unix standard of mice also had three buttons, so that fits.

This button is important, because it's the Unix paste button, you use it all the time. In addition, Firefox made it its own, for opening links in tabs and for closing tabs. It has always bugged me that I had to use the mouse wheel button for that. Not enough to actually do something about it, but enough to bother me. :lazy:

So today I got the Logitech MX 400, where the mouse wheel button is actually harder to press in, and I decided to finally fix the problem. So here's what you do.

First you should know how many buttons your mouse has. You count every button, you also count scrolling (back, and forth, each count as a button). For example, my mouse has 9; the front two, a mouse wheel with 4 directions of scrolling, the mouse wheel button, and two side buttons. If you have some extra side buttons to use, you can use one of these as the paste button.

But you need to know which is which. Here's how:

$ xev

ButtonRelease event, serial 29, synthetic NO, window 0x2c00001,
root 0x61, subw 0x0, time 8209381, (102,133), root:(946,186),
state 0x100, button 1, same_screen YES

Here I started up xev, which brings up a little window. It prints lots of output about mouse and keyboard activity. When I move the pointer into the window and click, I get a piece of output like the above. Here I clicked the left front button, which is called button 1. In the same way, I find out that the mouse wheel button is number 2. While the side button I want to use as paste button is number 8.

Knowing this, I can remap the two buttons, switch their positions. Like so:

xmodmap -e "pointer = 1 8 3 4 5 6 7 2 9"

Here the numbers are sequential, except that 2 and 8 are swapped. Run this while X is running and you get the desired effect.

To make this permanent, you need to add it to your X session script. KDE is not very nice, because it doesn't give you an easy way to do it, so I just added the line to the startkde script (ugly hack):

...

xmodmap -e "pointer = 1 8 3 4 5 6 7 2 9"
# finally, give the session control to the session manager
# see kdebase/ksmserver for the description of the rest of the startup sequence
...

does ogg suck or does ogg support suck?

July 5th, 2007

So ogg is well known as the open format for audio and people seem to love it, it has broad support. To be precise, ogg is just a container format, so just the fact that a file is an ogg file doesn't tell you much more about it than a zip file tells you about its content.

On the video side of things, noone seems to use ogg. Even though it is an open and by all accounts free format, I very rarely come across ogg videos. And sadly when I do, often they are broken. Since Theora seems to be the most used codec for ogg video, I'm assuming they're all encoded in that format (I know I've never seen an ogg video not in theora, although I don't make a point of checking).

Common symptoms:

  • Timer is completely bonkers, saying a 20 minute video is several hours long and whatnot.
  • Video stream has lots of bugs, frame freezes.
  • Audio/video sync can be way off.

Case in point, download this video from Akademy. In mplayer and vlc alike the timer is confused, and the video stream freezes as well. This is the kind of problem I've seen a lot of times with ogg videos.

Now it may be a production mishap for this particular video. But I've seen these bugs with ogg a lot more than with other formats. In mplayer, even if you reindex the stream the timer still doesn't get it right. It tells me the video is 412:29:15 long.

So what is it? Is ogg/theora busted or is the implementation busted? Is the encoder so bad that it's impossible to produce a video without bugs? Or is the decoder buggy?

why are we all wearing suits?

June 30th, 2007

The suit is, with astonishing regularity and unbridled universality, the mode of attire for "significant" social occasions. Sorry, for males. Dare I ask what merit has granted this style of clothing the unquestioned acceptance and unique adoption? Is it the aesthetic quality? Is it the economic feasibility of acquisition compared to richer local traditions which value craft and ornamentation? Is it some kind of great compromise where disputes over our regional values have produced a lowest common denominator?

brad_pitt_suit.jpgSignificantly, Hollywood has given the suit an image outside weddings and funerals that represents top class fashion and coolness. More so than anything, it suggests to us that given the choice, Hollywood characters would choose to wear a suit. Why would suave characters whose plot does not dictate unto them a dress code choose to wear a suit, a style of clothing associated with private family occasions and tedious business meetings? Exactly, it doesn't fit. And I think Hollywood, not necessarily by itself, but certainly as a medium, has helped create that image of the suit as desirable clothing. It's mythological. Most people don't look anything like Brad Pitt in a suit.

Why do we wear a suit? It's not the least bit comfortable. It's not cheap. It doesn't make you feel liberated in any way (despite James Bond running around roof tops in it). It's a huge hassle to clean, because you can't just wash it. And it's the world's least customizable bit of clothing: every suit looks exactly the same. It leaves zero room for individuality. And we don't even look good in it. Unless you have a tailored suit, most people look rather awkward in a suit, and far removed from their normal style of clothing and their natural unrestrained motion. Like these guys...

men_in_suits.jpg

What about women? They are doing much better. They don't have this narrow mindset of one outfit that must be worn. Ask yourself this, in any formal social context, who is more interesting to look at, with respect to dress, the men? Who all look the same? Or the women?

what it is to be a geek

June 28th, 2007

The word geek gets thrown around a lot, with a slightly negative connotation. Actually the degree to which it is a negative term is determined by the social circle in which it is uttered. To some it is an insult, to others it's just a fairly neutral classification.

In any event, the term geek (as with many such labels) is a very bland and generic thing to call someone. What it means is a person who enjoys doing something on their own. Not a terribly discriminating term, is it? So if you're a person who can't stand to be alone for even a minute and possesses no creativity as to what you can do when people aren't available to spend time with you, then you are not a geek.

The geek classification often is linked to excellence in some field. If you spend a lot of time on something, which makes you a geek, you inevitably get quite good at it, which again cements your legacy of a geek. Of course, there's no other way to achieve the same thing, so if you want to excel at something, you have to spend a lot of time on it, and that amounts to an achievement.

For example, if you spend a lot of time learning a foreign language, then you're a language geek. If you spend a lot of time ice skating, that makes you an ice skating geek. So whatever you do to a certain level, you're a geek for doing it. And if you don't do anything to the extent that it establishes a pattern for which people call you a geek, then you won't be a geek. For instance, if you do *a lot* of different things for short periods of time, but never do anything for a long time, then won't be a geek. But, of course, you never do anything long enough to be good at it, so you don't accomplish anything.

If you think about when it is that people get assigned this label, it is precisely when they are engaged in doing something that doesn't involve the person announcing this fact. As such, it is perfectly possible to be a geek for doing something *with* people, just as long as it doesn't involve *everyone*. For instance, role playing geeks play in groups, and crackers (no, not white people called "crackers" by black people, I'm talking about the kind of crackers who break into computer systems) also associate with other crackers, because otherwise they would have no recognition for what they do. This is only a manifestation of the fact that people who are interested in something naturally seek out other people who are also into the same thing, to exchange information. It makes sense. So my first definition is actually too narrow, being a geek is *me* doing something that doesn't involve *you*.

So was the term geek originally a protest against exclusion? Was it a term that means why-can't-I-be-in-your-club? It might have been. Of course, not necessarily the word geek itself, words often originate in unexpected and random ways, but there are many words in many languages that mean roughly the same thing as geek.

hierarchy of scrolling

June 25th, 2007

7. The arrows
scrolling_arrow.pngChances are that the first experience you had with a user interface, might have been your first experience with a computer altogether, someone told you that to scroll down the page, you use these arrows strategically positioned that scroll the page. This is officially the worst way to scroll, it's incredibly slow, and you have point your mouse at the tiny buttons each time.

Corollary: Some ui technologies emulate this button (certain flash sites) and instead of making you click it, they scroll when you hover over it. This is an improvement, albeit a small one. Most importantly, you still can't control the rate of scrolling.

6. Dragging the bar
scrolling_tab.pngNow you're one step up from clicking on the arrow. You realize it's too slow, so you grab the bar and drag it. This is a very imprecise scrolling method, but a much faster and empowering one. The problem is that you still have to use the mouse button for this, and since scrolling is something you do all day everyday, this is way too much mouse dependency.

5. Clicking the meter
scrolling_click.pngClicking is an improvement on dragging, so your hand will prefer this. You click the gray area where the bar is absent and it scrolls page-by-page. You also don't have to position the pointer as exactly, just as long as it's somewhere on the long gray bar, much better. Here uis differ, some stop scrolling once the bar reaches the position where you hold your pointer, which is logical, others don't.

4. The arrow keys
scrolling_arrowkeys.jpgWhat if you didn't have to use the mouse at all? Face it, the keyboard is a much faster control device, and before you had windowing applications with hundreds of pixels to traverse, you didn't need a mouse at all. And it's a much more pleasant control too: I don't know about you, but I find pressing a key much smoother than clicking the mouse button. Maybe you have a fantastic mouse. So yes, you can use the arrow keys. But the rate of scrolling is the same as that of the arrow buttons, so you trade in control for ergonomics.

3. The mouse wheel
scrolling_mousewheel.jpg

Back to the mouse, hah, bet you didn't see that coming! Oddly enough, you might say, the mouse wheel didn't enter the mainstream until a few years ago. It's true, if you go to a museum that has computers from 10 years back, the mice don't have wheels. The mouse wheel is a big improvement, because it doesn't divert your mouse movement to that damn scroll bar on the right side. When you click around, you can just keep your pointer exactly where it is and scroll with the wheel, it's fantastic. But again, the scroll rate is limiting (but it's more than the arrow buttons). If you need to scroll a big amount, the mouse wheel is out.

2. Good ole spacebar
scrolling_spacebar.jpg

Who'd a thought, after all these years, eh? The spacebar is positioned optimally. If you're right handed, your right hand will cycle between the keyboard and the mouse, but the left hand will be on the keyboard. And vice versa. The spacebar is right underneath your thumb, it's the quickest way to scroll. And you scroll page-by-page, which is efficient too. But it only scrolls down.

1. PageUp/PageDown
scrolling_pageupdown.gifThis is just like the linux programs more and less. The former only scrolls down, the latter scrolls up *and* down. The location of these keys isn't as good as spacebar, but they are still nearby for the right hand (even better if you're left handed and operate the mouse with it). The keys are at the end of a row, so it's easy to find them without looking. They (obviously) scroll page-by-page and so you have full flexibility. If you're only reading something and you keep scrolling down, you can do with spacebar, otherwise you go to PageUp/PageDown. And if you desperately need granularity, you can grudgingly go to the mouse wheel.

Corollary: One quirk with the keyboad methods is that the content pane must be in focus, which doesn't happen by default on page load in Firefox, so I first have to click inside the content to get this activated. A pet peeve.