gmshadow 0.2 published

I’ve just published the 0.2.1 version of my little utility gmshadow, which I use to backup mail from gmail.

The 0.2 version is now a “beta” release and features both backup and restore capability. It’s been optimized for speed and seems – at least to me – to be blazingly fast in downloading email. And the mbox and zip formats have received an overhaul, too – unfortunately breaking backwards compatibility, but it’s for a greater good. :)

It’s available over at http://www.gefvert.org/blog/downloads/gmshadow.

The Story of Michelangelo and Queen Arabella the Great

A work in progress…

Listen, I now will tell you a story fair,
Of queen Arabella in a distant land
Her wisdom as wonderful as the golden hair
That playfully flowed over shoulders bare -
Like sunrays glittered every strand.
Her knowledge had no discernful bound;
Every problem graceful answer found
And loving eyes of coolest blue
Like radiant sapphire in their hue
Shone from her head with emerald crowned.
And a multitude of roses gently sprung
From softest soil onto her castle walls
Which made of whitest stone so nobly swung
In rosy arches over ancient halls;
And through those halls her silvery laughter
Rippled like streams in early spring
And gave joyous voice to every living thing
That dancingly followed her thereafter.
Throughout all the kingdom spread her fame
And from far beyond the people came
To see the glory behind Arabella’s name.

…to be continued

I Wish I Had a 9mm Gun

(written 2010-07-25)

I wish I had a 9mm gun!
With such a thing, I know I would have fun!
I could wave it ’round,
And make a deaf’ning sound,
And act somewhat like Attila the hun!

I wish I had a nuclear submarine
Gliding ’round, so perfectly unseen!
I’d launch a nuke or two,
Rogue nations to subdue
And laugh inside my evil aqua-machine!

…or maybe not.

It’s hard, an evil genius to be
When there’s so much beautiful to see.
- A flapping butterfly;
White clouds in big, blue sky -
And the love of Christ for such a nut as me.

En dikt, i respons till ett brev från Transportstyrelsen

(skriven 2010-09-24)

Se här, här är nu en speciell adress
Som kommer orsaka mycket stress!
En som i vårt system ej får plats!
Vem, säg vem, är denne Mats?
Utomlands han flyttat, sägs det här
Nej, oj, det blir bara till besvär!
Hör fellistor i vår central skrivs ut,
Och ingen här kan fatta nåt beslut,
För denne Mats, som flyttat västerut!
Nej, nu slår vi stopp – stämpla! – fram med
Blankett arton sjuttiofem, och ge besked!
Fyll i på både bredden och på tvären!
Kontrollera noggrannt alla formulären!
Nej, på pappersexercisen finnes inget slut,
För denne Mats, som flyttat västerut. 

Hej och hå.

On Faith and Science

I *love* science. My heart burns for it; that gradual peeling away of the layers of the universe, to peek behind and see how it works – following experiments with other experiments and, in doing so, revealing things so amazing, so wonderful and enormously thought-provoking. The discovery of the atom was followed by the discovery of nuclei and elementary particles; these were, in turn, unraveled into string/particle dualism and quantum physics, which led to the current efforts of using enormous supercolliders in trying to peek into string theory and the very fabric of the universe. And in combining astrophysics and quantum physics, using these two fields together, to peer out into the universe and examine galaxies, clusters, pulsars and nebulae, this has provided for me the most profound and near-religious experiences; it is with silent awe that I look into the darkness of space and ponder, like Abraham before God in the desert, the vast, vast billions of stars across the night sky.

On the other hand, I also know within me that ultimately, I really have the answers to it all. John 1 says “In the beginning was the Word, and the Word was with God, and the Word was God … Through him all things were made; without him nothing was made that has been made.” When Genesis says that God created heaven and earth, and man and woman and every plant and seed and animal in it, I believe it with all my heart. I believe God made the earth, created the universe out of the thin threads of the laws He set in place, and when He said “let there be light”, the universe exploded in light that would shine for a hundred trillion years.

But my head can not accept what my heart knows. If I try to turn faith into science and say, “God created everything” with absolute scientific assurance, then the next thought that rises in my mind is “prove it” – and I can’t. And yet, I cannot wrap my head around evolution and call that true, because my heart knows that it is not. I know God is true, so the conclusion that the world was created on its own, must be false.

