Hoheinzollern

Alessandro Bruni's weblog

Sony Reader Notes to SVG or PDF

I recently bought a Sony PRS-T1 ebook reader and it turns out it has a very nice feature: it’s possible to sketch notes and little drawings using the touch screen. Then you can export them using the “take a snapshot” feature, which creates an image from the canvas.

What if you wanted to have them exported to any vector based format? It turns out that the format of the note files is a wrapped SVG with a container element and a couple of namespaces. To get an SVG file we just need to unwrap them. And you don’t even have to bother XML processing, you just need a simple sed command in any Unix-like (Linux, OS-X etc) environment:

#!/bin/bash
sed "{ s/n1://g; s/<n0:notepad.*<svg/<svg/;s/<\/n0:page.*notepad>// }" $1

Save this to /usr/local/bin/note2svg with your favorite editor and make it executable:

chmod +x /usr/local/bin/note2svg

Whenever you want to get the SVG file from the reader you’ll just have to open a terminal and type:

note2svg input_file.note > output_file.svg

If you also want to convert the SVG file to a PDF you’ll need to have Inkscape installed and type:

inkscape input_file.svg --export-pdf=output_file.pdf

Enjoy your notes ;)

 

Golden Gate Bridge

Unity Tracker Lens

A friend of mine was looking around for a decent file indexer for Ubuntu since he’s relying on this approach to manage his files on OS X (and Windows 7 does it too). I got interested in the topic, and personally I agree with him and think it’s such a shame that no indexing software is present and integrated in recent linux distributions by default, especially since this has been in past (with Tracker and Ubuntu, but also with Beagle and openSUSE) with good success and reception.

At the time of writing Tracker seems the only full-featured system remained alive and the best option among the various solutions.

So here’s my little contribution to this. I give you a little lens (well, technically a scope, which provides data for the file lens) that integrates Tracker with the Ubuntu Unity interface. I bundled the code with tracker-needle, which is the current official GUI for this indexer, but if there’s good request I can make a separate package, which would make more sense, I think.

To install the software execute:

git clone git://github.com/hoheinzollern/tracker.git
sudo apt-get build-dep tracker
sudo apt-get install libunity-dev
cd tracker
./autogen.sh
./configure
make
sudo make install

Beware the fact that it’s still an experimental plugin, that might have some errors and still doesn’t support filtering files by size and edit date.

You can poke around the source code in GitHub at the address https://github.com/hoheinzollern/tracker

Let me know what you guys think, and if this can be integrated with the official Tracker distribution or even in Unity.

Cheers!

Breeze, Tim and the Jewish Co-Op

Second time! Vi sto scrivendo dalla biblioteca dell’universita’, un edificio “huge” (tanto per rimanere in tema col post precedente), quattro piani di libri, good couches, tavoli, mac e terrazze dove si puo’ leggere in pace un libro dando di tanto in tanto uno sguardo alla foresta che ci circonda. Qui e’ pieno di scoiattoli e venendo su in autobus ho pure visto un cerbiatto che attraversava la strada.

Beh insomma dato che il posto ispira un po’ di tranquillita’ vi scrivo di un’altra esperienza di questi giorni. Dopo la notte passata da Clark e girando tutta Santa Cruz alla ricerca di un posto dove vivere, sempre tramite couchsurfing ho trovato un buon divano dove passare la notte. Lei si chiama Breeze, vive in una co-operativa ebrea, dove ho incontrato un sacco di gente simpatica tra cui Tim, un ragazzo australiano che sta facendo il giro della California in cerca di posti dove surfare, dormendo in un vain e facendo couchsurfing nelle citta’; Rebecca e Rachel, che faranno la school of arts a UCSC; Rachel seguira’ anche qualche corso di fotografia che spero di fare anch’io in futuro, quindi oltre che downtown ci potremmo anche incontrare in universita’; Chris, un pilota di aerei, che appena ha saputo che ero europeo mi ha chiesto di un’alleanza militare pacifica europea di cui ignoravo l’esistenza; Colin e un po’ di altra gente random per finire :D Leggi il seguito di questo post »

Huge!

Ciao ragazzi, come promesso è ora di raccontare un po’ di impressioni di questi primi giorni in California, prima che anche le sensazioni e i ricordi svaniscano nella routine giornaliera che inizierà a breve anche per me.

