Search Results: "xam"

12 June 2006

Simon Richter: Bind vs. POSIX

Martin, I fully agree that bind should not try to second-guess the admin, but for the simple reason that it is not possible in any sane way to know about all the possible authorisation schemes, so why bother trying? I don't buy the argument that applications need to be able to deal with ACLs either, for exactly the same reason. "scp" for example, could not care less, simply because in the vast majority of cases, it will be used to copy files between computers whose user account databases are not synchronised anyway, so you cannot restore the ACL. If you want that, use tar and explicitly tell i

11 June 2006

Florian Ragwitz: Class::DBI is dead

David, you wrote about Class::DBI performance. Even without benchmarking you could have found out, that Class::DBI is quite slow. Fortunately there are some alternative object-relational mappers available in the perl universe. The best ones I found so far are Rose::DB::Object and DBIx::Class. I took a closer look at both and would like to share my experience. As this shows, RDBO is faster than DBIC in most of the case. The generated SQL doesn't differ too much and therefor it must be the perl side of things that makes the difference. Matt S Trout <dbix-class@trout.me.uk> says:
  However, RDBO achieves its perl speed by aggressive inlining of stuff
  etc. - for example the main object retrieval function in RDBO's manager
  class is >3000 lines in a single sub. DBIC values extensibility over a
  few extra sub calls, so methods are much more broken out and there are
  many more ways to hook into the DBIC execution process to extend.
Also its idea of resultsets is something I really love. Here's a small example to illustrate that:
  my $user_rs = $schema->resultset('User')->search(  registered => 1  );
  $user_rs    = $user_rs->search(
		    comment.title => 'Foo'  ,
		   
		  	join     =>   'article' => 'comment'  ,
			order_by => 'user.name',
		   ,
  );
  # no sql executed yet.
  # now you can use your resultset as an iterator or query a list of User
  # objects from it or ..
  while (my $user = $user_rs->next)  
	  ...
   
  # or
  my $count = $user_rs->count;
