Articles Labelled with “Digital life”

Thanks Mr. Ritchie

Today Unix, or some other operating system deeply inspired by Unix, is pervasive: servers, embedded devices (notably Android, but it's only one) and the “revolutionary” Mac OSX is itself an incarnation of the ideas and works of Dennis Ritchie.

Dennis Ritchie worked on Unix more than 40 years ago, and my questions is: what will we use in forty years? Probably something Dennis Ritchie was working some months ago.

Thanks Mr. Ritchie.

Google+ and your privacy

Google+ privacy warning

Yesterday I was impressed by a privacy warning of Google+. While I was resharing a friend's post, Google+ remembered me that the original post had a limited visibility, and to take account of this fact. Click the image on the left to read the original message.

So Google+ starts it's journey with a strong accent to your privacy concern: you are invited not to tell everyone your business, because it's a valuable information, only Google wants to know... ;-)

Buon compleanno… da Google

Google's Doodle for birthday

Oggi è il mio compleanno, e questa non è più una novità da molti anni ormai. La prima persona che oggi mi ha fatto gli auguri di buon compleanno è stata la mia amica Valeria, a mezzanotte e cinque.

La seconda “entità” a farmeli è stato… Google! La prima ricerca che ho fatto, questa mattina, mostrava un logo di Google con un pacco regalo ed una torta. Come al solito, quando appare un logo custom, vado col mouse sul logo per scoprire di cosa si tratta.

Sotto il cursore è apparsa la scritta “Happy Birthday Paolo!”. Non ci potevo credere e, per chi in effetti non ci credesse, invito a cliccare sull'immagine in alto.

La prima considerazione è stata: ma che simpatici! La seconda non è stata una considerazione, ma una sensazione : un brivido lungo la schiena. Certo è tutto ovvio, non ci vuole chissà quale analisi o data mining per scoprire qual è la data del mio compleanno, visto che nel mio profilo di Google ce l'ho messa, anche se privata, nel senso che non ne ho autorizzato la pubblicazione.

Il problema qui non è infatti se altri possano scoprire informazioni personali, ma di quante informazioni aggregate disponga un'unica azienda. Cosa deve accadere perché iniziamo a preoccuparci?

Afterthought (about Unity)

Unity on my Dell netbook

In my previous post I expressed a strong opinion about Unity, the new graphic shell included in the latest release of Ubuntu, branding it as unusable.

Actually, I was wrong. My bad feeling was due to the novelty of ideas developed in Unity, and my the superficiality in testing it.

I don't know how Gnome Shell 3 compares with Unity, simply because I didn't tested the new Gnome Shell yet, but for sure Unity is a good project and represents a very interesting approach.

Unity

My checklist for today:

  1. try the new Ubuntu shell, Unity: done. Verdict: unusable.
  2. try Gnome Shell 3: done. Verdict: unstable.

This time I pass, let's see the next Ubuntu release if it will be more stable and usable.

Strange messages

Very clear warning messages from K3B

I just learned that, if your DVD burner or the medium you just inserted into it cannot run at 16x speed, it's safe to burn at 17x.

You never stop learning!

Installing OCaml Batteries

In this post I want to help OCaml newcomers to install Batteries. The task is trivial under Linux, while it's a bit tricky under Windows, because OCaml still lacks a self-contained Windows installer.

My assumption is that the reader is a coder, so I will not explain everything… Let's start with the easy part: Linux.

Linux

The installation of OCaml + Batteries under a Debian/Ubuntu system couldn't be easier, thanks the the hard work of the Debian OCaml Task Force. So open a terminal and type:

$ sudo aptitude install ocaml-batteries-included

That's all for Debian/Ubuntu. I don't know how Fedora works, but I think it's easy to install Batteries using YUM, something like:

$ yum install ocaml-batteries-included

If a RPM package for Batteries wasn't available, you could still install OCaml, Camomile (the Unicode library), and compile Batteries from sources, as described below for the Windows OS.

Windows

As said, this OS still lacks a self contained installer which is in progress, at least for installing OCaml. Since many OCaml versions are available for Windows, with different pros and cons, I had to decide which one to use, and I decided to follow the simplest path to reach the goal of installing all the stuff we need. The Cygwin port is by far the simplest way.

  1. Download Cygwin setup and double click the executable. In Windows Vista/7 (I made my test on a Windows 7 64bit box) you will be required to allow the program to be run a couple of times, as usual ;-) …
  2. when the list of available packages appears, select: each and every package containing "caml" (see the screenshot below), and also make, m4, libncurses-devel, git, wget and rlwrap;
    Necessary Cygwin packages
  3. open the Cygwin shell;
  4. download the Findlib library, version 1.2.6:
    $ wget http://download.camlcity.org/download/findlib-1.2.6.tar.gz
    
  5. unpack, compile and install Findlib:
    $ tar -xpzf findlib-1.2.6.tar.gz
    $ cd findlib-1.2.6/
    $ ./configure
    $ make
    $ make install
    
  6. download, unpack, compile and install Camomile 0.8.1:
    $ wget http://prdownloads.sourceforge.net/camomile/camomile-0.8.1.tar.bz2
    $ tar -xpjf camomile-0.8.1.tar.bz2
    $ cd camomile-0.8.1/
    $ ./configure
    $ make
    $ make install
    
  7. the last step is to download compile and install Batteries itself. I wasn't able to compile the latest stable release (1.2.2), for an obscure preprocessor error, but using the latest GIT branch everything went smoothly. So here are the steps:
    $ git clone git://github.com/ocaml-batteries-team/batteries-included.git
    $ cd batteries-included/
    $ make camomile82
    $ make all doc
    $ make install install-doc
    

Testing the installation

Before starting to play with the library and the toplevel (the OCaml REPL is called toplevel) let's put into action a couple of helpers.

  1. The OCaml toplevel doesn't support readline. To get this feature back we add an alias to .bashrc. This works in both Linux and Windows:
    alias ocaml='rlwrap -H /home/paolo/.ocaml_history -D 2 -i -s 10000 ocaml'
    
    restart the terminal or load another bash;
  2. we need to load Batteries in the toplevel. This is not strictly necessary, but it helps a lot and the Batteries ASCII logo is wonderful :-). All we need is to create a file named .ocamlinit in the home directory. Open your favorite editor and put this phrases in ~/.ocamlinit:
    let interactive = !Sys.interactive;;
    Sys.interactive := false;; (*Pretend to be in non-interactive mode*)
    #use "topfind";;
    Sys.interactive := interactive;; (*Return to regular interactive mode*)
    
    Toploop.use_silently 
                 Format.err_formatter (Filename.concat (Findlib.package_directory 
                 "batteries") "battop.ml");;
    

If everything went well you can now type ocaml and something like this should appear:

$ ocaml
        Objective Caml version 3.11.2

      _________________________
    [| +   | |   Batteries   - |
     |_____|_|_________________|
      _________________________
     | -  Type '#help;;' | | + |]
     |___________________|_|___|


Loading syntax extensions...
	Camlp4 Parsing version 3.11.2

Conclusions

This (rather boring) post has been devoted to the installation details of Batteries under Windows, where it presents some difficulties for newbies. Next time we will start on exploring the library with simple examples to exploit its strength.

Copyright © 2004–2012 by .
Creative Commons License Content on this site is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Italy License.

RSS Feed. Valid XHTML 1.1. This blog is written in Objective Caml. Design based on the work of Rodrigo Galindez.