Download Census.gov Tiger/Line shape files (2009 Edition)

by justin carlson on 21/12/09
PHPUse the php script or wget example to pull down census.gov Tiger/Line shape files. It would be easier to just use wget, but I'm using windows.

PHP COM() Access to Microsoft Word

by justin carlson on 11/12/09
PHPIn this article you will find very basic sample code for accessing Microsoft Word using PHP and COM(). This sample includes a table and some alignment settings.

PHP COM() access to Outlook Calendar

by justin carlson on 11/12/09
PHPIn this article you will find sample code for accessing Microsoft Outlook Calendar events using PHP and COM(). This sample includes recurring events and was tested on Windows XP with Outlook 2003.

Google Acquires VoIP firm Gizmo5

by justin carlson on 16/11/09
Google has acquired Gizmo5.  This is a big deal as it will allow them to expand their already existing voice and calling services (Google Talk, Google Voice) and compete directly with Skype, Vonage, etc.  But that's just the small picture in my opinion.

PHP DOMNode::removeChild, Whitespace

by justin carlson on 05/11/09
PHPJust a quick note to remind myself later. DOMNode::removeChild leaves whitespace unless you tell it not via:
$document->preserveWhiteSpace = false;

Geeklog Migration Assistant

by justin carlson on 28/10/09
Coffee Break Code - Quick Examples I've been migrating some Geeklog sites around lately and I was getting frustrated while changing config values between domains, databases, etc. I had been using Tony Bibb's migration script but it doesn't include some of the settings I wanted to change, and I'm a sucker for eye candy.  I created a new tool and have been using it. I think it's pretty stable but if you use it PLEASE make a backup first.

PHP 5.3 and Microsoft SQL Server

by justin carlson on 02/09/09
Microsoft recently released an updated SQL server driver that works with PHP 5.3.x.  I needed to make some changes to a very old app that uses MSSQL and PEAR::DB so I decided to grab this and try it out.  Of course it didn't work out so well or I wouldn't be posting this.

Bug in PEAR_PackageFileManager Plugins for Windows Users

by justin carlson on 19/08/09
There's a bug in PEAR_PackageFileManager_Plugins for windows users. It won't recognize CVS directories, and the build fails. The bug has been accepted and verified, but no stable release is available yet.  

The error users receive states:
PEAR_PackageFileManager_Plugins Error: Directory "foo" is not a CVS directory (it must have the CVS/Entries file)

PHP 5.3 - Changes to array() definitions.

by justin carlson on 08/07/09
I've come accross this change ( bug? ) in PHP 5.3, while troubleshooting a Creole/Propel problem it caused.
Array items are not as defined when using the same key twice. PHP 5.3. Array order is Incorrect.
I have a feeling this will break code in other projects as well, so I've reported it here:
http://bugs.php.net/bug.php?id=48858&thanks=4

Why I want Canvas Support in IE

by justin carlson on 23/06/09
My reasons for disgust at the lack of <canvas> in IE.
This is a response to: https://twitter.com/adrianba/status/2293950528

New Site Launched: TweetsWin.com

by justin carlson on 04/05/09
I actually launched the beta late Saturday night and I'm just now getting around to posting something.  Did you know there are hundreds of contests on Twitter right now? A lot of users do not realize people are giving away prizes just for some follow love. Many contests go unnoticed and end without a single entry. Meanwhile some popular users have thousands of followers and are faced with a somewhat daunting task when it's time to pick a winner for their contests. This site allows you to view and host contests on Twitter. The site is free to use, and does not require you to logon.

If you want to host a contest on Twitter® http://www.tweetswin.com/ makes it easy to do so. You can use this site to post a contest, gather statistics, and automatically choose a winner! Don't worry though, you're still in control and can manage the winner pool and cancel contests if necessary. Know what else? The site tracks your new followers and provides daily analysis. It will also show you who quit following you after your contest ended for up to 7 days.

Need help running a contest? Not on Twitter but want to market to it's users? I can help you with that as well

Sending Mail From Slicehost with PHP

by justin carlson on 29/04/09
If you are trying to get mail going on a Slicehost or similar self managed hosting solution ( I'm using Ubuntu ), this quickie guide may help.

Spell Checking in Eclipse, Zend Eclipse

by justin carlson on 31/03/09
You may be aware of Eclipse's built in spell checker.  It does not offer suggestions or replacement, but it will mark your mistakes. I was using a standard dictionary but of course it hit on a lot of php functions. I've created a decent dictionary that includes every PHP function and a ton of common words from various sources.  I'm sharing it here so others won't have to do the same. This post contains the dictionary downloads and instructions for enabling the spell checker in Zend Eclipse.

How Do I? Get the file location an object class was defined in PHP.

by justin carlson on 10/03/09
PHPFirst time I've needed ReflectionClass. Just making a note for future reference.  This will give you the pull path and filename to the file that defined the class for any given object. Requires PHP5 (OO).
// abstract class foo extends bar {}
$object = new foo();
$class = new ReflectionClass(get_class($object));
echo $class->getFilename();

New Site Launch | Tweetstacker.com

by justin carlson on 27/02/09
I just launched tweetstacker.com, it's a very simple threaded Twitter client. It should be considered a funcitonal prototype or beta. I was tired of visiting Twitter.com to see what's new and finding 1 or 2 pages full of one person's ramblings.  Obviously I want to hear from these individuals some of the time, but the signal to noise ratio eventually gets too high and I inevitably end up un-following them. It's also annoying not being able to see the message that people are replying to. When I first visit Tweetstacker.com it shows me the 20 most recent (unique) threads to update instead of the 20 most recent messages. It also shows me each person's stream if I expand their tweet, and it shows me the message they replied to. 

That's right, a threaded twitter client  that also has a very thin UI. Most of the work is done in a simple api that feeds the static html client.

I normally just leave the page up on my side monitor, it automatically adds new tweets to the top and caches and sorts everything. By the end of the day I can see a list that represents everyone I follow, everyone they replied to, and everything they said earlier ni the day. It's all threaded so its very easy to follow conversations.

SSL Peer Verification with cURL

by justin carlson on 25/01/09
PHPThere are too many posts on the web advising people to turn off cURL peer verification to disable the "Error performing HTTP request: error setting certificate verify locations" or "Error performing HTTP request: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed" messages. Please stop turning SSL_VERIFYPEER off.

PHP, ImageMagick, and MagickWand on Ubuntu

by justin carlson on 10/12/08
I can't believe my (mostly undocumented) windows install actually took less time to setup than MagickWand on Ubuntu.   This quick article will explain what you need to make it work.

Windows users should use this guide.

PHP, ImageMagick, and MagickWand on Windows

by justin carlson on 10/12/08
Do you want to setup ImageMagick and/or MagickWand on Windows? Here's what I did to get it working.

Passing Variables to Ajax Response Handler

by justin carlson on 28/11/08
If you want to have one Ajax request handler for all your site's requests, or if you're just looking to pass a variable to the response handler, this snippet shows you how ridiculously easy it is. This snipped uses jQuery, but you can apply the same principle to any Ajax call.

Windows "lag" when off domain network.

by justin carlson on 28/11/08
I have been struggling with what I can only describe as "click lag" whenever I try to work from home with my laptop.  At work it's part of a domain, and a few drives are mapped automatically when I logon.  When I connect at home, it doesn't have access to the domain any more, and it becomes, well, very unstable at best.