I want an elePHPant!

Written on November 17, 2009 by Matthew

Filed Under: IT

elePHPantRecently at PHP TestFest 2009 the winners were given their prizes, a small stuffed PHP elephant. After much searching I found these little mammals were the product of Damien Seguy and based upon a graphic by Vincent Pontier.

At the time I wrote this article, you cannot purchase or adopt an elePHPant. A recent email from Damien himself pointed me to www.elephpant.com, which has the latest news about elePHPants. It states that in early December ’09 we (the public, PHP user groups get priority) should be able to purchase them for $15 CAD from nexen.net.

I am definitely getting one. PHP is 90% of my day job, who wouldn’t want this little blue motivational guy sitting on their desk to help through great programming perils.

Tags:

Comments Off

I just received my Windows 7 Launch Party Kit

Written on October 8, 2009 by Matthew

Filed Under: IT

Well, I just received my Windows 7 Launch Party kit.

To be honest, I’m pretty impressed with it. As promised, it contained an official Copy of Windows 7 Ultimate. Also included in the box was:

  • A jigsaw puzzle of a Windows 7 background image
  • A set of Windows 7 playing cards (they are a little slippery, but still decent)
  • Windows 7 logo’d napkins
  • A 3d stand up card with Windows 7 adverts
  • A big poster of Windows 7 backgrounds
  • 10 Windows 7 reusable shopping bags

All in all, this was a great treat from M$. Thanks Bill!

Tags:

Comments Off

A, An, The and the sorting problems with Paginator

Written on September 2, 2009 by Matthew

Filed Under: CakePHP

CakePHPThe PaginatorHelper makes life easy! That is it’s job. Simple pagination from any controller, easy. The Paginator even does sorting of any field in your table, no problems, built in and easy to use.

Until … we get some data that does not sort correctly. Well, it sorts alphabetically, ascending and descending, but’s that’s not always right for us.

I have some document titles in my controller, many of which start with A, An , or The. When I sort on title, ‘The Weather’s Great’ displays before ‘Saturday Forever’. But it shouldn’t.

How do I tell MySQL to ignore the ‘The’ ? Easy actually. Here is a code snippet that literally be dropped into your controller to solve this problem. Keep in mind that my controller is called ‘documents’ and my field is ‘title’.

$documents = $this->Document->findAll($conditions,null,’Document.title ASC, IF(LEFT(title,2)=”A “,SUBSTRING(title FROM 3),IF(LEFT(title,3)=”An “,SUBSTRING(title FROM 4),IF(LEFT(title,4)=”The “,SUBSTRING(title FROM 5),title)))’,999,1,1);

Tags:

Comments Off

Blackberry and Postmaster

Written on August 24, 2009 by Matthew

Filed Under: IT

blackberry_8800So it seems Blackberry and Postmaster are not friends. Postmaster does not properly decode the base64 data from a blackberry email.

After many hacks and tweaks I found that Postmaster did not need to be altered. By default the BIS (Blackberry Internet Service) gives you a nice signature all on it’s own. “This email was sent wirelessly via my blackberry blah blah”, and this sig is actually base64 encoded separately from the rest of the message.

Once I removed the offending signature, Blackberry and Postmaster shared a Coke and started talking.

*To remove the signature, visit http://service_provider.blackberry.com and it’s under email options. Please replace service_provider with yours, (bell, telus, etc).

Tags: ,

Comments Off

Up & Running

Written on August 24, 2009 by Matthew

Filed Under: General

More and more I’m finding the need to join the blogosphere. Many potential clients have asked for a WordPress admin or template designer.

I decided to drop my old site this morning. It was mainly a photo gallery for years, but FaceBook has killed that. Now it will be my test blog.

Look out WordPress, Matthew’s coming to decipher your secrets and acquire your goodies!

Tags:

Comments Off