Il primo impatto che ho avuto quando sono arrivato qui è che tutto è HUGE. Non c’è altra parola che descriva meglio questa sensazione: grande o enorme non rendono il senso di grandezza che si ha guidando su un’autostrada a 5 corsie con una berlina che, tra le macchine da queste parti, è la più piccola. “Hey dude, that’s HUGE!” Così come sono sterminati i paesaggi, le bellissime foreste e l’oceano da queste parti, allo stesso modo lo sono le strade e altrettanto grande è ogni cosa che mi circonda qua. Chiedi un gelato piccolo e ti danno una botta di calorie che fai fatica a finire, il cibo e tutto è sproporzionato per un europeo. Posso capire i loro problemi alimentari, non sono problemi di cattiva alimentazione per la maggior parte – almeno qui in California – ma di troppa alimentazione!

Clark

Clark è stato il mio primo couchsurfer. Dopo un viaggio piuttosto travagliato, una freeway attraversata con una sensazione di libertà tra le distese di foreste che coprono la bay area, sono arrivato a Santa Cruz. Giro un po’ di strade per arrivare “downtown” e cercare l’ufficio informazioni per ottenere una mappa, che trovo immancabilmente chiuso. Chiamo Clark da un payphone locale: “Hi I’m Alessandro” “Hey boy where are you? (dude this one is smart, he just arrived and already has a phone number from Santa Cruz!)” “I went downtown to the information office to get a map but it’s closed, could you give me directions?” [..] Ok vi risparmio tutta la descrizione, vi basti sapere che ho scoperto che esistono 2 Mettinson Lane, una dalla parte opposta dell’altra rispetto all’autostrada, a cui si arriva rispettivamente da Ocean Street e Ocean Drive, e ovviamente ho preso quella sbagliata! Ma per capirlo ho dovuto prima interrogare una vecchietta del posto che, molto disponibile, mi ha dato indicazioni per prendere la strada giusta.

Leggi il seguito di questo post »

Google. Unbranded.

You were so much used to it that you didn’t notice, I bet! Google has removed all the beta labels from its brands… Wow!

That’s a great piece of news!

Computer Graphics project.. Released!

Shot of the game: the flag

Shot of the game: the flag

Hello world, this is my project for the computer graphics exham I just attended! It’s a simple videogame modelled like a first person shooter where you can’t shoot ;-) but must reach the jellow flag before the red balls – likewise said the enemies – reach you!

Here are the tech specs:

  • Language: c++
  • Libraries: OpenGL & GLUT
  • Memory footprint: 54MB on a 64bit machine, at least 32MB of video ram required.

If you are on a linux (Ubuntu I suppose) machine you must in order:

  1. install the build tools: apt-get install build-essential cmake freeglut3-dev bzr
  2. download the sources: bzr co lp:~alessandro-bruni/+junk/infografica
  3. build the sources: cd infografica/build && cmake .. && make
  4. run the project and enjoy the game: ./infografica

And if you want to browse the source code at my “junk” repository… go get it at: https://code.launchpad.net/~alessandro-bruni/+junk/infografica

That’s all for now folks! Make a nice game ;-)

Macarena macarena macarena

   o      o     o    o     o    <o     <o>    o>    o
  .|.    \|.   \|/   //    X     \      |    <|    <|>
   /\     >\   /<    >\   /<     >\    /<     >\   /<

Leggi il seguito di questo post »

Getting B&W

360 goduriossissimi scatti

360 goduriossissimi scatti

Come non tutti immagino sappiate è un po’ di tempo che ho riscoperto – grazie Tom ;-) – la cara vecchia ma fedelissima fotografia chimica in Black&White!

Oggi ho preso il primo pacco di 10 rullini (5 sono per me) per fare le prossime prove! Appena arrivano i primi risultati vi farò avere qualche scansione! :-D

Durst M301

Durst M301

L’ultima cosa che non vi ho detto è che ce le svilupperemo da soli, usando il caro vecchio ingranditore, acidi pinze e bacinelle in camera oscura! Speriamo bene!

The thrill is gone

Proprio come dice il grande B.B. King! Gli esami sono passati, la mia proposta a B.B. Google l’ho fatta, e ora…

Se io sono Alice e tu sei Bob come… Ok basta, è ora di tornar tutti i soliti:

Programmatori con gli stivali

Programmatori con gli stivali

Leggi il seguito di questo post »

Follow

Get every new post delivered to your Inbox.