Older blog entries for salimma (starting at number 60)

Attending FUDCon Zurich for the weekend

Got in here late last night by train — amusingly, of the three legs of the journey (Erlangen-Nürnberg-Buchloe-Zürich), the only late train was the Swiss train from Buchloe. Uncharacteristic, but hey. Took a detour of 15 minutes walking to the hotel due to mistaking a canal for the river that was shown on the map, which afforded some amusing sights: from someone climbing out of the Botanical Gardens, after hours, over the fence, to someone skateboarding backwards… to a Valley-esque girl outside a bar whose vocabulary appeared to be limited to “OMG” which she repeated ad nauseam.

No Internet on the train (I could have used my phone as a modem until the Swiss border, but between a paper, an eBook — Peter Hamilton’s Pandora Star), no Internet in the hotel, so I had to wait until I arrive at the conference venue for my Internet diet. Finally got the liboauth/bti EL-5 updates finished.

Adam’s just starting his talk so it’s time to sign off now.


Syndicated 2010-09-17 09:16:29 from Intuitionistically Uncertain » Technology

Android : flashing :: programming : ?

Your editor will confess that he still feels a certain childlike joy at the prospect of reflashing an expensive device that he depends on, possibly bricking it, then painfully restoring all of the settings and discovering all of the new bugs which have been added. It’s the sort of adrenaline experience that others, perhaps, seek through horror movies, bungee jumping, investing in equities, or PHP programming

Jonathan Corbet, The end of the road for the Nexus One, Linux Weekly News


Syndicated 2010-07-22 09:21:40 from Intuitionistically Uncertain » Technology

iTunes feed extractor

The downside of Apple’s iPod/iPhone being so popular is that so many podcasts only publish iTunes links, instead of the more standard RSS/Atom feeds. And I know of OS X and Windows users who detest iTunes — imagine how Unix users feel!

Well, the feeds are still there, but hidden from plain sight — turns out, though, that if you pretend to be iTunes, you can actually trick the iTMS server into giving you the raw data. And with Python 2.6′s built-in support for Apple’s property lists, extracting the feed is a trivial matter.

#!/usr/bin/env python

import plistlib
import urllib2
import sys

ITUNES_VER = '7.4.1'

USER_AGENT = 'iTunes/' + ITUNES_VER

def get_props(url):
    request = urllib2.Request(url)
    request.add_header('User-Agent', USER_AGENT)
    response = urllib2.urlopen(request)
    return plistlib.readPlistFromString(response.read())

def get_feed(url):
    next_url = get_props(url)['action']['url']
    props = get_props(next_url)
    return props['items'][0]['feedURL']

if __name__ == '__main__':
    for url in sys.argv[1:]:
        print get_feed(url)

Syndicated 2010-07-15 01:59:18 from Intuitionistically Uncertain » Technology

On (not) reinventing the wheel

I used to dual-boot Moblin and Fedora on my old netbook — but when I had it replaced due to battery and SSD failures, I stopped doing it on the new netbook, instead exclusively booting Fedora, and relegating MeeGo to a USB stick with persistent overlay. Thankfully, MeeGo’s image creation tool (mic2) is derived from Fedora’s livecd-tools, so I can simply use the latter to burn the MeeGo image to USB with overlay, without messing with the image by hand.

(as an aside, the only way to flash an image to a partition, instead of wiping the entire disk, is using Fedora’s tool, and by extension MeeGo’s — but with the latter, only if one used the Fedora-derived command-line tool, mic-livecd-iso-to-disk instead of the recommended ones)

There are several reasons for this, in no particular order:

Storage

Moblin supports ext3 but not ext4; MeeGo adds btrfs to this mix but there’s still no ext4 support. I buy the rationale that ext4 is the SVN of file systems, and that we’ll eventually all migrate to btrfs anyway. But on the other hand, btrfs is not quite there yet — I switched back to ext4 after the SSD failure, when I realized that btrfsck does not yet handle bad sectors properly, unlike e2fsck. With other Linux distributions increasingly switching to ext4 — which can be easily migrated to btrfs later on — the trade-off (slight disk usage increase vs easy access to other Linux partitions) is surely in favour of supporting ext4.

Moblin/MeeGo also does not support LVM, which is used by default by Fedora’s installer, but this is a minor issue — someone deciding to use MeeGo and Fedora can just partition the disk without using LVM.

connman vs NetworkManager

