Search Results: "xam"

6 December 2006

Joachim Breitner: No more Obroni Computer Club

Yesterday I was planning and prepared to hold the last session of the Obroni Computer Club that I ran at the SOS Hermann Gmeiner College. Very disappointingly, nobody showed up. Well, not entirely true: The computer lab was crammed full, as ususal around that time, but nobody was there for the club.It might have been because there were no club sessions the last two weeks because of exams, and the students forgot that I told them that there will be another session after that in a mail back then. It might have been because the IG2 class (10th grade), which presumedly make up the largest part of the club, had a meeting at that time. Or it might just be that I did not mange to awaken the student s interest and nobody cared.I have put all material for the club, together with various other documents from my SOSHGIC time, on the Ghana contents section of my now (mostly) bi-lingual and very slightly redesigned homepage.

Matthew Palmer: I Have Problems With REST

Not being one to stick with what I know, over the last few days I've been trying to put a RESTful sheen on a small app I'm toying with. It's quite simple -- there's really only one type of resource I need to deal with, and I've got a solid URI structure to refer to it all. So far, so good. I've read all the theoretical stuff about how URIs should be nouns, and the HTTP action should be the verb -- and I agree with the sentiment, at least for this system I'm writing[1]. I can even (I think) model all of that stuff using my framework of choice, the ever-hyped-but-good-despite-that Ruby on Rails. There's even fairly explicit support in Rails for a lot of what I want to do, with automatic Content-Type: and Accept: handling logic built-in. But this thing is, primarily, a web app, not a web service. I want the RESTful thing so I can interact with the app programmatically, but at the end of the day, I expect most interactions will be via the good ol' HTML. How, then, do I implement my HTML interface so that my user's browser does the right thing with my resources? My REST resource http://example.com/widgets/1337 will do the right thing if an appropriately-credentialled user issues a DELETE /widgets/1337 request, but how do I tell a browser to do that? The "traditional" way I've done that sort of thing, in Rails, is to encode the verb in the URL, like so: /widgets/delete/1337, but I completely agree with the idea that a GET request shouldn't modify data[2]. So I'm completely sold on the idea of not encoding actions into the URI itself. I'm also a DRY[3] kind of guy, and one of the things that has always slightly irritated me about web services is that, when you write them alongside a HTML-oriented webapp, you often have to duplicate logic (even if it's not very much) to get both versions working. Considering that both the webapp and the REST service are using URLs in pretty much the same fashion, it seems very wasteful to have to design two subtly different schemes to handle the two nearly-identical sets of requirements. So, having written this article without managing to figure the answer for myself, I invite comment (sent to mpalmer@hezmatt.org, and I'll summarise later). How do I tell a user's browser to issue a DELETE or PUT against a URL? Am I being overly idealistic to expect the two access methods to be somewhat comparable? Should I just give up and encode the action I want in my URL, or maybe the parameters to the POST request? Am I even completely misunderstanding REST, and trying to find answers in it that just aren't there?
1. I have some slight qualms about the idea that every possible interaction with any possible system could be modelled using an unlimited noun set and four verbs, but I'm happy to leave that debate alone for the moment, as I don't have anywhere near enough experience to speak intelligently, and I have more basic problems at the moment anyway. 2. I remember the common story of the website where the 'delete' hyperlinks are regular GET requests, and the first Google spidering of the website causes everything to be deleted, resulting in a very bare database. This is a result I'm keen to avoid. 3. Don't Repeat Yourself -- a phrase that should be tattooed on the inside of every developer's eyelids.

5 December 2006

Josselin Mouette: My contribution to dunc-bank

Over the last few weeks, I have been very busy at work, and therefore hadn't have much time for Debian. Especially, I haven't been able to help the Dunc-bank project as much as I wanted to. However, it recently became obvious that I brought my contribution to the project's impressive success (despite being not too dramatic). That was, orphaning libpng. The one thing to know about libpng is that upstream developers like to break their software at every single release. Given the number of packages depending on it, it is not reasonable to upload new versions less than 6 months before the release; this is the reason why I carefully kept the working 1.2.8 version. However, despite being warned, the new maintainer decided to upload two new upstream versions with a high urgency to fix two security issues, instead of backporting them. Looking at the rest of the changelog is eloquent : The result is now, according to the unofficial RC bug list, no less than six libpng-related release-critical bugs: Before anyone asks me: no, I'm not volunteering to fix these bugs. Maintaining libpng is a tedious and time-consuming task that requires more motivation than I currently have. It is way too late in the release process, and my advice for a short-term solution (suitable for a release in two months) would be to revert completely to 1.2.8 and backport the security fixes. The medium-term solution involves even more work, but I think there is no more choice: the library needs to be split in two, one private library with an unstable ABI for software like pngcrush and optipng, and one public library with a very strictly fixed ABI (probably following closely the LSB). Good luck to anyone implementing this. The long term solution is more appealing: rewrite everything from scratch. The PNG specification is much clearer than the libpng code, and calls for a clean reimplementation using modern programming techniques. For a completely unrelated, but more entertaining moment, I recommend the reading of this Bjarne Soustrup interview, where he tries to defend C++ against all common sense. The introduction really made my day: C++ remains the archetypal "high level" computer language (that is, one that preserves the features of natural, human language). Something to meditate on.

4 December 2006

Erich Schubert: Software mixer with ALSA

The "high definition audio" in my laptop is rather minimal. Apart from the mic not yet working, it has a line out and a single volume control. Thats it. However, I'd like to have multiple applications use the sound card, for example my music player, eventually some video player or flash, and some system events. ALSA to the rescue. It's not easy to configure, but really powerful: Mixer screenshot with MPD volume control Yes, that is a separate volume slider in my regular mixer for MPD, my music player. Here's how to do that: First we'll need to create a huge /etc/asound.conf:
# the real device
pcm.realdev  
        type hw
        card 0
        device 0
 
# software mixing
pcm.dmixer  
        type dmix
        ipc_key 3129397
        ipc_key_add_uid false
        ipc_perm 0666
        slave.pcm "realdev"
        slave  
                period_time 0
                period_size 1024
                buffer_size 8192
                # we're enforcing 44100, since thats what most apps use
                rate 44100
         
        bindings  
                0 0
                1 1
         
 
