Emacs: reposition paragraph after justify
Emacs’ justify (fill-paragraph, usually bound to the key M-q) has one bit of behaviour that annoys me. I prefer horizontal scrolling to breaking long lines. If I type a long line that goes off the edge of the current emacs window, emacs will scroll left as expected. If I then hit M-q, the paragraph gets justified. So far so good. But after justification the lines remain left-scrolled, so that I can’t see the beginning of the lines even if they are now small enough to fit in the emacs window. I have to hit C-a C-e or something like that to re-scroll the text sideways.
The fix is simple: remap M-q to fill-paragraph, scroll-right instead of just fill-paragraph. Scroll-right is smart and won’t scroll right if the window is so narrow that, even after fill-paragraph, the line doesn’t fit in the window. This is exactly what I want. I inserted the following code into my .emacs:
;; Automatically scroll-right after justification
(global-set-key (kbd “M-q”) (lambda () (interactive) (fill-paragraph nil) (scroll-right)))
LaTeX Auto-Preview

It never ceases to amaze me that one or two brilliant people working by themselves can sometimes invent something that is so far superior to a professional piece of software produced by a behemoth like Microsoft. Knuth created TeX, Leslie Lamport evolved it by creating LaTeX, and we keep getting huge improvements (like PGF/TiKZ) from time to time. I find myself very grateful for some of the other things available for LaTeX, one of the most important being auto-preview.
There are three main auto-preview methods for LaTeX while editing under emacs. These are collected at http://www.emacswiki.org/emacs/WhizzyTeX
WhizzyTeX is the most evolved. It continuously updates a separate dvi-preview window as you type in emacs, and also positions the dvi preview at the point where you are editing. The biggest problem with whizzytex is that it doesn’t understand newer packages like PGF/TiKZ which directly compile to PDF using pdflatex. Such documents don’t compile to DVI at all, so whizzytex is no good here.
LaTeXMk is essentially a ‘make’ for LaTeX but it can auto-update every time you save. So it won’t update continuously but will refresh as soon as you save (C-x C-s) under emacs. This will also work with any other editor; it follows filesystem level changes to the file. But:
- It does not position the pdf viewer at the point you edited; you have to keep doing this yourself.
- When there’s an error in compiling LaTeX code, LaTeXMk calls LaTeX, which stops on the error. You have to manually go into the LaTeXMk window and quit LaTeX for it to continue. (Correcting the error within emacs isn’t enough.)
Rubber appears to be similar to LaTeXMk. I’ll update once I’ve given it a whirl…
Other that these, there are some What You See Is What You Mean programs like Lyx and Scientific Workplace (commercial). Both are excellent, but sometimes it’s hard for me to get used to the lack of control.
Backup (Part III)
As I keep using computers, I keep changing my backup requirements. I’m a fairly simple user: I have one laptop (with three partitions), one desktop (with 3 partitions), and one external hard drive (with one partition) that I need backed up. I back up everything to another external hard drive. I started off with lofty industrial-strength backup ideas. The backup drive had to be on my LAN, always accessible from any computer, and available to anyone on my LAN with a password. (It was a pain to administer and quite slow to transmit data, so I gave that idea up.) I needed industrial strength encryption and versioning. And so on. I even wrote two posts on this: Backup and Backup (Part II).
At first I was using a tool called dar. It had all sorts of features, but its main problem was it used its own data format. This made it very hard to access my archives. Then I switched to Sbackup. This was a bit simpler, but stored the backups in tarred and gzipped files. I thought this would be accessible enough, but when your .tgz file is 60 gigabytes, it’s a major chore to unzip it just to see the contents! I think the rar format solves this problem somewhat. It maintains indexes so that to access the table of contents or to extract any particular file in a rar archive you don’t need to unrar the whole thing. But I think I’ve finally decided that I’m not that interested in compression or encryption or any of that fancy stuff. So I’ve switched to a lightweight tool called rdiff-backup.
rdiff-backup stores an identical copy of a directory on the backup drive. No unzipping, no decrypting; the files are all there for you to see. Every time you run a backup rdiff-backup stores a reverse incremental diff. This means that the backup looks like a mirror of your latest version, but some additional info is stored so you can retrieve an earlier version if you need to. Plus, it’s super easy to use. I just run one small script (for each computer) that basically checks to see whether the backup hdd is connected, then runs rdiff-backup for each directory I want backed up.
Pros: Super-simple, super-fast, has a sort of versioning system, your latest version is immediately accessible.
Cons: Unsecure, takes a lot of space because of no compression, no stable gui frontend for rdiff-backup yet.
Ubuntu 9.04

