programming arts…

Monitoring Ajax application usage and usability with Google Analytics Event Tracking APIs

I have an ajax application or website, what’s the best way to monitoring user interaction?

Google Analytics! (you can use it also if your webapp is an intranet app: GA API sends data to google server from javascript! Then you need just that your application user got an internet access)

How to use Google Analyitics API to log dynamic  page events?

Google introduced the awesome event tracking feature in Google Analytics API, so using the gaTracker object is very very easy

for instance:


<script>

var loggedUsername='<?php echo $_SESSION['<a class="zem_slink" href="http://en.wikipedia.org/wiki/User_%28computing%29" title="User (computing)" rel="wikipedia">username</a>']; ?&gt;'

function zoom(img){

logGASingleEvent('gallery','image_zoom',loggedUsername);

//other stuff

}

function logGAEvent(category,action,label){
     pageTracker._trackEvent(category,action,label,1);
}

</script>

echo '<img onclick='zoom(\"$gallery_img\");'  ="" src="$gallery_img">;';

logs a user click on an img tag  (in this case the javascrip t zoom() function related to this onClick DOM event).

Ps. i like to put username in label for having a final report like this (a per user action overview):

per user action report

…and this is the general event overview:

analytics event tracking report overview

Isn’t cool? Don’t you love Google?

See also:

Using GA Event API to Monitoring Website Performance

Reblog this post [with Zemanta]
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , , , , , , , , , , , , , , , ,

Browser Package – All major browser in a pacakge for testing your webapp

Need a test environment to test your DHTML webapp?

This kit is very useful: it’s based on a vmware virtual application packaging technology and gives to you a clean and standalone installation of all major browser, including:

- Firefox 3.5.6 (updated)
- Firefox 3.6 beta 5 (updated)
- IETester 0.4.2
- Netscape 9.0.0.6
- Opera 10.10
- Opera 10.20 Test (added)
- Safari 4.04 (updated
- Chrome Google 3.0.195.33
- Chrome Google 4.0.223.16 beta
- Maxthon 2.5.11 (updated)
- Maxthon 3.0.4.8 Alpha
- Arora 0.10
- SeaMonkey 2.0

Installations are standalone and based on virtual machines then this package is not invasive for your windows register.

(Yes i need to use Windows, but just because i need to test my webapps in all existing world browsers…)

Download it here (the site is in french):

http://labs.xoofoo.org/modules/news/

http://tutos.xoofoo.org/modules/mydownloads/visit.php?cid=23&lid=96

Reblog this post [with Zemanta]
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: ,

Tip: Internet Explorer DIV Height Problem

Yes i know, i’m for GWT, Ext, Dojo, Zk, and all the other frameworks that made life easy to web developers abstracting the HTML/CSS and most part of the Js layers, but I come from hard and deep JS/DHTML/CSS hand-programming (HttpXMLRequest sweet HttpXMLRequest) then somethimes i help my collegues to solve classic HTML/Js problems…

One of this is the Interent Explorer buggy way of manage div heights: Any height less than 20px is rendered as 20px.

I just give to you some techniques to hack this annoying IE bug:

1) Put a comment inside an empty div:

<div style="height: 10px;"><!-- --></div>

2) Put a &nbsp;  inside the div and add this to its style: font-size:1px;
line-height:0.

<div style="font-size: 1px; line-height: 0pt;">&nbsp;</div>

of course the styling rules can be put in a css class…

Refs:

http://archivist.incutio.com/viewlist/css-discuss/39150

http://www.codingforums.com/showthread.php?t=46408

Reblog this post [with Zemanta]
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , , ,

How to open a clothes shop and become a stylist in 5 minutes (and with a 0$ budget)

Hi guys, i just opened a new international clothes shop and started my stylist career. Zero investment, zero burocracy:

http://creativebrains.spreadshirt.it

Are you a creative mind? your dream is to see your creation all over the world like “Che Guevara” shirts?

Try to open your clothes shop on spreadshirt.com, you can  create clothes and gain money selling it… it’s free!

http://www.spreadshirt.com

PS. if you like it, please buy a nerd/creative shirt to support creativeprogramming.it:



(life is short, enjoy it!)

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , , , , ,

Using Google Docs as a PDF templating engine

You need to replace text strings in an existing document template?

..and you need to get the output in PDF format?

How to achieve this?

a PDF API?  an Open Office one? or a Microsoft Office “pay for nightmare” SDK (Suicide Developer Kit) ?

nooo… the (easy) solution is Google Docs…!

In fact, thanks to the Google Document List API and the Google Data Protocol, you can edit your document (replacing strings in the template) via an update of the HTML body of the Google Doc Format. I said HTML body, yes , not Postscript-like formats or hard binary data…

It’s official: I love Google.

This is little  demo screencast, enjoy:  (is a PDF2FAX application written for my enterprise.)

Screencasts and videos online

for help in realizing things like this write to info{GUESS_WHAT}creativeprogramming.it

Reblog this post [with Zemanta]
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , , ,

SOAP is died, but not like Elvis: like COBOL!

This video is in Italian:

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , ,

Nice effects with dojo: Enlarge text for a while

