Ganymede / PHPEclipse – not a good choice for debugging CakePHP

November 14th, 2008

After hours of trying I finally conclude that CakePHP cannot be debugged in Eclipse 3.4.1 (Ganymede) and PHPEclipse 1.2.1.200810130444PRD (XDebug).

My webroot is set to app/webroot and Eclipse stops on a breakpoint only if it’s in app/webroot/index.php
Even after it stops there it won’t stop on a next breakpoint that is set in my controller.

The only working solution I found is downgrading to Eclipse 3.3.2 (Europa) and PDT 1.0.3.v20080603. Fortunately both can run side by side so in theory, I can write new code in Ganymede and debug in Europa but that sucks. Programming is a constant debugging.

I could try to switch from XDebug to DBG. Maybe I will next time I have a day that I can waste.

Update:

New PDT 2.0.0.v20081030-1802 works with Ganymede/XDebug just fine. It also has features I have been missing like Mark Occurrences – one more reason for switching. It doesn’t have support for chm help files though (PHPEclipse does) and is generally slower than PHPEclipse.

Calculating time difference in months as a decimal number

October 8th, 2008

There’s a number of functions out there for calculating the length of time in months but they only provide integer results. MySQL can do it too, for instance. But what if you need to get a precise number?

2008-11-15 minus 2008-10-01 can’t be one if you’re calculating rent. It must be 1.466…

Read the rest of this entry »

Absolute positioning in HTML e-mails for Outlook 2007

October 2nd, 2008

I couldn’t possibly explain my frustration from Microsoft switching Outlook’s rendering engine to Word so I better not even try. Instead, I’m going to tell you how to make Outlook/Word position elements absolutely.

The idea originally came from doublethink (written in Czech) who made a text field in Word, saved it as HTML and then dug through the mess to extract the essence. I just went a step further and did the same for images as well.
Read the rest of this entry »

processing IMAP folder on a regular basis

April 13th, 2008

When you need to check a mailbox on a regular basis and process messages that has arrived since your last check you may find that some messages were somehow skipped.

Read the rest of this entry »

How to deal with IMMUTABLE error in indexes that work with timestamps

March 19th, 2008

Say that in an older version of PostgreSQL you had an index like this:

  1. CREATE INDEX logTypeDay ON myLog (eventType, date_trunc(‘day’, creationTime));

and now after upgrading to 8.1+ you’re getting:
ERROR: functions in index expression must be marked IMMUTABLE

Read the rest of this entry »