Using these resultset makes it extremely easy to built up queries piece by piece and to work together well with, for example, a templating system. You don't need to fetch all row-objects and give them to your template. You can just pass the iterator to the template library. There's a lot more to say about this two object-relational mappers (for example RDBO supports prefetching of multiple one-to-many at once, which DBIC doesn't), but maybe you just should take a look yourself. I personally prefer DBIx::Class for its vast extensibility.

Erich Schubert: Life, Exams, Worldcup

Life: I'm having my final oral exams the next weeks. Starting on Tuesday with the exam on Databases, Index Structures (R-Trees, X-Trees, ...), Knowledge Discovery in Databases and Data Mining. 30 Minutes. Should be okay, though I have been doing way too little reading. This also implies that I'm missing most of the Worldcup fun. I watched the first game, and it's hard to not read about results. But I won't be going to soccer partys every day. I don't care much about watching sports, and I should spend my time studying for the exams.

9 June 2006

Andres Salomon: Holy Tango of Literature

Holy Tango of Literature, by Francis Heaney. The author creates poems in the style of famous poets, using anagrams of their names as the poem titles. For example, the following is the first stanza of “Brr, Footrest” (in the style of Robert Frost):

This ottoman is in my way.
I tripped on it again today;
It chills me with a nameless fear
To think it sees me as its prey.
And the best part? It’s under a Creative Commons license, and is freely available online.

8 June 2006

Ian Murdock: Google badly needs some platform thinking

Another day, another Google product launch, though this one does more than just lay the groundwork for epic battles to come (most recent example: Google Spreadsheets). Google Browser Sync is a Firefox extension that solves an immediate problem that no one to date has adequately solved: It automatically synchronizes browser settings across computers. I’ve been using Foxmarks for a while now to keep my bookmarks synchronized across the various computers I use and have found it incredibly useful. But bookmarks are just a small sliver of the Web 2.0 client problem, and I’ve recently found myself wishing Foxmarks could synchronize saved passwords too, the next maddening bit of client metadata that never seems to be in the right place. Well, I now have my solution, and after using it for a few hours, it seems to work pretty well. My only real complaint is that it only works with one open browser at a time—if you launch a browser on a second computer, it logs you out on the first one. I have multiple computers on my desk with multiple browsers open at any given time, and Foxmarks handled this use case well. Of course, as with all new Google products, this one exposes as many (or more) new holes in the Google platform as it covers, at least for me. For example, why not synchronize my bookmarks with, well, Google Bookmarks? That way, I could get to my browser bookmarks online, add tags (er, labels), etc., with any changes I make online being reflected back on the client side via the browser synchronization. And why isn’t bookmark functionality available in the Google Toolbar? (Actually, it looks like it is available in the IE version, but not the Firefox version, which makes absolutely no sense to me: Shouldn’t the goal be to abstract away the platform underneath, which implies exposing the exact same feature sets in both versions?) And don’t even get me started on Google Notebook, which otherwise looks promising but is completely unintegrated with Google Bookmarks, not to mention the new thing. While I’m at it, why, oh why, doesn’t Google Notebook utilize the very nice word processing functionality acquired with Writely instead of implementing its own rudimentary text editing support? (Ok, that last one’s further afield, but you get where I’m going here.) In summary, I now have three ways to bookmark things using the Google platform—the browser (nicely synchronized across computers via the Google cloud), a star (a la Gmail) next to results in my Search History (but not on plain old Google search), and “Note This” on plain old Google search (but not the Search History). Oh, and they all create bookmarks in different places. The end result? Even though I’m primarily a Google customer these days, none of this mess is usable, and I’m still using del.icio.us to bookmark things. That said, I’m not even using del.icio.us as much as I used to because it’s not as well integrated with the browser as it could be, which is presumably why Google is investing in a saner browser environment. (There, we’ve gone full circle now.) I could go on all day. And, thus far, I’ve only talked about bookmarks. From where I set, this is just an example of a much broader problem for Google: Google has an impressive collection of interesting, but disjoint, features. I’d imagine this is a result of Google’s engineering culture combined with rapid growth. Granted, this approach has served Google pretty well thus far as it pumps new stuff out on a nearly weekly basis while Microsoft struggles to get anything done in less than six years. Of course, Microsoft’s rapidly learning how to be agile, and if there’s one thing Microsoft is good at, it’s assembling disjoint features into platforms. So, heads up, Google: You have a thing or two to learn from Microsoft before that epic battle I referred to earlier begins. They’re certainly learning from you. Technorati Tags: , , , , ,

Joey Hess: rpm hell

I thought I knew most of what was wrong with rpm, but this bug has opened my eyes to whole new levels of evil. (It's also a textbook example of exactly how not to respond to bug reports.) Description of why using rpm to upgrade a package with /usr mounted read-only can cause the package to silently be removed from the rpm database:
RPM uses a "best effort" algorithm when doing upgrades. What actually happened here is that the previous versions were removed as part of the upgrade process, and the newer versions were installed. At least as much as possible. :-) As many files as could be removed from the old install were, and that install was removed from the RPM DB. As much of the new stuff as could be installed was, but the install of some items failed, so the new packages were not added to the RPM DB.
dpkg's behavior in the equivilant situation is to complain as soon as it can't write to a file, and roll back the package state to the previous version.

7 June 2006

John Goerzen: Announcing HSH, the Haskell Shell

Following the "release early, release often" motto, I am happy to announce version 0.1.0 of HSH, the Haskell shell.

You may obtain it with:

darcs get --tag 0.1.0 http://darcs.complete.org/hsh

Things are still very rough in many ways, but this version already lets you:



Here is an example session: (some lines wrapped for readability)

$ ghci -fglasgow-exts HSH
*HSH> run $ ("ls", ["."])
COPYING    HSH        HSH.hs    TODO    announcements  testsrc
COPYRIGHT  HSH.cabal  Makefile  _darcs  test.hs
*HSH> run $ ("ls", ["-l"]) - - ("wc", ["-l"])
12
*HSH> :m +Text.Printf
*HSH Text.Printf> let countLines = (zipWith (\i line -> printf "%-5d %s" i line) 
       [(1::Int)..])::([String] -> [String])
*HSH Text.Printf> run $ ("ls", ["-l"]) - - countLines - - ("grep", ["hs$"])
6     -rw-r--r-- 1 jgoerzen jgoerzen  1285 Jun  6 09:43 HSH.hs
11    -rw-r--r-- 1 jgoerzen jgoerzen   565 Jun  6 09:43 test.hs
*HSH Text.Printf> :m +Data.List
*HSH Text.Printf Data.List> run $ ("ls", ["-l"]) - - countLines - - 
         filter (isSuffixOf "hs")
6     -rw-r--r-- 1 jgoerzen jgoerzen  1285 Jun  6 09:43 HSH.hs
11    -rw-r--r-- 1 jgoerzen jgoerzen   565 Jun  6 09:43 test.hs
*HSH Text.Printf Data.List> run $ ("ls", ["-l"]) - - countLines - - filter (isSuffixOf "hs") 
       - - ("tr", ["a-z", "A-Z"])
6     -RW-R--R-- 1 JGOERZEN JGOERZEN  1285 JUN  6 09:43 HSH.HS
11    -RW-R--R-- 1 JGOERZEN JGOERZEN   565 JUN  6 09:43 TEST.HS
*HSH Text.Printf Data.List> let generator = \(_::String) -> unlines . map show $ [1..20]
*HSH Text.Printf Data.List> generator ""
"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n"
*HSH Text.Printf Data.List> run $ generator - - ("grep", ["1"])
1
10
11
12
13
14
15
16
17
18
19
Future versions will likely simplify syntax to make it easier to write scripts and introduce a sh to hsh converter. I also plan to add pure Haskell tools for some common shell-ish things that one could do in Haskell.

6 June 2006

Uwe Hermann: OS Install Experiences - Part 4: Ubuntu


Note: This article is part of my OS Install Experiences series.
Next OS — the recently released Debian-derived distribution Ubuntu 6.06 (Dapper Drake). Install
  1. First, I downloaded a Ubuntu 6.06 CD image, burned it on a CD, and booted from that.
  2. The first installer screen allows you to choose between a normal install, "safe graphics mode", "check CD for defects", "memory test", and "boot from first hard disk". If you hit enter and wait a few minutes, you're dropped right into a fully working GNOME session (think Live-CD). No user-iteraction is required at all...
  3. If you like you can use the system for normal tasks already (web browsing, whatever). If you want to install Ubuntu, you click the "Install" icon on the desktop...
  4. After choosing the language, timezone (by clicking on your country on a nice graphical world map!), and keyboard layout, the installation begins.
  5. You must enter your user password (no root password, in Ubuntu you have to use sudo for everything which requires root permissions), user account name, and (ugh!) you must enter a full name (same annoying behaviour as with PC-BSD).
  6. The partitioning tool is graphical and quite easy to use. It takes ages to scan the disk(s) and partitions though (yes, I have quite a lot of them, but still)...
  7. That's mostly it, the installation of the packages starts now, and after it's finished, a window pops up asking you whether you want to reboot or continue using the Live CD for a little longer.
  8. What's noticeable is that I was not asked where or how I want to install a bootloader, Ubuntu simply scans the disks, tries to detect the OSes and writes itself into the MBR. Which sucks quite a bit, especially for more complicated setups like I'm using here. For example, it didn't detect the PC-BSD installation, so I can no longer boot that for now (need to fix GRUB manually).
  9. That's it, after a reboot you're dropped into GNOME and the installation is done. Pretty impressive how easy such Linux installations have gotten recently...
Security Continue reading here...

5 June 2006

Matt Brown: The importance of truly Open Standards

I think the current brouhaha surrounding PDF functionality in Office 2007 is an excellent object lesson in why software patents shouldn’t be allowed anywhere near an Open Standard (and software in general!). I’m not sure if a patent is the tool of choice that Adobe is wielding in this particular example, but even if it’s not Patent’s present a large risk to Open Standards and should be resisted. It’s the same as the distinction between a Shared Source program and Open Source or Free Software. You may have the source code for a shared source program and be able to see how it is implemented and how it operates, but there are restrictions preventing you from doing anything with that information. Likewise a standard shouldn’t be called Open simply because you have details on how it is implemented (although that is undoubtably a critical part of openness). An Open Standard should be one which is openly specified and completely free of any other encumberances (such as patents). Unfortunately I don’t see any of the standards bodies making this a priority. My understanding of the IETF RFC process is that you have to file a statement stating any IP claims but you’re not prevented from standardising somethign that you hold a patent on. W3C and the IEEE seem slightly less prone to this problem as they tend to have committee oriented standards process that require more interaction, but I’m still not aware of any direct efforts to prevent parts of the resulting standard from becoming patent encumbered. If the lack of truly Open Standards can bite Microsoft it can bit any of us. It’s not an issue we should be ignoring.

Alex de Landgraaf: Debtags AI web interface

Hacked up a quick REST-style webinterface for the debtags AI classifier, try for example: http://alextreme.org/ai/emacs/use::editing to get the chance emacs is used for editing. My server had to train all night to process all tags, so a central debtags-ai-webservice makes sense. An issue is that it's not very clear which tags are available (an ajax-like interface would be much more human-friendly), but then again this interface is meant to be easily parseable. Next step is to actually use the classifier for approving suggested tags...

MJ Ray: Annoying blog comment misfeatures: anti-spam: How not to do it (2)

Benjamin Seidenberg's Blog: New Anti-Spam Measures uses a simple maths test, which should work, but it produced a rambling SQL error for me. I emailed it as requested and got an error back saying Command died with status 1: "/usr/share/doc/spamassassin/examples/filter.sh" That may block all spam, but also blocks other mail, snatching defeat from the jaws of victory. [links in permalink version]

4 June 2006

Enrico Zini: Dapper on XEN (part 1/1, unfinished)

I need to do some work on a Dapper system, so it's time to try out xen:
apt-get install linux-image-2.6-xen-686 xen-hypervisor-3.0-i386 xen-utils-3.0 xen-tools
xen-tools tries to recommend xen, which is old and has been requested to be removed from the archive. The recommends needs to be ignored, which is not that trivial to do with aptitude. The linux-image doesn't happen to have an initrd. The bug has already been reported. One can recreate one using:
mkinitrd -o/boot/initrd-2.6.16-2-xen-686.img  2.6.16-2-xen-686
Then one adds this to /boot/grub/menu.lst:
title Xen
root (hd0,0)
kernel /boot/xen-3.0-i386.gz
module /boot/vmlinuz-2.6.16-2-xen-686 root=/dev/hda1
module /boot/initrd.img-2.6.16-2-xen-smp
And it boots lovely:
# xm list
Name                              ID Mem(MiB) VCPUs State  Time(s)
Domain-0                           0      939     2 r-----  4677.9
Now xen-tools provides xen-create-image. I'll try to create the Dapper image (deboostrap in my system has already been changed to be able to install dapper):
xen-create-image --size=4G --swap=128M --dhcp --volume=marvin \
                 --hostname=cavazza --dist=dapper --fs=xfs
But I get:
[...]
Creating swapfile : /dev/marvin/cavazza-swap
Done
Creating disk image: /dev/marvin/cavazza-root
Done
Creating xfs filesystem
Done
Installing the base system.   This will take a while!
Copying files from host to image.
Finished
Something went wrong with the debootstrap installation
Aborting
I love detailed error messages. This one is not. So I'll have to do by hand. The documentation says:
Before you can start an additional domain, you must create a configuration file. We provide two example files which you can use as a starting point:
  • /etc/xen/xmexample1 is a simple template configuration file for describing a single VM.
  • /etc/xen/xmexample2 file is a template description that is intended to be reused for multiple virtual machines. Setting the value of the vmid variable on the xm command line fills in parts of this template.
But in Debian there's no trace of the two example files. I've reported to Guido Trotter. Then I googled for the two files and found them. Now, on to adapt Dapper to run under Xen. The good Ubuntu wiki has an HOWTO which crudely makes you install the Tarballed Pre-built installations of Xen 3.0. It's sad that xen-enabled kernels didn't make it into Dapper roper. I can make this:
kernel = "/boot/vmlinuz-xen-domu"
memory = 128
name = "Dapper"
disk = [ 'phy:marvin/dapper,hda1,w' ]
dhcp="dhcp"
root = "/dev/hda1 ro"
I used the pre-built kernel as a domU, but:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)
Sigh. I'll try with the Debian Xen-enabled kernels. Installing yaird and linux-image-2.6.16-2-xen-686_2.6.16-14_i386.deb and linux-modules-2.6.16-2-xen-686. It WORKS! Now, that's not Dapper: that's a debootstrap install of it. No user, no root password, no desktop, no shiny Ubuntu custom config. How to finish the installation? No idea. In the past, I could run base-config, but now it doesn't exist anymore. It seems that the best bet is not to use debootstrap, but to install the CD in the LVM partition using QEMU and then chroot into it and then install the debian xen kernel to boot it. A QEMU install will take ages, and I expect some trouble, like getting partman to see LVM. Maybe I better install on a disk image file and then use tar and netcat to bring the ubuntu installation out of the disk image and into the LVM image. For today, I didn't make it. This job slips another day. Frustration. I hope that at least this description of my efforts so far can be helpful to someone trying similar things. One suggestion I got was to boot the Dapper CD and install from there. I can't: this computer has no bootable CD. Update: I found out http://xensource.com/summerofcode.html and it says:
Project Idea 3: Xen Desktop Outside of Domain 0 This project would deliver a Xen desktop to the user of a client system that presents an abstraction of a virtual desktop to the user in which multiple guests share the virtual desktop, each with a subset of the desktop resources (pixels, etc). Smart management of the sound drivers would allow mixing of sound from multiple guests to the single device used for output. Microphone input could be broadcast to all guests. Technologies such as ALSA already emulate playback settings by downsampling for the hardware etc. so its not hard to imagine a xen-snd-front device munging the data to a common format used for the internal sound card. Issues: synchronization of playback.
So, what I'm trying to do has been proposed as a SoC project and (I guess) is something that can't be done overnight. Although I was planning to run a diskless gdm accessed with XDMCMP from domain0's X server, and to just hand out the audio card to the domU using pciback, so my task would have been easier. Thus I give up using Xen for this one. I'll work around the lack-of-bootable-cd limitation of this computer by installing Ubuntu using QEMU. Which I found out requires using the "Alternate install" CD. The desktop install CD is a live CD installing with Ubuntu Expresso, and the live CD doesn't seem to work in QEMU. Or, I'll install in a LVM partition in the laptop and then move it around using the network. This one's probably faster. Could this experience be an interesting use case for Edgy Eft?