I used to be agnostic as to how my network connections are configured — as long as it just works. This is why my new netbook is a Sony — because unlike other vendors (shame on you, especially, Dell) it does not use a Broadcom WLAN chip with a proprietary, badly-documented, buggy Linux driver (shame on you, Canonical, for helping develop it). Instead, it has a nice Atheros chip.

The same is true when it comes to the software stack. At the beginning I did not pay much attention to the connman vs NetworkManager controversy — prior to version 0.7, NetworkManager had its warts, and connman happened to work just fine on the home wireless networks I tried. This changed when I try connecting to a work network that uses 802.1X security. The MeeGo GUI does not support this, and the developers don’t consider this important at all. The command-line tool is badly documented — documentation is non-existent — and throw cryptic error messages. Makes one wish Java-style checked exception is more widely used; that way, at least developers have to *think* about the exception propagation, instead of just exposing them by neglect to the users.

GNOME 3.0, Fedora MeeGo stack

Fedora 13 already comes with a preview of GNOME 3.0′s shell, and work is in progress on having  MeeGo available. There are some annoying integration issues — the network-manager-netbook applet that integrates the Moblin/MeeGo desktop with NetworkManager is not as well supported as the default connman-based applet, and MeeGo’s window manager has some incompatible modifications that has not been merged back upstream. But, like NetworkManager’s Dan Williams, I believe that the way to improve the Linux desktop is to improve the existing tools that work across all sorts of devices, rather than reinventing them to solely target mobile devices, and in the process having to solve the same technical issues over and over again.


Syndicated 2010-07-11 11:45:04 from Intuitionistically Uncertain » Technology

Worrying trend in open-source graphics drivers

It is not so long ago that one could get high-end notebooks with integrated Intel graphics — not the most performant hardware, but with decent[1] open-source drivers directly supported by the manufacturer. Yet when I did a precautionary replacement purchase for my laptop a few months ago, the situation has changed — unless you opt for the business laptops, you either get Intel on the low-end (no Core for you) or AMD/nVidia on the higher end. There are exceptions, but not many. Dell, the company that previously allows you to tweak virtually anything, now does not offer graphics card options for its Studio line-up, at least in Germany. The Sony Vaio E-series, which I purchased, is no longer produced with an Intel card.

Open source drivers for AMD (née ATi) and nVidia cards are improving — and one is grateful for AMD to actually cooperate with open-source developers with documentation and technical help, but at the moment one is caught in a three-way bind: buy Intel and be stuck on the low end (or very limited vendor choices), buy nVidia and get great proprietary drivers and good open source drivers, but supporting the company with the most FLOSS-unfriendly business practices, or buy AMD/ATi and have good-ish proprietary drivers (provided one downgrades one’s Linux install or at least the X components) and so-so (but improving) open source drivers. Being stuck in the latter camp, I was running the open-source Radeon driver, which currently has no DRI support for the Radeon HD 5400 series (no gnome-shell. Not even gthumb, nowadays!) — but then noticed that an older problem might be resurfacing itself — that my graphics card is not being throttled down, contributing to the awful (~ 1 hr) battery life on Linux. That’s about the last straw one can take: my old netbook has snazzier graphics and better battery life[2] than my new notebook!

Going to try the newly-updated proprietary Catalyst driver, coupled with a downgraded X installation from Fedora 12, and see how it goes. Will report my experience here — and recuse myself from submitting X and kernel bug reports until the next version of X comes out and hopefully make the situation less painful.

First time in many, many years using proprietary graphics drivers, but I’m not killing my battery and my hearing (the fans are rather loud) over this.

[1] ports to new APIs tend to introduce periods of instability and performance regressions, but overall the impression is positive
[2] after close to two years, battery capacity just dropped precipitously to ~ 30% of the original, so it’s now getting a new — and higher-capacity — replacement. This is probably the last upgrade — there better be a dual-core, 2 GHz+ netbook out by the time the new battery fails (or a well-supported, affordable ARM smartbook), and it better has SSD options (Dell, what happened to your great Mini 9 SSD deal?)


Syndicated 2010-06-01 11:46:11 from Intuitionistically Uncertain » Technology

FSFE and the cross we bear

I’ve been a fellow of the Free Software Foundation Europe for just over a month, and recently a visiting friend commented on a point that, until then, I’ve only noted to myself: that the fellowship logo is rather similar to the Christian cross.

