Cracking the Cryptext with PHP

In the book the DaVinci code there’s a fun little device called a “Cryptex”. It a container for a secret message, and to open it, you need to align some dials to the correct position. In an quiz somewhere you were invited to crack such a cryptext consisting of 6 dials with 6 letters on each to find the correct combination, which would spell a word. To find the solution quickly, all you need is PHP.

Everything is cooler on a Mac

… even crashes. While it shouldn’t matter too much, the eye candy (cool graphics, sweet effects and other eye pleasing stuff) on a Mac even makes me smile from time to time – and you just have a little more forgiveness to a program, which crashes with grace. Take Adium - my favourite Instant Messaging client. Being a multi language expert (and thus speaking both MSN, Jabber, GTalk, ICQ and other protocols) it does have a hard time, and some times – weeks if not months apart – a may go down in flames.

Do you use PHP Constants?

Browsing in other people code can be an interesting experience. Sometimes you learn stuff, other times you just get scared of the things you see. One recent observation I seem to make a lot, is that handling “application configuration” is often handled less gracefully as a would have wished. The plain basic configuration handling in many PHP applications seems to be creating a php-file and declare all configuration values in this file – then have all other scripts in the application include this one config file – and sure it works.

10 år

(Legacy post in Danish) Hold da op…. Nu er det faktisk 10 år siden jeg startede med at arbejde med Internet hos den virksomhed, der lige for tiden hedder TDC. Selvom jeg som sådan ikke har skiftet arbejde, så har der dog gennem årene været flere omvæltninger og skift, end de fleste sikkert har prøvet – selvom de har skiftet arbejde og virksomhed flere gange. I ”de gamle dage” sad vi sammen med DKnet ude på Symbion – her var det en lille afdeling, der lavede internet-løsninger for eksterne kunder. Nu er vi en stor afdeling, der kun laver interne løsninger i en af TDC’s egne bygninger.

Getting started on GTD

I’ve been reading a lo ton the GTD philosophy the past six months, and while I haven’t fully adopted the preaching’s, some things are working better for me, than in the past in terms of time and project management. This is how I try to work towards less stressful days and more actual work.

Inbox management

I used to have well over 1.000 mails in the inbox. Through focused and efficient cleaning, it’s now down to around a hundred on an average day. Short mails are read and killed. Important issues are managed. FYIs and reference materials are either killed or filed in archive folders upon arrival.

Do I need a primary key and should it be called id?

While working with databases – especially Mysql – most people seem to ask the same question over and over again when it comes to Primary Keys. Here’s my typical answer to the question(s) above (and more).

Do I need a primary key?

No, you don’t need it, but if you haven’t got one, there’s probably something wrong with your data model. A primary key is the unique key to a row in a table. It can be a single column, but in some cases it can be a combination of two or more columns.

Managing email

It seems most people are capable of launching an email application and do understand most of the technical skills required to use the application. It does however also seem that a fairly large part of the same people lack the social intelligence and skills required to make efficient use of their email capabilities. Scanning through my inbox I saw a fair and typical number of examples in the ”bad email usage” category. These include:

MVC for PHP

With the amazing buzz around RubyonRails, everyone seems to be hooked on the Model-View-Controller (or just MVC) paradigm – and do strive to mindlessly implement the ”Ruby way” into other programming languages without too much reflection and thoughts on how to do it. . Even tough most of the efforts I’ve seen so far seem pretty hopeless; I do believe you could actually do something good with MVC and PHP. Let me try to tell you how. My ”systems thinking” is usually in the ”large professional genre” and it’s an absolute requirement that the PHP code developed is Efficient, Secure and Maintainable. To get a decent shoot at these, we really can’t reuse ideas and ideologies from Java or Ruby into PHP – we must adapt them to the strengths, weaknesses and ”php ways” to get a good result.

QuickSilver

I finally get it. QuickSilver that is. Its an application for the Mac OSX and is the best friend any OSX Power User can have. I’ve downloaded it a couple of times, tried to figure what it was and uninstalled it – but not any more. It’s just great and ought to be build into the OSX. QuickSilver is sort of a power tools basically has made my muse workless today. It’s a power-edition of the Dock and it probably has a ton of undiscovered features I haven’t figured out yet.