Erich Schubert: Optimize your ext2/ext3 filesystem

You might have read that ext2/ext3 has support for so called "directory indexes", which supposedly speed up operations on directories with many files. For example your /usr/share/doc directory, your packages database, or your home directory (use ls -la wc -l to count the number of files). However, this feature is not enabled on most machines, since up to now you needed to pass a flag when creating the filesystem. The 1.39 upload of e2fsprogs (in Debian unstable as of May 29) made this default. So you probably didn't enable this when creating your filesystem. To check, first find out what your filesystem device is (use mount). Mine is /dev/hda5, so my example will use this device. In traditional terms, this is the first extended partition on the IDE primary master drive. Now use tune2fs -l /dev/hda5 grep features to get a list of your filesystem features. If you have "dir_index" in there then you're all set. Ignore any "needs_recovery" - that is good for mounted filesystems (it just means "not cleanly unmounted") To add dir_index, do the following.

1 June 2006

Adam Rosi-Kessel: Montreal Memorial Day 2006

Rachele and I went to Montreal for the day this past weekend. It was the longest time we’ve ever left our one year old daughter Esther—just over twelve hours with my parents. Remarkably, she survived, and didn’t even miss us. Every time I go to Montreal I’m reminded of just how much better Canada is. For example, Senzala, a Brazilian breakfast place in Mile End, served the most delicious gourmet poached eggs (pictured here with Rachele): We also had a great time visiting the Botanical Garden, a vast park that dwarfs anything Boston has to offer. Here are a few examples of the flora—click on the image to see the full size version.
Along with poached eggs, beautiful gardens, and socialized healthcare, what more could one ask for?