FSFE is certainly not a Christian organization. One could argue that it is a by-product of a traditionally Christian civilization, but one could equally argue that it traces its heritage to Greco-Roman philosophy! The green cross, with a slit on the bottom so that the entire shape looks like an icon representing a person standing with open arms, is probably closer to the Red Cross in iconography than to Christianity. That being said, being a fellow does have some similarities to being a committed Christian.

  • The cross we bear: Joining has a price, whether financial, in time commitment, or other means
  • A mission: we bear this price gladly because we believe in what the respective organizations stand for. In case of the FSFE, it’s freedom. Freedom to learn. Freedom to innovate. Freedom from unreasonable restrictions imposed on you by software patents (at this point, I’d like to extend a special welcome to any budding cinematographer who just discovered that by recording your video in H.264, the MPEG-LA consortium owns your soul — er, I mean your work)
  • Diverse voices: just as Christianity is represented by a myriad denominations, some with higher profile than others, some with a more tarnished reputation than others, yet all based on the same foundation — no matter how garbled in the transmission (we are all humans!), the same is true of the Free, Libre and Open Source Software (FLOSS) community. There are differences between the free and open source camps, between the copyleft and liberal-license camps, etc. But deep down we believe in sharing our works with others, whichever way we justify it to ourselves and others.

The struggle against the anti-commons nature of overly-restrictive intellectual property will be with us for a long time. We have made huge technical leaps — FLOSS software is competitive in diverse fields including server operating system (Linux, the BSDs, OpenSolaris), instant messaging (Jabber, standardized as XMPP), audio codecs (FLAC, Vorbis, Speex), and are catching up in video (Theora, Dirac, and thanks to Google, WebM, née VP8). Even users still locked into proprietary systems can thank FLOSS, and open standards, for the Web they surf (served mostly by Apache), their web applications (often built on top of the Java platform), and further down, the network protocols they use, all developed in collaboration instead of in proprietary isolation.

Yet the road ahead is a long and winding one. Flash is still omnipresent on the Web, Apple is proving a huge disappointment (after contributing to, and sponsoring, so many open source projects, now they’re starting to shrilly attack any competitor to their iPhone/iPad lines — be it Android, Flash, Theora, or WebM). To quote Benjamin Franklin,

Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety

I’m not giving up my liberty, and neither should you. It’s true that it is hard to completely give up proprietary software — don’t be discouraged, many free software advocates are not there yet either. But you can start by following these simple guidelines:

  • Favour open standards — does your calendaring solution support the ICAL format? does your mail provider provide IMAP and POP3 access? is your instant messaging platform XMPP-based (e.g. Google Talk), or are you locked onto a proprietary protocol?
  • Vote with your wallet — if a company has a history of abusive behavior (sadly, Apple is now there), attempt to discourage this kind of behavior. Don’t buy the products they’re trying to protect by this behavior, tell them why you’re not buying, and tell other people why too.
  • Be aware of your rights — you have the right to make a personal copy of your music and movie collections. Yet the RIAA and MPAA tries their hardest to make this impossible — in case of DVDs and Blu-ray, to the point of making it illegal

I highly recommend reading Against Intellectual Monopoly and Gridlock Economy; both are accessible and highly illuminating accounts of the damage our current legal IP regime is doing to our societies. The solution is not anarchy — copyleft licenses *are* legal copyright documents — but to work for reform; if you agree, consider donating your time — or money — to organizations such as the Free Software Foundation, its affiliates — including FSFE; the Open Invention Network; your favourite free/open source project (whether in code, documentation, useful bug reports or donation); or projects that enrich our cultural commons by making public domain information more accessible — e.g. Wikipedia and Project Gutenberg.

I thank you. Future generations will thank us too, for whatever little we can do for them today.


Syndicated 2010-05-23 19:44:16 from Intuitionistically Uncertain » Technology

Discovering Emacs: Org-Mode

Needing to find a tried-and-tested GTD application, I finally discovered Emacs’ Org-Mode. It’s a planner, a note-taking application — and more. I’ve taken to using it to generate most documents — whether they’ll end up as text (for email) or LaTeX (for reports). Amazingly flexible and well-documented.

You’d want to install the latest version, rather than relying on the version bundled with Emacs (since version 22) — otherwise some features described in the documentation simply won’t work (e.g. quick-selecting the initial state of a TODO item).


Syndicated 2010-05-19 12:26:26 from Intuitionistically Uncertain » Technology

[Mini Kanren] Benchmarking different substitution data structures


