Tuesday, March 18, 2008

Def Leppard in India - May 2008

DEF LEPPARD has officially confirmed the following dates as part of its 2008 world tour:

May 16 - Bangalore, India - Palace Grounds
May 18 - Mumbai, India - Bandra Kurda Complex

http://www.defleppard.com/tour/

Rock in India 2008 - Megadeth (Gigantic Tour 2008) & Machine Head

Rock in India concert was definitely a huge success. There were so many Indian and International bands performing on a single day. 7 Indian and 2 international acts on one day was mind blowing...it was like an overdose of rock !!

The day started with the Indian bands performing around 2.15pm. There were two stages and the crowd was divided as to which stage to be at. half of the crowd moved to the Indian stage when the bands started playing the rest remained at the international stage

keeping their place for the main acts. There was only 1 cover of U2 played, the rest of the songs were OCs by the Indian bands.They performed till around 7.10pm.

Machine Head name on stage after this and with no further ado started performing. The entire crowd went wild and the first 20 rows there was no place to headbang, jump, start a mosh pit, etc. ppl were pushing, shoving, kicking, etc to get close to the stage. The middle of the crowd was like a tornado with ppl moving to the left, right and center like a

whirlpool. there were times when a section of the crowd lost balance and fell on the ground. but it was worth it. Robb Flynn was amazed that the crowd kept singing along with him. He raised a toast to the crowd several times and threw the booze into the crowd.At the end of every song the crowd said “Machine Fuckin Head” which again took them by surprise. I was fortunate to get 2 glasses on my face & head. He

was drinking Old Monk :O). Machine Head showed good showmanship on stage and kept the atmosphere electric. they finished their set around 8.15pm. then there was a 20 Min's delay to change the drum kit and the stage monitors.

Come the main act MEGADETH. The entrance made by Dave was simply superb. He started off with sleepwalker and with each riff being played, Chris walked on stage

followed by James and then Shawn. There was not much of crowd interaction coz of time delay but they let their music do most of the talking. Every1 in the crowd went completely berserk when they started playing and the entire crowd kept headbanging as one. Dave was astounded that for most of the songs the crowd kept backing him on vocals esp for 'a toute le monde'. They played 'Take No Prisoners', 'Skin O' My Teeth',

'Washington Is Next', 'In My Darkest Hour', 'Tornado Of Souls', 'Symphony Of Destruction', 'Trust', 'Peace Sells' & 'Holy Wars' plus a couple more. He promised that they would be back again. Dave played most of the solos . Chris guitar volume seemed to be low dunno if the sound guy made mess of the settings and pushed Dave's guitar on full volume.

This was one hell of a concert and there should definitely be more...

Thursday, March 6, 2008

Megadeth Gigantic tour 2008 set list

For MEGADETH 's gig on Monday, February 4 2008 at the Ice Hall in Helsinki, Finland the set list was:

01. Sleepwalker
02. Take No Prisoners
03. Wake Up Dead
04. Skin O' My Teeth
05. Washington Is Next!
06. Kick The Chair
07. In My Darkest Hour
08. Hangar 18
09. Gears Of War
10. A Tout Le Monde
11. Tornado Of Souls
12. Ashes In Your Mouth
13. Never Walk Alone
14. Symphony Of Destruction
15. Trust
16. Peace Sells
---------------------
17. Burnt Ice
18. Holy Wars

Javascript and XPath

In IE once an xml file has been loaded we need to set a property so that XPath can be used:

xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("someFile.xml");
xmlDoc.setProperty("SelectionLanguage","XPath");

for other browsers like Firefox we need to set :

xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("someFile.xml");
var nsResolver = xmlDoc.createNSResolver( xmlDoc.ownerDocument == null ? xmlDoc.documentElement : xmlDoc.ownerDocument.documentElement);

before calling the evaluate() method.

'selectionsPath' is the xpath expression that we need to form and then for getting the value(s),

//Internet explorer
if (ie)
{
var actions = xmlDoc.selectNodes(selectionsPath);
var i = 0;
for (i=0;i<actions.length;i++)
{
alert(actions[i].childNodes[0].nodeValue);
}
}
else
{
//mozilla
var actions = xmlDoc.evaluate(selectionsPath, xmlDoc, nsResolver, XPathResult.ANY_TYPE,null);
var result=actions.iterateNext();

while (result)
{
alert(result.textContent);
result=actions.iterateNext();
}
}

Tuesday, March 4, 2008

Javascript calendar showing daily events