31 May 2006

Aigars Mahinovs: Debconf6 day 7: Lightning and splashing

May 20th. The day started with an important meeting that was aimed at getting our priorities straight for the Google Summer of Code (SoC) program. Many good and some not so good applications have been proposed to Debian by students from all around the world. Now it was the time for Debian to choose the best of these proposals and rank them according to our priorities. We did not know how many applications Google will grant us, so we had to get our rankings right through the whole scale. We want to be sure, for example, that after this meeting project ranked 5th would be less useful to us then any of the first four, but more useful then all others. The discussions were short and very on topic. Rankings were determined quickly and mentors for all selected project were appointed. AJ leading the BOF was very helpful in making decisions when they had to be made. Now we only need to wait and see how many application slots Google will give us. A set of lightning talks followed. The talks were very different: some were funny, some were serious, some were too fast, some got to get boring. The one talk I want to highlight especially is a talk by Joey Hess about what Debian can learn from Gentoo. Especially handling of configuration files on package upgrades was raised as an example. Gentoo is an interesting distribution that is developing very separate from Debian, so it is quite possible that upon closer inspection there are other things that Debian could use from what Gentoo is doing. That only needs some closer inspection by someone with in-depth knowledge in both systems. Right after the lightning talks I want off to prepare for the second group photo - the fun photo in the pool. It was planned just before lunch. The start was small and easy - 15 people easily make a swirl by the side of the pool. As people continue to join maintaining order becomes harder and harder despite all efforts of self-organization on the part of all people involved. The swirl grows, deforms beyond recognizability and then straightens out again, just to be deformed again by newcomers. Just like Debian. When the number of people grew to 50 I decided that we no longer can get a better swirl in any reasonable timeframe, so I called that shot done and called everyone to group into a single bunch for a different take on the fun group photo. That was much easier except for the splashing fight that broke out in the back rows and took over the whole group as soon as I called that the second fun group photo is also done. After that all went for lunch. The next thing I went to was the discussion about the Debconf7. Apparently it was not supposed to be a public discussion, but after a while the consensus of open discussion prevailed and candidate cities for Debconf7 started their presentations. Edinburgh was the first candidate - they had it all: good transport connectivity, good Internet, nice facilities, nice living places. It was not clear about the food and the prices were very high - 30 EUR per person per day, not including food. As the presenter from next city could not come because of visa problems, stockholm presented for her. Sarajevo is the capital of Bosnia and the organizers have all needed problems solved already: facilities are provided by an UAE company (so they are the best one can get for any kind of money), 20 Mbit of sustained throughput Internet connectivity, very cheap food with good adaptability, 15 minutes from the airport. In total the Sarajevo Debconf would cost around 15-17 EUR per person per day. After that "Brixon boys" presented their city for Debconf7. The presentation was more concentrated on skying and other relaxation issues then on the questions that are more relevant to the organization of such conference as Debconf. >From this meeting and from talking to people later on I have two conclusion on the matter: 1. it would be very good to make a decision on the next Debian conference place slightly more open and also pool people about issues that concern them (which is planned now), but I still think that one person should be entitled to make the final decision; 2. I think Sarajevo is the best choice for next year for many reasons, but most important because of cost. The less it costs per person to hold a Debconf, the more people can be there and the more people could get sponsored travel. Some people might even agree to come to Debconf by a bus, which should be quite possible from most of continental Europe it the conference is in Sarajevo. It would be much cheaper and would still be not as exhausting as the 40 hour flight mambo jumbo that I had to take to get to this event here. Bubulle spoke afterward summarizing the i18n situation in Debian before Debconf6 and the discussions that took place at Debconf6 that intend to improve it. It was a good summary, so you only need to watch the i18n BOF videos if you will be working in the infrastructure. CAcert signing event was conducted after that. I have no idea of the real use of those certificates, but some apparently do. As the final discussion a meeting specifically about the Google Summer of Code i18n infrastructure project was conducted. We were deciding what shall we ask Gintautas (the student that proposed the project) to do, how will we define the scope of his work, so that we can have a definite way of determining if he did that or not be the end of the SoC program. The final decision will ultimately be on me. The result of this meeting was that we will ask Gintautas to take the current code of Pootle and make of it an translation system with clearly separated backend where other translation frontends could be plugged into. After that (optionally) he should work to create such plugins in cooperation with other Debian i18n and Pootle developers and also continue refactoring and remaking the codebase to allow for other plugin development. But the essential part of Gintautas contribution will be a clearly separated translation backend with Pootle frontend and a stable API between them. After the SoC will be over Gintautas will be welcome to present his further vision on the whole infrastructure at the I18N meeting in Extramadura. This work will also serve as a research base to clarify Debian i18n needs, so it is very well possible that at Extramadura it would be decided to abandon the current code and make a new system from scratch in Zope 3. :)

