Creating a site tour with jQuery

Sometimes when you build a custom solution end users need a little bit of help, or time, in order to determine where everything is. Grounding them within the actual environment rather than within help pages is the fastest way in my opinion to get them up to speed. A great option is jQuery site tour.

Working either manually or in a timed fashion it highlights predetermined classes with text and images. Tooltips on steroids in a way… To use it, you simply have to add certain class to any elements that you want to describe in the walk-through. E.g. “tour_1″, “tour_2″ would look like:

1 <div class="box left">
2     <h2 class="tour_1">Create a tour>
3     <p>Far far away, behind the word mountains, ...p>
4 >

The following parameters can be set:

  • name: the class given to the element where you want the tooltip to appear
  • bgcolor: the background color of the tooltip
  • color: the color of the tooltip text
  • text: the text inside of the tooltip
  • time: if automatic tour, then this is the time in ms for this step
  • position: the position of the tip

Resources
There is a full article with a functional demo here: http://tympanus.net/codrops/2010/12/21/website-tour/

Dynamics CRM 2011 got to cloud customers first…

Users of the cloud-hosted version of customer relationship management software from Microsoft, aka Dynamics CRM, will be first in line to get the latest version. Microsoft Dynamics CRM 2011 will be available for on-premises deployment from February 28, but cloud customers can start using it today in 40 countries and 41 languages…

Clearly gunning for Salesforce.com and Oracle CRM customers, Microsoft is trying to undercut its competitors with a promotional price of $34 per user per month, and as an added incentive is offering $200 per user transferred from a competing product to Dynamics CRM for a limited period, to help cover any migration costs. Which are not really that bad speaking from an implementers perspective.

Resources
https://offers.crmchoice.com/Cloud-CRM-For-Less/?locale=en-us
http://crm.dynamics.com/en-us/

Browser detection: solving the quandary with a bit of PHP

The browser and its specific version can tell you a lot about your visitors. Not just that they are running OpenSolaris, Windows 7, or Chrome OS but much, much more. It also can help you enable, or more likely disable, certain features of your site, content, or application. Therefore it is more than critical to determine it correctly. It is/should be mandatory.

So what are your options. Precisely three.

  1. Do nothing
  2. Go client side
  3. Go server side

1 is not worth mentioning, 2 is typically performed by JavaScript which leaves 3.

Now leaving aside the potential impact on your caching mechanism/plans/shenanigans option 3 can bring some great benefits without sending the client browser any payload. But if you have to do it yourself it can be a royal pain as browser versions and new products are like beer. Everybody will try a new one but usually not for long. (that may need work.) So what to do? Cue Browser.php


Browser.php is a PHP class that helps this process by collecting data about a visitor’s browser such as:

  • platform used
  • browser
  • browser version

It is very easy to implement.

Typical usage

$browser = new Browser();
if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
echo 'You have FireFox version 2 or greater';
}

Needless to say you must do the usual beforehand such as:
require_once(‘Browser.php’);
and
$browser = new Browser();

Resources: http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/

Open source projects for PST file access

This goes back a while and I just plain forgot to post about it.

Back in February of 2010, Microsoft released a public specifications for PST files, the databases used by Outlook for storing and archiving e-mail. To these specifications, Microsoft also added a pair of developer-oriented open source projects:

Though the core Office document formats are now XML-based open standards, alleviating such lock-in issues, Outlook has continued to use a complex database format for storing mail, making interoperability difficult. With the documentation and these software projects, the days of being locked into Outlook could be coming to an end.

The SDK project is still not finished; seemingly it still only provides read-only access to PST data, though write support is purportedly planned. Both tools are released using under the Apache License 2.0. This means that they can be incorporated into proprietary, closed-source projects, as well as other open source projects.

Overall the information available at the Microsoft Interoperability site is very, very useful and I would strongly recommend a visit.

Resources
http://blogs.msdn.com/b/interoperability/

EC2 now has FreeBSD

EC2 now has FreeBSD

Good news. EC2 now has FreeBSD. Though with some quirks…In order to work with EC2, the FreeBSD AMIs are slightly modified from what you would have immediately after installing FreeBSD from a release CD:

  • The network is configured and the sshd daemon is enabled, for obvious reasons.
  • SSH logins as root are enabled, but root’s password is starred out (i.e., password logins as root will fail until a password is set).
  • The first time an AMI is booted, a script fetches the public half of an SSH keypair from EC2 and arranges for root logins using that key.
  • Every time the the AMI boots, it prints the SSH host keys to the console in the same format as Amazon Linux AMIs do.
  • The FreeBSD kernel is located on an ext2 filesystem, in order to allow Amazon’s user provided kernel functionality to work. (Everything else is on a single UFS2 filesystem.)
  • AMIs published from 2010-12-29 onwards have /etc/motd text with some comments about FreeBSD/EC2 and a link to this page.
  • AMIs published from 2010-12-29 onwards by default report kernel panics (including backtraces) to the FreeBSD/EC2 maintainer to assist him in identifying and fixing bugs. 
At the present time, FreeBSD/EC2 should be considered an experimental platform not yet ready for production use.

The following AMIs are available (though there are additional obsolete AMIs…):

FreeBSD version us-east-1 us-west-1 eu-west-1 ap-southeast-1
FreeBSD 9.0-CURRENT @ 2011-01-04
For t1.micro instances only! ami-8cce3fe5 ami-61683824 ami-e388bd97 ami-36bdc364
FreeBSD 8.2-RC @ 2011-01-08
For t1.micro instances only! ami-4a15e423 ami-376e3e72 ami-f77e4a83 ami-3eb6c86c

Note: Apparently FreeBSD will only currently work on t1.micro instances..

Resources
http://aws.amazon.com/ec2/
http://www.freebsd.org/
http://forums.freebsd.org/showthread.php?t=254

PHP: Finding the binary

The other day I was stumped, albeit rather briefly, by something I should not have been. I was scripting out some CRON jobs for a CRM system when I found out I could not locate where the hosting company had put the PHP binary. Now that is something you usually do not have to think about so it can easily fall into the ‘been a while’ category.

So if you ever find yourself asking, where is the PHP binary? or just where is PHP? Here are some steps to follow.

Telnet/Shell
If you have shell access via telnet, log in, and type “which php” and you should be given the location to use.

If you don’t have shell, try one of the following:

Create a php page with just the following: and then call the page, this should tell you the location of PHP.

echo system('which php');

If that does not work, though it should, try checking one of the paths listed under path in the ENVIRONMENT section of the output with this.Take note though that this will give you the environment path so you will still need to add /php to it…

echo phpinfo();

Smartupdater: A JQuery periodical updating mechanism

I often need to implement some kind of periodical updating functionality from client to server and vice versa. Aka a classic polling mechanism. Smartupdater is a jQuery plugin which simplifies the process of sending regular requests to a server (polling) and handling the responses. I have found it very useful, and easy to work with. It can be started or stopped on any event and the interval of the polling periods can be redefined as well as controlled remotely.

A simple example would be how to display the remote time on a server with a polling interval of 5 seconds. Note that the remote script is returning a JSON format like this: “{“servertime”:”hh:mm:ss”}”

$("#example1").smartupdater({
  url : 'gettime_json.php',
  dataType:'json',
  minTimeout: 5000 // 5 seconds
  }, function (data) {
    $("#example1").html(data.servertime);
  }
);

The returned results can then be displayed in a div tag…

    
      Time on server: hh:mm:ss

Download link: https://code.google.com/p/smartupdater/