# software volume
pcm.softvol  
        type softvol
        slave.pcm "dmixer"
        control  
                name "Software"
                card 0
         
 
pcm.mpdvol  
        type softvol
        slave.pcm "dmixer"
        control  
                name "MPD"
                card 0
         
 
# input
pcm.input  
        type dsnoop
        ipc_key 3129398
        ipc_key_add_uid false
        ipc_perm 0660
        slave.pcm "realdev"
 
# duplex device
pcm.duplex  
        type asym
        playback.pcm "softvol"
        capture.pcm "input"
 
# default devices
pcm.!default  
        type plug
        slave.pcm "duplex"
 
pcm.dsp0  
        type plug
        slave.pcm "duplex"
 
I won't go into all the details (I don't know all of them either), but the basic idea is that I setup the dmixer plugin for software mixing, and attach two software volume controls to it. I'm keeping the permissions to 0666, since my MPD is running as a different user, and I didn't find a way to say I'd like to have the permission set to group "audio". The default device is the regular microphone jack (untested, since there are driver issues with my chipset and recording) and the "Software" volume control. If you have an ~/.asoundrc you might want to move it out of the way. Next I need to configure MPD to use its own volume control via /etc/mpd.conf:
audio_output  
        type            "alsa"
        name            "my ALSA device"
        # 'mpdvol' is the device name I used in asound.conf
        device          "mpdvol"
 
You'll probably need to restart all applications currently accessing your audio devices to have them pick up the new config. The new volume control will also only appear after you've started an application using it AFAICT. Sometimes you need to restart them twice for the new volume control to be effective. When alsa-utils restores the volume controls after reboot it should work right away. The "Software" volume control is optional, but that way I can tune down the default applications volumes below the MPD volume if ever needed. Oh, and I think you can safely keep one or all of the software volume controls to maximum without distortion happening (this doesn't hold for all sound cards, where it's often best to keep the sliders at ~75% max to avoid distortion)

3 December 2006

Erich Schubert: Skype bastardized DBus

I've started playing around with DBus a little. It's somewhat cute, I was able to quickly write a script that monitors my wireless network connection going up and down, and after some searching for useful documentation, I'm now able to tell gaim to disconnect when my wireless goes down and reconnect when it comes back. All with just a few lines of Python. While searching for some docs on the Gaim API, I stumbled upon the Skype DBus API. But it's crap. Evil stuff. (And not working, from what I can tell; I read somewhere they're using a totally outdated DBus version, and to use it you have to downgrade and break lots of other stuff). They've totally bastardized DBus. First of all, the trace of a DBus API I've found is on a system level, not a user/session level. It should be per-session; you especially don't want others to mess with your Skype. Instead of offering an API with sane methods to invoke, they offer a single method, called "Invoke", and a single callback called "Notify". Ouch. With these methods you're expected to do a ascii protocol something like this:
-> NAME UltimateProgram
<- OK
-> PROTOCOL 5
<- PROTOCOL 5
Note that the name choice is up to the connecting application; so you can cloak yourself as a different application; it will be displayed to the user when asking for confirmation, apparently. Another example how crappy Skype dbus is: their "dbus example in C" links to the Python example and the other way round. The C example consists of 2.4 MB precompiled example and about 100k source code (the example of course is a graphical client). For comparison, this is a complete example on how to reconnect all your Gaim accounts via python-dbus:
import gobject, time, dbus, dbus.glib
# get DBus inteface
sesbus = dbus.SessionBus()
gaim_obj = sesbus.get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject")
gaim = dbus.Interface(gaim_obj, "net.sf.gaim.GaimInterface")
for account in gaim.GaimAccountsGetAllActive(): gaim.GaimAccountDisconnect(account) time.sleep(5) for account in gaim.GaimAccountsGetAllActive(): gaim.GaimAccountConnect(account)

Amaya Rodrigo: Amayita in ProzacLand

[Absolutely nothing related in any way to Debian or Free Software here, so you can just skip ahead]

As some of you may be already aware of, I suffer from OCD, in a very mild form. If left untreated for long enough time, in my case it was years, it leads to depression. A good one. You can end up in Learned Helplessness Land, where your closest companion will be your inner voice, constantly criticising you, blaming you for anything that happens, I even used to believe I brought bad luck to the people I was with or met.

I strive for perfection, and the world is not perfect, not everything is under my control, and OCD is just a jail. In my case it is cleaning and re-arranging stuff. My perfectly shiny jail.

Some of my friends think it is so bourgeois that I have a person come clean my house every week. Maybe they do not understand that I can t clean, because I can t stop. The same way an ex-addict can t take $SUBSTANCE_OF_CHOICE. When I get stressed I tend to clean, and when I start cleaning I just don t stop. One stupid example of how ridiculous it can get: doing the laundry in an empty laundry machine so that it is clean inside. I can kill my plants by watering them too much, specially Cactus, dist-upgrading all my machines every morning, and then several more times a day, even if i know there will be no updates available at all.

And while I am doing it, I don t enjoy it. I can t stop, control it or decide anything. I follow very strict rituals, things have to be the right way, following a very complex set of rules that make sense to no one else but me. Well, not even me. But I have to, I don t choose to, and that is where the jail comes from.

I think it all comes from my childhood, in a very chaotic household, at a deeply disturbed family, with an abusive, alcoholic father and a very overwhelmed mother, the only thing I could control in my life was that my room was clean and arranged, as opposed to the rest of the house, and my homework perfect, as opposed to the rest of my life. The same way anorexics feel in control when they let themselves starve to death, because they control the food they eat, their hunger and their bodies.

My father also turned up to be psychotic, manic-depressive, and what not. When my mother finally forced^W helped him to stop drinking, I had this hope that things would be fine, but they didn t really improve. I was eleven. At the beginning it was the drinking, then the mental illness, then the aging, but my worst fear has always been to become him. To do onto others what was done to me. When I was 16 I already knew I would never have kids. I can t even bear to think that I could fuck up the way my family did. I can t even bear the thoughts of passing these genes onto an innocent baby. I specially hate the idea of bringing a new baby into this fucked up world, with so many kids out there so helpless, as myself as a kid, that nobody wants. I would definitely adopt a kid one day, if I was sure I would not repeat certain behaviours on him/her. If a doctor would put it in writing with his own blood.

In 2004, wanting to kill myself, even with a well thought plan and a written unofficial will (who gets my laptop, who gets my clothes, who gets my money, and so on) I went into treatment. Some of you might remember I was kind of MIA at the time. I was on Prozac, tranquilizers, and a year and a half therapy later, I was fine. I was even happy! That was by Debconf 5, after being fired from a job that was hurting me, giving up a 15 years relationship that had become unhealthy for both of us, the death of two very dear friends, and other looses not worth mentioning in this blog post that already gives too much away, I was finally happy. My life radically changed, my jail was almost gone, my fears were under control, I was finally free.

But, recently, a very dear friend of mine got sick, not any near what my father was or had ever been, but I saw myself in a mirror. My worst fears paralyzed me. My inner voice whispered I would end up being him. Again. And again. And some more. So I had to fight my I can do this alone pride, called my doctor and I am back on all the crap that will probably fuck my brain chemistry in the long run, and back on therapy, which is the only resource that will be really helpful for my life. I am not as bad as I once was, and it is going to be much easier this time, but I am scared as hell, because I though this was gone forever. But my friend got sick, and I had a stressful couple of months at work, and (yay!) I started cleaning again.

My physical health is also reflecting what I am going through. I am in a very acute UTI episode. The amount of pills I take in the morning is getting scary now. The pain and the burn are hardly bearable, and I have become unwillingly an early riser. I wake up at 5:30 or 6:00 am, and go to bed somewhere between 8:00 and 10:00 pm. One of the side effects of the painkillers is I can t really focus my sight at the moment, so my computing is painful and limited.

Being unable to concentrate on the computer I engaged in compulsive house improvement.

* I changed every light switch and power outlet in the house without turning the power off. Dangerous? Sure. Am I proud of my new skill? You bet!

* I revamped a very old and crappy piece of furniture I found in the trash. When the lady that cleans for you has a better cell phone than you, and you can t afford new shoes for the winter, you start looking at the stuff other people throw away in a different way. In a very different way.

* I lost ten kilos, and the clothes I wore to Brazil fit again. I am fixing the broken bits, because I can t really afford to get clothes of my new size anymore either.

Some pics of my achievements (some work is still in progress):



You might have noticed my web server is down at the moment. I hope this post explains why I am timing out. My server is called aenima, latin for soul, and quite incidentally.

2 December 2006

Erich Schubert: Go Tagging!

Debtags made quite some progress the last months. Many thanks to Enrico Zini, who did most of the work. We now have a new database (on alioth), a new editing frontend (using Ajax, and accessing this database) and a couple of nice utils around it. Go Tagging is a page listing untagged packages - by popularity contest score. Just go there, click a package you are somewhat familiar with (sorry, the really popular ones are already gone :-) but there are still some well-known ones in there such as "rails") and edit the tags. Enrico also did some kind of AI to suggest tags. This is not based on the Google Summer of Code project, but something Enrico did using the Xapian search engine index he's been using for the main search function. A couple of good features have been proposed, but are not yet implemented. For example, a "similar packages" overview, so that when you've been tagging one package you could easily switch over to another similar package. Or a per-maintainer view. It was suggested that it should be added to the packages.qa.debian.org per-maintainer view page; this would be great, but will require some more work to be done. On a related base, it would be interesting to make a tag cloud (like this Debian package cloud) on one maintainers packages only. This would then be a view of one maintainers interests in Debian... Anyway, thanks to everybody who has been tagging packages and helping with the backend databases and applications.