Jacobo Tarr&#237;o Barreiro: More articles, please

When one is translating software, some times the original strings are not clear enough.
#. Type: text
#. Description
#. Menu entry
#. Use infinitive form
#: ../partman-lvm.templates:45
msgid "Delete volume group"
msgstr ""
For example, what’s this? Is this the option to delete a volume group you have selected, or is this the option to select a volume group and then delete it? Because the translation for each case would be different: Borrar o grupo de volumes versus Borrar un grupo de volumes . The difference is just a definite vs. an indefinite article. In fact, it could have been clear in the original English text:
msgid "Delete a volume group"
or
msgid "Delete the volume group"
Well, at least it has a note saying it’s infinitive, not imperative. I won’t translate it erroneously as if it read you, user, delete the volume group at once! . This message was paid for by the Platform For More Articles In Program Text.

30 May 2006

Christine Spang: got UROP? (well, sort of)

It’s occurred to me that I haven’t ever actually blogged that yes, I accepted enrollment at MIT. Hence the preparing to move from Camillus, New York, a little suburb outside of Syracuse, to Cambridge, Massachusetts. (I.e. the Cambridge where you get to pick your email!) Not only that, but I have a job. A job at the MIT Media Lab, Tangible Media Group. They use Gentoo (on cygwin…), but I forgive them at least for now since it’s a heck of a lot more interesting a job than the crap retail jobs that my friends are queueing up for the summer. Though it means that I won’t be able to party with them for the last summer before university, since I won’t be home. Why I have the job is mostly Mako’s fault. So, I was staying at him and Mika’s place when I was down visiting MIT, and I met him outside the Media Lab the night I arrived since it’s right across the road from East Campus, where my undergrad student host lives. I got an awesome tour, got to check out the shiny toys, and got introduced to a few people. A day after I get home, I have forwarded email from Mako in my inbox from one of the people I was introduced to (another grad student at the Lab), who’s looking for people to hire this summer. Zing, nifty. The position’s basically a temporary UROP, hence the post title. A month and a bit later, I’ve paid my June rent for my sublet in Cambridge and am making lists of stuff to go shopping for. If you want to be helpful, tell me something you took to college and never used. Though keeping in mind that I’m in a small, rented house for 2.5 months until I move into my dorm in late August. Or, point me to quick and easy recipes. I’ve never really done a lot of cooking before, so I’ll be using the kamikaze “cook or don’t eat!” method here. I have 9 days of high school left until classes let out for exams, and I’m pumped. I’ll only have one final exam this year since the only classes I’m taking that have ‘em are Economics and AP Physics, but I managed to cut through the numerous layers of red tape necessary to get out of taking the New York State physics regents exam since it’s given on the very last day of testing, and I am leaving before then. (I’m heading down on June 19th; it was supposed to be the 22nd.) Seriously, red tape. Talk to guidance counselor, talk to academic dean, talk to guidance counselor again, talk to admissions officer from MIT whom I’m acquainted with, give guidance counselor his phone number so she can fulfill the school politics requirement of having official confirmation of okay-ness, get the go-ahead from guidance counselor afterward. The economics exam is on the first day of tests, w00t (June 12th, IIRC). Commencement is June 17th. Walk across the stage (I’m giving a speech!), then drive across the Northeast to the rest of life.

