Mostrar mensagens com a etiqueta Linux. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta Linux. Mostrar todas as mensagens

domingo, 12 de janeiro de 2014

Musings from a Sunday morning

In the last Sunday of 2013 and I was holding David in my left arm (then a two months old baby) while he was slipping. It was a normal morning with Sara (two years and one week older than her brother) wandering and running all over the place.

Since I had only one hand available and I had to stay still I decided to read some rss feedings. In one of them, that I now forget the source, I was redirected to this gcc bug report titled "__cplusplus defined to 1, should be 199711L".

The amusing part, at least to me, was that it has taken more than 10 years to close the bug. The bug was opened on 2001-01-25 for version 2.97 and finally closed and fixed on 2011-08-18 for gcc 4.7. The whole bug report is an entertaining reading and really appropriated for Saturday morning in the Christmas holidays (just 129 comments).

The interesting part was that the change was withheld  by the solaris port of gcc. While I suspect that although an important reason the bug was not overly urgent or else the social pressure to fix it would had justified a quicker action.

The musing part was twofold, on one hand how free(/libre) software works and one of the reasons why I enjoy it, the cooperation and the ideas exchange. The second reason was for being a Sunday with Susana, that understands and uses free software, and the two kids who (at least for now) could not care less about software as a social experience. Surely this inspires me with a smile and hope in the humanity.

terça-feira, 26 de outubro de 2010

Python class for quaternions


Last August in Dublin (at DCU) I presented a tutorial about Python in Scientific Computing.

While there I thought it was appropriate to give a native example (in Rome be Roman) and so I choose the Quaternions. This is a good excuse as any other to present the multiple features of python for science. :-)

The picture above is carved in the Broom Bridge, over the Royal Canal, and where supposedly Hamilton had the inspiration to come with such beasts :-) . I had described before (in Portuguese) my hazard quest to find the place. An yearly event, at 16th of October, gets people together to visit the place and probably for a couple of drinks. :-)

While preparing the course I searched for python implementations of the quaternions and I have only found code related with graphics transforms (where the quaternions can be useful).
In the same spirit of Free/Open Source Software, to scratch a itch, I make available my implementation of  a python class that implements the quaternions and that deals transparently with the complex numbers.

The code can be found at my homepage.

Here it is a sample:

    a = Quaternion(1, -2)
    b = Quaternion(1, 2, -3, 4)
    c = 1 - 2j

    print "a =", a
    print "b =", b
    print "c =", c

    print a + b
    print a - c

    print a*b
    print a*c

    print 2*a

    print b*b.conjugate()
    print abs(b)**2

And the resulting output:

a = +1-2*i+0*j+0*k
b = +1+2*i-3*j+4*k
c = (1-2j)
+2+0*i-3*j+4*k
+0+0*i+0*j+0*k
+5+0*i+5*j+10*k
-3-4*i+0*j+0*k
+2-4*i+0*j+0*k
+30+0*i+0*j+0*k
30.0

I hope this helps others who have the same problem I had. :-)

sábado, 4 de setembro de 2010

Samsung Galaxy: Adding a proxy

I have a (new) smart phone, the Samsung Galaxy S that has a really nice 4 inches (10.16 cm) AMOLED screen among other niceties. :-)

It come with the 2.1 Éclair Android systems. In the last couple of weeks I have been in DCU (Dublin City University) that has (a weird security setup and) a network that requires an explicit proxy. In order to use the Wifi there I had to set up the said proxy.

The problem as I found out later is that the standard Android versions does not come with a way to configure a proxy. Taking a look to Xana's HTC Wildfire I see that HTC Sense does not have that option either.

That issue is reported in Android bugs list, with lots of ired and angry users letting their opinions being known about the fact (some of the posters are really harsh about the missing feature).

The purpose of this post is to report that it is possible to add a http proxy for Galaxy. It is not obvious at first (or second, third and so on) sight. We need to go to Wifi Network Settings and while there press the context menu (the list button), there are two possible options, Scan and Advanced. The proxy can be set in Advanced, the Advanced mode is also available in the standard Android set but the proxy option is not there.

Unfortunately the proxy does not work with the Android Market application, or with maps, or... so it is not a huge advantage. :-(

Lets hope that this is solved for future versions.

quinta-feira, 24 de junho de 2010

kanguru no Fedora Linux (novo tarifário)

A Xana usa o kanguru, que funcionava bem com o Fedora Linux. Com o novo NetworkManager desde o Fedora 11 que a configuração é imediata.

Recentemente aproveitamos a mudança de tarifária para pelo mesmo preço ter mais velocidade e maior tráfego. O problema foi que a partir dessa altura o kanguru deixou de funcionar no Fedora.

Hoje depois de procurar um pouco na rede encontrei a resposta aqui:
Kanguru at linux

A única modificação necessária é alterar a APN na configuração do NetworkManager para
kanguru-portatil

e voilá, funciona. :-)