Jaldhar Vyas: The Real Meaning of Nalanda

Venkatesh Hariharan recently wrote an article on Indias traditions of knowledge and how Open Source meshes with them. Now having met him at foss.in and knowing of his work, I am 100% convinced he is on the side of the angels and their is no malice in what he wrote. However, his interpretation (really not his, but the conventional wisdom amongst the Indian elite.) of Indian history and culture is so monumentally wrong it bears correction. While I admit my hackles were raised by the cultural and theological mistakes made, there are implications for Open Source advocacy in India and the world at large too. He starts by giving the example of Nalanda, supposedly "the first university in the world." but more accurately a Buddhist vihara (monastery.) Its' very name indicated sharing. I use the past tense because Nalanda doesn't exist anymore. In fact except in a few border areas influenced by Tibet or Burma, Buddhism itself is so thoroughly extinct in the land of its birth, the place where it flourished for over 1500 years, that the only reason people like Hariharan or myself only know that there ever was such a thing due to the work of 19th century Western Indologists. How could this be? One theory is that a resurgent Hinduism coopted or persecuted the Buddhists into oblivion. However this is unsatisfactory. It does not explain why Jainism (a religion as old as Buddhism and equally heretical for exactly the same reasons from the Hindu point of view) still survives to this day and it doesn't explain how it could have happened for even the most advanced genocidal regimes of the 20th century have been unable to "disappear" undesirables to the extent which Buddhism disappeared. A more plausible explanation revolves around the fact that, as I mentioned before, places like Nalanda were Viharas. This doesn't mean that they can't have university-like properties too; after all the great academic institutions of Europe also had religious foundations but the monastic nature of a vihara is salient. A monastery is not a place you go to engage the world, its a place you go to escape it. To mix metaphors a bit, the viharas were cathedrals not bazaars. While there may have been a lively intellectual life within its walls, there is no evidence that Nalanda and its denizens interacted much with the surrounding culture. An economically unproductive institution of such vast size (15,000 monks at its peak) could only survive by the patronage of kings and other rich people. When that patronage dried up as for example when the medieval Muslim invasions swept away the old royalty, Nalanda and its sisters couldn't survive. Just as when a proprietary software company dies, its "intellectual property" often dies with it, when centralized Buddhism died, Buddhist ideas died with it. (Luckily Buddhism had spread to other countries by then and developed new, less monolithic forms so it was not lost to the world altogether.) In contrast Hinduism (and for that matter Jainism) while having all due respect for monks were and are primarily lay movements. The pursuit of morality (Dharma), wealth (artha) and pleasure (kama) in this world are equally valid human goals alongside liberation from the world (moksha.) and this manifested as the much maligned institution of caste. Hariharan quotes the conventional view probably familiar to Westerners from Anthropology 101, a lock-step hierarchy of four classes (varna is the Sanskrt word) with fixed occupations, with knowledge and privilege on top and ignorance and oppression at the bottom. The thing is, this view bears no relationship whatsoever with social reality in India now or historically. There is another Sanskrit word, jati, which can be translated as caste. There are thousands of these jatis and while Indian thinkers have periodically attempted to try and shoehorn them into the varna framework, they have had little success and varna is for all practical purposes just a theory. And this is not just a fall from some putative golden age (Like the canard that once caste was flexible and merit based and only later became rigid.) but the state of affairs throughout recorded history.