29 May 2006

Joey Hess: bashing bash

Madduck, the thing you're not seeing in your examples, which is pretty painfully obvious to people who do write a lot of shell code is that the shell starts a subshell for any shell code on the right hand side of a pipeline. So when you do:
echo -e "1\n2\n3"   while read i; do
    blah
done
You're running the whole while loop (not just its body) in a subshell, just as if you'd written:
echo -e "1\n2\n3"   (
    while read i; do
        blah
    done
)
This is indeed occasionally annoying. (BTW, any posix shell will behave the same way. I'm suprised zsh doesn't, but then I don't generally write significant code for zsh since it's so different.) (PPS, can I delete Biella's drive now?)

Martin F. Krafft: Shell sucks

Shell programming must be the most depressive waste of time out there, and if only because things sometimes just don't work the way you'd expect from a scripting language. Take the following simple examples in bash (3):
for i in 1 2 3; do
  echo $i
  exit 1
done
echo END
==> 1
echo -e "1\n2\n3"   while read i; do
  echo $i
  exit 1
done
echo END
==> 1
==> END
WTF? The result of the first -- the whole script exits entirely after the first iteration -- is what I expect. After all, I did not call break, but exit. The result of the second is totally unexpected. I understand that for and while each execute their iterations in a subshell, but why don't these behave in the same way? The fix here is a exit $? following the done keyword. Urks! Here's another one: the task is simply to output the number of 1's in the output (yeah, I realise grep -c can do this too):
cnt=0
echo -e "2\n1\n3\n1"   while read i; do
    case $i in
      1) cnt=$((cnt + 1));;
    esac
  done