It’s been almost a month since Ubuntu 9.04 has been released. I perfer not to install OSs immediately because they’re likely to have all kinds of bugs, but it’s time to upgrade now.
My main reasons for upgrading are a bunch of small but persistent and annoying bugs in my 8.10 install: gnome application window contents get garbled while scrolling and need a refresh (e.g. minimize and maximize again) to work, sound crashes frequently and needs rebooting to be brought back, gnome-terminal’s select-to-copy-to-clipboard wasn’t working, I wanted hibernate to be much more stable, poor sound quality issues with skype, and some quirky window size behaviour (windows would edge onto other workspaces by themselves), synaptic’s broken search (existing packages wouldn’t show up in searches), logout crashing X, etc.
I’m going to write about my upgrade/reinstall experiences here. My laptop is a Lenovo T61 with 3 gigs of RAM, an nVidia Quadro NVS 140M and Intel Corporation PRO/Wireless 4965 AG network card.
Upgrade This didn’t work at all for me. I first got a “Not all updates can be installed” message from update-manager, and when I tried to go ahead anyway, I got a peculiar “Could not calculate upgrade” message and the upgrader quit. It may be because I have some non-standard repositories and packages (like KDE 3.5).
Installation Before installing, I used
dpkg --get-selections > packages.txt
to keep a record of all the packages I had in my previous install. I also copied
/etc/apt/sources.list
to an external drive so I’d remember the sources I got those packages from. During installation, a minor problem with manual partitioning: clicking “Forward” and then “Back” in the Ubuntu installer causes it to forget all partitioner settings. It’s also very slow to set up mount points. The next irritant was the message “There were no users or operating systems suitable for importing from”, even though there was an Ubuntu 8.10 which the installer did recognize. Next, I still think Ubuntu should warn about the special status of the first user (who has sudo privileges), so that people can choose an appropriate username. (I prefer to call this account admin, and avoid using it on a regular basis.) Other than that, it was pretty simple, taking only a short while to install the basics. One very awesome thing about installing from the live CD is you can use the computer during installation.
Reusing home directories I reused my old home partition when installing. I renamed my old home directories temporarily and created all my usual user accounts (making sure the userids didn’t change from my previous install). Then I renamed all the accounts back to what they were originally. Although the accounts weren’t imported during install, I could log into any of the accounts after this and it was as if they had been imported and I could pick up where I left off. No problems so far. Every app I tried has simply picked up where it left off on the 8.10 installation. And that includes all the apps I installed under Wine.
Restoring Packages I tried to restore packages using
dpkg --set-selections <packages.txt
and then
apt-get dselect-upgrade
to get back all the packages I had on 8.10. This didn’t work very well. apt-get wanted to uninstall about 110 packages I wanted in addition to installing the 1400 or so packages I asked it to. Some of those 110 packages were things like compiz, which I definitely wanted. Luckily, it displayed the list of 110 packages and asked whether to proceed. I tried various things and finally kept a record of those 110 packages and proceeded. After that was done I asked it to install those 110 packages again. That worked.
Skype This time around, Skype isn’t part of the repositories. However, the old package can be downloaded from the Skype website and installed. I haven’t yet tested the sound quality issues.
X Logging out of the current account doesn’t simply blank the screen as it did on 8.10. You get back to the default login screen. Update 1: The X system feels a little more stable and responsive than 8.10.
Hibernate This still works out-of-the-box, but it seems the same as in 8.10: garbled screens and loud beeps before the session is restored. Slow. But it does work.
Suspend Suspend works beautifully. I’m not sure how much power is consumed in suspend mode, and I’m still pretty apprehensive about putting a suspended laptop in a backpack for worry that it’ll overheat. But my laptop suspends and resumes without a hitch in about 5 seconds.
Garbled Apps This one is important to me: 9.10 seems to have none of the scrolling-garbles-screen problems that were rife in 8.10.
Sound So far sound seems better than in 8.10. It appears to crash less frequently. But I did experience one sound crash that needed a reboot, so the problems are not gone. Ah, I yearn for the good old 7.10 days!
I found a fix of sorts for this problem in this thread; it seems to work in my configuration. The idea is to first close all applications that are using sound (discovered with “lsof | grep pcm”) and then restart sound using “sudo /etc/init.d/alsa-utils restart”.
Overview/Conclusion So far, my 9.04 installation is practically a clone of my previous 8.10 installation. There’s very little here that feels new. Even the much-vaunted “polish” just boils down to a glossier login screen background and a bit of mouse movement tweaking. Everything seems to work as expected. Whether the annoyances I had are now fixed, I’m not sure: those bugs weren’t always easy to reproduce. A few days in now; 9.04 does feel somewhat more stable and polished than 8.10.
Ubuntu and Whizzytex
I have an earlier post in which I pointed out that whizzytex was causing emacs to freeze intermittently. After a lot of searching and a bit of system tool use (specifically, iotop) I think I’ve pinpointed the problem (but not solved it yet).
It looks like the problem is not with Whizzytex at all, but related to known a known bug in Firefox and/or Tracker and/or Google Desktop. Or maybe something about the way fsync() and kjournald interact. These programs access disk a lot, which is what was causing the delays. Apparently this is compounded because Firefox 3 issues a large number of calls to fsync(), which in turn causes kjournald and pdflush to activate on a regular basis. This is what sometimes ties up the disk for a second or two.
A potential solution is to tell firefox to do asynchronous updation of history and bookmarks, and use a ramdisk for the Firefox cache. I tried this and also disabled tracker and gdl_indexer indexing, but I’m not sure it’s helping yet.
Update (Feb 25, 2009):
Fixed! I am fairly sure that google desktop was one of the factors behind the annoying slowdowns. I am not sure which (if any) of the other issues (firefox and tracker) was responsible. But if I disable all three, I don’t see the delays any more. I’ve been freeze-free for about 3 weeks now! I like google desktop, so I simply disable indexing before starting whizzytex and re-enable it after.
Ubuntu 8.10: Love and Hate
I decided to quit being obsolete and upgraded from Ubuntu 7.10 to 8.10. 8.10, aka Intrepid Ibex, is not a long term support version and most reviews I read said it didn’t really make waves over 8.04, but then I was upgrading from 7.10, Gutsy Gibbon. I expected it to make waves for me! Indeed there were a lot of extremely useful things Intrepid does better than Gutsy. Frustratingly, it also breaks a lot of things that were already good in Gutsy. Here’s a kind of review with some details under various headings. My installation is on a Lenovo T61 with an nvidia 140m card.
Things I’ve Dealt With So Far
Installation. The first thing I tried was to upgrade from Gutsy to Hardy (i.e. 8.04), planning a further upgrade to Intrepid. BIG MISTAKE. The upgrade took 3 hours (I do have a lot of packages), did a hotch-potch job, didn’t update the boot manager GRUB, and broke X completely (nvidia 140m wasn’t recognized after reboot, installing proprietary drivers didn’t help either). At this point I gave up on upgrading since I was only interested in Intrepid Ibex anyway. I installed Intrepid from a CD, the install was trivially simple but with a couple of scary moments:
- Selecting manual partitioning, the install GUI makes it look like everything will be wiped from the disk (based on the before and after pictures). It doesn’t actually do this, but I was very nervous clicking “Forward”.
- In the partitioner, while editing a partition the dialog should tell you which partition you are actually editing.
- As usual, it doesn’t mention that the first user has a special status (Administrator but not root) on the install. I’d rather not have sudo privileges for my usual login; I call this user “admin”. The installer should warn about this.
- It asked me whether I wanted to import previous accounts, but didn’t display any information on what it would actually do! I was planning to use a home directory with a lot of info already in it and didn’t want to take any risks, so I had to skip this and set up other accounts manually (even though maybe Intrepid could’ve done this automatically).
GRUB. Intrepid seemed to recognize all the other operating systems on my computer properly and put them into GRUB.
Bootup. Bootup is fast. One common problem before was routine disk checking (fdisk). This can really slow down bootup at times when you are in a hurry, you want to postpone and move on. Intrepid does two nice things: first, it shows the disk check progress in the splash screen rather than the console, and it allows you to press Esc to postpone it to next time.
Network Manager. This program always gives me trouble, and this time was no different. It doesn’t always come up on the non-admin accounts; sometimes I have to manually invoke nm-applet.
Nvidia Proprietary Driver. As soon as you login you get the option of installing the proprietary Nvidia graphics driver which provides 3D acceleration. This is a pretty useful driver. But the driver installer had an annoying glitch: I kept clicking on “activate” and it would bring up a dialog of some sort that disappeared immediately, and do nothing. On the 5th or 6th try it suddenly worked and activated the proprietary driver. No more trouble after that.
Fonts. Operating system fonts look even more awesome than before all round. UNTIL you install the Nvidia proprietary driver, after which they’re ok but not that awesome. Firefox fonts, on the other hand, are a different story.
Firefox. Intrepid installed Firefox 3.0.4. Works as expected, nothing new here, except a couple of weird things:
- Fonts in Firefox are awfully ugly. (The rendered fonts, not the ones on the menubar etc.) Maybe this is because all the websites want to use Microsoft fonts, I don’t know. I fixed it by going to Edit -> Preferences -> Content -> Advanced and unchecking “Allow web pages to choose their own fonts…”.
- While trying to get fonts in Firefox to work, I moved my .mozilla folder to .mozilla.old and then back. Somehow Firefox went and deleted everything in those folders, including bookmarks, customizations and history for 4 profiles. I have to start with a blank slate now. I’m probably to blame as well, but Firefox shouldn’t just delete everything without asking.
- Firefox hangs occasionally while exiting. When it does this, it forgets all tabs that were open. This is really problematic.
X.org. Intrepid has X.Org 7.4.
- The big deal with X.Org 7.4 is its hotplug support, of which I am already an extremely grateful beneficiary: I can now dock and undock my computer from the Lenovo mini-dock. AWESOME! Before, the only solution was to restart the X server after docking or undocking (using Ctrl-Alt-Backspace). The freedom to move about with my laptop is so liberating I feel like I lost 5 lbs and have improved lung capacity.
- But on the downside, the new server is glitchy. Once I’ve logged in to any account, I can’t log out. Logging out simply blanks the screen. Even Ctrl-Alt-Backspace doesn’t seem to restart the X server. Sometimes I get a weird message saying my video card isn’t recognized. Sometimes I’m just dropped to the console, without a shell. All I can do at that stage is Ctrl-Alt-Del to reboot. If I try to switch users instead of logging out, I sometimes don’t get a taskbar or panel after switching.
- Intrepid changes the keycodes for X, creating a whole host of problems for software relying on the keycodes. One of the affected programs is DosBox, which no longer recognizes the arrow keys correctly. (Fortunately the fix for DosBox is simple: insert the lines
[sdl] usescancodes=false
into a file called .dosboxrc in the home directory and restart dosbox.)
xmodmap. I used xmodmap to switch Caps Lock and Ctrl to help avoid RSI. Previously Ubuntu recognized this switch as soon as I put a .Xmodmap file in my home directory. It’s stopped doing this, but it’s fairly simply to get Ubuntu to do this every time my session starts up. Supposedly the X keycode reassignment also creates problems with xmodmap, but I don’t use keycodes so I’m ok so far.
User Management. Some glitches in the GUI tool:
- Say you’re trying to add a new user whose home directory already exists, from a previous installation. It won’t let you do it! The error message is that the home directory already exists. There should be a follow up action: create user anyway, or no, thanks.
- Say you’re trying to add someone to a group. The user manager gives you a list of users you can add to the group but only displays the full name of the users (not their usernames). So if two people have the same name, it’s impossible to tell who you’re adding to the group!
Konqueror. This was the most unkindest cut of all. I loved Konqueror 3. Even though I don’t use Kubuntu, I still used Konqueror as my main file browser; I think it’s much more functional than Nautilus. But Intrepid has Konqueror 4.1.2, a horrifically amputated version of the heroic Konqueror 3 which could do almost anything. Now:
- There is no Create Folder item in the right-click menu.
- There is no folder tree view (I think). Folders can’t be expanded by default (the little (+/-) beside the icon is missing) — although after some digging I could enable it via Settings -> Configure Konqueror -> Views and checking Expandable Folders. But I have to do this every time I start Konqueror. There doesn’t seem to be a way to save this setting.
- When viewing an image, it doesn’t show icons for the next and previous picture in the folder. Clicking the “Previous” button after viewing an image takes you back, but it forgets where in the directory hierarchy you were — so you have to click a series of (+) symbols to re-open your directory. So Konqueror can no longer be used as an image viewer.
Why did they do this to Konqueror? They should rename it Konquered. Update: after some intensive google searching, I found out how to install KDE 3 under Intrepid. It seems a little quirky, but it does have a version of Konqueror I can live with.
Hibernate. This is one of the two changes I’m excited about, one of the reasons why I wouldn’t consider going back to an earlier version of Ubuntu. It appears as if Hibernate actually works out of the box on the Lenovo T61. I’m not sure whether it worked on Ubuntu 8.04, but this is a feature I’ve been craving for at least 3 years. There are problems with hibernate:
- It is extremely slow (takes much longer than rebooting)
- When it comes back, it first garbles the screen and beeps loudly (twice), which means I better not bring the laptop out of hibernation during a meeting.
- It doesn’t feel like real hibernate — I get the feeling it’s loading a bunch of libraries which it wouldn’t have to do if restoring the computer state. It feels like it hibernates individual running applications.
- When it comes back it forgets about my multiple desktop placement and dumps all my apps onto one desktop (another reason I say this isn’t real hibernate). This is related to problematic interactions between Compiz’s workspace switcher configuration and Metacity’s.
I also haven’t played with it enough to know whether it’s otherwise stable, but no problems so far.
Update-manager. Can’t run update-manager from a root console anymore.
Skype. This very important application is barely usable anymore. It may have something to do with the use of the new Pulseaudio audio server. The person at the other side hears me barely or not at all, often with an echo. Skype used to work fine with 7.10. OTOH, I can now video-conference with Skype!
Printing. I can’t seem to print in landscape mode any more. I’ve encountered this problem so far with evince and Adobe Acrobat Reader 8. The application’s “landscape” option shows up properly in the print preview. But when I actually try to print it prints wide without rotating, with the result that only the leftmost 2/3 or so of the page is visible on paper. This is almost a dealbreaker; there were no such problems with 7.10.
Sound. This is one of the more troublesome parts of Intrepid. I think it has something to do with the introduction of PulseAudio as a sound… server? I know very little about how sound works under Ubuntu, but whatever it is, it keeps crashing repeatedly. At least once a day. There is no sound after the crash, with various applications complaining that they can’t initialize sound. The only way to fix it if I do need sound seems to be to reboot. Skype sound quality also seems affected, though I’m not yet sure Ubuntu’s sound is to blame.
Untested Features I’m Excited About
USB Boot Disk. Nifty new feature; you can write your installation to a USB drive and boot off it on any other computer, thus taking your entire setup with you whereever you go.
Microsoft and Evangelism
What does Microsoft have to do with Christian churches?
Nothing, except that they both exhibit a certain behaviour: aggressive evangelism. Both operate in ways that tend to reduce freedom of choice and make it hard for people to choose alternatives. Their behaviour on this count is similar because their motivations are similar. Both wish to monopolize society.
When Google became popular in search, Microsoft tried to beat Google at search. When Google began its mail service, Microsoft tried to beat Google at mail. When Google began getting into maps, books, Microsoft put some serious effort into the same fields. This is reminiscent of church planting in Indian villages.
When a Hindu temple undertakes a major activity that might get people interested (such as renovation of a temple or appointment of a new priest), Christian organizations often rush to plant a church and engage in a publicity and incentive blitz to attract villagers.
Microsoft has been doing the same thing in the tech domain. If there’s any tech development that attracts people, Microsoft tries to enter it in a big way in order to attract customers to the Microsoft fold.
Both Microsoft and church have practically unlimited financial resources compared to their competitors, and both are extremely resistant to the existence of alternatives.
It’s no secret that I’m on the side of Freedom here: freedom as in free software, and freedom of religion. Makes me wonder: do Microsoft vs. open source and evangelism vs. freedom of religion have the same solution?
Automatically Inserting Matching Parentheses for LaTeX in Emacs
My use of emacs varies, but a good chunk of my time is spent writing in LaTeX for mathematical formulae. AuCTeX simplifies my life quite a bit, and whizzytex makes it awesome. But one feature that would really save me some typing is auto-completion of matching parenthetical symbols. In LaTeX, such matching delimiter pairs are $$, [], {}, \{\}, \left\{\right\}, \left(\right), etc. I found a major mode called Ultratex that does exactly this (and much more), but unfortunately it replaces AuCTeX rather than augment it, and isn’t maintained any more.
Here’s some trivial emacs lisp code for a minor mode that accomplishes this. You can easily modify it yourself to add or remove simple matching completions. You can put it directly in your .emacs file, or in a file called dlmins.el, and add the line
(load "/path/to/dlmins.el" t t)
to load it. If you want this to be activated every time LaTeX is fired up, put the following line in your .emacs file:
(add-hook 'LaTeX-mode-hook 'dlmins-mode)
To toggle the mode manually, use command M-x dlmins-mode. Here’s the code for the minor mode.
;;; dlmins.el -- Trivial minor mode to insert matching LaTeX
;;; delimiters automatically.
;; Copyright (c) 2008 Rajeev Ayyagari
;; Author: Rajeev Ayyagari
;; Keywords: Parenthesis matching
;; Version: 0.01 of Sat Nov 1 11:22:44 EDT 2008
;; This file is not part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Minor mode: dlmins-mode
;;
;; Entering a left-parenthetical symbol causes the corresponding
;; right-parenthetical symbol to be inserted automatically, and point
;; is positioned appropriately.
;;
;; To use, place this code in a file called dlmins.el and add the line
;;
;; (load "/path/to/dlmins.el" t t)
;;
;; to your .emacs. To make the mode start automatically when a latex
;; document is opened, add the line
;;
;; (add-hook 'LaTeX-mode-hook 'dlmins-mode)
;;
;; to your .emacs after the above "load" line. Manually toggle (enable
;; or disable) the mode using M-x dlmins-mode.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set up keymaps and list of delimiter pairs.
(defun dlmins-setup ()
"Initialize delimiter auto-insertion."
(interactive)
;; Order matters in the list below!
;; The rule is if STR2 is a suffix of STR1, then STR2 should come
;; after STR1.
(setq dlmins-dlm-list
'(
("\\left\\{" "\\right\\}")
("\\{" "\\}")
("\\frac{" "}{}")
("{" "}")
("\\left(" "\\right)")
("(" ")")
("\\left\\|" "\\right\\|")
("\\|" "\\|")
("|" "|")
("\\left|" "\\right|")
("\\left[" "\\right]")
("[" "]")
("$" "$")
))
(define-key (current-local-map) (kbd "{") (lambda () (interactive) (insert "{") (dlmins-pair)))
(define-key (current-local-map) (kbd "[") (lambda () (interactive) (insert "[") (dlmins-pair)))
(define-key (current-local-map) (kbd "(") (lambda () (interactive) (insert "(") (dlmins-pair)))
(define-key (current-local-map) (kbd "$") (lambda () (interactive) (insert "$") (dlmins-pair)))
(define-key (current-local-map) (kbd "|") (lambda () (interactive) (insert "|") (dlmins-pair))))
;; Called when left delim is typed, finds and inserts appropriate
;; right delim.
(defun dlmins-pair ()
"This should be called as soon as an opening delimiter has been typed.
When called, looks backward to see which delimiter has just been typed.
It inserts the matching closing delimiter.
Eventually it will be smart enough to take care of \left and \right as well."
(interactive)
(catch 'getout
(mapcar
(lambda (dlm)
"If expression before point matches open dlm, insert close dlm."
(if (looking-back (regexp-quote (car dlm)))
(save-excursion
(insert (car (cdr dlm)))
(throw 'getout nil))))
dlmins-dlm-list)))
;; Toggle the parenthesis matching mode
(define-minor-mode dlmins-mode
"Minor mode LaTeX matching delimiter auto-insertion. use
\"dlmins-mode\" to toggle."
:init-value nil
:lighter " DlmIns"
:keymap '()
(dlmins-setup)
)
Open Source versus Innovation?
I’m reading The World is Flat by Thomas Friedman, and he asks a question about open source that really made me think. What is the motivation for innovation if everybody gives their innovations away for free and nobody gets paid for their innovations, which is what open source seems to suggest?
I don’t have a good answer, but it seems to work. As Friedman himself points out, many important innovations have come out of open source, including the Apache web browser. I would go so far as to say that most innovations in the field have come from not-for-profit efforts. Google’s entire search infrastructure runs on Linux; Amazon’s entire web presence runs on Apache. It’s as real as it gets.
The question is tied to (and perhaps motivated by) statements from Microsoft bigwigs. Here is one that Friedman quotes (the inserts are his):
You need capitalism [to drive innovation.] To have [a movement] that says innovation does not deserve an economic reward is contrary to where the world is going. When I talk to the Chinese, they dream of starting a company. They are not thinking, ‘I will be a barber during the day and do free software at night.’… When you have a security crisis in your [software] system, you don’t want to say, `Where is the guy in the barbershop?’ — Bill Gates
But Bill Gates is hardly in a position to talk of innovation. Microsoft has not made any significant technical innovations in the last 10 years. Windows Vista’s UI is (feature-wise) just a bloated version of Windows 95, with some bling. Microsoft’s innovations are almost entirely on the business end: it has figured out effective ways to stifle innovation by competitors. So Bill Gates talking about what drives innovation is like a thief lecturing about honesty.
Gates’ comment about security is even more perplexing in light of the extensively poor track record Microsoft has in security. Open source alternatives are far more secure in every way than anything Microsoft has. Maybe the reason you don’t want the guy in the barbershop is if you know there’s something wrong with the security, it’s probably the Microsoft guy who’s responsible.
But what Gates says is not really relevant here. None of this actually answers the question: how can you justify, theoretically, the claim that innovation can be sustainably executed within Open Source frameworks?
I don’t have a good answer.
PGF and TikZ
I guess I’m just completely out of touch, but there’s an excellent package that allows you to draw sophisticated graphics within LaTeX (using a graphics programming language) I hadn’t heard of till recently.
It’s called PGF, and the component you use in your LaTeX/TeX source code is called TikZ. You enter simple LaTeX-style commands to tell it what to draw, in an environment right in your (La)TeX code, and it does the job for you. The excellent user manual can be found here, including instructions for installing and a tutorial. (If you’re a Ubuntu user, of course, there’s already a package you can install with a few clicks.) Great examples can be found here. Wow! What a package.
leave a comment