Text

Why isn’t $LANG Popular in Industry?

With LANG=haskell, Why isn’t Haskell popular in Industry?

It’s interesting because I think that list of 9 points can apply to other languages too (such as Perl).

A language is unpopular because it’s different, and it makes it difficult to learn. Moreover a language can be popularly known to be difficult, or believed to have known problems, such as maintainability or code readability.

It’s very difficult to hire programmers that already know it, because it’s unpopular. Although you can teach it, it doesn’t make the language suitable for your projects, because you need good programmers already trained, and you can’t find them!

All together makes that language a risky option that gets discarded in favour of other ‘industry leading’ languages such as Java.

And don’t forget the customer: they’re used to some words, and although it’s not their business, they tend to be more happy if they know (or think they know) about the technology you’re using. So, it can be harder to sell an application made in Haskell.

At the end, sadly, the advantages of using $LANG aren’t that important.

Text

Making Reports in CVS from SQL

Sometimes I need to query a database, using SQL for that, and get the results to process them with OOo Calc o any other data analysis tool (for example GNU Plot).

The most easy way to import data into OOo Calc is using CSV, but the SQL clients I usually have at hand doesn’t support that output format and I always end using some AWK magic to get a correct CSV.

It’s not a big deal, but last week I had a different problem at work: what if you have to do different queries in different databases depending on a main table?

In fact, it was a multi-tenant application with one database for each instance, that can be in any of machine in our backend cluster, so having the list of the databases wouldn’t help.

Due to this I had to execute a query to get the database name and the connection information for each instance, and then run the query I actually needed for my report.

I did the work, and the report it’s being generated automatically as the customer requested, but I wasn’t satisfied with the resulting code (you know what happens when you don’t have enough time to do your work), so I’ve spent some of my spare time programming a tool to make easier this kind of reports: YAML Simple SQL Reports (yes, I know… what a fancy name!).

The idea is to specify the report in a YAML file. For example:

report:
    name: first report
    connect:
        type: mysql
        database: dbname
        username: user
        password: secret
    query: select foo, foo2 as whatever from bar
    output: file.csv

This will generate a CSV file into file.csv, with foo, whatever header and one line for each row resulting of the query.

At this point, al least, I got rid of the AWK post-processing. But, what about the multi-database problem? Easy peasy with subreports!

report:
    name: first report
    connect:
        type: mysql
        database: dbname
        username: user
        password: secret
    query: select dbname, dbhost, dbpasswd, dbuser from masterdb
    report:
        name: sub report
        connect:
            type: mysql
            dabase: {dbname}
            hostname: {dbhost}
            username: {dbuser}
            password: {dbpasswd}
        query: select * from table
    output: file.xml

The query in first report is executed, and for each row in the result, the report named sub report is executed (after replacing the {KEY} stuff in each loop with the value from the result row). The result of all the queries in sub report are concatenated and used as output (in this example as XML).

It’s not the ultimate tool to make reports, but it will work for me next time I’m asked to do a report ASAP from any SQL database.

Update: you can get the stable versions from the downloads section of github. PostgreSQL it’s being tested, and will be version 0.3.

Text

Gnome Census Released (and Red Hat 16% vs Canonical 1% Flame)

David Neary released a preview of his report about Gnome’s contributors: GNOME Census.

It’s a very interesting document that states, for examaple, that more than 70% of the contributions come from people beind paid to work on Gnome. Check it, it’s worth reading.

But what I’d like to point out it’s a post (rant?) by Greg DeKoenigsberg: Red Hat, 16%. Canonical, 1%.

I don’t like flames, because it’s very hard to get something interesting from that kind of improductive Internet discussion; but this time is different and I guess it’s worth reading. I don’t know if it’s because there are some good level participants, but I must confess I’ve learned a couple of things and it made me think about other couple or so.

The number of comments it’s growing fast, so I recommend you to wait until it’s settled. It will be great if Greg writes another post with the conclusions, wouldn’t it?

Update: the flame it’s being epic ;). There’s a good post from Jono (let’s say point of view of Canonical): Red Hat, Canonical and GNOME Contributions.

Late update: there’s a reply from Mark Shuttleworth (owner of Canonical): Tribalism is the enemy within. I must confess I’m disappointed by this post, I was expecting a different kind of reply from Shuttleworth. In fact, I think his comments in the different threads about this story are way better.

There’s a follow up from Greg: It’s not about tribalism, Mark.

Text

Copyright Nonsense

You may know I play different instruments, including the Ukelele.

I’m actually a casual player, and I’m user of different websites that provide lyrics and chords of the songs I like to play. One of these sites is Ukelele Tabs.

