Archive for the 'Programming' Category

Finding missing consecutive dates in an PHP array

Wednesday, November 12th, 2008

I have dates stored as ‘2008-01-01′ in the period field of a table. It’s the format Y-m=d. I needed a way to query the database and determine if the returned periods were broken consecutively or not. This is what I came up with to solve the problem. The query already returns [...]

Creating a diff patch for php

Thursday, February 14th, 2008

Generating the patch:

diff -urp revised_code.php orig_code.php > patch.diff

UPDATE: with svn it’s just:
svn diff > diff.patch
Applying the patch:

patch -p0 < patch.diff

Reference: Using diff to generate patches.

Technorati Tags: php diff patch

Full Screen Apps Mac OS X

Sunday, February 10th, 2008

I’m not a mac user, but when I have to work on one I find in really frustrating that I can’t make my apps full screen.   Recently When I started working at Classic Graphics I was provided a Mac Book Pro to work on and quickly started longing for full screen apps.  I had solved [...]

PHP, VIM, Ubuntu, XDEBUG

Wednesday, February 6th, 2008

Here’s a round up of links that detail setting up Xdebug on Ubuntu.
There are several that just detail using Xdebug to trace PHP applications.
Xdeug Official Docs
Xdebug and VIM
XDebug and Eclipse on Windows
Debugging Drupal with XDebug
Tracing PHP with Xdebug
Debug PHP with VIM
Debug Drupal with VIM
Debug Symfony with VIM
Debuggin PHP on Ubuntu
Technorati Tags: php, vim, xdebug

Mono and GTK#

Sunday, September 4th, 2005

Praise the lord! Cross-platform GUI enabled development has arrived. My quest to operate only GNU/Linux has just reached a new stepping stone. Now I’ll be able to do things I used to do in Windows with VB in Linux. And with the help of “MONO A Developer’s Notebook” it’ll be much easier to learn this [...]