This is a new message counter demo javascript and html code (at each new message received the new message count is highlighted and magnified for a while.

The function animateFontSize(nodeid,duration) is a little wrapper of 2 nested dojo.animateProperty calls (opportunely delayed)


function animateFontSize(nodeid,duration){
duration=duration/3;
dojo.animateProperty({node:nodeid,duration: duration, properties: {color:"orange", fontSize:23}}).play();
setTimeout(function(){
dojo.animateProperty({node:nodeid,duration: duration, properties: {color:"green", fontSize:12}}).play();
 },duration*2);

}
... New messages (<span id='newmessagecount'>0</span>)
var newMessageCount=0;
function newMessageArrived(msg){
       // ....
       newMessageCount++;
       dojo.byId('newmessagecount').innerHTML=newMessageCount;
       animateFontSize('newmessagecount',2000);
}
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , ,

LdapAuthPHP – a Little API for LDAP Based AuthN AuthZ in PHP applications

OpenLDAP Software
Image via Wikipedia

I released under open source licence a little tool that helps you in integrating a php application into an LDAP based AAI

Download  it here! (google code)

Features:

  • - Load balancing and HA beetween multiple LDAP servers
  • - HTML Standalone Page Protector (if you are lazy you don’t need to write a login form)
  • - BasicAuth Standalone Page Protector (wanna LDAP-protect an RSS feed?)
  • - Custom attribute fetching (for AuthZ)
  • - Configurable  ldap2Session attribute mapping (LDAP Attr -> PHP Session Attr)
  • - Access logging (to be improved and localized)

Usage example:

<?php
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
    $pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
    $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}

session_name('MYAPP');
session_start();
if (!isset($_SESSION["user"])) {
    include("LdapAuth.inc.php");
    $ldap=new LdapAuth();
    $ldap->setSessionAttr("user","uid");
    $ldap->setSessionName("MYAPP");
    $ldap->setRedirectPage($pageURL); //page where we get redirected after login (in this case self)
    include("LdapStandalonePageProtector.inc.php");
}
else {
  echo "Logged In As: ".$_SESSION["user"]."</hr>";
  //paste here the old page code (or write the new page to protect)
}
?>

Configuration:

/* Configuration section: */
        private $serviceUser="cn=LdapAuthenticator,ou=Groups,dc=mydomain,dc=com";
        private $serviceSecret="serviceUSERpassword";
        /* Tip: a service user is required (keeping enabled anonymous access is a bad thing)
         * and you are supposed do write some ACL to limit the service user to read-only the cn
         * and the uid attribute in the People tree
         */
        private $BaseDn="ou=People,dc=mydomain,dc=com"; //where are the users in the tree?
        private $UIDAttributeName="uid"; // what attribute you wanna search for the search & bind login?
//e.g. "mail" let users to login with their email address and password

        private $ServerList = Array(
            /* Multiple LDAP Servers: for load balancing/ HA redundancy mode, not for multi-ldap auth!!!!
             *  (Server MUST have some user tree synchronization mechanism e.g. <a class="zem_slink" title="OpenLDAP" rel="homepage" href="http://www.openldap.org/">OpenLDAP</a> syncrepl ) */
            Array(
                                        "ip"=>"123.123.123.123",
                                        "name"=>"ldap-master",
                                        "sslport"=>636,
                                        "port"=>389
            ),
            Array(
                                        "ip"=>"ldap125.mydomain.com",
                                        "name"=>"ldap-replica",
                                        "sslport"=>636,
                                        "port"=>389
            )
            /* You can add or remove LDAP server entries (But this is not multi-ldap:
             *  servers MUST have the same user tree */
        );

        private $accessLogFile="ldap.access.log"; //file where access will be logged

        /* Optional parametes (keep it to empty or wrong string if you don't want AuhtZ attributes: */

         /*
          * Note: all attribute names MUST be written in lowercase e.g. givenName -> givenname
          */

        /* Optional*/ private $AuthorizativeAttrName="member";  //can be multi-value
        /* Optional*/ private $AuthorizativeJSONAttrName="x-garr-authoritativejsondata";  //single valued JSON String attribute  e.g. {"myappLevel":"admin","yourappLevel":"guest"}

        /*
         * Other configuration options can be set programmatically, check
         * for the setters methods of this class and call it before
         * calling the method authenticate() into a page to protect.
         */
    /* End configuration. */
Reblog this post [with Zemanta]
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , , , , ,

LNGS-INFN: aperte le iscrizioni per i corsi di Alta Formazione in modalità e-learning

L’Alta Formazione dei Laboratori Nazionali del Gran Sasso parte con quattro nuovi corsi destinati ad imprenditori, dirigenti e tecnici delle piccole e medie imprese abruzzesi su Competenze per l’e-tutoring, Sistemi di telecontrollo del territorio, Fonti rinnovabili di energia e Servizi informatici.

Maggiori Informazioni >>

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Firebug Lite: Firebug for all browsers!

This is a pure Javascript/DHTML version of Firebug, it’s a little limited and slower than the Firefox Plugin but is very useful for web-developers because you can embed Firebug in any webapplication and then debug it on all browsers:

http://getfirebug.com/lite.html

IE Firebug ScreenShoot

This bookmarklet Starts Firebug in any page: it dynamically embeds firebug lite on a webpage, here the code:

<a href="javascript:var%20firebug=document.createElement('script');firebug.setAttribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');document.body.appendChild(firebug);(function(){if(window.firebug.version){firebug.init();}else{setTimeout(arguments.callee);}})();void(firebug);">Firebug</a>

For Google Chrome there is also a Firebug Lite Extension (is just a wrapper button), to install it just search firebug in the Chrome Extension directory.

chrome beta

(For unlock Chrome Extensions support in Google Chrome, today at 4 Jan 2010 you need to switch to Chrome Dev Channel, instruction here: http://dev.chromium.org/getting-involved/dev-channel )

Reblog this post [with Zemanta]
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , , , , , , ,