Stefano Costa

There's more than potsherds out here

Faccio l’archeologo e vivo a Genova

Autore: Stefano Costa

  • darcs2bzr using tailor

    Disclaimer: I’m not a software developer. Just trying to learn as much programming as I need

    From time to time, I write some short programs, mostly to handle otherwise annoying tasks, or for hacking’s sake. Even though I never reach a mature application state, I like to keep track of development using revision control systems.

    For two Python apps I’m writing, I started using darcs as RCS. Then the summer came and I had no time to hack on them for some months. Now I have discovered bzr, which looks better and has many plugins.

    Switching from one RCS to another could sound as a painful task, but not when you discover tailor. Tailor knows almost all RCSs and can convert between them. I have to admit that it hasn’t been easy at all to understand how exactly the configfile should look like, and where it should be put and so on. Here’s what I’ve done:

    1. your darcs-managed project is in ~/code/project
    2. your new bzr project will be created in ~/code/project-bzr, so create this directory
    3. cd into ~/code/project-bzr directory and create a file yourproject.tailor
    4. the contents of the yourproject.tailor file should look like this:
      [DEFAULT]
      verbose = True
      
      [project]
      target = bzr:target
      start-revision = INITIAL
      state-file = tailor.state
      source = darcs:source
      
      [bzr:target]
      
      
      [darcs:source]
      repository = /home/user/code/project/
    5. Now, from the destination directory, run tailor --configfile yourproject.tailor. The destination directory should be populated with the bzr version of your repository.
    6. check with bzr log whether the conversion was really succesful
    7. (re)start writing code. Happy hacking!
  • Webcam dall'Appennino

    Per un ligure che passa la maggior parte del tempo lontano dalla Liguria, le webcam installate sulle vette dell’Appennino Ligure sono una vera manna dal cielo…

  • Le tasse universitarie a Siena

    Questa volta l’Università di Siena l’ha fatta proprio grossa. Con una decisione non molto cristallina, subito dopo avere offerto la possibilità di rateizzare le tasse in 8 pagamenti (tramite Consum.it, una società — guarda caso — del gruppo MPS), elimina le consuete due rate. Lo studente che si immatricola da quest’anno (e penso che saranno sempre meno) può pagare in due modi:

    1. In una unica rata
    2. In 8 mini-rate

    Come dire: o i soldi passano da MPS, oppure sborsa n-mila € in un colpo solo. Bravi.

  • Crozza e l'antipolitica

    Napolitano (su suggerimento di una giovane ragazza napoletana) invita i politici a dedicarsi meno alla propria immagine e ad apparire meno in TV. Invece, se tutti andassero in TV a farsi sputtanare da Maurizio Crozza come Mastella, forse la gente capirebbe qualcosa di più sulla politica. La reazione di Mastella è stata semplicemente inqualificabile… da bambino piccolo.

  • Kernel

    Last night, for the first time since I use GNU/Linux, I got the Linux kernel compiled.

    The main reason for recompiling was some extra speed, choosing my processor (Pentium M), removing useless modules and the like. Unbelievably, it all went fine (I’m using it right now). Well, not so strange, since I started from Debian’s .config. However, I didn’t notice any improvement.

  • Aeroporto a Siena

    Se vivete dalle parti di Siena, fatevi un giro su questo sito: http://ospiti.comune.siena.it/filoerba/aeroporto/index02.html.

    Costruire un aeroporto a Siena, oltre a essere una speculazione (l’ennesima targata MPS), è anche la più grande cagata degli ultimi 10 anni. Collegamenti con Fiumicino (raggiungibile in 3h30 dal centro di Siena) e Malpensa (5h) che servono non si sa bene a chi.

    Se è fatto per i turisti, allora consiglio agli amministratori di migliorare i trasporti su gomma e rotaia, a partire dal percorso Stazione FS – Centro. Al momento, chi esce dalla stazione deve percorrere 500 m a piedi per raggiungere la più vicina fermata dell’autobus, perché nello spazio dove sarebbe ovvio che ci fosse una fermata dell’autobus c’è un abuso edilizio (che sarà legale, ma è pur sempre un abuso).

  • From KML 2.1 to GML, Shapefile, whatever you like…

    I have used a lot of times this method from Matt Perry for converting KML files to GML or anything readable by OGR (currently OGR can just write to KML 2.0, not read it).

    Yesterday I was interested in viewing the Pleiades dataset, that can be downloaded in KML format. The mentioned method wasn’t working and gave strange results (e.g. < and > converted to &lt; and &gt;, no XML tags). It took me an hour before I noticed that the sed one-liner for getting rid of the KML namespace wasn’t working just because it was looking for 2.0 instead of 2.1, which is what I had and actually the most common version you find. This was driving the XSL parser mad.

    So, just change that one character, or delete by hand the xmlns declaration in your file, letting the <kml> tag alone.

  • hackergotchi, now

    Carlo ha attivato gli hackergotchi su planet.linux.it. Accorrete numerosi, mostrate i vostri visi!

  • punk

    «il punk esiste a causa della falsa assunzione secondo la quale i Ramones possono essere imitati»

    da Wikipedia

  • .htaccess rewrite rules

    Memo: if you use multiple rewrite rules in your .htaccess file, remember that each RewriteRule must follow the necessary RewriteCond, e.g. you can not pack all rules. Thus, this doesn’t work:

      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^([^/]+)/([^/]+)$ index.php?jid=$1&mode=$2 [L,QSA]
      RewriteRule ^(.*)$ index.php?jid=$1 [L,QSA]

    while this works smoothly.

      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ index.php?jid=$1&mode=$2 [L,QSA]
    
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^([^/]+)/([^/]+)$ index.php?jid=$1 [L,QSA]

    Of course I stumbled upon this while hacking at my jabber presence agent.