In logic programming, a substitution is a mapping from logic variables to values (including other logic variables). Logic programs are composed of goals, with the type signature Subst => Subst* — i.e. it might fail (thus generating 0 possible substitution), succeed once, or succeed multiple times, or even an infinite number of times.

It is necessary for substitutions to behave as values — if you take a substitution, and add a binding, you better get a new substitution, rather than do the modification in place, because that substitution might be used by other goals. In Lisp, the traditional data structure for this is the association list: a list of lists, where the cars (first elements) of each inner list are the keys. Clojure takes Phil Bagwell’s Hash Array Mapped Trie and adds persistency on top of it, to the effect that you have a copy-on-write trie map, with logarithmic rather than linear lookup times.

Technorati Tags: functional, logic, programming, clojure, scala, jvm, data-structures, tries

Using association lists, my Scala code was performing about 3x slower than Petite Chez Scheme. Horrendous results — interestingly, using linked case objects optimized for storing keys and values reduce the gap, to the point that it was only about 10-15% slower. Still not great, but acceptable. Since my Mini Kanren implementation is written in Scala, not Clojure, I tried using Scala’s own immutable maps, reasoning that with Bagwell tries, the boost in look-up performance (O(log n) vs O(n)) ought to outweigh the increased cost of extending (O(log n) vs O(1)). Alas, Scala’s maps are not Bagwell tries. One simply gets an OOM error; I’d have to dig deeper to find out exactly why.

The solution, of course, is to use Clojure’s maps in Scala. Doable, after patching its Java interface a bit — Clojure being a Lisp, there is a penchant for short names, and therefore an IMapEntry has a getter called val(), instead of value() — but val is a keyword in Scala (denoting values, i.e. names, like variables but immutable). Patched code lives in a branch on my Clojure fork; hopefully this can get merged in as a stop-gap until Scala gets its own tries.

And with Clojure maps? Scala Kanren is now 2.5 times *faster* than Mini Kanren on Petite Chez. Mind-boggling. Oh, and you’d want the raw numbers, naturally. Bear in mind that this is used on a desktop system that is running Firefox, etc. at the same time. I’d need to do longer runs (e.g. 100x) from runlevel S to get better results.

Next speed-up is probably going to be obtained by reimplementing this back in Clojure — it has a built-in parallel map that works on lazy sequences, unlike Scala.

Strategy 1 2 3 avg rel
association list (Scheme) 39312 38853 39207 39124.0 1.0
association list (Scala) 114562 111629 109939 112043.3. 2.86x
linked triples (Scala) 47833 44813 44277 45641.0 1.167
Immutable maps (Scala) OOM
Clojure persistent maps (Scala) 17955 15586 13482 15674.3. 0.40

Syndicated 2009-10-25 20:13:07 from Intuitionistically Uncertain » Technology

Gnoetry 1-2-3


I’ve been fascinated with Jon Trowbridge and Eric Elshtain’s Gnoetry for quite some time, but have until recently contented myself with watching from the sidelines. There are several reasons — being busy with other projects, and mostly that the code is rather well-hidden from the public eye; there is a Subversion repository, but one has to jump through some hoops to get to it (I forgot how I got to the code; I think I might have emailed Jon about it).

After you get the code, there’s still the matter of setting things up. And SVN is a rather messy interface to use if one does not have commit access…

I’ve decided to take the plunge, though. I used git-svn to make a clone of the official repository, committed some usability improvements to a bugfix branch, and pushed the code to GitHub. Get it here (the master branch is Jon’s latest SVN code; the bugfix branch has a Makefile added that let you run Gnoetry by simply running ‘make’ — it does all the setting-up for you. ‘make clean’ cleans up the generated files).

Now, time to fix that unreleased-mutex-on-exit bug…

Technorati Tags: gnoetry, linguistics, python, poetry, statistics

Syndicated 2009-10-25 00:23:03 from Intuitionistically Uncertain » Technology

Discovering Rosetta Code


I discovered Rosetta Code over the weekend. It bills itself as a programming chrestomathy [wp] site, offering a place to learn, compare and contrast different programming languages by reading and writing solutions to different programming tasks.

So far, I’ve been using it to brush up on my Clojure, Pure and Scala fu. I’ve just added the Pure category, so the examples are a bit sparse still. If you want to see the solution to any particular problem in it, just drop me a note.

Also check out the stair climbing exercise I borrowed from Chung-chieh Shan’s Lambda the Ultimate post.

Syndicated 2009-10-24 23:14:36 from Intuitionistically Uncertain » Technology

51 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!