echo $cnt
==> 0
The reason? The while subshell receives a copy of the caller environment, so when it updates $cnt, it only updates a copy of the actual variable, leaving the original untouched. Similarly, a variable defined inside the subshell won't be available after the while loop is done. I cannot find a fix that's not bash specific. Of course, it works fine when I replace the while loop by a for loop:
cnt=0
for i in 2 1 3 1; do
    case $i in
      1) cnt=$((cnt + 1));;
    esac
  done
echo $cnt
==> 2
Great, isn't it? And I am not surprised that zsh gets it right. Why would anyone actually want to use bash? Update: here's Joey's explanation for the behaviour, and Clint's account for why zsh does it right. I still can't figure out how to count the 1's. Update ^2: Axel Liljencrantz sent in this message. Update ^3: Alexander Sieck showed me that process substitution ("<(command)") instead of the pipe does work (for both cases):
while read i; do
  echo $i
  exit 1
done < <(echo -e "1\n2\n3")
echo END
Of course that's nowhere near POSIX compliance... Update ^4: my solution, which allows for spaces in the lines:
IFSOLD=$ IFS:- 
IFS='
' # yes, a newline
for i in $(the_command): do
  IFS=$IFSOLD
  ...
done
What a hack!

28 May 2006

Ian Murdock: Picasa: Why not a native Linux port?

