Posts Tagged ‘software’
A better keyboard layout for typing IAST on Mac OS X (based on EasyUnicode)
To type IAST (English letters with diacritics, for Sanskrit transliteration) on Mac OS X, perhaps the easiest way, rather than to use transliteration tools, is to get a keyboard layout that does it. Just to be clear, this is the alphabet we want:
a ā i ī u ū ṛ ṝ ḷ ḹ e ai o au ṃ ḥ k kh g gh ṅ c ch j j ñ ṭ ṭh ḍ ḍh ṇ t t d dh n p ph b bh m y r l v ś ṣ s h
In other words, the special characters needed are:
- Letters with macron above: ā ī ū ṝ ḹ plus it may be occasionally useful to have ē and ō as well
- Letters with dot below: ṭ ḍ ṇ ṣ (the retroflex consonants), also the vowels ṛ ṝ ḷ ḹ, plus ṃ and ḥ (anusvāra)
- Letters with other marks above: ṅ ñ ś
There is a keyboard layout that does this: It’s called “EasyUnicode”, created by Toshiya Unebe (Nagoya University), and is documented at http://ebmp.org/p_easyunicode.php (“EasyUnicode version 5” it says) (PDF version), and you can download it from http://www.ebmp.org/p_dwnlds.php (EBMP) (=Early Buddhist Manuscripts Project, University of Washington) or also http://www.palitext.com/subpages/PC_Unicode.htm “Pali Fonts for PC and Unicode”. (Page in Japanese.)
This keyboard layout is just like the usual (US English) layout ordinarily, but when you hold down the Alt (Option) key and press a, you get ā, similarly Option+s gives ś, Option+n gives ñ and Option+g gives ṅ, etc. The full mapping is available along with other documentation in the download above.
This is very convenient. One issue with the layout is that also overrides a lot of keys for no apparent reason (Ctrl-A / Ctrl-E etc. stopped working for me), so I got Ukelele from SIL, and wrote my own keyboard layout. I’ve called it EasyIAST, and it is available here for now. I plan to add a README etc. and distribute it in some proper way later; for now you can use the instructions from EasyUnicode above. (Short version: Copy the file into ~/Library/Keyboard\ Layouts
) If you find it useful and/or make any improvements, please let me know as well.
If some time is available, it would be good to make a Devanagari keyboard layout along the same lines.
A history of Microsoft Word, and an insight into the Microsoft outlook
(Ok, couldn’t resist adding the accidental pun to the title.)
Fascinating article from 2004, from a Microsoft employee.
I plan to revisit this post and clean it up (as always?), but here are some interesting quotes:
After a year of distrusting the company somewhat, I began to gain an appreciation of how Microsoft worked, and to see it for what it was – a machine that was focused on building products that people wanted, as quickly and as well as they could. Note the “quickly” – this was what distinguished MS from Apple in the end – a focus on moving quickly, and beating the competition. Details like great design were simply not critical to most (business) customers, so that sort of thing didn’t really make it into most products, except where it mattered to the target customer. It’s hard to fault this logic really – it is pure efficiency from a business perspective…
This is illustrative of the Microsoft outlook on doing business: great design is a “detail”; the main goal is to beat the competition and gain market share.
Both Microsoft and Apple have very smart people as employees. The goal at Microsoft is to grab as much share as possible, even at the cost of shoddily designed software if necessary. The goal at Apple is to design software that is simple yet powerful, and a pleasure to use. And both have been phenomenally successful at what they want to do.
The Microsoft approach is to get a release out of the door, see what the main reasons people have for not using it (not necessarily what people most complain about), throw patches (or wizards!) to get those issues across the level of acceptability, add new things, move on, keep moving — the appropriate scenario is not software design, it is war: it is all Fire And Motion.
So, that in a nutshell is the Microsoft method. Understand the market, and the customers, and then go pedal to the metal, with release after release focused on what the customers need, incorporating their feedback. That puts the competition into reaction mode. And of course it helps if they also make a strategic error because they are under so much pressure.
And how successful they have been. Even creating markets where there none.
“I think there is a world market for maybe five computers”
— Misattributed to Thomas J Watson, IBM president, 1943.
No one can disagree that Microsoft has had a bigger role in bringing computers to the masses than anyone else. Perhaps it would have been better if they hadn’t.
Another point is that it shows (again!) (twice!) that it is a really stupid idea to throw away all your code and start over.
Web phrase occurrences
Quick post while I get back to work. Someone please help me here…
There are two things I mainly use Google for:
- Searching for pages related to a particular something. This is the most common, and intended, use of Google.
- Searching for all occurrences of a particular phrase, or more generally a pattern. This might be to compare numbers and compile statistics, or to find what context the phrase is most often used in, or find what are the most common phrases using that pattern.
For example, I just thought of the “My dad can beat up your dad” phrase, and searched Google for “my * can beat up your *”. (Click on link, and see results for yourselves.)
Someone should already have developed a tool/library for using Google (or any other search tool) for doing this, right? Why haven’t I found it yet? Maybe I should contact the “X is the new Y” people… Tell me if you’ve found such a tool.
——————————————
X is the new Y:
Original(?) diagram,
Updates, Updates on updates,
Wikipedia.
Auto-save
Good software does what you want. Preferably without your having to tell it to. And it matches your mental model of what you expect things to work like.
We have come a long way since the days personal computers were severely constrained in their resources, but some traditions have not changed. The humanized weblog looks at the save icon, but I want to point out that the “saving” “feature” is itself an anachronism. There is no analogue of the concept of “saving” a file in the real world; when you write on a sheet of paper the change is permanent. Why, then, does most software require you to explicitly “save” something if you want to leave it permanent? The answer, I guess, is that a long time ago, a “save” was an expensive action (I remember seeing “Saving…” progress bars), so you wanted users to be in control of when it happened, so as to not annoy them.
Today, personal computers have enough resources that in many applications (such as text editing), there is really no reason for software to insist that you remember to “save”, so as to not lose your work. Still, programs continue behaving this way, partly out of tradition, and partly because no one gives a thought to usability.
Fortunately, the rise of applications on the web brought with it an “everything old is new again” phenomenon and programmers began to take a fresh (and naive) look at everything, which, while often causing them to stupidly repeat the mistakes of desktop programs from decades ago and generally be inconsistent, has also allowed them to throw away meaningless traditions in situations where they don’t matter.
I believe it was Gmail which started this, and now Gmail, Blogger, WordPress, Google Docs, and any number of online text editing applications now “automatically save” your work for you every few seconds, and this idea is finally (slowly) taking hold in desktop applications as well.
Goodbye Adium: Pidgin on Mac OS X… with native GTK!
So you’re on Mac OS X, and want to use Pidgin on it.
First: Why not use Adium? Adium is a Free multi-protocol IM client for Mac OS X that uses libpurple, the IM library that was developed as part of Pidgin. It has several popular features such as message styles, and uses the Cocoa API native to Mac OS X, and all round looks pretty. Being a native Cocoa application, it is more well-integrated with the Mac desktop than a GTK-using application like Pidgin can ever be.
On the other hand, if you, like me, have tried Adium and have reasons for finding it unusable, then it is possible to install Pidgin on OS X too. There are two ways of doing this:
[Edit: Note that this post is from 2007. Probably a lot has changed since then.]
- Install Pidgin to run inside X11. Any default distribution of Pidgin should build fine on this, as long as you have all the dependencies installed. However, using an X11 app on OS X is really like entering another universe entirely… it’s like having two entirely disjoint OSes that just happen to run simultaneously. It is cumbersome, and I would not recommend it unless you are already doing much of your work inside X11 for some reason.
- Install Pidgin to run on the Mac desktop directly (without X11), using native GTK+ for Mac OS X and some minor modifications to Pidgin. This is very simple to do and requires only one step, described below.
Instructions:
Gmail has IMAP!
Finally. Many thought this would never happen.
And just like Free software usually, it seems to be the handiwork of someone scratching an itch.
Notes:
- IMAP folders are Gmail labels. Gmail labels show up as folders in your client, and moving a message to a folder in your client simply adds that label in Gmail.
- In particular, be careful creating folders, and avoid making a mess. Try reusing the default Gmail labels: Set your client’s drafts folder to “[Gmail]/Drafts”.
- Messages with multiple labels appear in each of those folders. So there is some duplication at the client end, of course, but this is unavoidable; the price you pay for forcing a tagging philosophy on software that has different beliefs.
- Conversely, if you want to apply multiple labels to a message through your client, you can use the “poor man’s tagging” that has always been possible — copy the message to each of those folders.
- If you delete a message from a “folder” (other than “[Gmail]/Trash” and “[Gmail]/Spam”), Gmail only removes that label. It is still present in “All Mail”. To actually delete, move to “[Gmail]/Trash”. What happens if you delete email from “All mail”?
- Recommended IMAP client settings: Don’t save sent messages on the server; any mail sent through gmail’s smtp is automatically copied to “[Gmail]/Sent Mail” folder.
- In general, actions sync neatly; see the full table.
- IMAP and POP work with messages, so if you move only one message from a thread to a folder, only that one will get that label, but the Gmail web interface will show the entire conversation with that label. Note that this is only a display thing — it’s not that opening Gmail will give all the messages the label, and when you reopen your client suddenly things are different. (I need to actually check this.)
- You still have Gmail’s amazing server-side spam filtering.
- Some things don’t work.
- Some other things are alleged not to work that I don’t even understand
- Everything.
They got everything in order, made all those pages, and turned on IMAP without making any advance announcement…
Debian/Ubuntu: Find out which packages are taking the most space
There is a package called debian-goodies (that’s what it’s called on Ubuntu as well :-)) which has this utility called dpigs — for telling you which packages are “pigging out” on your system. (So install it with sudo apt-get install debian-goodies, and then run dpigs). This and other utilities, from the description:
debget - Fetch a .deb for a package in APT's database dpigs - Show which installed packages occupy the most space debman - Easily view man pages from a binary .deb without extracting checkrestart - Help to find and restart processes which are using old versions of upgraded files (such as libraries) popbugs - Display a customized release-critical bug list based on packages you use (using popularity-contest data)
Nice.
Using Emacsclient
Emacsclient, essentially, says “use a running emacs”. With it, you can have only copy of Emacs running, and every time you need to edit something, you can call “emacsclient filename” to use the existing instance of Emacs without having to wait several seconds for a new one to start. To use it, simply put (server-start) in ~/.emacs, or type M-x server-start from within Emacs.
There are two (minor, irritating) problems with it, though:
- When you are done with a file, you have to close it by hitting C-x #. Closing it normally (hitting C-x k, or exiting Emacs) brings up an annoying
Buffer `buffername' still has clients; kill it?
message. The rationale for this is in server.el:
;; Ask before killing a server buffer. ;; It was suggested to release its client instead, ;; but I think that is dangerous--the client would proceed ;; using whatever is on disk in that file. -- rms.
I don’t see what’s dangerous about that, but then again, I’m not RMS! …
One could put something like (global-set-key (kbd "C-x C-k") 'server-edit) to replace C-x # by an easier keystroke, but I found a better solution to be to remove the thing altogether, assuming that you’re going to be careful against whatever it is that is dangerous:(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
Remember to put this after the (server-start) line in .emacs (If you’re doing M-x server-start manually, you’ll have to call the above remove-hook manually too.) After doing this, you can simply save and close the buffer as usual (or even quit Emacs), and everything will work fine — you won’t get the annoying message any more.
- The second problem is that when you call emacsclient from a shell, although the file gets loaded in Emacs, the Emacs window rarely pops up, at least on GNOME and KDE (and, on hearsay, OS X as well). It was suggested to put (add-hook 'server-switch-hook 'raise-frame) somewhere, but that doesn’t work either. (In KDE, it only flashes the Emacs window in the task bar, but that is better than nothing, as Ctrl-Alt-A is KDE’s shortcut for “Activate window demanding attention”.)
At least it appears that peoplearewere discussing it of late, in a gnu.emacs.help thread “raise frame no go”, and related discussions here, and also a GNOME bug here. These discussions are specific to Metacity (GNOME’s default WM), but it also doesn’t work on KDE and Cygwin.
Oh, and if you’re on OS X, you can turn emacsclient into a .app with Platypus. (Although you probably don’t really need it…)
Update: Emacsclient just got a lot more friendly. You no longer have to go find where the original emacs “server” was started — you can simply start up a new frame for your new buffer, wherever you want (all such Emacs “instances” share the same buffers). This makes the second problem above entirely irrelevant. (It seems to be an Emacs tradition to give up on fixing things that don’t work and implement something better instead :P) Read more about it.
The pefect (non-)markup solution
(This
I just found something that’s amazing in its simplicity, and yet neatly solves a problem. Maybe you’ve sometimes wondered how to markup your email (perhaps in cases where you want the same text to be reusable) and yet retain its readability. (I have a friend who sometimes writes email in TEX markup, which is just incredibly wrong and annoying.) There is a solution that is as close to perfect as imaginable: Markdown. Its Basics page was itself written in Markdown. The syntax is perfectly readable; it is available on Ubuntu and Debian, and can even be generated from HTML, in case one wants to go in the other direction. It even has a Wikipedia article, and (even without looking!) I’m sure it’s the best “lightweight markup language” there is. There seems to be a markdown mode for Vim, but no “standard” mode for Emacs yet. (But with such good and readable syntax, who needs an Emacs mode, anyway?) There is a comparison here. There are converters from MarkDown to other formats (such as LaTeX), see Pandoc (written in Haskell!) and MultiMarkdown.
Another thing that looks impressive (and even more useful, because it is well-integrated into Emacs) is Emacs Muse, can be published to a lot of formats, including DocBook and LaTeX. Documentation here, and someone’s personal notes here.
I haven’t tried either of them yet.
[Update] Emacs Muse is nice, but it’s really not polished enough yet. (Either that, or if it’s not going to change then I don’t like it.) There are no nested lists yet. (It does now.) Markdown says
The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. While Markdown’s syntax has been influenced by several existing text-to-HTML filters, the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.
That doesn’t seem to be Emacs Muse’s “overriding design goal” to me (I need to figure out why I feel so, but somehow the syntax feels kludgy and seems to have many bad corner cases).
As I see it, the most powerful and compelling features of Emacs Muse are
- The entire publishing system, where you can take a document and publish to multiple formats based on syntax translation rules, keeping a daily journal, etc. (planner-el depends on Emacs Muse for some of its functionality.)
- Its integration with Emacs
Frankly, IMHO, the actual markup language is not one of its greatest features, and it would be great if they used — or allowed plugging in — other existing languages.
(Update-update: This does seem to be the idea, or at least was at some point of time. See this thread, which contains a file that provides some MarkDown support in Muse.)
[End update.]
ssh-keygen as another user
To set up an ssh-key usually, type
ssh-keygen -t rsa, hit [Enter] a few times, type
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys, and add entries from other places where you might have created a key, to the same authorized_keys.
To set it up so you can log in as another user (called, say, user2)
ssh-keygen -t rsa
Enter a different file to save (id_for_user2, say), and blank passphrase.
Now add the contents of the file id_for_user2.pub to user2‘s ~/.ssh/authorized_keys file.
Oh, and when you want to login as that user, you will have to specify that you want to use that file, like
ssh -i ~/.ssh/id_for_user2 user2@hostname. For long commands like this, it’s best to make an alias (put alias sshasuser2='ssh -i ~/.ssh/id_for_user2 user2@localhost' in your ~/.bashrc if all you want is a password-less replacement for su - user2). You can also give the id_for_user2 file to others, and they can also login as user2 without a password simply by typing the command above.
Got it from this linux.debian.user newsgroup post.
Gnome File Selector
Although there is no indication anywhere, one can actually start typing, and a box will appear to accept your input. This is incredibly unintuitive, but who’s to argue with the folks at GNOME? (Actually, even Gaim has this “feature”—start typing in the buddy list window to see it. So it could be a GTK+ thing, and not a GNOME thing…)
There are actually two places that take input:
- The one that pops up when you start typing the name of a directory, say. This is at the bottom-right corner, and isn’t very good. No autocompletion.
- There’s another one, that pops up when you type Ctrl+l (that’s l for location) or when you start typing with a /. This one has autocompletion, but works a bit weirdly: it interprets each keystroke as occurring after the completion (so if you start typing /etc, it will go into /etc after the ‘e’, then look for files beginning with ‘/etc/t’). Another problem is that it’s not done until you actually type the whole thing. For instance, to open /usr/bin/emacs, it is not enough to type “/u[sr/]b[in/]em[acs]{RET}” — that makes it look for “/usr/bin/em”. You can’t type “/u[sr/]b[in/]em[acs]a…” either: those files don’t exist. The only thing you can do is “/u[sr/]b[in/]em[acs]{Backspace}s{RET}”. Very weird. And if the file you want is inside the home directory, it can be got with “/{Backspace}~/…”.
Also, when “/bin/” or “/usr/bin” has too many files, opening one of them can take quite a long time. A “solution” is to have a separate directory (like “/usr/freqbin”) that contains links to all the programs that one might want to use to open things downloaded from the net (because the File Selector is encountered mostly when using Firefox).
2007-10-26: At some point, it started accepting “~” too, so you don’t have to do “/{Backspace}~” now. The rest of the mess is still there.