Been to Morocco, loved it

I didn’t really want to go there because it meant lots of car (4100 Km in a week) and not enough time to enjoy and getting to know each place we went.

ferdy as a twareg

In the end, well, I went. And I’m quite happy I did it. It is a very interesting country where the first thing you learn is:

Hurry kills...
    and lazyness re-kills. — Anyone in Morocco

We crossed the Atlas twice. Some of the views up there are just amazing.

We also went to the dunes in Merzouga. If you ever consider going to Morocco, you can’t miss a couple of nights in ‘Atlas du Sable‘ with Ali’s crew, those guys make it very comfortable and enjoyable.

We also visited M’Hamid and that part of Morocco, that part was a bit harder emotionally. But it is still enlightening and a very interesting place to visit.

Last place was Marrakech. I loved it so much that I’ll have to go again because two nights is not enough for this city.

Only complains are: Too many hours of ‘car stuck because of sand’ and not enough time to get to know any place. but all in all it’s been a wonderful trip and a very nice experience. Their way of living and thinking is just too different from anything in Europe.

We took hundreds of photos, some of them are on my picasaweb album: http://picasaweb.google.com/fpereda/MoroccoTour07 .

If you ever have the oportunity to go to Morocco, go for it.

— ferdy

Hidden PI

The people from Gaussianos.com (spanish blog abouth math) posted a couple of algorithms to calculate Pi and asked readers to provide some more.

I recently read on The Computational Beauty of Nature that Pi is hidden in the Mandelbrot set:

Take the mandelbrot iteration function:

z0 = 0
z = z^2 + c

And the initial complex number:

c = -3/4 + a * i

That set of complex numbers lays just between the two main parts of the body of the set, it is also known as the ‘neck’ (since it joins the cardiod with the biggest ‘head’).

For a = 0 the point belongs to the mandelbrot set. Let k be the number of iterations needed for a point (c = -3/4 + a * i) to reach modulus greater than 2 (escape radius), as a approaches to zero, k * a approaches to pi.

