brain activity log
23.03.2007 - Friday - 10:12 - LOL
I just got this junk in my mbox. A couple of antispam
systems including my own spamassassin (that
has a very low false-negative rate on this machine)
failed to catch it. Couldn't resist to post it :D
X-Spam-Checker-Version: SpamAssassin 3.1.3-gr0 (2006-06-01) on etherea
X-Spam-Status: No, score=2.6 required=3.5 tests=BAYES_80,HTML_90_100,
HTML_MESSAGE autolearn=no version=3.1.3-gr0
X-Scanned: with antispam and antivirus automated system at libero.it
Delivered-To: pragma at firenze dot linux dot it
Received: from 184.108.40.206 (HELO mx1.punkass.com)
by siena.linux.it with esmtp (B8=9B6:>7'( ;3U*)
for pragma at siena dot linux dot it; Fri, 23 Mar 2007 08:45:13 -0200
From: "Rory Combs" <email@example.com>
To: <pragma at siena dot linux dot it>
Subject: anti-spammers are lamers
Date: Fri, 23 Mar 2007 08:45:13 -0200
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1158
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at firenze.linux.it
This is a multi-part message in MIME format.
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
20.03.2007 - Tuesday - 18:10 - Matrices for dummies
A matrix is an ordered, bidimensional collection
of mathematical expressions usually rapresented as a rectangular table.
The horizontal lines in a matrix are called rows and the vertical
lines are called columns. A matrix with m rows and
n columns is called an m-by-n matrix (written mxn)
and m and n are called its dimensions. The dimensions of a matrix
are always given with the number of rows first, then the number of columns.
If the number of rows of a matrix equals the number of columns (m = n) then
the matrix is said to be square otherwise it's just rectangular.
Square matrixes have several interesting properties that we'll talk about later.
The entry of a matrix A that lies in the i-th row and the j-th column is called
the i,j entry or (i,j)-th entry of A. This is written as ai,j,
aij or A[i,j]. The row is always noted first, then the column.
If the entries of a matrix are all real numbers then the matrix is said
to be real. If the entries are complex numbers then
the matrix is too said to be complex. If the entries
are polynomials then (guess what?) the matrix is said to be polynomial too.
The entries of a matrix usually have some associated meaning but we don't
care about that in this article. Now let's just say they are mathematical
expressions (maybe numbers) and concentrate on matrix manipulation.
Let's play with it
We define the matrix sum as an operation that given
two mxn matrices A,B returns a mxn matrix C with entries that are sums
of the corresponding entries in A and B. Please note that the sum
is defined only for matrices of exactly the same dimensions: we say
that such matrices are sum-compatible.
For sum-compatible matrices it's obvious that
We define the scalar multiplication as an operation
that given a mxn matrix A and a scalar expression K returns a mxn matrix B
with each entry made of the corresponding entry of A multiplied by K.
It's again obvious that for sum-compatible matrices A,B and any scalar expression k
and for any matrix A and any couple of scalar expressions
Food for thoughs: Multiplication by scalar is commutative
if the underlying ring (of expressions) is commutative. This is true when the expressions
are (real or complex) numbers or polynomials, that is most real-world cases in that matrices
are applicable. However, the matrix algebra can be applied also to non commutative rings
(for example quaternions) where the multiplication by scalar must be splitted in two
different operations: left multiplication and right multiplication.
Not that obvious
We define the matrix multiplication as an operation
that given a mxp matrix A and a pxn matrix B
returns a mxn matrix C with element i,j computed
as the scalar vector product of the i-th row of A and the j-th column
Note that the matrix multiplication is well defined only for
couples in that the left matrix has the number of columns equal to the
number of rows of the right matrix. We say such two matrices
to be multiplication-compatible.
Food for thoughs: the multiplication
of two nxn matrices processes 2 n2
entries. However there is no known algorithm with computational
cost of O(n2). Most algorithm
are O(n3) and the most clever
implementations are O(n2.8).
An O(n2.376) algorithm has been proposed
by Coppersmith and Winograd but its implicit factor hidden by the O() notation
is so big that its implementation is worthwile only if we're going to
multiply matrices with n that is out of our current computing possibilities.
It's very easy to show that (and here comes the non obvious) the matrix
multiplication is generally not commutative, that is
except for very few special cases. The (square) matrices for that
are said to commute and must satisfy strict rules
on their elements.
The non commutativity of the matrix multiplication makes
the algebraic manipulation to become non trivial and causes
infinite headcaches to engineering students.
However, we're lucky since the associative and distributive properties
still apply and it can be proven that the following equations are all true
(given that the matrices involved are multiplication-compatible and
the underlying ring is commutative).
We define the transpose of a mxn matrix A
as a nxm matrix B obtained from A by swapping rows with columns.
The transpose of a matrix A is often written as AT
or as A'.
Note that swapping rows with means effectively swapping
the order of indices of each element. The element aij
of the matrix A becomes the element aji of
Food for thoughs: This property is interesting in computer
matrix processing. To apply an algorithm to the transpose of a matrix instead of the original
one we can simply swap the parameters of all the matrix element access functions...
A matrix whose transpose is equal to itself is called a symmetric matrix;
that is, A is symmetric if AT = A. Note that A must be
square to be symmetric and internally the elements must satisfy the relation
aij = aji.
It's easy to show that
for any matrix A, thus the transposition is a self-inverse operation.
Also for two matrices with the same dimensions
If the matrices A and B are multiplication-compatible then
Note that the order of multiplication is inverted.
And finally taking the transpose of a scalar (1x1 matrix) is a null operation
A particular square matrix that commutes with all other
matrices of the same size is the identity matrix.
The identity matrix has all unit elements on
its main diagonal.
It's easy to prove that
and thus the identity matrix is the "unity" element of the matrix algebra
and the multiplication by the identity matrix is an idempotent operation.
Obviously the transpose of an identity matrix is still an identity matrix.
Given a square matrix A we define the inverse matrix of A
as the matrix that when multiplied by A gives the identity matrix as result.
The inverse matrix is usually written as A-1.
The inverse matrix does not necessairly exist. A matrix that has no inverse
is said to be non invertible and later we will discover
that it is also singular.
Note that A and its inverse (when it exists) do commute.
Food for thoughs: for non square matrices
we can define the left (A-1A=I) and the
right inverse (AA-1)=I. Such inverses
have few real world applications...
It can be shown that the inverse of a matrix is again invertible and that
for any invertible matrix A and that
for any invertible matrix A and any non null scalar k.
It can be also proven that
for invertible matrices A and B of the same size. Note that the order
of factors is inverted and the formula is very similar to the one
that involves transposition.
Finding the inverse of a matrix is a very common highly intensive computational task.
There are several algorithms that implement this operation and many of
them operate better on matrices with elements that satisfy certain properties
or conformations. The task of finding the inverse is strictly related
to the computation of the determinant which is the argument
of the next lesson. Stay tuned :)
16.03.2007 - Friday - 01:10 - TopCoder
Warning: self-glorification follows: don't read this post.
I've been looking at my past bookmarks tonight and in some deep
folder I've found the link to topcoder.com. I did some
competitions just for fun in 2004, including a Google Code Jam
(hmm... they have promised to send me a T-Shirt but never
fulfilled... bad, bad Google!). Anyway, after only those 3 matches
I've found myself still being in the "outsiders" part of the graph.
Well, ok, Petr,
the top rated member has a score of 3426 which substantially doubles mine but he also did nearly 300 matches
which means that he is playing this thingie weekly since several years now. It's a nice sensation :)
Curious note: the Russian Federation and Poland are the topmost rated countries.
Besides this and after all, the topcoder arena is really fun:
give it a try.
So you've readed the post anyway heh ?
12.03.2007 - Monday - 21:43 - Log (all in one)
I've submitted a kernel qconf patch to kbuild-devel@sf but the list seems to be quite
silent since a couple of weeks. I'll resubmit to the kbuild mantainer if I don't have
feedback in a day or two.
I've tested XGL and beryl recently. You can see some screenshots
on the right. Yes, it's running inside an X window and yes, I have
tried it as a fullscreen server :P
It basically works like a charm. The widow movements are very
cool and the 3d cube really adds a new dimension to the desktop.
I've found only some really minor bugs like the tooltip trick
that you can see in the third photo (but this might be tweakable
The fact is that with the ati proprietary drivers the internal
part of the windows seems to slow down a lot. Most browser pages
flicker and jump a bit when scrolling. With the open source radeon
drivers things should be better but at the moment the RV580 chip
is not supported (X1950 Pro) because ATI is not releasing specs.
Will have to wait a bit more for this to become really usable.
Gabriele is using beryl with the nvidia native support and
he didn't notice any slowdown.
Ethy is preparing
the graphic layout for the new KVirc
web site. It's very nice! You can take a look here.
Next song is "Word Up", as performed by Korn.
Yo, pretty ladies around the world
Very cool because it's powerful and makes you wanna dance :)
Gotta a weird thing to show you
So tell all the boys and girls
Tell your brother, your sister and your momma too
Were about to go down
And you know just what to do
Wave your hands in the air like you don't care
Glide by the people as they start to look and stare
Do your dance, Do your dance
Do your dance quick, mom
C'mon baby tell me what's the word
I'm prolly going to start a collaboration with truelite.
EBS offices definitively moved. Frantz is a bit upset for this reason.
Nearly completed the fourth eTraveler milestone.
Maybe I've found the root cause of a very annoying
disease that follows me since months or maybe even years. Don't worry: nothing deadly,
just extremely disturbing. This would be really cool since this time
I would kill the beast forever instead of constantly fighting the symptoms.
It looks that eutelia is going to
bring wireless connectivity to my home town. I've been waiting for this since years
12.03.2007 - Monday - 03:57 - Star Wars
Anakin Skywalker, now Darth Vader:
Where is Padmé ?
Is she safe ?
Is she all right ?
Lord Darth Sidious:
It seems.. in your anger... you killed her
05.03.2007 - Monday - 13:08 - Rhinovirus
I got cold ://// Damn rhinovirus.
Well..it's the most common illness in the world and I haven't got it for a year now so
nothing special: I'll be outta home in a couple of days. I'll take it constructively
and try to study & work anyway.
I've just discovered that I've been using the terms
and cold interchangeably.
In fact these are two distinct ilnesses with common symptoms, both caused by viral infection.
Influenza is caused
by the very specific family of
RNA viruses while the common cold
is caused by several families of other viruses affecting the respiratory system
(mainly rhinoviruses, coronaviruses, and also certain echoviruses, paramyxoviruses, and coxsackieviruses).
In humans, influenza's effects are much more severe than those of the common cold, and last longer.
Common cold is deadly in one case over 50.000 while influenza has been a pandemic killer in the past
and can be still deadly for the weak, old or chronically ill. Mine
is almost surely common cold
because I have no fever.
I had to void the appointment at Sistemi ITC. Shifted to friday.
Romina obviously thought that the illness was an excuse :D It couldn't be: I wouldn't miss
a meeting with such a nice girl unless there was a real reason :P ... especially in such a sunny day.
Back to work (sugar reef).
25.02.2007 - Sunday - 22:21 - Diary
There are ongoing massive changes in the
TVS service is moving offices from the peaceful EBS establishment
to the primary Bassilichi dept.
People aren't happy about it. Well, the bright side is that innovation might bring positive results.
Upgraded gentoo on
etherea. It took me several days and caused
some headcaches. I had to fight with random
caused by a faulty DRAM
bank and completly messed dependancies.
At a certain point something something got totally
I've ended up with a system unable to compile and run 32 bit apps.
Bleah :D Well... I've fixed it and I'll be probably switching
to gcc 4.1.1 too,
in the next days.
Linux etherea 2.6.19-gentoo-r5 #3 Sat Feb 24 17:02:52 CET 2007
x86_64 AMD Athlon(tm) 64 Processor 3500+ AuthenticAMD GNU/Linux
Almost finished porting kvirc to
Qt 4: only few modules are missing now.
Got it to a point where others can take care of separate modules: Noldor is
taking care of the objects.
Bought a new shiny Sapphire Radeon X1950 Pro. Too bad it doesn't boot with my Abit MoBo :(
In fact it gets through BIOS,
it does POST but it
locks up nearly in the end, probably when attempting real boot by invoking INT 19h.
It *might* be a problem related to the power supply not being able to source enough current.
Tomorrow I'll buy a 500W or greater unit and will try. If it doesn't
work then I'll try to upgrade the BIOS.
Studied a massive number of metal songs recently. It's very fun to play them.
The most recent entries are "Tornado Of Souls"
by Megadeth and
"Antisocial" by Anthrax.
Actually I'm taking on "Anna Molly" by Incubus
and "Can I Play With Madness" by Iron Maiden.
Spam is reaching absurd levels.
Spamassassin behaves quite well but
since once in a while it blows out a false positive I'm substantially forced
to dig in the trashcan looking for reasonable subjects or known senders. Hate it.
This blog gets spammed too: it looks like I can't filter them out all.
I need to add some anti-spam measure like the "type the digits you see" image...
Released GEOS 2.0.0. It works like a charm :)
Started the fourth eTraveler milestone: will mainly take care of path updates and implement a new XML data format.
Will also try to doom some of the remaining TomTom Navigator problems...
Eva is moving to London...
or somewhere nearby. She will be working for RedHat:
a great chance! Good Luck Eve!!! :*
There are rumours about CNR.
14.02.2007 - Wendesday - 23:30 - PragMathic Valentines
This 3d surface is supposed to be a Valentines heart.
In fact it's a 30400 polygon phong shaded
RGB=255,0,0 numeric approximation of
illuminated by a spot light placed at (-1.0,-1.0,0.8).
I had a couple of hard hours while trying to plot (and later render)
the implicit equation with matlab but in the end it looks rather nice, eh ?
02.01.2007 - Tuesday - 02:55 - Primality Tests
Happy New Year to everyone :)
At a certain point, in the middle of the New Year party we ended up
talking about prime numbers. The simple question was if 2007 was prime or not.
A guy immediately comed out with the answer: no, it's divisible by 3.
He used a simple "rule of thumb": if the digits of a number sum up
to something that is divisible by 3 then the original number is also divisible by 3.
And in fact 2+0+0+7 yelds 9 that is obviously 3*3.
So 2007 is not a prime year. But how is it that the rule of thumb works ?
We were quite convinced that the rule is correct by carrying out
a ton of working examples but (probably because of alcohol :D) were unable
to prove it.
In fact a pedantic proof is not as trivial as one might expect for such a simple rule.
Anyway, a bit of thinking (with a sane mind) pulled it out. Here it is.
Given an integer x let y be the sum of its decimal digits. If y is divisible
by 3 then x is also divisible by 3 and vice-versa.
Since for x=0 the theorem is trivially true, let x be a non-zero integer and consider
it's positional rappresentation:
The digits di in the sum are obviously the positional digits of x
ordered by magnitude (power of ten). Let y be the sum of the digits of x.
Asserting that "if y is divisible by 3 then x is also divisible by 3 and vice-versa"
is equivalent to asserting that "if there exists an integer w that yelds x=3w then
there must exist an integer v that yelds y=3v and vice-versa".
A yet more convenient way to formally state the theorem thesis is: given
prove that "if w lies in Z then also v lies in Z and vice-versa".
To prove this let's concentrate on the positional rappresentation of our number.
We can trivially rewrite it as
which can be decomposed in
which clearly shows that the second component is the sum of the digits defined above
and allows us to write
and then rewrite it further as
Now if we assume that w is an integer then v is an integer (lies in Z)
if and only if
The same condition remains if we first assume v to be an integer
and ask for w being an integer: it still
leads us to prove that
Now if you're cool, you should have already be "seeing" the end of this
proof since the formula above can be "trusted" to be true if you realize
that 10^i - 1 leads always to a number with digits formed by a sequence
of all 9.... but let's be pedantic and prove this formally.
To do this we need to take a quick look at a nice property of the foolowing
We can multiply both sides by (a-1) to obtain
Expliciting the multiplication
and removing the cancelling terms we get
which is quite interesting since by plugging in a=10 it allows us to write that
and for i=k+1 -> k=i-1 it allows to rewrite our clue formula as
and then by trivial algebric manipulation
Remember that in the formulas above we have assumed x != 0 (since, as stated at the beginning,
for x=0 the theorem is trivially true). This in turn requires i > 0 and
thus i-1 is at least 0.
Finally since , since 10^j is
an integer and a sum of integers is still an integer it's obvious that
which proves our theorem.
Cool eh? What a strange world... :)
It is interesting to state that this thingie can be applied recursively.
If y is too big to be trivially known to be divisible by 3 then
the sum of its digits can be taken and the theorem can be applied again.
Another note is that the theorem will work for bases B that can be written
in the form B=3N+1 where N is an integer. It will work for base 4, 7, 10,
13, 16... but not for base 2 (for example). This can be proven by substituting
(3N+1) in the whole theorem in place of 10 and noticing that it will lead
us to prove that
The geometric serie property is still valid and yelds
which is rewritten as
This allows us to rewrite our question as
which, since di and N are integers, yelds the obvious conclusion that
One can push this thingie even further and assert that to verify
the divisibility by a number D one has to write the number x in a base B
that can be written as B=(DN+1), where N is an integer greater than zero,
sum up the digits of B and verify if the obtained number is divisible by D.
This can be proven by reusing the
last version of the theorem and plugging D instead of 3. The question
will now be
And it will lead us to state that
Which is indeed true since D, N and di are integers.
Interesting. So if you want to know if 3147975 is divisible
by 255 all you could write 3147975 in a base of the form 255N+1,
for example 256 (huh.. we're talking of BYTES!), sum up the digits
and check if it's divisible by 255, recursively.
3147975 is (48)(8)(199) in base 256 which magically sums up to 255.... doh!
I could have written this thingie in base 255*2+1=511, which would yeld
a rappresentation of (12)(28)(215) which again sums up to 255.
The bad news, eventually, is that this theorem can't be easily used
as a general primality test since it involves base changes. A generic change
from base A to base B requires consecutive divisions of the original
number... so one can actually directly divide the number by the divisor
and check if there is a remainder...
This can be used as primality test for some divisors,
in particular the ones that lead to the bases B to which switching
is easy. Switching from base 10 to base 100 is straightfoward and
does not require any division to be performed. Same goes for base 2 and base 16,
Now I have to work. Further investigations later.
Have a nice day!
17.12.2006 - Sunday - 17:01 - Diary
Millo made this cool photo of me for the EGO's album
cover artworks. We have also one of Francesca and
the other band members are on the way. Giacomo is the next...
his "composition" will be really interesting :)
In the process of switching the kvirc
source control system from cvs to svn. Jan has set up a nice
https based svn server and a Trac web interface installation.
Again overloaded with work. Well, nothing new at this point
I'm getting used to it... but I've been gasping for air (and sleep)
this last week. Too good that some festivities are coming.
Studying Numeric Calculus. Kinda slow, but it's taking off.
It comes out that I'm playing guitar in three bands now :D
EGO, Ace Of Space and the still unnamed band with Samuel, Roberto
and Francesca. It's a lot of fun but in the future it might become difficult...
Cleettina: ho aggiornato :P
26.11.2006 - Sunday - 20:26 - IA
So I've been acting somewhat weird recently
I guess it's life that's catching up on me
Tired of pretending
Run out of facade
You can only keep things
Stashed away for so long
I've had all the shit I can take
All the shit I can take
To push me now is a grand mistake
I've had all the shit I can take
Chest pain waltz!
Here comes another stunning panic attack
Increase the dose, there is no turning back
My legs feel kind of dead
Shock treatment maniac
You can only keep things
Stashed away for so long
I've had all the shit I can take
All the shit I can take
To push me now is a grand mistake
I've had all the shit I can take
Chest pain waltz!
Mattias IA Eklundh is
another Hero at the level of Mustaine. Nothing more to say.
It seems that he has no daugher with a cool name (to source inspiration from) at this time.
...and I can't find anything about a wife neither.
Haha!.. take a look at the site LoL :D
Hum.. now that I think about it, all of my heroes are male.
Bad sign ? ...or there is a heroine shortage around the world ? :D
22.11.2006 - Wendesday - 03:14 - Diary
It's kinda raining :)
Time to stay at home, work, study, play guitar, improve KVIrc a bit (maybe make a release).
As usual in this period I'm overloaded with work so don't be surprised if this blog
doesn't get updated often.
I have put online the slides and the test program for the (In)Security Foundations presentation.
The slides are mostly in italian (but the interesting part is in english) and
you need OpenOffice 2.0 to view them.
I've studied the examples on an amd64: if you can recompute the stack layout and the jump
addresses for an ix86 you're a r0x0r! If you can recompute them for an
(like the Intel's XScale) then
you're a guru :)
Have fun :)
21.11.2006 - Tuesday - 01:30 - Targeting N.Y.
click on the photo and take a look at the large version: it's amazing, even if it is a 1.8 MB download.
We're planning a trip to New York
in late April 2007. Probably from 21 to 30. We want to end up in a nice hotel in the center of
so this is right time to start looking for lodging and plane reservations.
At the moment we're three persons on the outgoing route.
We will enjoy ten days of the "city that never sleeps". An interesting
experience for Europeans, I guess. Wanna come with us ? Take a look at the photo above
and then give me a phone call or drop me a mail :)
04.11.2006 - Saturday - 04:09 - One of my Heroes
This morning I made the call
The one that ends it all
Hanging up, I wanted to cry
But dammit, this well's gone dry
Not for the money, not for the fame
Not for the power, just no more games
But now I'm safe
in the eye of the tornado
I can't replace the lies,
that let a 1000 days go
No more living trapped inside
In her way I'll surely die
In the eye of the tornado,
blow me away
You'll grow to loathe my name
You'll hate me just the same
You won't need your breath
And soon you'll meet your death
Not from the years, not from the use
Not from the tears, just self abuse
Who's to say, what's for me to say
Who's to say, what's for me to be
Who's to say, what's for me to do
Cause a big nothing it'll be for me
The land of opportunity
The golden chance for me
My future looks so bright
Now I think I've seen the light
Can't say what's on my mind
Can't do what I really feel
In this bed I made for me
Is where I sleep, I really feel
I warn you of the fate
Proven true to late
Your tongue twist perverse
Come drink now of this curse
And now I fill your brain
I spin you round again
My poison fills your head
As I tuck you into bed
You feel my fingertips
You won't forget my lips
You'll feel my cold breath
It's the kiss of death
Dave Mustaine is one of my heroes.
If I'll ever have a daughter I'll strongly promote her name to be Elektra.
Rust In Peace is
one of my best 10 albums ever. Fantastic riffs, incredible solos, interesting lyrics, parts that you just can't play
that way... Please note that Dave sings while playing that stuff.
Just try to play and sing (possibly at the same time) the first 2 minutes of Holy Wars...