When I moved to UK I sadly noticed that they were having legal problems because of copyright infringement, and songs weren’t available (remember: lyrics and chords, for Ukelele!). It’s not a big deal, because I can play almost any guitar tablature (although I obviously prefer those adapted to the Ukelele).

Today I realized that they solved their legal problems. If you check a song (at least from an UK connection), you’ll see something like:

Intro :
[C][G][Am][F][C][G][F-Em-Dm][C]

1st verse :
       C              G                 Am          F
xxxx I xxxx xxxxxx in xxxxx xx xxxxxxx, Mother xxxx comes xx xx
C                 G              F  Em Dm C
Speaking xxxxx of xxxxxx, xxx it xx
    C             G                    Am            F
And xx my xxxx of darkness, xxx xx standing xxxxx in xxxxx xx xx
C                 G              F  Em Dm C
Speaking xxxxx of xxxxxx, xxx it xx

That’s part of the tablature of Let It Be (Beatles).

I don’t know if you’re as surprised as me, but I don’t think copyright laws are meant to be used like this. I’ll keep playing and singing copyrighted songs at home, so go and sue me (sic).

Link

There are a lot of changes (check the link), and some of them aren’t backwards compatible, so upgrading will need some work.

Anyway, Ben Darnell and his mates are doing an awesome work.

Quote
"Taking the contributions of Rackspace and NASA as a starting point, OpenStack forms a powerful foundation of technologies including, a scalable compute provisioning engine - OpenStack Compute - and a fully distributed storage engine - OpenStack Object Storage."

From Opening the Rackspace Cloud.

Rackspace makes its cloud infrastructure open source! The site of the project is OpenStack.

Text

Wordpress RSS and Planet

I’m using Planet for aggregating different blogs in a single website. OK, just in case you don’t know what’s a planet, it’s just that: a blog aggregator.

After adding a couple of blogs, I’ve found weird things with the feeds that Wordpress hosting service provides: even if you configure your blog to serve the full posts in the RSS, Wodpress is serving a summary in the description field.

Oh, they’re serving the full post too (as you configured), but they’re using content:encoded instead the description field.

In consequence, Planet is showing the 300 character long summary, instead of the expected full post.

That’s an old issue, and seems it won’t be fixed (well, you could argue that there’s nothing broken here; but I would then disagree).

So I’ve patched my Planet with a small hack to use the content instead of the description, and at the same time avoid a complaint from Planet for the format of the content:encoded.

--- a/planet/feedparser.py	2006-07-27 01:53:35.000000000 +0200
+++ b/planet/feedparser.py	2010-07-16 14:21:35.000000000 +0200
@@ -2695,7 +2695,12 @@
         feedparser = _LooseFeedParser(baseuri, baselang, known_encoding and 'utf-8' or '')
         feedparser.feed(data)
     result['feed'] = feedparser.feeddata
-    result['entries'] = feedparser.entries
+    entries = feedparser.entries
+    for e in entries:
+        if 'content' in e and e['content'][0]['type'] == 'text/html':
+            e['summary'] = e['content'][0]['value']
+            del e['content']
+    result['entries'] = entries
     result['version'] = result['version'] or feedparser.version
     result['namespaces'] = feedparser.namespacesInUse
     return result

It applies to 2.0 release of Planet, and feel free to use it at your own risk.

Link
Quote
"I actually quite like the model of a free* version of software and then a paid-for pro version with extra coolness. It’s a model that works well. But when you combine that with Open Source, it becomes a little more dubious (maybe) because there’s the possibility that you use the name of Open Source but create a system where in practice, people can’t meaningfully participate and it’s primarily a hook into the paid version."

From Slashdot comment on ‘SugarCRM 6 Released, But Is It Open Source?’ (* I think he meant free as in free beer).

Very insightful and worth reading comment that sums up all the downsides I’ve seen in open core based products.

You may argue that the open core model helps the company use an open source development model while keep making money in the old-fashioned-way just selling licenses, but it won’t happen: there won’t be an open source community, because it would be enemy of your business model (which is selling licenses!).

Text

Is your Liferea 1.6.2 Getting Somewhat Slow?

Because mine was. I’m running Liferea for some months, with lots of feeds, and I’ve noticed lately that it was getting slower. I couldn’t say how much, but it was noticeable.

I’ve tried to unfragment the database:

$ cd ~/.liferea_1.6
$ cp liferea.db bak.db
$ sqlite3 liferea.db VACUUM;

My liferea.db was 18MB before the VACUUM and 15MB after, but the point is that I’ve noticed it’s faster starting and updating the feeds after the surgery.

Once you run Liferea and everything’s OK, you can remove the bak.db.