For the basic part of constructing and displaying a HTML calendar in javascript please refer to url:
http://jszen.blogspot.com/2007/03/how-to-build-simple-calendar-with.html

Making use of the above calendar , all that is needed inorder to show events on a day to day basis, is to get a list of events for a particular day. The structure for storing the events for each day can be an xml file or a json file or any other kind of data structure that is approrpiate.

what changes are needed to be made to the code at url: http://jszen.blogspot.com/2007/03/how-to-build-simple-calendar-with.html

1) in "Calendar.prototype.generateHTML" function add a function to return all the events for a particular day

html += getDayEvents(tempYear, tempMonth, day);

2) The xml file that is used in this example is shown below:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<year id="2008">
<month id="2">
<days id="1">
<events><a href="#" target="_blank"> some other event</a></events>
</days>
<days id="2">
</days>
</month>
<month id="3">
<days id="6">
<events><a href="#" target="_blank"> some other event</a></events>
</days>
<days id="2">
</days>
</month>
</year>

3) code the javascript function

function getDayEvents(year, month, day)
{
var dayevents = "&nbsp";
//months are being referred to as Jan=0. Feb=1, etc so add 1 to the month so that it matches the normal calendar months
var tempmonth = month + 1;

var rowcount=xmlDoc.getElementsByTagName('days');
var found = false;

for(ii=0; !found && ii<rowcount.length;ii++)
{
//check if we have got the correct day , month and year
if ( (rowcount[ii].getAttribute('id') == day) && (rowcount[ii].parentNode.getAttribute('id') == tempmonth)
&& (rowcount[ii].parentNode.parentNode.getAttribute('id') == year) )
{
//get a list of all events for that day
for(jj=0;jj<rowcount[ii].childNodes.length;jj++)
{
if (rowcount[ii].childNodes[jj].text != "undefined")
{
dayevents += rowcount[ii].childNodes[jj].text;
}
}
found = true;
}
}

return dayevents;
}

4) To show previous month and next month events, add the code below to "Calendar.prototype.generateHTML" function:

html += '%lt;th colspan="1" align="left" id="previousmonth">%lt;a href="javascript:previousmonth('+currentMonth+','+ currentYear+')">previous month%lt;/a>%lt;/th>';
html += '%lt;th colspan="5" align="center">' + monthName + " " + this.year ;
html += '%lt;th colspan="1" align="right">%lt;a href="javascript:nextmonth('+currentMonth+','+ currentYear+')">next month%lt;/a>%lt;/th>';

5) code the previous and next months javascript functions

function nextmonth(month, year)
{
var nextMnth = month + 1;
if(nextMnth > 11)
{
nextMnth = 0;
year = year + 1;
}
var cal = new Calendar(nextMnth,year);
cal.generateHTML();
document.getElementById('calendarID').innerHTML = cal.getHTML();
}

function previousmonth(month ,year)
{
var prevMonth = month - 1;
if(prevMonth < 0)
{
prevMonth = 11;
year = year - 1;
}
var cal = new Calendar(prevMonth,year);
cal.generateHTML();
document.getElementById('calendarID').innerHTML = cal.getHTML();
}



The complete code is below:

%lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
%lt;html lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
%lt;head>
%lt;style type="text/css">
.calendar-table{
width : 100%;
border : 1px solid black;
}

.calendar-header{

}

.calendar-header-day {
width:14% ;
align:center;
border : 1px solid green;
}

.calendar-day{
height : 100px;
padding : 2px;
border : 1px solid blue;
}
%lt;/style>
%lt;script type="text/javascript">
//credit to http://jszen.blogspot.com/2007/03/how-to-build-simple-calendar-with.html for the logic

// these are labels for the days of the week
cal_days_labels = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];

// these are human-readable month name labels, in order
cal_months_labels = ['January', 'February', 'March', 'April',
'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'];

// these are the days of the week for each month, in order
cal_days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

// this is the current date
cal_current_date = new Date();

var currentMonth;
var currentYear;
function Calendar(month, year) {
this.month = (isNaN(month) || month == null) ? cal_current_date.getMonth() : month;
this.year = (isNaN(year) || year == null) ? cal_current_date.getFullYear() : year;
this.html = '';
currentMonth=this.month;
currentYear=this.year;
}

