{ Don't Repeat Yourself ! }

Browsing Posts published in October, 2009

After fixing the problem with php 5.3 and the openid library I ran into the next problem.

Trying to to use the provided example that comes with the openid php library,
with google openid url -

And getting:

Fatal error: current_url must be a string; see NEWS file for upgrading notes. in /var/www/clients/php-openid-1.2.3/Auth/OpenID/Consumer.php

Wow – must be my lucky day today. Getting really really tired of the openid stuff. Especially cause I can’t find any decent documentation.

I figured out that I needed to add the url of the finish_auth.php to the complete function call in the finish_auth.php script itself.

//get full url of current script
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER[PHP_SELF];
//pass url into complete handler
$response = $consumer->complete($thispage);  //modified function call in finish_auth.php

And I had to get rid of the $_GET parameter that was passed into the complete function in the example.
This seems to solve the problem. Getting a nice response:
You have successfully verified…as your identity.
Except for a few warnings and notices of course :-)

I used this url as my google identity url:

taken from this tutorial:

but had to replace


download modified finish_auth.php

If a PHP script has an error but the displayed page stays blank and does not show anything,
add these two lines to the top of your script to display all PHP errors for the current script.

ini_set("display_errors", 1);

I recently downloaded the latest Openid library for PHP and got the follwoing deprecated errors when trying to run the example in my webbrowser:

Deprecated: Assigning the return value of new by reference is deprecated in /php-openid-1.2.3/Auth/OpenID/Consumer.php on line 266

Deprecated: Assigning the return value of new by reference is deprecated in /php-openid-1.2.3/Auth/OpenID/Consumer.php on line 298

It seems to be only an issue with PHP 5.3 and I found a great fix at Miguel Santirso Blog.
He has gone through quite some trouble to fix all the compatibility issues with PHP 5.3 and and was so kind to provide his fixed version for download.

Flashplayer is using a separate cache to store remote shared libraries ( RSL ) .
It wont be cleared by just emptying the browser cache.

To clear the flashplayer cache go to:

Uncheck the checkbox: “Store common Flash components to reduce download times”

This will delete the Flashplayer Cache.

After that check it again and done

FlexUnit Setup

No comments

Required steps to integrate FlexUnit into a Flex project
Just some reminder notes to set up Flex unit testing. These are valid for FlexUnit 0.9

1. copy the FlexUnit.swc to the projects libs folder

2. Create unit tests
Each Unit test is a simple Actionscript class that extends TestCase

public class MyTest extends TestCase

It contains a number of functions where the function name must start with a test
e.g. testFunc

Each function contains a number of assertions methods.
There are several assertion methods available for our unit tests such as:
assertTrue, assertFalse, assertNull, assertEquals, and several others.

3. Create a new MXML Application

add this mxml tag to the application

<flexunit:TestRunnerBase id=”testRunner” width=”100%” height=”100%” />

add these lines to a creationComplete handler function:

testRunner.test = createSuite();

add these lines to the createSuite function

var testSuite:TestSuite = new TestSuite();
testSuite.addTestSuite( MyTest );
return testSuite;

all done run the test application and watch it fail

I recently purchased a Mac Book Pro – primarily for software development. As a long time Linux and Windows user I though it would be time to try something new and join the hype.

To work with Mac OS efficiently I needed to install quite a bit free extra software.
Here is a list of what I found useful for my purposes.

Awesome and free:

  • Firefox – I like it much better then safari
  • Perian – adds support for many popular video formats such as divX
  • Open Office – used this under Linux and Window as well
  • Google Notifier – check for new Google Mail and Google Calendar entries
  • Google quick search box – search for anything from your taskbar
  • iChat with Google Talk – use iChat to chat with your google buddies
  • Virtual Box – free virtual machine to run Windows or any other OS
  • Skype – I use skype since many years to stay in touch and do my calls
  • Seashore – easy to install free image editor based on gimp

Free development tools:

  • Xampp – save yourself the hassle of setting up Apache, Mysql, PHP, etc
  • Eclipse – my favorite development platform
  • jEdit – a free editor for programmers, written in java
  • Cyberduck – handy opersource ftp, sftp, webdav browser for Mac OS X
  • Wget – Mac OS X only comes with curl. But curl does not provide the same functionality as wget
  • NVU – NVU is a handy and free HTML and CSS Editor
  • Free Ruler – measure things on your screen with this useful little tool

Commercial Tools:

  • Path Finder – replacement for mac finder with great features like tabs and split pane

A cool website listing all opensource mac applications

I have recently found an awesome thread on software comments.

It made me laugh out loud a few times, even though I was in a very bad mood that day.

Some of these comments are just hilarious. Sooo funny.

Check it out

Get Adobe Flash player