July 31, 2006

Internet Explorer 7 Beta 3 in standalone mode - article link

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 2:46 pm

Yousif has posted a good article on having IE7 (beta 3) running beside IE6 at the same time. You can view the article here.

Manually set PHP Session Timeout

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 1:04 pm

Sometimes it is necessary to set the default timeout period for PHP. To find out what the default (file-based-sessions) session timeout value on the server is you can view it through a ini_get command:

// Get the current Session Timeout Value
$currentTimeoutInSecs = ini_get(’session.gc_maxlifetime’);

Change the Session Timeout Value

// Change the session timeout value to 30 minutes
ini_set(’session.gc_maxlifetime’, 30*60);

If you have changed the sessions to be placed inside a Database occasionally implementations will specify the expiry manually. You may need to check through the session management class and see if it is getting the session timeout value from the ini configuration or through a method parameter (with default). It may require a little hunting about.

There are more settings for you to manage your session with, have a look on the PHP site.

My AJAX Framework

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 12:13 pm

I have setup both a PHP and JavaScript framework for making fast AJAX calls. There are a number of implementations of AJAX frameworks out there, but I have found it better to create my own specific server and client implementation so I can implement AJAX patterns in my own versioned controlled project. This will allow me a greater flexibility and ability to extend from my own code.

The idea around the implementation was to be a purely service level framework. A lot of the other frameworks that are available provide quite a bit of dependency between the server and the javascript (often trying to help you generating your JavaScript - which is nice, but also limits you as you could simply change the gateway server implementation from one language to the other, and often influences your design of both the server and the client). Being a service level framework it does not provide the other extended JavaScript functionality that other frameworks offer, such as Drag and Drop helpers, Autocomplete boxes and the like. These can be implemented ontop of the service level framework as seperate libraries, with hopefully close to no reliance on the service framework.
I have modelled the PHP off a MVC/Model 2 implementation that has a build up/tear down of ~5ms (before optimisations, such as concat single file, or compile to bytecode) to service a request and build a response. The design of the framework allows the response to be changed in a modular fashion, such as building a JSON response. The actions are seperated out to promote reusability and modularity and we have an action server and request processor to handle the application process, authentication and application configuration. It will allow the RPC/Request to be processed quickly through a reusable framework.

On the Javascript client end I have built a RPC/Remoting style framework. The framework handles the creating of the request to be sent to the server and allows API to manage state and response. This allows Requests/Calls to be handled individually through a service with state observers and relay responders, and implements timeouts and fault handling.
I am still considering how I will proceed with the framework, I am waiting for a project where I can really take advantage of it.

July 28, 2006

Creating accessible Popup windows

You will find other articles relevant to this document in these sections:
Richard Lee @ 3:09 pm

Often when we create complex pages with lots of content it’s advantageous to use popups for smalls bits of information such a “Help” text. However since the introduction of popup blockers this once simple task has proven to be a tedious job. For example, by default the IE 6 Popup Blocker will block active scripting opening windows without user clicks i.e. using onload() in the body tag for instance. Higher security settings in IE will even prevent scripted popups running off user clicks. So what’s the answer? I came up with a few ideas, my initial thought was to try and detect if my window would be blocked. To do this I would check whether window.open returned a reference to an object:

function popUpWin(url, width, height) {
 
if (window.open) {
window.open(...);
} else {
alert('It appears your browser is blocking popup windows');
}
}


<a href="javascript:popUpWin(disclaimer.htm, 450, 500)">Read Disclaimer</a>

Although sites use this today it’s not a viable solution because it primarily validates the browser and ultimate won’t provide the user with a working link. Instead the user is expected to go off and adjust their browser settings and re-launch the window. Worse still they might potentially miss important information you were trying to provide in that popup (i.e. a disclaimer).
My next more user-orientated solution is what I use today. Employing the JavaScript onclick() function we can call our popUpWin() funcion, and at the same time we can still use our href attribute to supply a normal link if the javascript fails:

function popUpWin(url, width, height) {
 
if (window.open) {
window.open(...);
}
}

<a href="disclaimer.htm" onclick="popUpWin(this.href, 450, 500);return false;" >Read Disclaimer</a>

July 27, 2006

Gone Pro with Flickr

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 1:56 am

I purchased an upgrade for Flickr tonight which enables me to post gigs of photos online to the service. As a result I will be uploading a lot of our old photography.

Check out http://www.flickr.com/photos/zoecameron/ to see our photos.

