DateTime startTime = DateTime.Now;
Console.WriteLine(startTime);
This blog was setup as a result of too much programming, I realised that I was getting back to the same problems which I had solved a few years ago. I thought a blog that can serve to remind me of what I did when i ran into programming problems :) So yep. Hence the title programming trail.
Tuesday, June 9, 2009
Wednesday, June 3, 2009
CSS Visibility vs Display
There is a difference when you want to hide things using CSS. Setting Visibility = 'hidden' and Display = "none" may appear similar at first, but actually it is not. If we have multiple lines of items arranged vertically that we want to hide, it will be obvious that the div layer set with visibility:none will have a whitespace placeholder wherelse a div layer set with display:none will not have a whitespace placeholder.
function showhide(header, childid)
{
var myHeader = document.getElementById(header);
var myLayer = document.getElementById(childid);
if (myLayer.style.display == "none") {
myLayer.style.display = "block";
} else {
myLayer.style.display = "none";
}
}
function showhide(header, childid)
{
var myHeader = document.getElementById(header);
var myLayer = document.getElementById(childid);
if (myLayer.style.display == "none") {
myLayer.style.display = "block";
} else {
myLayer.style.display = "none";
}
}
Random Number in C#
int RandomNo(int min, int max){
Random random = new Random();
return random.Next(min, max);
}