Calendar.prototype.generateHTML = function(){
var xmlDoc;
parseXML();
// get first day of month
var firstDay = new Date(this.year, this.month, 1);
var startingDay = firstDay.getDay();

// find number of days in month
var monthLength = cal_days_in_month[this.month];

// compensate for leap year
if (this.month == 1) { // February only!
if((this.year % 4 == 0 && this.year % 100 != 0) || this.year % 400 == 0){
monthLength = 29;
}
}

// do the header
var monthName = cal_months_labels[this.month]
var html = '%lt;table class="calendar-table" cellspacing="1" cellpadding="2">';
html += '%lt;tr>';
html += '%lt;th colspan="1" align="left" id="previousmonth">%lt;a href="javascript:previousmonth('+currentMonth+','+ currentYear+')">previous month%lt;/a>%lt;/th>';
html += '%lt;th colspan="5" align="center">' + monthName + " " + this.year ;
html += '%lt;th colspan="1" align="right">%lt;a href="javascript:nextmonth('+currentMonth+','+ currentYear+')">next month%lt;/a>%lt;/th>';
html += '%lt;/th>%lt;/tr>';
html += '%lt;tr class="calendar-header">';
for(var i = 0; i %lt;= 6; i++ ){
html += '%lt;td class="calendar-header-day">';
html += cal_days_labels[i];
html += '%lt;/td>';
}
html += '%lt;/tr>%lt;tr>';


// fill in the days
var day = 1;
var tempMonth = this.month;
var tempYear = this.year ;
// this loop is for is weeks (rows)
for (var i = 0; i %lt; 9; i++) {
// this loop is for weekdays (cells)
for (var j = 0; j %lt;= 6; j++) {
html += '%lt;td class="calendar-day" valign="top">';
if (day %lt;= monthLength && (i > 0 || j >= startingDay)) {
html += day ;
html += getDayEvents(tempYear, tempMonth, day);
day++;
}
html += '%lt;/td>';
}
// stop making rows if we've run out of days
if (day > monthLength) {
break;
} else {
html += '%lt;/tr>%lt;tr>';
}
}
html += '%lt;/tr>%lt;/table>';

this.html = html;

function parseXML()
{
try
{ //try IE first
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e)
{
try
{ //try Mozilla, Firefox, Opera, etc.
xmlDoc=document.implementation.createDocument("","",null);
}
catch(e)
{
alert(e.message);
return;
}
}
xmlDoc.async=false;
xmlDoc.load("CalendarEvents.xml");

}

function getDayEvents(year, month, day)
{
var dayevents = "&nbsp";
var tempmonth = month + 1;

var rowcount=xmlDoc.getElementsByTagName('days');
var found = false;

for(ii=0; !found && ii%lt;rowcount.length;ii++)
{
if ( (rowcount[ii].getAttribute('id') == day) && (rowcount[ii].parentNode.getAttribute('id') == tempmonth)
&& (rowcount[ii].parentNode.parentNode.getAttribute('id') == year) )
{
for(jj=0;jj%lt;rowcount[ii].childNodes.length;jj++)
{
if (rowcount[ii].childNodes[jj].text != "undefined")
{
dayevents += rowcount[ii].childNodes[jj].text;
}
}
found = true;
}
}

return dayevents;
}


}

Calendar.prototype.getHTML = function() {
return this.html;
}

function nextmonth(month, year)
{
var nextMnth = month + 1;
if(nextMnth > 11)
{
nextMnth = 0;
year = year + 1;
}
var cal = new Calendar(nextMnth,year);
cal.generateHTML();
document.getElementById('calendarID').innerHTML = cal.getHTML();
}

function previousmonth(month ,year)
{
var prevMonth = month - 1;
if(prevMonth %lt; 0)
{
prevMonth = 11;
year = year - 1;
}
var cal = new Calendar(prevMonth,year);
cal.generateHTML();
document.getElementById('calendarID').innerHTML = cal.getHTML();
}

function init()
{
var now = new Date();

var cal = new Calendar(now.getMonth(),now.getFullYear());
cal.generateHTML();
document.getElementById('calendarID').innerHTML = cal.getHTML();
}
%lt;/script>

%lt;/head>
%lt;body onload="init()">

%lt;div id="calendarID">%lt;/div>
%lt;/body>
%lt;/HTML>

Getting around in Bangalore

http://www.btis.in/


This is a very good site for new comers to Bangalore. This site gives point to point directions that shows most of the roads along the route with the autorickshaw fare !! The results are displayed in a map which is easy to read provided you know the roads being shown :O).

It also gives live traffic updates, BMTC bus stops and car pools.

Refresh a browser (client side) automatically

Inorder to do a client side refresh automatically you will need to add the below line to your webpage:

<META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.aabbcc.com/">

where '10' is the number of seconds to wait since the webpage was already loaded and 'http://www.aabbcc.com/' is the url to reload.