Javascript syntax highlighting

Page author does not have to prettify code.
Just include it on page and this Javascript program syntax-highlights it at runtime.

From here.


C++ code

#include <stdio.h>
#include <stdlib.h>  

// comment

main ( int argc, char **argv )
{
 double lamb = atof ( argv[1] );
 double x = atof ( argv[2] );   

 for ( int i=1; i<=30; i++ ) 
 {
   printf( "%.5f \n", x );
   x = lamb * x * (1-x);
 }           
}

XML

<?xml version="1.0" encoding="UTF-16"?>
<soml xmlns="http://w2mind.org/soml" version="1.0">
<continuerun runid="1250522178060" type="response">
<action value="24"/>
<score>13, 860 alive</score>
<state>perceivedFatShortage:0.3965525064304313;
perceivedCarbohydrateShortage:0.12797975235558348;
perceivedProteinShortage:0.46190554471641926;
animalPermanentInjury:0.0;
dangerousPlacePerceptionStimulus2:[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0];
irrelevantAnimalPerceptionStimulus2:[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0];
preyInAnimalSquare:false;
fruitFoodInAnimalSquare:false;
cerealFoodInAnimalSquare:false;</state></continuerun></soml>