Between my heart and my mind lies this gap, this great divide, which I don’t know how to overcome; one side of which says, “believe everything”, for man lives and dies by faith in God, and without faith no one can please God. And yet the other side says, “believe nothing”; this being my scientific side that absolutely cannot believe anything that has not been meticulously proven, again and again. These are not necessarily at odds which each other, but they do conflict, in purpose. The purpose of faith is to save a man’s soul and provide for his eternal well-being, upon which no science must dare to tread; similarly, the purpose of science is to unravel the mysteries of the universe without regard to any particular faith – it must never be swayed by beliefs, never led astray by man’s opinion or interpretation of the truth – it must relentlessly stay true to its original task, the gradual and meticulous uncovering of the reality of the universe, step by step, by inexhaustible patience and curiosity.

So when [some] evolutionists say that Christians are stupid for believing in the bible, I shake my heart at their arrogance and ignorance, and I fear that one day they will be proven terribly wrong. And yet, when [some] Christians declare that the big bang theory is just a lot of bogus, and they shake their head at me for believing that the earth is older than 6000 years, it pains me; because they do not know the love of science that resides within me and which tells me, quietly, that if the universe is not older than that, then we’ve made a lot of measurements wrong.

I hope that one day, science and faith will meet within me; that faith will declare through the heavens that God created everything that exists; and that science will tell me, in excruciating detail, how it happened. Obviously, we are not there yet; but if science is the searching for truth, then eventually, hopefully, it will lead us there. I wish that I could reply with absolutely certainty – the way other people do – to the question of how the world was created, but I can’t.

My mind and my heart do not yet agree within me. I hope one day they will.

Storing Person-specific Sensitive Data in Databases

How do you build a system that can ask people very sensitive questions, for instance about their work, etc; and ensure confidentiality of the answers on a database level, yet allow each person to answer only once (and if necessary edit his answers)?

This is my proposed method.

  • The system itself consists of a database, a set of PHP pages, and a configuration file.
  • The PHP files identify the user and give him a unique identifier ku, say, the person’s name, SSN, or similar identity. This is only stored in the current session. Necessary referential constraints can be added to ensure the validity of the identifier, so the user specifies a real name – e.g. through a lookup in a user table.
  • The system configuration file contains a system key, ks, which is a unique, random key, and which is kept secret.
  • The database has three tables.
    • Two tables make up the questions. One for each questionnaire, and one for each question connected to the questionnaire. Each questionnaire is given a unique, random key kq, and each question has an auto-incrementing ID.
    • The third table contains the answers, which every user has specified. The unique key to each answer is given by the question ID, and a cryptographically secure hash h -> H(ks + ku + kq).

By keeping ks a secret, it is cryptologically impossible to find out the user identity of any given answer in the answers table. And by varying kq for each questionnaire, it is also impossible to track users over several questionnaires. h will, however, be the same for each given questionnaire and user.

It is thereby possible for the system to post answers from a given user into the tables, and access previous answers; and it is also possible for a user to retrieve answers, filter them, and generate statistics, without ever having access to any identities for the given answers. Even if the system is compromised, it is impossible to learn the identities of any answers without using a brute-force (or table lookup) method.

Does this sound ok?

An Autumn Poem

Watching all the brightly-colored leaves
On bright & sunny autumn days
And how they’re falling off the trees
In their whirlwind kind of dancing ways
Makes me think of how this gentle
Browned-eyed woman swept into my life
And in ways most accidental
Through a strange and wonderous grace
You become my cherished wife.

You are beautiful, mysterious, and sweet
Your love of cheese has seen no bound -
Your grace has swept me off my feet
And in your arms, a home I’ve found.
So with these words, remember this
Said from a heart so full of bliss
In every possible way
I love you, today
You make my heart complete.

MySQL Function to Calculate Excel- (or Delphi)-style Dates

drop function if exists exceldate;

delimiter //

-- Function that returns an Excel-style or Delphi-style date value
-- from a MySQL date. A date value of 0 represents 1899-12-30.
create function exceldate(p_date date)
    returns int
    sql security invoker
begin
    return to_days(p_date) - 693959;
end //

delimiter ;

select '1899-12-31', exceldate('1899-12-31')     -- should be 1
union
select '2011-10-18', exceldate('2011-10-18');    -- should be 40834