PHP mCrypt blowfish interop with Java, .NET

by justin carlson on 07/20/2010
PHPWhile writing a PHP ePayment client for USBank's service, I noticed strings that were blowfish encrypted with PHP's mCrypt in ecb mode were not matching the encrypted values from Java and .NET. This was frustrating as the Java client was not using any specific settings for block size or pad type, and, sorry guys, Java documentation seems lacking.  Luckily the solution was very simple.

PHP 5.3 mCrypt dll for Windows

by justin carlson on 07/14/2010
There isn't one. Just a reminder, mcrypt is built in for PHP 5.3.x on windows, you don't need to do anything with a dll anymore.

Appcelerator, Titanium Mobile and Android

by justin carlson on 07/09/2010

I finally have a working development environment to test out Appcelerator's products. I'll step you through some of the gotchas I come across and do a bit of a review of the whole process as I work with Titanium Mobile.

Apple 4.0, New Terms, Worried Developers

by justin carlson on 04/08/2010
Check out this little gem in the Apple iPhone SDK 4.0 terms:

3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

Does this mean Titanium Mobile, Unity3D, Ansca, MonoTouch, and possibly PhoneGap are headed to the deadpool?

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

by justin carlson on 12/21/2009
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 12/11/2009
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 12/11/2009
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.

PHP DOMNode::removeChild, Whitespace

by justin carlson on 11/05/2009
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 10/28/2009
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 09/02/2009
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 08/19/2009
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 07/08/2009
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 06/23/2009
My reasons for disgust at the lack of <canvas> in IE.
This is a response to: https://twitter.com/adrianba/status/2293950528

dead simple jQuery progress bar plugin

by justin carlson on 05/13/2009
This snippet makes it easy to drop in basic horizontal bars, or progress reports.

     $('#sample').progressreport(100,50,'%1 (%3%) of goal reached.');

$(this) combo box selected options

by justin carlson on 05/13/2009
Simple jQuery snippet to get the selected options from a select box using $(this):
$(this).children(':selected').each(function() {
 // handle $(this) selected option
});

New Site Launched: TweetsWin.com

by justin carlson on 05/04/2009
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 04/29/2009
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.

Apple Support, and PlayMesh Games

by justin carlson on 04/08/2009
When I started playing games on my iPhone, I found a little cluster of them from a company called PlayMesh.  If you've ever seen or played the Mafia games on Facebook, you know the type of games they offer. Start a player, build stats, and attack other players. Run missions, collect money. PlayMesh offers a variety of themes around that same model. Mafia, Robots, Racing, a format for everyone.

Spell Checking in Eclipse, Zend Eclipse

by justin carlson on 03/31/2009
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 03/10/2009
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();