A jati consists of people who share a common (or fictive) kinship, who have particular food and ritual choices, and marry endogamously. While many jatis are associated with a particular occupation, many others are not. This is what caste means to a typical Indian (it is also the social organization prevalent amongst Jains, Sikhs, Muslims and Christians even if they don't accept its theological basis.) Yes, hierarchy and concommitantly oppression, are in some cases a byproduct of casteist thinking but they are hardly its raison d'etre. A comparison can be made to the Western nuclear family system. Some people think it is superior to any other form of social organization. Most people wouldn't go that far but go along with it as "the way it is." Some of those of a liberal persuasion might want tweaks of certain aspects of it. A very small fringe think it is nothing more than a nefarious plot to spread patriarchy, subjugation and racism etc. They are mostly considered kooks by the other groups. (Unfortunately when India and caste are concerned, the kooks are ruling the roost.) The diversity of jatis like the diversity of open source creates a certain resistence to disruption that a monoculture cannot. Thus though Hinduism also suffered grievously from invasions, it was able to hold on where Indian Buddhism could not. Brahmin (sic. That's an English mispronounciation.) is also misinterpreted as one who knows Brahma (masculine noun. The Creator God.) instead of Brahman (neuter noun. The supreme spirit pervading the Universe.) though even then it would be wrong because Brahmin, Brahma, and Brahman all come from a common root word brhati (feminine noun. Sacred speech.) as any Sanskrit dictionary will attest. Hariharan cites the example of the sacred scriptures (Sic. He means the Vedas) and the notorious statement of the Manusmrti saying that an unqualified person who hears them should have molten lead poured into their ears as examples of the proprietarization of knowledge. Now the long-suffering untouchables may have been afraid of many things but having lead earplugs was not one of them. There is no historical evidence that any such action was ever attempted. You can criticize the Manusmrti for even saying such a thing but that is a far cry from using it as evidence of historical attitudes. You see, the Manusmrti is not even in the most orthodox conception Hindu Sharia and the Vedas are not "Sacred Scriptures" in the sense that the Bible or Koran are. Rather they are part of a wide range of significant literary works respected in Hinduism of which other important examples are the two Epics the Mahabharata (which includes the Bhagavadgita), and the Ramayana, and the vast compendia of geneologies, philosophy, lore and legend called the Puranas. Hariharan actually missed a good chance to make his point here because while the Vedas are indeed "proprietary" the other works I mentioned are not and have in fact permeated all over India and even beyond its borders. Many Indian languages owe their literary existence to translation of the epics or Puranas. For instance one of the earliest monuments of Hindi literature is the Ramacharitamanasa, Saint Tulsidas's translation of the Ramayana. When he wrote it in the 16th century, he did face some opposition from those who didn't think such an august work should be rendered into a "vulgar" tongue, he also received encouragement from equally orthodox people (including those who believed the Vedas should be restricted to Brahmins) Today it is by many accounts the most popular Hindu holy book in existence. So really the whole idea that the Hindu canon shows a fall from open grace to rigidly controlled private property is just bogus. To those who have slogged their way though all this verbiage wondering what it has do with Linux and Open Source, let me assure you I am getting to the point :-) It's bad enough from my point of view as a devout Hindu that my religion would be misrepresented this way but from my point of view as a supporter of Free Software ideals, it is catastrophic. Linux and Open Source in India has spread, as in most parts of the world, primararily as a hobby amongst computer enthusiasts and for a hobby it's doing ok. However if you think of it as more than that, as a tool to enhance society and empower peoples lives, that is not nearly good enough. But how can one serve a society if one apparently has no clue about that societies history and mores? The developing world is littered with failed projects that were carried out with the purest of motives but no regard to what the putative clients actually wanted. Do we want Linux and Open Source deployments to go the same way? For a couple of years now I've been trying to get Indian and NRI programmers to get involved in localization in debian-installer and elsewhere but even with the small minority that are sympathetic to Open Source (a scandal in itself.) it is like pulling teeth. To their credit, Red Hat India pays people to work on such things but volunteerism is the heart of the Open Source movement as we all know so the apathy of Indian IT professionals is deeply troubling. Hariharan is trying to increase interest by appealing to the Indians' sense of cultural pride which is a good tactic--it has been successfuly applied by many non-western or minority cultures--but he is not going to be very successful if the vision of Indian culture he is presenting is as alien as Eskimo culture to the vast majority of the people. Western Open Source advocates also run into difficulties due to being tone-deaf in their understanding of how third-world cultures actually operate. When India declined to participate in the One Laptop Per Child (OLPC) project, some commentators on places like Slashdot were perplexed. Wouldn't a poor country want an inexpensive yet efficient pc using free software instead of high-priced imports? The thing they missed is that while people in India may be poor, thanks to a more-or-less democratic polity and more-or-less open communications, their frame of reference is no longer their village. Their trends are increasingly set in Mumbai, New York, Paris, and London. The forward-thinking amongst them know that computers are the key to the future. They also know Bill Gates is the richest man in the world thanks to something called "Windows" knowing which can get you a green card and your own chance of becoming rich. So if Linux comes along, presented as a cheap alternative which is "just as good", the fake Gucci handbag of IT if you will, it is not going to impress. Thinkpads and Dells appeal to the upwardly-mobile persons vanity, a third-world hand-cranked laptop does not. (This incidently is what is behind the "Nalanda university" meme too. Monasteries are yesterday. Universities are the in thing so we have to have some in our past and not just any but by golly, the first university in the world.) When they venture from pure technology into the realm of culture, Open Source advocates need to be a lot more sophisticated, not to mention accurate, in their arguments lest they fall on deaf ears. Platitudes and sentimentality about "spiritual" versus "material" culture aren't enough. There must be concrete demonstrations of the benefits of why the Open Source approach to knowledge is better. They must be more sensitive in their presentation to avoid needlessly antagonizing people who might otherwise be natural allies. I believe the Open Source ideal is good for India and the whole world, not just in software but for society at large and I wish Venkatesh Hariharan and all the others on the frontlines of the fight for openness the best of luck. But good intentions cannot excuse sloppy thinking.

