среда, апреля 09, 2008

Wouldn't it be cool to have a shell command - say, haul, - that would move a file to the specified folder and then chdir there?

воскресенье, января 20, 2008

The Microsoft approach to Unicode

OS X and Linux use UTF-8 to represent Unicode texts. The advantage of UTF-8 is that ASCII text only needs 1 byte for each character, and converting apps to Unicode is relatively easy. The downside is that characters are variable width, which complicates string manipulation.

For Windows 95/98/NT, Microsoft used UCS-2, which uses exactly two bytes for every character, so it's easy to manipulate strings once you convert all your chars to WCHAR and all your "strings" to _T("string"). But a WCHAR can only hold 65536 symbols which is not enough for some Asian scripts and certain Unicode symbols.

Once they realized that 65536 characters will not, after all, suit everyone, Windows 2000 was upgraded from UCS-2 to UTF-16, which still uses 2 bytes for most chars, but some need 4.

So the Microsoft approach to Unicode now combines the worst of two worlds: you need twice the memory for ASCII text, programs are hard to upgrade, and the encoding is once again variable width so you can't manipulate strings easily.

воскресенье, октября 21, 2007

Ubuntu 7.10 Gutsy Gibbon: What's Lame Today

- Alt-Tab is blocked when a window menu is active
- "About" dialogs: "Close" button selected by default, why? If you're using the keyboard, you'll just hit Esc to get rid of the button. (OK, at least they made Esc work at last)
- Nautilus: as useless as usual. A whole two view modes!! "Icons" and "List". Who would ever want, say, "Tiles" a la Redmond?
- NTFS mounts are broken
- Want a shortcut to Home folder on your desktop? What can be easier, just drag the Start->Places->Home Folder icon to the desktop. Oops? No workie?
- For windows without a resize area (how's that called properly) in the bottom-right corner (say, Firefox), it's no easy task to grab the resize-both ways area which is only a couple of pixels across. A popular non-free OS had it right since version 3.1 at least.
- XChat-GNOME IRC Chat: the IRC->Connect dialog fails to remember the server you connected to last time. And in that dialog, the Close button should really be Cancel, right?
- If a drop-down menu doesn't have icons for any item, the items' text starts right from the left border of the widget. Dunno about you, feels wrong to me (too used to Windows I guess).
- Keyboard preferences -> Layouts -> Selected layouts: "Default" radio buttons won't work.
- The idiotic counter-intuitive highlighting of file icons on mouseover is still there, still no way to turn it off.
- Firefox is still version 1.5? You kidding?
- gedit still insists on opening everything in the same window, in tabs. Even if you're on a different virtual desktop at the moment.
- It seems that every dialog that ever comes up has the keyboard selection activated on some widget, even if you can't imagine anyone ever using that widget, even if everyone uses the mouse anyway. This kind of visual garbage annoys me. OK, I'm easy to annoy.
- If you use Alt-Shift (Windows default) as locale switcher, it won't work if you press Shift first. And of course it fucks up Alt-Shift-* shortcuts, as usual.
- Ctrl-* shortcuts don't work when Russian layout is selected. As usual.
- Onboard sound doesn't work on my ASUS P5GPL-X.
- It's 2007, we have Xgl and stuff, but we still haven't learned to draw window decorations simultaneously with drawing new windows.
- In Nautilus, pressing Del moves the file to Trash immediately. I know you love Apple, but can you at least be consistent when you copy them? It's not easy to hit Cmd-Delete accidentally you know.
- Start -> Accessories (etc) -> right-click on any item. The selection on the item disappears? Now try Start -> Places -> right-click on any item. Deliver a speech about how consistency.
- Login window: is it so hard to accept that Microsoft does get some things right? Can we please put TWO edit boxes (for username and password) on the screen simultaneously, rather than show them one at a time? And does the vertical arrangement of the "OK/Cancel" manifest inability to make a decision in which order to place them side by side?
- I have an "Audio Disc" icon on my desktop. Right-clicking it presents, among other things, a choice of two actions: "Open" and "Browse folders". Both start the "Sound Juicer". Which is internationally challenged btw.
- Speaking of internationalization, have we learned yet that people in some countries have a strong preference for expressing things in a different way from U.S? Like dates, you know, or time. Or single-byte encodings where Unicode is not available. (Haven't actually checked this one as I didn't install Gutsy from scratch)
- Open a terminal and start any gtk application. Enjoy a flood of "WARNING" and "error" messages. Free and open source software at its best, no doubt. Is it too much to ask that GUI application fork into background and resist the urge to dump their debug information to stdout unless explicitly asked to?

Good things:
- in "Open File" dialogs, a single click is now sufficient to open an item from "Places" sidebar
- Esc finally works in about dialogs
- In some themes at least, the scroll bars are no longer highlighted on mouseover.
- Totem Movie Player seems to work, sometimes. The progress bar slider must be a joke though.

Overall, Ubuntu (and Linux desktop in general) is showing imrovement. Give it another 10 or 20 years, and I won't be surprised if it approaches Windows XP in usability.

пятница, октября 27, 2006

Send messages on Ctrl-Enter in GAIM 2.0.0beta4

"If you find a feature, it might confuse the user, so remove it." (c)

Okay, I do like the new interface in GAIM 2.0 beta, shipped with Ubuntu 6.10 'Edgy Eft'. It sucks a lot less than 1.x series did.

They Preferences dialog has been cleaned up considerably. A lot of rarely-used options were removed, so it's a lot easier to navigate and with luck you can get GAIM configured to your liking in under 5 minutes.

Unfortunately, the "Send message on Ctrl-Enter" setting that I use happened to be among the options that had to go. The FAQ does address the change but is not very helpful, and I had to spend some time researching. And here are direct instructions:

In your home dir, find or create a file named .gtkrc-2.0 and add the following lines:
binding "my-message-bindings"
bind "Return" { "insert-at-cursor" ("\n") }
bind "<ctrl>Return" { "message_send" () }
widget "*gaim_gtkconv_entry" binding "my-message-bindings"
Restart GAIM and enjoy.

Переключение раскладки по Alt-Space в Linux

В /etc/X11/xkb/symbols/group добавить:

// Alt-Space toggles group
partial modifier_keys
xkb_symbols "altspace_toggle" {
virtual_modifiers Alt;
key <SPCE> {
symbols[Group1]= [ NoSymbol, ISO_Next_Group ],
virtualMods= Alt

В /etc/X11/xkb/rules/base.lst в раздел ! option добавить:

grp:alt_space_toggle Alt+Space changes group.

В /etx/X11/xkb/rules/base в раздел !option = symbols добавить:
    grp:alt_space_toggle   =       +group(altspace_toggle)

Это, наверное, не обязательно, но полезно для настройки клавиатуры через GNOME:
В /etc/X11/xkb/rules/base.xml в районе grp:alt_shift_toggle добавить:
<description>Alt+Space changes group</description>
<description lang="ru">Alt+Space меняет группу</description>

И по желанию перевод на другие языки.

вторник, октября 17, 2006

Переключение раскладки по Alt-Space / Win-Space в Windows

Давно мечтал переключать раскладку клавиатуры одной и той же комбинацией всех системах, где мне приходится работать (это в первую очередь Windows и Mac OS X, а также Linux).

Недавно осилил настройку xkb, а на днях придумал решение и для винды. Делаецца помощью программы AutoHotkey, добавлением в её конфиг вот такой строчки:

!Space::PostMessage, 0x50, 2, 0,, A

!Space означает комбинацию Alt-Пробел

А вот так можно прибиндить смену раскладки на Win-Space, для маковских клав или для Happy Hacking Keyboard:

#Space::PostMessage, 0x50, 2, 0,, A

Правда, пока это писал, обнаружил глючок с !Space: если отпустить Alt раньше, чем пробел, то активируется меню в активном приложении. Попробую это побороть.

вторник, августа 15, 2006

A message I just sent via dictionary.reference.com's feedback form:


I would like to report a problem with the configuration of the software running on dictionary.reference.com that makes it harder for some people (including me) to use your service.

The problem is that the web server doesn't specify the character encoding of the documents it serves to the user's web browser. While it is generally okay for someone in North America, it causes problem for anyone whose OS is configured for a different locale than Western.

In case of a Russian locale, for instance, it results in accented characters in French loans and in pronunciation guides to be replaced with a random Cyrillic character, rendering the word partially unreadable. The user will have to go to the "View -> Character Encoding" menu in their browser and choose "Western (ISO-8859-1)" to make the page display correctly -- every time a new word is looked up! What's worse, many users not even know to do that, and will think that dictionary.reference.com contains factual errors.

What has to be done to fix the problem is a really simple change to the configuration of the web server; I will not go into the technical details here, but here's an excellent link that explains it in detail: http://www.htmlhelp.com/tools/validator/charset.html

I hope my report helps make your service more useful for your international customers.

Anton Gavrilov

What do you think, will they listen? Will they fix it or yawn and hit Delete?
Is there something I could improve in the letter to make sure it reaches the right person and helps them make the right decision?

пятница, июля 28, 2006

Robot cars a reality... since 1995?

"A culmination point was achieved in 1995, when Dickmanns´ re-engineered autonomous S-Class Mercedes-Benz took a long trip from Munich in Bavaria to Copenhagen in Denmark and back. On highways the robot achieved speeds exceeding 175 kilometres per hour (roughly 110 miles per hour; there is no general speed limit on the German Autobahn). Only very rarely a human driver took over in particularly critical situations where the system was deemed not reliable enough.

Unlike the early robot cars, the S-Class Robot drove in traffic. Therefore it had to recognize other moving objects and estimate their speeds. It even suggested and executed maneuvers to pass other cars. Unlike later robot cars it did not need the global positioning system or automotive navigation system to locate itself precisely. The car´s abilities left a big impression on many observers, and heavily influenced robot car research and funding decisions world-wide."


Яфшоке. Много думал.

Додумался до conspiracy theory, что кое-кто уже давно знает, как сделать полноценный исскуственный интеллект. А может, уже сделали.