Robert Love: “In Google’s calculation, the cost of a native port outweighed the benefit of a native [port] v s-a-v s a WINE-fueled Picasa. Is that really unexpected? Our development platform is no shining star. We have two toolkits, poor binary compatibility, and unclear direction. To be sure, vendors such as Novell are devoting increasing effort toward improving the Linux ISV and platform story. But the community must make it a priority as well, from the kernel up through the highest levels of the graphical desktop.” That’s part of it (and certainly an accurate assessment of the kind of thinking we need as a community to make Linux a better platform). I think there’s another part of it, though, and that’s that operating systems in general are fundamentally uninteresting to Google as platforms in themselves, as well they should be—after all, the web is Google’s platform, and they dominate there, so why should they promote an alternative where they are much weaker? In my view, the (fat) client bits merely exist to ease the transition from the current, predominantly desktop centric world to a new web centric world where Google naturally thrives. After all, such paradigm shifts are always gradual. There’s the offline question too—if all your data is in the cloud, how do you get to it when you’re not online?—though I suspect over time the browser will provide offline capabilities of some sort, so this is largely a temporary problem too. So, using Wine in ports not only minimizes the incremental cost of building out a foothold on the client (which, again, is a necessity for Google, given that Google’s biggest competitor is between them and 90% of their customers), but it raises the fat client platform up a level too. In other words, it builds a fat client platform with a consistent look and feel across desktop environments; and with this, the operating system underneath rapidly becomes irrelevant. The real question is when Google will hook Picasa into a photo sharing service of its own. I already keep my photos in the cloud, and I’d love to organize and edit them in Picasa (Organizr is nice, but nowhere near as nice as a desktop application, and it doesn’t have some basic functionality, like import from camera and red eye repair). Of course, this is just one example of Google having some platform thinking issues of its own, though that’ll have to be a rant for another day.

Next.

Previous.