1 December 2006

Ian Murdock: Now *this* is Office 2.0

It’s now possible to dynamically link web data into Google spreadsheets. For example, stock information can be pulled in via the simple formula GoogleFinance(ticker, attribute), where attribute can be any number of metrics from market capitalization to P/E ratio. Not much to choose from yet—at this point, there’s only GoogleFinance and GoogleLookup, which seems more novelty than useful, and I’d love to see more than just the obvious metrics available for GoogleFinance, things like cash per share, revenue growth over the past m years, number of insider purchases over the past n months, etc. However, it’s a great start, and it’s pretty easy to see where they’re going with this—after all, most spreadsheets are inherently linked to external data sources, though I’d wager a majority of them are “linked” via copy and paste. I look forward to the day when you can pull in all manner of structured information into a spreadsheet via similar formulas. To me, this is the real value of “Office 2.0″. To compete, the office challengers have to go beyond just copying Microsoft Office on the web—success will come from exploiting the new platform, not cloning the old model. Pretty easy to see something like this grow into a platform all its own too. With a few more financial metrics, a slightly more powerful macro language, and the ability to connect to more arbitrary data sources (say, Google Base or the CSV files my bank makes available to me), I could track my finances on the web in a Google spreadsheet and give Quicken the boot (for what I want to do, Quicken is like driving a nail with a sledgehammer). Update: Google spreadsheets has an API now too.

30 November 2006

Yves-Alexis Perez: exiv2

Ok so, I was there, trying to assemble pictures taken at my sister's birthday. I have my pictures, her boyfriend's pictures, both have more or less the same date sor pictures have the same timestamp. Then comes another friend, which camera isn't at all at the same time. It's +/- 6:43 hour lead. And there is the mess, because I want all those pictures sorted by time, so people looking at them doesn't have to sort them himself. He just clic "next" and the next photo appears, whoever has taken it.

Now, I want my pictures sorted by time and gallery knows how to extract the time for EXIF tags, so I don't have to set the modification time of the files accordingly. But what to do when even EXIF tags are wrong ? I just discovered exiv2 adjust option, which does exactly what I want. From the manpage:

ad adjust
Adjust EXIF timestamps by the given time. Requires option -a
time.

-a time
Time adjustment in the format [-]HH[:MM[:SS]]. This option is
only used with the ’adjust’ action. Examples: 1 adds one hour,
1:01 adds one hour and one minute, -0:00:30 subtracts 30 secccc‐
onds.


So a simple loop accros those files:

corsac@hidalgo: for i in * [/tmp/gallery/arthur]
for> do
for> exiv2 ad -a -6:43 $i
for> done


and the work is done. Simple. Powerful. I love it.

29 November 2006

Paul van Tilburg: Bachelor of Science

The Bachelor of Science certificate After finishing Hypermedia and History of Computing in October I was ready to meet the requirements of the bachelor’s exam. I passed it on November 14 and received my Bachelor of Science in Computer Science last Monday. While before the BaMa (Bachelor Master) system was introduced this 3-year milestone might have meant nothing at all, so it feels kind of odd that I have finished a study now. I’ve updated my CV. I hope I can do this again soon, namely when I’ll finish my Master of Science…

Pierre Habouzit: On C and strings APIs

C default str* functions have very poor semantics, and a whole lot of consistency problems. That's a fact, a well known one. For those who still don't know them, and only to cite a few: A good string API MUST treat any string as a buffer + its allocated size (not len, I said size, meaning including the terminating NUL). Moreover, it should return informations that avoid the stupid problem of strcat that has to compute the destination length again and again. There is one function of the usual C string API that has it right, if you forget about the int return type problem: snprintf[1]. Why ? because:
  1. it prevents most buffer overflows because you always pass the buffer size;
  2. unlike strncpy the resulting buffer contains a true NUL-terminated string;
  3. it returns the size the string could have had if there was enough space in the buffer, so that a correct reallocation can work with reduced programatical costs;
  4. if you support negative buffer sizes, you can chain as many of those calls, and be safe !
and if you want a proof that it makes code more concise, just go read that patch. EDIT: Here m_strcpy is a function that respects the 4 previous points: m_strcpy(dest, dlen, src) copies src into dest like its brother strcat, but in a buffer of size dlen, and returns in fact, src length, la snprintf. And if you do m_strcpy(dest, -1, src) it does not breaks, so that I can use it without needing to check if my virtual result length overflowed or not. With those functions it's just obvious how to build new ones with exactly the same semantics. For those who wonder, yes I've forked mutt the hard way, and am trying to deobfuscate its code (I was shocked to see how bad it was given how I like mutt as a MUA). And here what you see is that this string API semantics is very easy to use, is safe, and extendable. For example, in that patch, rfc822_write_address and rfc822_write_address_single that did had the bad property to truncate the result without any way for the caller to know that now use the usual snprintf semantics for no pain at all. with those API no need to care about the ending '\0', or about off-by-ones, you always speak of buffer sizes, and when your current virtual write position in the buffer is pos, you just need to call pos += your_strXXX(buf + pos, buflen - pos, ...) and you'll be safe. If you want to know if a realloc is needed, you just have to verify if pos >= buflen, the same as what you have to do for snprintf. I really wonder why such API are not common in the C world, I see way to much code using the usual C string functions that just are a PITA.
Notes [1] and not printf like I said in the first place...

28 November 2006

Daniel Burrows: Digging for Conspiracies?

While I appreciate the research and legal commentary over at Groklaw, the tendency of PJ and the regular posters to imagine vast conspiracies makes me more than a little uneasy. Yesterday I came across a truly jaw-dropping example that would be offensive if it wasn't so laughable; and since I happen to know more about the situation, I felt I should comment on it:


I have some questions about this group, BELUG, who did the article, I gather. There is no info on the site to be more informed. Anyone in the Seattle LUG know anything about this new group in Bellevue, 5 mins. from Bill Gates' house?

...

I don't like to be a cynic, and maybe they are a Linux user group, but if so, maybe the Seattle LUG can give them a hand.