July 26, 2006

Keep it real

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 8:39 pm

I am looking through bringing some enterprise development patterns/practices across to ActionScript and I found an interesting SWF:

http://svn.sourceforge.net/viewcvs.cgi/*checkout*/asunit/trunk/comm/marketing/trailer/fla/AsUnit-TechnicalMerit-Trailer.swf

July 25, 2006

Flash Remoting - RecordSet

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 2:13 pm

On the Macromedia website there is some good documentation for interacting with FlashRemoting services and receiving a Record Set. The RecordSet is a data structure that typically represents a 2D structure with items and properties, which you can read about working with the RecordSet at this page:

http://livedocs.macromedia.com/flashremoting/mx/Using_Flash_Remoting_MX/UseASData6.htm#1170158

Setting up a PHP Development Environment - Part 2: Installing PHP4

You will find other articles relevant to this document in these sections:
Richard Lee @ 1:14 pm

Part 2 assumes you have a working installation of Apache 2.0 please refer to Part 1: Installing Apache if you haven’t already done so.

Requirements

  • Apache 2.0.x

1. Download the PHP 4.3.x Windows Binary zip package from http://www.php.net/downloads.php .
2. Run a virus scan and an MD5 checksum to verify the integrity of the download, then unzip to the same root directory as your Apache installation. I have Apache under C:\Apache2, so I have unzipped PHP to C:\php4 .

3. Now edit your php.ini file:

Rename C:\php4\php.ini-dist it to php.ini

Open the php.ini file, locate doc_root and set it to whatever your Apache DocumentRoot is set to. Mine is doc_root = “C:\public_html”

Note: Remember that when adding path values in the Apache configuration files on Windows, all backslashes such as c:\directory\file.ext must be converted to forward slashes, as c:/directory/file.ext. A trailing slash may also be necessary for directories.

Scroll down to extension_dir = “” and set it to the location of the ext directory of your PHP installation extension_dir = “C:\php4\extensions”

Since where using windows we also have to set the session save path to an existing directory so we can use PHP’s sessions functions. I recommend using the Window’s temporary directory session.save_path = “c:/windows/temp” OR for Win2k session.save_path = “c:/WINNT/Temp”

4. Next edit your Apache Conf file (hppd.conf )

For PHP 4 add the following line and copy your php4apache2.dll file from the sapi directory into the php4 root directory:

LoadModule php4_module "c:/php/php4apache2.dll"
AddType application/x-httpd-php .php

For PHP 5 do something like this:

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

And for both configure the path to the php.ini file:

PHPIniDir "C:/php"

5. Now test your installation - first restarting the Apache server - by creating a simple phpinfo file:

< ?php

phpinfo();

?>

Save this file as phpinfo.php in your webroot C:\Apache2\htdocs and run it through your web browser http://localhost/phpinfo.php. You should now be faced with a printout of your servers settings.

If you do not see this page check to make sure you have restarted Apache by right clicking the Apache monitor in your task bar.

You have now completed your installation of PHP 4.

For more information please refer to php.net’s documentation Apache 2.0.x on Microsoft Windows

WebProNews article: Bloggers’ Favorite Subject: Me

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 10:14 am

“…But no other subject, not politics, sports, business, or technology, was more important to the bloggers polled than “my life and experiences.” No, other topics were not even close. About 76% claim their personal experiences as A reason, if not THE reason to blog.

Here’s the breakdown:

37%: my life and experiences

11%: politics

7%: entertainment

6%: sports

5%: news

4%: technology

2%: religion and spirituality

“Some observers have suggested that blogging is nothing more than the next step in a burgeoning culture of narcissism and exhibitionism spurred by reality TV and other elements of the modern media environment,” write Senior Research Specialist Amanda Lenhart and Associate Director Susannah Fox.

July 24, 2006

Flickr photos

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 10:08 am

I was recommended flickr.com by a photographer working at teds this morning as a place to place up my photos online. The service is run by Yahoo and contains hundreds of thousands of photos and members. The service is free to upload 20mb worth of photos a month (not a year, meaning next month you can upload another 20mb) which is enough string to determine if you will continue to use the service by playing with it for a few months. You can happily continue with the 20mb a year, or for AUD$60 for 2 years you can upload 2GB worth of photos online a month.

I have placed up a few of my photos I took on Saturday trying to experiment with the Camera, you can view the photos under my account:

View the photos here

Next Page »