I wrote a simple C program that shows this (http://dev.gentoo.org/~ferdy/stuff/pi_mandel_gmp.c). When compiled, linked against libgmp and run, it outputs something like the following:

  a      || k         || aprox. pi
 --------++-----------++-----------
  1      || 3         || 3.0000000
  0.1    || 33        || 3.3000000
  0.01   || 315       || 3.1500000
  0.001  || 3143      || 3.1430000
  0.0001 || 31417     || 3.1417000
  1e-05  || 314160    || 3.1416000
  1e-06  || 3141593   || 3.1415930
  1e-07  || 31415927  || 3.1415927

It is an utterly expensive and pointless way to calculate pi, but it is one of the most obscure and weird ways to do it 🙂

Of course, all the credit goes to Dave Boll, who discovered the fact on 1991.

– ferdy

Random Git Stuff

Switching between projects using different SCMs is painful sometimes, and I always fail to remember the branch I’m on in my Git repositories. I use some bashrc/PS1 magic to show some SCM information in my PS1, I thought someone would find it useful: bashrc-scm.

Lately I’ve been working on RepoDoc whenever I’ve found a bit of free time. We are using Git as our SCM mainly because it is easy and very flexible and we can follow a pseudo-centralized workflow that probably only suits us 🙂 We faced some problems with it but given the flexibility of Git, fixing them was really easy.

We keep a central repository with one branch per committer plus master. Those are the top-level branches, and not everybody can update every brach, so the traditional Unix filesystem permissions doesn’t solve our problem. Then we can create as many temporal branches as we want under the tmp/ directory.

Also, we decided to keep a ‘fast-forward only’ policy on top-level branches, so everything has to be cooked in temporal branches first and then cleanly merged into top-level branches.

To enforce both policies (permissions and ‘fast-forward only’) we call a script from the update hook who does all the magic: http://dev.gentoo.org/~ferdy/stuff/enforce-perms. The users-allowed file is something like:

refs/heads/master$  alice bob
refs/heads/alice$   alice
refs/heads/bob$     bob
refs/heads/eve$     eve
refs/heads/tmp/     ^
refs/tags/          alice

Today I also decided to hack a CIA bot to send repodoc stats. It was fairly easy since the ciabot.pl included in Cogito did almost everything I wanted. However, being a perl-ignorant I rewrote the whole thing in bash to suit my needs, grab it from http://dev.gentoo.org/~ferdy/stuff/ciabot.bash.

For those with the ability to read or understand some Spanish I wrote a little introduction to Git: http://dev.gentoo.org/~ferdy/git-intro/

I have also been trying to import the gentoo-x86 module into Git without much luck, both parsecvs and git-cvsimport failed, I’ll probably try Tailor later. I haven’t payed much attention to it anyway, since I’m a bit busy with university stuff. I guess I should seek help in the Git mailing list once I take it seriously.

Oh, and by the way, there is a new Git version in the tree. Go grab it!

– ferdy

PAY, it depends on how do you understand licenses

Hey PAY!

The answer to your question about free licenses depends on how you understand a license. What do you want to do ? protect the work or give rights to your users ?

If you see the license as a way to protect the code itself (the music in this particular case); then there is no way the BY-SA is ‘more free’ than the BY-NC-SA.

However, some people (me among them) think licenses are meant to give rights to users. With this idea, the BY-SA is far ‘more free’ than the BY-NC-SA; because the former allows derivatives works not allowed by the latter. Following with this argument you come to the conclusion that the BY is the ‘most free’ among the CreativeCommons licenses.

Of course thats only my opinion and since IANAL I might be totally off.

Cheers,
Ferdy

Simplest bash quine ?

Playing around with some of the new bash-3 features I accidentally found a really simple quine:

[ $ ~ ] cat quine.bash
echo ${BASH_COMMAND}
[ $ ~ ] bash quine.bash
echo ${BASH_COMMAND}
[ $ ~ ]

Of course it only works on bash-3. I don’t know if that’s ‘cheating’… but oh well… it’s still interesting heh 🙂

Cheers,
Ferdy

Having great fun

Hi all!

Ireland is so great (it has always been anyway :). Working with teenagers is a bit harder than programming but I keep improving my style haha. There’s two more spanish leaders working with me and they’re also quite good. So I can’t complain really…

Of course no Gentoo work since I haven’t found a network to connect to with my iBook. I keep trying anyway 😉

Alright… time to get back to those little devils.

Cheers,
Ferdy

Everything is packed up, see you in August

… I hope to enjoy there and come back with enough energy to work on Gentoo.

BTW, in August I will start an ‘Alpha Arch Tester’ subproject so probably some of you will want to join us. If you want to, drop me a line.

Donnie, thanks for answering, I think I’ll buy it on August… will report when I adquire it.

Have a nice July people, see you in August.

Cheers,
Ferdy

Exams are over, and holidays start just now

Well.. it looks like finally the exams are over. The rest of today and tomorrow will be the only ‘holidays’ I’m going to have this year. Also Gentoo work is going to be delayed until the first days of August since I’m going to go to Ireland for the whole July and I don’t think I will be able to either check my mail or ssh home. In fact I don’t think I will be able to connect to Internet for the whole month. Anyway, I’m carrying my laptop just in case I found a hotspot or a [i]neglected[/i] access point :>

Although I’m going to Ireland to work it is a strange way of ‘working’… they pay me the trip to Ireland (Clonmel, Co. Tipperary) and some cash to spend there or wherever I want; I [i]just[/i] have to take care of ~10 spanish students. Great chance to finish those books I’m currently reading or I want to read; and also a really good oportunity to ‘disconnect’ from RealLife(TM).

Since my memory is getting worse and worse every day I thought I could spend that money on a Tungsten C, It’s a nice gadget and it will definately help me maintain a bit of order among the things I have to do… It’s also got Wi-Fi builtin which is ‘a must’ for me. Any experiences with it? If any of you has tried or owns this device I’d like to hear from you 🙂

Cheers,
Ferdy