Of course, we all know that the Microsoft corporate campus has an enormous mind-control ray mounted on Building 1 that turns everyone living on the Eastside of Seattle into mindless Gates-worshipping zombies. Part of Bill's personal security plan, dontchaknow. That's why BELUG starts every meeting with a round of "All Hail Gates, Lord of All That Is Electrified".


She goes on to complain about "major confusion" in their description of free software. At a quick read, I can only see two glaring problems with this page: first, they describe free software as being both "free in a monetary sense" and able to be sold (which is actually true but sounds like a contradiction without more explanation that they don't provide); later, there's some weird wooly-headed stuff about revolutionizing entire economies and societies. I don't know what they're talking about, but they certainly can't be accused of lacking enthusiasm.

Finally, she quotes a section of the FAQ that suggests that Microsoft professionals should learn Linux and vice versa, since the world is heterogenous and getting more so. I don't think that's controversial, so I think she must be referring to this question:


Q: Why does BELUG dislike Microsoft?

A: That is a complete misunderstanding. BELUG does not dislike Microsoft. Microsoft is our neighbor, and many of our friends and relatives work there. Both Microsoft's headquarters and Bill Gates' house are located just minutes away, and Microsoft's world sales headquarters is currently under construction nearly adjacent to BELUG's meeting location. BELUG merely believes in friendly competition and that competition can benefit everyone, including Microsoft. This is what a free market economy and the American system is (supposed to be) all about, and this is what has helped make the U.S. a great country.


The statement that Microsoft is nearby is nothing but geographical fact (I could walk about fifteen minutes from my apartment and be on the MS campus; does that make me an MS mole?).

As for the rest, I really don't see anything to complain about. I know some people like to rhetorically shred Microsoft at every opportunity, but if you're trying to attract members in Microsoft's hometown, it's wise to keep your comments polite. It's also true that Microsoft benefits from competition (even if they don't see it that way); I don't think it's a coincidence that their products started sucking drastically less as OSX and Linux became reasonable alternatives to Windows. And the fact that we can have friendly competition (as opposed to the cut-throat, take-no-prisoners style that's popular in some quarters) is exactly one of things I like about Linux. You will notice, however, that the Q&A carefully doesn't mention what sort of competition Microsoft engages in. I think anyone who knows anything about the company knows the answer to that one.


Here's the kicker, though: I actually attended a BELUG meeting a few months ago. It seemed pretty much like what I'd expect from a small group of volunteers: one guy gave a talk about hooking ALSA up to a digital audio receiver, another guy showed off a Unix kernel he had written for classic MacOS (it ran as a user process and presented a Unix-like interface to the Mac), someone passed around cookies, and people talked a bit about using Linux and so on.

The poor quality of the Web site and the lack of a mailing list probably reflect the fact that there are a handful of people organizing the thing who all have day jobs and other committments, not some vast Microsoft conspiracy to undermine Linux from the inside by setting up fake LUGs. PJ never said they were fakes outright, but it was a clear subtext of her comment, and the Groklaw regulars who replied knew exactly what she was getting at. If she really thinks they might be fakes, then I think she needs to take a break from watching SCO (which could make anyone paranoid and suspicious) and enjoy the holiday season instead.

Uwe Hermann: German people: do you care about democracy and your right to vote?

If yes, please consider signing this online petition which asks the government to completely prohibit the usage of voting machines in Germany. Actually, you should sign this replacement petition, as the first one was getting "too big", a.k.a the software or server they use couldn't handle the sheer numbers of recorded votes anymore (ironic, isn't it?)... Note: the deadline for the petition is today, i.e., November 28, 2006! Ca. 45.000 people have signed already. If 50.000 signers are reached, there's sort of a guarantee that the government has to formally put this issue on their agenda (or something in that direction, I don't remember the exact details right now). If you haven't followed the latest news regarding the voting machine issues, I urge you to get informed by reading the recent blog entries of Frank Rieger and Tim Pritlove (for example). The Chaos Computer Club (CCC) has a very good collection of information and further readings. Take a look.

Benjamin Mako Hill: Bring the Bling?

I'm been perplexed by the recent fracas around the possibility of Ubuntu shipping non-free drivers by default as part of the feisty release goal to bring the bling. The issue has been discussed by many people, most recently and eloquently in a blog post by Scott James Remnant. I have never been 100% comfortable with our (Ubuntu's) decision to ship proprietary drivers. The Ubuntu philosophy document -- which Mark Shuttleworth and I drafted originally -- says quite unambiguously:
Every computer user should have the freedom to run, copy, distribute, study, share, change and improve their software for any purpose, without paying licensing fees.
I believe this deeply. Consequently, I feel that binary drivers in Ubuntu are, and always have been, a failure to live up to our principles. If our philosophy document is still representative, most people in our community should be a little uncomfortable with them -- even if they think, as most of us do, that shipping them is the correct thing to do. Early on Ubuntu decided that binary firmware and hardware drivers would be distributed and quasi-supported in restricted. While not completely comfortable with the move, I could understand and defend it for three reasons:
  1. The drivers were easily removable and not enabled by default unless necessary to achieve functioning hardware.
  2. As part of this process, we promised to work with vendors to accelerate the freeing/open-sourcing of their drivers.
  3. Perhaps most importantly, I couldn't imagine not using them if it were the choice between non-free drivers or inoperable hardware.
