In tutta la storia non c’è una guerra che non sia stata gestita dai governi, dai governi da soli, indipendentemente dagli interessi del popolo, per cui la guerra è sempre una sventura, anche quando è vittoriosa.
As I wrote earlier this month, I bought a LeapMotion device (during the pre-selling phase), and as it arrived I tried to find some way of playing with it, not only with the apps from its store, but with its API, in particular integrated with Processing.
After some experiments with movement detection, coloured boxes and whatnot, I decided to try something physical. I had a couple of servos lying around, and they too were still looking for some test application (I had never used them), so I decided to put everything together. I built a crane using some Legos (from my youth) that were in a box in my closet here in my parents’ house, adding the two servos even if they do not fit perfectly (but the connection of the servos was almost perfect with the Lego gears, so in the end it was not that bad). The crane has two degrees of freedom: the red platform rotates with a continuous servo, and the black arm goes up and down with a standard servo.
The Arduino has the Adafruit motor shield (the old version actually), and I uploaded a firmata sketch to send commands from Java (Processing) without having to come up with a specific protocol; on the computer side, a Processing sketch receives frames from the LeapMotion and detects two movements: the inclination of the palm of the hand (detected only if there are at least 4 fingers in view, this means that there should be some distance between the single fingers, otherwise it doesn’t work) and the circle gesture, that happens when a finger performs a circle clockwise or counterclockwise; the first movement raises the arm, the second movement moves the platform.
http://www.youtube.com/watch?v=8tiFtJSMCyc
The video shows it working: the palm movement is sometimes detected with some delay, I think because of the angle values of the palm inclination that I put in the sketch (also, sometimes the angles assume some strange values, completely different from the previous ones, I have no idea why…*). Anyhow, it was nice to write some really easy code to detect stuff with the LeapMotion and apply it to physical stuff (instead of virtual stuff, like the apps), even if it was a toy application.
* I have to add that Linux users, at least as of today, are still second-class citizens for the LeapMotion world: not only there are no apps (but I don’t really care about this), but the SDK has a quite low version number with respect to Windows and Mac OS X, even if the latest news update from LeapMotion devs says that the latest version of the SDK is coming to us as well. This may be the cause of some misdetection happening from time to time.
Posted in Real world | Tagged Arduino, LeapMotion, Lego | 1 Comment »
One way of beginning to understand privacy is by looking at what happens to people in extreme situations where it is absent. Recalling his time in Auschwitz, Primo Levi observed that “solitude in a Camp is more precious and rare than bread.” Solitude is one state of privacy, and even amidst the overwhelming death, starvation, and horror of the camps, Levi knew he missed it…. Levi spent much of his life finding words for his camp experience. How, he wonders aloud in Survival in Auschwitz, do you describe “the demolition of a man,” an offense for which “our language lacks words.”…
One function of privacy is to provide a safe space away from terror or other assaultive experiences. When you remove a person’s ability to sequester herself, or intimate information about herself, you make her extremely vulnerable….
The totalitarian state watches everyone, but keeps its own plans secret. Privacy is seen as dangerous because it enhances resistance. Constantly spying and then confronting people with what are often petty transgressions is a way of maintaining social control and unnerving and disempowering opposition….
And even when one shakes real pursuers, it is often hard to rid oneself of the feeling of being watched — which is why surveillance is an extremely powerful way to control people. The mind’s tendency to still feel observed when alone… can be inhibiting. … Feeling watched, but not knowing for sure, nor knowing if, when, or how the hostile surveyor may strike, people often become fearful, constricted, and distracted.
Safe privacy is an important component of autonomy, freedom, and thus psychological well-being, in any society that values individuals. … Summed up briefly, a statement of “how not to dehumanize people” might read: Don’t terrorize or humiliate. Don’t starve, freeze, exhaust. Don’t demean or impose degrading submission. Don’t force separation from loved ones. Don’t make demands in an incomprehensible language. Don’t refuse to listen closely. Don’t destroy privacy. Terrorists of all sorts destroy privacy both by corrupting it into secrecy and by using hostile surveillance to undo its useful sanctuary.
But if we describe a standard for treating people humanely, why does stripping privacy violate it? And what is privacy? In his landmark book, Privacy and Freedom, Alan Westin names four states of privacy: solitude, anonymity, reserve, and intimacy. The reasons for valuing privacy become more apparent as we explore these states….
The essence of solitude, and all privacy, is a sense of choice and control. You control who watches or learns about you. You choose to leave and return. …
Intimacy is a private state because in it people relax their public front either physically or emotionally or, occasionally, both. They tell personal stories, exchange looks, or touch privately. They may ignore each other without offending. They may have sex. They may speak frankly using words they would not use in front of others, expressing ideas and feelings — positive or negative — that are unacceptable in public. (I don’t think I ever got over his death. She seems unable to stop lying to her mother. He looks flabby in those running shorts. I feel horny. In spite of everything, I still long to see them. I am so angry at you I could scream. That joke is disgusting, but it’s really funny.) Shielded from forced exposure, a person often feels more able to expose himself.
(Private Matters: In Defense of the Personal Life)
Posted in Citazioni | Tagged Citazioni | Leave a Comment »
Oggi (finalmente!) ho potuto testare un po’ più a fondo l’oggetto in oggetto, dopo aver aggiornato un po’ di sistemi operativi, e posso buttare giù le prime impressioni.
Il LeapMotion supporta tutti i sistemi operativi, tuttavia l’app store e le app sono solo per Mac e Windows. Dato che sono a casa, non ho con me un PC col secondo sistema a bordo (salvo virtualizzazioni), quindi la scelta è ricaduta sul primo, per poter non tanto testare la semplice calibrazione (che funziona anche sotto linux), quanto anche qualche programma che lo supporti.
Questo ha implicato recuperare un’immagine di OS X 10.8, perché per una serie di motivi su cui sorvolerò, avevo installato il 10.6 ma quasi tutte le app vogliono almeno il 10.7.
Il primo giudizio è che il LM è il nirvana del nerd tecnologico, puro e semplice. Il fatto che rilevi tutte le 10 dita ed i movimenti 3D è semplicemente bellissimo, ed abbiamo visto tutti Minority Report.
Poche secondo me sono le app che lo sfruttano in tal senso: la maggior parte sono manipolazioni di strumenti musicali virtuali o di semplici oggetti 3D, o tanti giochi; la prima vera app nello stile del film è quella del New York Times, che sfrutta delle gesture per leggere gli articoli online, e la sensazione è molto interessante (anche se uno schermo da 40+ pollici aiuterebbe 🙂 ). Peraltro, i controlli di Google Earth sono troppo sensibili, e non è facile “volare” sulla Terra…
Prossimi obiettivi: testare il driver per integrare il LM nelle gesture di OS X e dare un’occhiata alle API (per C++, C#, Java e JavaScript (anche Processing!)).
Posted in Virtual world | Tagged LeapMotion | Leave a Comment »
Pongo la domanda: secondo voi una volta erano più bravi a fare colonne sonore rispetto ad oggi? In particolare parlo dei telefilm.
Mi spiego: sono un feticista delle colonne sonore, genere che ritengo mio preferito (a pari merito con l’hard rock), e ne ho diverse di film e anche di videogiochi, più o meno apprezzate ed apprezzabili. Non avevo mai fatto troppo caso alle colonne sonore proposteci dai telefilm, e per colonna sonora intendo la musica che viene trasmessa durante il telefilm, e non la sigla iniziale (qui ce ne sono di carine anche oggi, anche se a causa di questo mondo consumistico del c***o i produttori fanno di tutto per guadagnare secondi di quei miseri 40 minuti che si ritrovano per fare una puntata, e le sigle sono diventate pressochè inesistenti (Lost docet); per dire, Nara di Cold Case mi emoziona tanto quanto il tema di Twin Peaks, per quanto probabilmente non godrà della stessa fama di quest’ultima – negli anni ’80 i telefilm di 1 ora duravano 50 minuti. Per dire.).
Dico questo perchè sto guardando nelle ultime settimane due esemplari di telefilm tratti direttamente dagli anni ’80: Remington Steele e Moonlighting (che vengono di fatto dallo stesso background, dato che hanno un produttore in comune almeno inizialmente, ed entrambi hanno lanciato le carriere del buon PB e del buon Bruce Willis. Non mi soffermo sulle caratteristiche in sè delle storie (carino il primo, forse addirittura meglio il secondo, se vi mancano guardateli!), ma sul fatto che hanno delle musiche che mi colpiscono. Ed è una novità, per quanto mi riguarda.
Pensateci: on top of your heads, nominatemi un telefilm di cui vi ricordiate le musiche. A me ne vengono in mente tre (e solo tre) in 28 anni di telefilm guardati: Battlestar Galactica (ho comprato il CD, principalmente per All along the watchtower, ma tutta la terza stagione è niente affatto male!) e Cold case (qui potreste notare come io non distingua tra musiche composte appositamente e musiche scelte tra le esistenti, ma soprattutto per i telefilm non si possono separare questi due piani; questo secondo telefilm ad esempio è un fiorire di scelte musicali che seguono l’anno temporale del delitto di turno, e sono spesso molto belle e molto azzeccate (una su tutte, Stolen Car nella puntata 3×11)). Il terzo è Prime Suspect, versione US, che però è durato solo mezza stagione (ma che secondo me aveva una musica rock sporco bellissima, e già la sigla lo dimostra anche se non a sufficienza).
Posted in Real world | Tagged colonna sonora, musica, telefilm | Leave a Comment »
C’è stato un momento, qualche mese fa, in cui mi sono chiesto se fosse possibile avere corde di nylon anche su una chitarra acustica… questo perchè, forse per il fatto che la mia preparazione musicale è stata prima di tutto classica, per quanto mi riguarda non esiste suono paragonabile a corde in nylon, in particolare la rotondità che si riesce ad ottenere su una chitarra classica nelle tre corde più acute, tra IX e XII capotasto, pizzicato al manico (o sopra la buca, se preferite), questo perfino sulla mia chitarra classica, di fascia piuttosto bassa. L’unico suono che riesce ad avvicinarsi a questo in quanto a forma e corporatura, per quanto sia completamente diverso, è quello della Strat, pickup al manico, overdrive con gain a 2/3 circa, riverbero. Ma questa è un’altra storia…
Anyway, ho presto scoperto che in realtà esistono corde pensate per l’acustica ma in nylon, in particolare queste, che mi sono affrettato ad ordinare. Non le avevo ancora provate, dato che quando sono arrivate le avevo appena cambiate sulla chitarra con altre “normali”, ma ieri notte ho deciso che era ora di testare il tutto. Qui sotto trovate un esempio di suono, la qualità della registrazione non è particolarmente buona perchè ho registrato con un microfono (il sistema di amplificazione della Fender acustica trasmette le due corde più alte ad un volume troppo basso rispetto alle altre, e la qualità sarebbe risultata anche peggiore… e anche questa, purtroppo, è un’altra storia).
Le prime impressioni sono abbastanza positive: tendo ad evitare di fare i versi che facevo con le corde “normali” (ci sono stati pomeriggi in cui ho suonato sull’acustica brani hard rock con una foga piuttosto significativa), dato che queste sono molto più morbide (anche quelle in bronzo); il suono del nylon è più ovattato rispetto ad una chitarra classica, e questo fa sì che si contrasti molto con quello delle tre corde rivestite, soprattutto sui capotasti alti, ma la sua rotondità resta impareggiabile. Bisogna fare un po’ di attenzione a posizionare la mano sinistra, dato che si è abituati ad un manico stretto ma a corde tutte in bronzo, su cui si riesce ad avere una certa presa che il nylon non offre altrettanto ferma, essendo le corde più lisce.
Posted in Real world | Tagged Fender, folk, nylon | Leave a Comment »
Since I’m doing some performance/battery duration tests on my rooted Kindle 4NT, I decided I needed the always useful screen application, so that I could execute tests while connected over SSH, then detach the console and let it run for a while, only to re-attach back later to the same console and see what happened, monitor some logs and so on, all the while without interrupting anything. There are other ways to execute stuff in background, but this remains the most practical of all.
Now, I found out that the ncurses library is already installed on the OS, even if it doesn’t seem to be in the sources archive distributed by Amazon; the version 5.4 is sitting right there in /usr/lib; since it is the only external requirement for screen, I copied the library back to my system and directly into the sysroot created by crosstool, so that the linker could find it easily. Then I downloaded the screen sources.
And there the problems started to arise.
First, the fact that you can specify the target/host/build systems in ./configure is not clear at all, or even documented in the help of the script, so you need to improvise and find out by yourself. The configuration does not work by specifying CC/CFLAGS/LDFLAGS, or at least I could not make it work, the only correct way is to use the –host option.
The second problem was, of course, the neverending source of surprises that is the triptych of commands produced by the autoconf stuff: it sucks beyond belief, and in particular in this case it does not work at all for cross-compilation: there are some tests that cannot be executed, the script tells you that, and then simply stops. So you need to apply a well known patch (for example, I have used this one), which allows the script to output the makefiles regardless of those tests. Then, of course, is not over: the failed tests do not produce the correct options in config.h, so my advice is to execute (separately) a configuration for your own computer, then use the config.h generated for the computer for the Kindle sources too: it will compile fine, and the final binary works without problems on the Kindle.
Posted in Virtual world | Tagged ELIoT, Kindle, linux | Leave a Comment »
In this previous post I’ve already described how to develop the toolchain for the Kindle, from that it was easy to recompile ELIoT: I was able to maintain the computer version of the VM without modifications (in Android some patches were necessary to accomodate it to the OS), and the standard ping utility worked again; no screenshots, since the execution was performed from SSH, and I will avoid to add the console output (it is basically the same of the previous post, with a couple of debugging lines that my VM has).
Now I’m thinking about outputting something on the screen: on Android the SL4A framework gives Erlang (and thus ELIoT) the ability of writing standard layouts and stuff on screen; on the Kindle you can choose between using their J2ME VM and their Java applet framework (called Kindlet), or the GTK+ on DirectFB from C; I have not explored any of those alternatives, so I have nothing more to say here (yet).
We’ll see…
Posted in Virtual world | Tagged ELIoT, Kindle | Leave a Comment »
In the last couple of weeks, I decided it was time to port my Erlang framework, ELIoT, that I develop as part of my Ph.D. thesis, to several other devices than the ones on which I already ported it (the Raspberry Pi and the Carambola). So last week I ported it to Android, and while I still have to refine it so that it can be executed on non-rooted devices (i.e., you don’t need to be root to do it), I decided to give the Kindle a try. This first post describes my findings in exploring the device itself, in a later post I will talk about ELIoT itself.
I have a Kindle 4th generation non-touch, and this “non-touch” adjective is quite important, since it changes the operating system version (and probably the toolchains/hacks). The first step is to jailbreak it (beware of the consequences! this may at best break your warranty, at worse brick the device!), using the main guides it is quite easy and (seems) with little risks, from the point of view of losing all your settings and books; at the end of the procedure, you can access it through WiFi and SSH.
Given the fact that my main objective was to cross-compile stuff, I started trying to figure out how to obtain the toolchain, and the answer is, as usual, crosstool-ng. Given the fact that the Kindle runs Linux, the non-proprietary part of the OS (i.e., everything except their ebook applications) is open source and they allow us to download the source code; in this way, we know that the 4th gen runs the 2.6.31 kernel and 2.12 libc, so I started to specify those in the ct-ng configuration; for binutils I decided for the latest stable release available, and in my first try I compiled gcc 4.7 Linaro edition.
Some guides on the Web seemed to say that the floating point type was softfp, but since there was so little clue about the toolchains for this particular Kindle, I decided to give the hardfp a try. It didn’t work out, as expected, but it led to an interesting side note: if you want to know what kind of fp a distribution is, you can execute
readelf -A
on an existing binary (I tried on the wpa_supplicant binary): if it contains the line
Tag_ABI_VFP_args: VFP registers
then it means it is hardfp; otherwise it is softfp (I checked against a binary for the Raspberry Pi, which I know is the former).
So, I recompiled the toolchain with softfp and tried the usual hello world: it worked! But the joy was limited: on a more complex application some assembly errors emerged, and at this point I thought the reasons could be
- I was using the 2.6.31.14 vanilla as kernel, but I didn’t know the subsubsubversion of the Kindle kernel and it may have been different
- maybe 4.7 was a too much advanced version of gcc to use.
So I changed the ct-ng configuration again and used the existing kernel sources downloaded from Amazon for my specific Kindle version, and changed the gcc version to 4.5.4, since /proc/version says:
Linux version 2.6.31-rt11-lab126 (jenkins-official@lucid-build02) (gcc version 4.5.3 20110406 (prerelease) (Linaro GCC 4.5-2011.04-0) ) #5 Sat Jan 12 20:39:09 PST 2013
this worked and I was able to compile and execute Erlang on the Kindle! Unfortunately, no screenshots here: access was from SSH, so all I can show you is:
[root@kindle erlangarm]# ./bin/erl -name erlang@192.168.1.3 -setcookie abc
Eshell V5.9.3.1 (abort with ^G)
(erlang@192.168.1.3)1> net_adm:ping(‘erlang@192.168.1.178’).
pong
copied directly from the terminal.
The final version of the ct-ng configuration is here, if anyone wants it; you have to adjust paths for the output directory and the kernel sources path (that you have to download from Amazon).
Posted in Virtual world | Tagged ELIoT, Kindle, linux, toolchain | 2 Comments »
Prendo spunto dal post “Lo scaffale d’oro” (link) di un blog che seguo (sperando che all’autrice originale non dispiaccia), per indicare quei 10 libri che io metterei nello scaffale d’oro ideale della mia libreria, ovvero quello scaffale (immaginario) dedicato ai libri un po’ speciali per ciascuno di noi. C’è il difetto che questi libri negli anni cambiano un po’, è difficile fare un best of e sarei stato tentato di inserire qualcosa degli ultimi che ho letto, forse troppo vicini temporalmente per poterli giudicare appieno. Alla fine in classifica ho inserito tutti libri letti qualcosa come 8-10 anni fa, e che sono i primi a cui penso se penso alla letteratura che mi piace davvero.
Spero nella mia classifica non ci siano troppe facezie… in no particular order:
- “Il signore degli anelli”, J.R.R. Tolkien
- “Addio alle armi”, E. Hemingway
- “Jack Frusciante è uscito dal gruppo”, E. Brizzi
- “Dracula”, B. Stoker
- “L’ultimo dei Mohicani”, J.F. Cooper
- “Due di due”, A. De Carlo
- “Guida galattica per autostoppisti”, D. Adams (1)
- “Rainbow Six”, T. Clancy (2)
- “La scomparsa di Patò”, A. Camilleri (3)
- “Il conte di Montecristo”, A. Dumas
(1) per la precisione, dovrei indicare tutta la serie
(2) c’è stata una serie di estati adolescenziali in cui ne ho letti una quantità industriale di Clancy, alla fine R6 resta un po’ l’iniziatore della serie (lo scrittore l’ho scoperto dal videogioco…)
(3) qualcuno potrebbe dire che è un titolo strano di Camilleri da inserire qui, ma è stato il primo che io abbia mai letto dell’autore
Posted in Real world | Tagged libri | Leave a Comment »


