I’m sick of those Pi posts

Pi (π) is the ratio of a circle’s circumference to its diameter. It is an irrational number, so it can’t be represented with a fraction, and its decimal representation contains infinite non-repeating digits, so for all practical purposes it has to be approximated.

There is a number of (ignorant) people on the internet claiming that every possible finite combination appears at some point inside the decimal representation of π, and that hence, this number contains all the knowledge and wisdom of the universe.

As far as I know, to this day, there is no proof that every combination appears inside π. And this isn’t a property that comes automatically from being an irrational number. For example let’s imagine the number 0.1011011101111011111… (the “bursts” of one always increase of size and are separated by a zero). This number is irrational, but never contains the digits 2 3 4 5 6 7 8 9, so hardly any combination.

Why am I doing this post? Because Duty Calls.

Also, I took the time to write a series that converges to my example irrational number:
a_n=\frac{\sum_{i=0}^n10^i}{10^{(\sum_{i=0}^ni+2)-1}}\\S=\sum_{n=0}^\infty a_n

Posts like this one should disappear.

GMail’s SMTP sucks

I try to send an email to a gmail user, with my @tiscali.it address, using galileo.dmi.unict.it as relay.

Gmail sends me a delivery notice because they won’t be accepting bulk mails from my server anymore. Of course I didn’t send one.

What happened was that some other people had in fact flagged as spam some emails coming from that server. I fix the problem by allowing to unsubscribe from those messages and try to tell google that the problem is now fixed. After opening something like 200 tabs and following some stupid automatic procedure, they thank me and tell me that eventually, automatically, at some point in the future they will accept emails from that server again, but there is no way in the world that they can accelerate the process.

I still need to send the email, so I try tiscali’s own SMTP, which fails miserably because they aren’t my ISP at the moment so they don’t want me to get too confortable and avoid their webmail.

So I try to send the email using my ISP’s SMTP server. They reject my username and password. And it is unclear to me why do they even want authentication in the 1st place, since I am connected with them.