The proposal to include proprietary nVidia driver in place of the existing free nVidia driver is important because it changes, or eliminates, the first and third justifications. Since the first issue has been discussed in depth, it seem appropriate to focus on the third and final point. The point is perhaps best introduced with an observation:
While I have met many people who research and buy hardware to avoid the need for non-free drivers, something I do myself, I have never met anyone who voluntarily chooses inoperable hardware on a computer they use over working hardware through a non-free driver.
While not airtight, this observation is precisely why the old policy of using non-free drivers only when no free drivers exist works so well. By effectively synonymizing use of the non-free driver with use of the hardware, the crisis created by non-free drivers is rendered paradoxical: anybody using a piece of hardware that only works with non-free drivers is, by definition, either using non-free drivers or not using the hardware. The only way to not use non-free drivers in situations where no free drivers exist is to not use hardware that requires them. If you use different hardware, you will not need to use non-free drivers. This important justification is completely inapplicable to the proposal to include non-free drivers in place of free (but not perfect) alternatives. Second, while shipping non-free drivers is wrong because we lose our freedom and violate our philosophy, the desire for basic hardware support is universal and important enough that it's defensible. One reason that the "binary by default for bling" situation alarms me is that I don't believe that the desire for desktop bling is as universal, or as strong, as the desire for working hardware. An analogy might be stealing food to feed your family and stealing a CD from the record store. Both are wrong because stealing is wrong, but I have a lot more sympathy for the hungry thief in the first example because CDs are not as necessary as food and because many people would rather go without a new CD than steal. We can ask: "Which is worse: selling your soul for a decent job or selling your soul for a PS3?" In an absolute sense, neither is worse; but it's easier to support the former than the latter. I'm very impressed with Beryl -- but I have trouble empathizing strongly with the need for a spinning desktop cube. New users may be impressed and attracted to an Ubuntu desktop powered by proprietary drivers. They might also be impressed by proprietary applications. However, it is self-defeating to attract new users to our free platform and principles by compromising our core values. Many users already make the decision to use non-free video drivers and Ubuntu makes it very easy to do so once they have made that choice. Installing binary drivers by default is choosing for the large number of users who will stick with any default. It may be a conservative stance but as long as we believe that a non-insignificant number of users would choose to live without bling before compromising Ubuntu's philosophy and goals, we should make the difficult decision to side with freedom by default. When discussing this issue, many people say, it's not my decision or it isn't my call. Regardless of whether anyone agrees with me and regardless of who the final decision is up to -- and it's not clear to me now -- I believe that the Ubuntu community has the power to inform and shape the development of their distribution. As the Ubuntu community, we can make our position heard. The best place to do that right now seems to be the Accelerated X specification comments page. One can also email the the Technical Board (for technical comments) and the Community Council (for principle or philosophy related issues).

27 November 2006

Jon Dowland: Thecus

Yesterday I installed debian on my thecus n2100. Thanks to Martin Michlmayr for putting up with my neurotic questions during this process. Normally, this would take about 2 hours. Unfortunately I hit a bug in the r8169 network driver (or the hardware) which made the process excruciatingly slow: over 8 hours. I did delay the process somewhat by going for a stable installation first time through. You need to go for etch, for anyone following along at home. I have two hard discs in this box and I wanted to use RAID-1 for the root filesystem. Actually, the two discs were already in a linux RAID-1 set, with superblocks, an ext3 filesystem and some files, from when I was using the default thecus firmware. The following approach lets you setup RAID in the installer and preserve any existing data. You will need to have at least one connection to the installer running a shell, in addition to the one running the installer. When you enter the disc partitioner stage, you will need to fetch the udeb which gives you the md module. For the current thecus installer image, that's md-modules-2.6.18-3-iop32x-di_1.5_arm.udeb. wget it from a mirror (path pool/main/l/linux-kernel-di-arm-2.6) and udpkg -i it. Then restart the partitioner. To preserve the contents of the RAID-1, you might be able to select "don't wipe this partition", and just make sure nothing on it would clash with the directories that Debian will create. I didn't take this approach. Instead, you can drop one of the discs from the mirror, continue with the installation as normal, copy the data back across after, and re-add the disc to the mirror set. Before you select your filesystems in the partitioner: Now feel free to let the installer stick a new filesystem on the RAID set, and install the base system etc. Once the thing has booted: Periodically check on the rebuild status with mdadm -D /dev/md0. One other thing I would strongly advise is getting the installer's debconf priority to medium or lower before you get the base system installed, so you can skip the bootloader / flashing stage. Update: I've clarified the following paragraphs. At present, the default etch kernel is 2.6.17. The network device in the Thecus is not supported by this kernel, so you have to manually install a particular 2.6.18 kernel prior to rebooting, or you will not be able to communicate with the machine once it boots. Martin makes this very clear in his instructions. However, if you have no experience using a d-i which flashes the kernel (as appose to say, the bootloader prompts you get when doing an x86 install, for example) you may not be aware that by default, the flash stage proceeds without prompts. That means that if you do not prevent it from doing so, there will be a window between the installer flashing 2.6.17, and you manually installing 2.6.18, where the thecus will be in an unbootable state, should you suffer a power cut or similar problem. In my case, I left the base system being unpacked overnight (due to the fact the network was so slow). So, that window was several hours wide. This is only a temporary situation, as the release team plan to have 2.6.18 available for Etch, and the patches for the Thecus hardware are steadily working their way into the mainline kernel.

26 November 2006

Russell Coker: supporting an electrion campaign

Yesterday I handed out "how to vote" cards for the Greens at the state election. It did seem to be a significant waste to have so much paper produced. Slightly more than half the voters who visited my polling booth took cards from all parties, which was obviously of little use. There is some useful information to be gained from reading the cards from all parties, but nothing that you can analyse during the short period spent waiting in line. I expect that most people decide who to vote for before they get anywhere near the polling booth and just accept the cards because they feel that it may be rude to reject them. While ironically some people who didn't like the Greens refused to accept a card from me and told me that they didn't want it with the impression that they would offend me, I'd rather save the trees and not give cards to people who don't want to use them...

I spoke to a representative of the Family First party who tried to convince me that the Greens should be against homosexuality because the Greens are "against unnatural things", he also claimed that people who choose not to have children (being gay is apparently choosing not to have children) are selfish - unless of course they are a celibate priest. He also managed to offend a supporter of the ALP in two different ways which led to an amusing heated debate and then left before I could have any more fun. For the reference of other Family First people, I've pasted in the dictionary definitions of "homo" and "hetero", when used as prefixes those Greek derived words mean "like attracting like" and "opposites attract". An example of such usage is the term "homo-charged electrets" used in electronics.

From The Collaborative International Dictionary of English v.0.48 [gcide]:
Hetero- \Het"er*o-\ [Gr. "e teros other.]
A combining form signifying other, other than usual,
different; as, heteroclite, heterodox, heterogamous.
[1913 Webster]

From The Collaborative International Dictionary of English v.0.48 [gcide]:
Homo- \Ho"mo-\
A combining form from Gr. "omo s, one and the same, common,
joint.
[1913 Webster]

From Bouvier's Law Dictionary, Revised 6th Ed (1856) [bouvier]:
HOMO. This Latin word, in its most enlarged sense, includes both man and
woman. 2 Inst. 45. Vide Man.


The ALP (usually known as Labor) supporters had unfortunately believed the lies of their own apparatchiks. They were convinced that the Greens were directing preferences to the Liberal party, even though in most districts the Greens actually directed preferences to the ALP! The only exceptions were a small number of districts with split preferences (favoring neither Liberal nor ALP). It continually amazes me that while helping the ALP they were attacking us! Once I showed the ALP supporters the cards I was distributing they became quite friendly, as the Greens had a very low chance of winning the lower house in the districts for the polling place in question the preferences would go to the ALP.

It was interesting to talk to a Liberal supporter, he supports the workplace reforms implemented by the Federal government (Liberal) because he was hired for his current job because his employer can easily get rid of him if the business has a down-turn. It is hard to argue with someone who has only got a job because of the policy in question, but I did point out that continuity of employment is a major factor when applying for a mortgage. I recently bought a house and had a significant amount of hassle from the banks due to the fact that I work as a contractor. I had previously enquired about borrowing twice as much money while at my last permanent position and had much fewer problems from the banks.

I mentioned some of the other bad things the Liberal government has done (such as invading Iraq for no good cause), but the Liberal supporter was too sensible to comment on any of the issues where he would only lose. This however left him with not very much to say.

Most of the work of handing out the cards was quite boring and very tiring. Fortunately a friend decided to visit and help out so there were three people handing out Greens cards instead of the scheduled two which made it easier work. The ALP apparently had four people which seems to be an optimal number as there were voters arriving from two directions and no matter where they came from at least two ALP supporters would be able to intercept them.

Surprisingly the work was easier at the most busy times. When the queue stretched out into the street I could stoll along the queue and give the cards to the voters. When the queue disappeared later in the day the voters were walking past at high speed and I had to move quickly to get to them.

Now it's time to start planning for the next Federal election.

John Goerzen: Society's Views of Dads

Back before Jacob was born, I was reading The Expectant Father: Facts, Tips, and Advice for Dads-to-Be, 2nd ed. by Armin A. Brott and Jennifer Ash. It was a good book and I recommend it.

Towards the end, there was a section that the author clearly was passionate about, and it made me mad too.

He was talking about society's attitudes towards dads. He started by looking at messages that are sent out in commercials. One study of commercials said that "100% of jerks singled out in male-female relationships were male. There were no exceptions. . ." That study also said that 100% of the ignorant and incompetant people in commercials were male as well.

He went on to cite some examples. Tons of slogans like "kid tested, mother approved", "choosy moms choose Jif", Robitussin's "recommended by Dr. Mom", etc. And one for Post Raisin Bran in which a father and daughter are impressed by their cereal. Dad says, "somebody must really love us. Who do you think it is?" The daughter answers, "Mommy!"

Of course, these were just some examples from commercials, but they seem to reflect a message that dads are, at best, incompetant. Brott mentions studies that show that men display the same decision-making skill and affection as parents as women do.

Brott went on to talk about some of his experiences. One time, while he was in a park playing with his children, a little girl started to fall off the top of a slide. He was right there and was able to catch her as she fell -- probably saving her from, at best, a broken bone. The girl's mother rushed over, ignored Brott, and said to the girl, "did he hurt you?"

I started to see this sort of thing all over the place even before Jacob was born. In stores, there would be tons of infant shirts, bibs, etc. saying things like "I love mommy," rarely even one thing that mentioned daddy. Similar patterns were there for greeting cards and pretty much everything else baby-related.

I've noticed this even more since Jacob was born. There have been times when Terah and I are somewhere together, standing right beside each other, and someone will ask Terah all about Jacob, and totally ignore me. Even if I'm the one holding him. I'm sure people are well-intentioned; some of them that have done this are people we know well and I know they mean well. Somtimes, I don't even notice when this is going on (though Terah does and when she mentions it later, I remember it).

Do they just expect that men don't care? Or do they think that since Terah is working part time, and I'm working full time, that we must be "traditional" enough that I don't care to be involved in Jacob's life? (Though I'm not sure that the "detached & uninvolved dad" stereotype ever was true, at least from the examples I can think of) It's hard to miss out on so many moments of Jacob's life during the day that Terah gets to be there for. But that doesn't mean that I'm an uninvolved or clueless dad.

Now, despite this little rant, there are quite a few people out there that have no problem including me in discussions about Jacob -- relatives, friends, people at church, co-workers, etc. In fact, probably more people include me than don't. I really appreciate that, and especially the extra effort some of them go to in order to include me. (I know how much effort it took to find baby clothes that mention dad, for instance) Terah is best at all this, making sure that I get to be part of Jacob's life as much as I possibly can be, and I really appreciate that.

But to Wyeth (makers of Robitussin): Don't think I haven't noticed that Walgreens sells "Wal-Tussin", same active ingredients as your product, and at a lower price. Dr. Dad knows how to buy generic.

Sebastian Rittau: Gaia shut down by Google

Clint: Did you actually read the letter sent by Google? I actually consider this to be a perfect example of "don't be evil." There are no threats in that letter, Michael Jones, the writer, is just explaining why Gaia hurts Google and in what way he think the Gaia project is violating Google's Terms of Service. He tells the Gaia project members that he understands their curiosity, even calls them "smart engineer[s] like ourselves", but asks them to "refocus [their] work toward building an open earth viewer that uses open earth images." I don't think that Google is free to do whatever they want with the images of the earth stored on their server. They most likely have a rather restrictive deal with the actual image providers. And even if they hadn't, Google probably pays a rather large amount of money to these image providers. I can understand that they don't want to offer these images for everybody to grab. I consider this letter to be very kind and understanding, compared to what seems to be standard today: Let the lawyers do the talking, or don't bothering with the talking at all and just sueing.

24 November 2006

Steve Kemp: Friend or enemy we re all to blame

There has been an interesting thread on the debian-isp mailing list talking about control panel software for virtual hosting. I’m biased against several of the available control panels, but there are certainly times when I wish there were a simple solution or two which I could try that didn’t involve throwing away all my current setup and migrating all at once mail, web, etc. I’ve ruled out several systems due to : Every now and again I think about updating my hosting scripts such that they could be driven by a graphical control panel. But each time I get this thought I decide against it because: The other reason not to do it is that I have a system which is portable, well understood (by myself at least!) and isn’t hard to migrate away from if I wished in a piecemeal basis.

Next.

Previous.