I don’t want to use gmail’s SMTP because I know they’d rewrite my From: address, which is not what I want. ( http://lee-phillips.org/gmailRewriting/ )

Eventually I use an old hotmail account, only to find out that microsoft does the same thing.

After some searching I found out that it is possible to add more addresses to gmail, verify them, and now I am able to send emails using gmail’s SMTP without having the From: field rewritten.
This is still quite inconvenient because I would need to go and verify several addresses and aliases if I had to activate them all.

Why is sending an email so hard?

I suppose this only makes things quite hard for people who just want to legitimately send emails, while the spam continues at will.

Etica relativista

Segue un post di cui non conosco l’autore originale ma che ho trovato interessante.

Il problema etico è piuttosto interessante, nella sua relazione con la religione. La lettura “convenzionale” di questo tema, e mi pare che i passaggi sopra citati lo esemplifichino, è che l’etica religiosa è “assoluta”, ha una base immutabile e rivelata, quindi “solida” e coerente, ma rigida e soggetta a obsolescenza secondo i “laici” (intesi come non credenti, non come credenti non ecclesiastici).
Al contrario, l’etica “laica” sarebbe relativista, mutevole secondo le caratteristiche della società, basata sul libero consenso dei soggetti (l’etica “del discorso” di Habermas vagamente evocata nelle parole di Piermaria). La classica critica a questa etica è quella karamazoviana dell’impossibilità di fondare un’etica oggettiva senza un fondamento metafisico: “se Dio non esiste tutto è permesso” (queste parole, in varie forme, sono risuonate spesso sulle labbra ad esempio dei recenti Papi cattolici).

Ora, a mio parere, queste affermazioni sono arbitrarie. La vera differenza tra le due posizioni è che nel caso dell’etica laica il fondamento è non ovvio, ma questo non conduce (necessariamente) al relativismo. Il punto è capire cosa sia l’etica, quale funzione svolga e quindi a quali principi debba obbedire “per costruzione”. Ne derivano dei principi etici, anzi metaetici, assolutamente non arbitrari (mia valutazione).

Una volta che si sia fatto questo, a mio parere ne deriva un’etica molto più “oggettiva” e “rigorosa” di quella religiosa, che è di fatto fondata su principi rivelati. Questa che segue è chiaramente una caricatura, ma serve per estremizzare: quando Dio ha chiesto ad Abramo di sacrificare Isacco, nessun principio etico poteva opporsi: la Parola di Dio è legge in sè. Poi, naturalmente, Dio è buono e misericordioso, e non vuole il male delle sue creature, ma queste ultime non sono in grado di conoscere appieno il Bene e il Male, che anche dopo la digestione della Mela restano in parte un mistero (è per questo che un inqualificabile personaggio può dire che la strage provocata da uno tsunami può essere in qualche modo “buona”).
Se domani un roveto ardente dichiarasse che è moralmente obbligatorio dare un ceffone alla prima persona che si incontra ogni mattina per strada, il credente potrebbe davvero opporsi? (anche qui, sono deliberatamente caricaturale) E se, al posto del roveto ardente, a parlare è il Papa ex cathedra (e quindi ispirato direttamente dallo Spirito Santo)? Allo stesso modo, l’etica “laica” ha un obbligo di coerenza che quella rivelata non necessariamente ha: non è detto che i comandamenti debbano rispettare la logica razionale umana.

Il vero “relativista”, quello per cui nessuna azione è in linea di principio irrevocabilmente vietata o permessa, è il credente. E’ relativista nel senso che essendo il mondo contingente rispetto al Logos, esso non ha in sè la propria legge, ma la riceve dall’esterno. Se San Tommaso d’Aquino dice che l’embrione non ha anima e Papa Giovanni Paolo II dice di sì, non per questo il fedele può farsi un’idea propria cercando magari un (temo inesistente) chiarimento nelle Scritture: deve assumere che il Papa esprima la verità rivelata, che San Tommaso sbagliasse, e che la vita sia sacra dal momento del concepimento. Eppure, per sacra che sia, il credente non è mai al riparo dall’eventualità che gli venga richiesto l’eroico ed estremo sacrificio di condurre il figlio sul monte a immolarlo.
Questo, a me non può accadere. E’ vero che in un sistema etico laico nessuna azione, neanche l’omicidio di un figlio, è incondizionatamente proibita, ma questo accade proprio perchè esiste un sistema di principi che obbliga a considerare l’azione nel suo contesto (e in questo senso sì, è relativa, o meglio _non è la stessa azione_). Ma in presenza dello stesso “caso”, la risposta è univoca. Introdurre la variabile “metafisica” implica che il contesto umano non è autosufficiente e quindi la pura rilevazione delle “variabili” terrene non determina in modo assoluto l’eticità.

In altre parole: se Dio esiste, tutto è permesso (salvo poi fare i conti con Lui).

OsX usability

A lot of people write nonsense about how GNU/Linux distribution are completely not usable while OsX is so great and just works out of the box and so on. So since I am bored I want to write something about my experience as a mac user.

When I bought my macbook it came with OsX 10.4.

The installed player is quicktime. When I tried to watch a movie with it, I was informed that I needed to download some codecs, and redirected on a page where there was a long list of codecs that I could download. No support implemented to try to understand which codec I needed.
I downloaded and installed a few at random, and still I couldn’t watch the movie. But after a reboot the movie worked.

Yes I am fully aware that normal people just use VLC, I wanted to try the “works out of the box” part, which was clearly false. And one has to know about VLC in advance, which is not “usability”

That laptop also came with a remote and a nice media center full of eyecandy that would miserably crash when instructed to play a movie.

The default instant messenger only supported some apple protocol used by 3 or 4 people in the world. Hence completely useless.

I failed to create a playlist in iTunes the 1st time I used it (honest!).

To safely remove an external device, you need to drag it on the trash bin (uh?)… this makes total sense, right?

Windowses don’t go to full screen normally, you need to drag them big.

And well the enter button doesn’t open files, it RENAMES them! Because of course that’s the most common action to do with a file: rename it!

It comes with just 1 game: chess, with a 3d graphic, and I hate those, because if i look from top I don’t know which pieces am I looking at, and if i look laterally I don’t get a really clear view of the situation. Yes they look cool but are not good to play with.

I won’t be buying an Android device

I currently own a Nokia E71, that uses Symbian.

Recently I did reset the device (hoping to fix a software bug, which I fixed otherwise) and hence I’ve had to reinstall all the applications.

One nice application was quickoffice, they had a deal with Nokia so for the owners of my model the software was free of charge. Was. Now the company has been bought by google and they removed any trace of symbian downloads just to leave android and ios ones around.

My phone can sync contacts and calendar with gmail, but the instructions for doing so, that were located on google, are now missing. They have taken them off.

I feel like they are purposefully trying to make the life of the remaining symbian devices shorter, to sell more of their new devices instead.

While I do realize that I am completely powerless against this sort of strategy, and that this website has only 1 reader (myself), I don’t want to reward google’s strategy by getting and android phone.

By the way, I also believe that the iThings are crap as well, mostly because of the extra money that would be required for me to run a program I wrote on my own device.

Short story

Many years ago there was a castle, placed on top of a mountain.
It had been built by a rebel lord, who didn’t ask the real estate municipal office for proper authorization; and this it had been built as for a game, with many changes of mind and afterthoughts. So there were many staircases that didn’t lead anywhere, doors leading to brick walls, hatches, loose tiles and all sort of things that your mom wouldn’t want in her living room.

There was one of those stairs, a bit different than the others: nobody knew if it did indeed lead somewhere or not, for the end of it was completely dark and nobody dared to venture in it. And they were also too stupid to think of bringing a torch (just to fix the holes in the plot).

One day the young Olaf Happy Face decided to go in there.

And he went.

And descended.

And descended.

In the darkness.

Feeling the steps with his feet, and not seeing anything at some point, he heard someone breething; so he asked “who’s there?”

And Gandalf replied: “you shall not pass!”

So Olaf turned around on his heels and went back home.

THE END

Accept dbus calls in java

Today I’ve had a real tough time in making a Java software accept dbus calls from other programs.

It turns out it’s a very trivial thing to do, so here’s the code.


DBus.java

This interface defines the functions that will be available over dbus.
The decoration is very important, otherwise you will need to put the interface into a package named in the same way.

import org.freedesktop.dbus.DBusInterface;
import org.freedesktop.dbus.DBusInterfaceName;

@DBusInterfaceName("org.printer")
public interface DBus extends DBusInterface {
 public void Print(String message);
}

Main.java

import org.freedesktop.dbus.DBusConnection;
import org.freedesktop.dbus.exceptions.DBusException;


public class Main {
    public static void main(String[] args) {
        new Main();
    }

    public Main() {
        DBusConnection conn = null;
        Printer p = new Printer();
        try {
            conn = DBusConnection.getConnection(DBusConnection.SESSION);
            conn.requestBusName("org.printer");
            conn.exportObject("/org/printer/MessagePrinter", p);
       } catch (DBusException DBe) {
           DBe.printStackTrace();
           conn.disconnect();
           return;
       }
    }
}

class Printer implements DBus {
    public boolean isRemote() {
        return false;
    }

    public void Print(String message) {
        System.out.println(message);
    }
}