Thursday, February 19, 2009

Don’t Change the World, try to adjust yourself

Once upon a time, there was a king who ruled a prosperous country. One day, he went for a trip to some distant areas of his country.

When he was back to his palace, he complained that his feet were very painful, because it was the first time that he went for such a long trip, and the road that he went through was very rough and stony. He then ordered his people to cover every road of the entire country with leather. Definitely, this would need thousands of cows’ skin, and would cost a huge amount of money.

Then one of his wise servant dared himself to tell the king, “Why do you have to spend that unnecessary amount of money ? Why don’t you just cut a little piece of leather to cover your feet?”

The king was surprised, but he later agreed to his suggestion, to make a “shoe” for himself.

There is actually a valuable lesson of life in this story: to make this world a happy place to live, you better change yourself - your heart; and not the world.

Difference between asp.net server controls and html server controls

Advantages:

1. ASP .NET Server Controls can detect the target browser’s capabilities and render themselves accordingly. No issues for compatibility issues of Browsers i.e page that might be used by both HTML 3.2 and HTML 4.0 browsers code is written in the Server Controls.

2. Newer set of controls that can be used in the same manner as any HTML control like Calender controls. Without any need of Activex Control without bringing up issues of Browser compatibility).

3. Processing would be done at the server side. In built functionality to check for few values(with Validation controls) so no need to choose between scripting language which would be incompatible with few browsers.

4. ASP .NET Server Controls have an object model different from the traditional HTML and even provide a set of properties and methods that can change the outlook and behavior of the controls.

5. ASP .NET Server Controls have higher level of abstraction. An output of an ASP .NET server control can be the result of many HTML tags that combine together to produce that control and its events. Example Gridview or Form control.

Disadvantages:

1. The control of the code is inbuilt with the web server controls so you have no much of direct control on these controls

HTML Server Controls

Advantages:

1. The HTML Server Controls follow the HTML-centric object model. Model similar to HTML

2. Here the controls can be made to interact with Client side scripting. Processing would be done at client as well as server depending on your code.

5. A HTML Server Control has similar abstraction with its corresponding HTML tag and offers no abstraction.

Disadvantages:

1. You would need to code for the browser compatibility.

2. The HTML Server Controls have no mechanism of identifying the capabilities of the client browser accessing the current page.

How to make Productive in Project Meetings?

  • Every meeting MUST have 3 elements: purpose, agenda and maximum duration. If any of these items is missing, the meeting is meaningless and should not happen.
  • Make sure you are able to define a purpose for the meeting in a maximum of 2 sentences, for instance:”This meeting is to plan the new developments for the project X”. This way, everyone will know why they are there, what needs to be done and how to proceed in order to well-succeed.
  • Define a clear agenda in advance. Make a list of all the items to be discussed, revised, analyzed, displayed etc. When I conduct meetings, my personal strategy is to allocate a time limit for each item in the agenda and to assign the responsibility to lead the discussion to someone in the group. Works as a charm.
  • Define duration for the meeting, how many minutes/hours it should last. From the start make crystal clear to everyone what time the meeting will start and, sometimes more importantly, when it will end. It is amazing the number of managers who have absolutely no control of their meetings and do not know how to enforce the finishing rule. If you think you have this habit…CHANGE THIS !!!
  • Do not wait for the delayed people. Meetings must start on the agreeded time. Do not wait about late arrivals. Do not wait for those who need to be called for the meeting. You just make sure everyone gets notified, then when someone arrives after the meeting have started, DO NOT STOP TO REVIEW WHAT WAS SAID. Do this as a proof of respect to those who arrived on time.
  • If the meeting’s organizer is late, Consider the meeting cancelled, and get back to work. How long is considered late? Depends on the company, but I would not wait more than 5 minutes.
  • Document your meeting. What I do is to put someone in charge of writing down the notes. What to put in the meeting notes? Basically the name of the attendants, the discussed subject, the agreed points, the next developments and/or actions with dates and their respective responsible.
  • When the meeting is over - do not wait more than 24 hours - the meeting notes must be sent to: All the participants, to those who could not make it to the meeting and to those who might be influenced by upcoming decisions.
  • Keep the focus. Every meeting must have a regulator to notify the others when someone is discussing any subject outside the scope of the current topic. Ask one of the presents to volunteer for this task when the meeting is about to start. His/her task is to interrupt the meeting at any given time when the focus is lost and bring back the main subject. This new outside topic can maybe then be noted and even can be discussed in future meetings. In case of doubt regarding a specific topic being in or outside the scope, the meeting organizer has the final word.

Trials in life

Trials in life can be tragedies or triumphs, depending on how we handle them. Triumphs don’t come without effort.

A biology teacher was teaching his students how a caterpillar turns into a butterfly. He told the students that in the next couple of hours, the butterfly would struggle to come out of the cocoon. But no one should help the butterfly. Then he left.

The students were waiting and it happened. The butterfly struggled to get out of the cocoon, and one of the students took pity on it and decided to help the butterfly out of the cocoon against the advice of his teacher. He broke the cocoon to help the butterfly so it didn’t have to struggle anymore. But shortly afterwards the butterfly died.

When the teacher returned, he was told what happened. He explained to this student that by helping the butterfly, he had actually killed it because it is a law of nature that the struggle to come out of the cocoon actually helps develop and strengthen its wings. The boy had deprived the butterfly of its struggle and the butterfly died.

Apply this same principle to our lives. Nothing worthwhile in life comes without a struggle.

As parents we tend to hurt the ones we love most because we don’t allow them to struggle to gain strength.

Wednesday, February 18, 2009

Horizontal Drop-Down Menus



Creating the menu

The first and most important part of creating our menu is the menu structure itself. The best way to do this is to build an unordered list, with each sub-menu appearing as a list within its parent list item. Sound complicated? It’s actually very straightforward:


Computability : IE, Mozilla Firefox


Add below links in header

<script type="text/javascript" src="../Hmenu.js"></script>

<link rel="stylesheet" type="text/css" href="../Styles/Cssmenu.css">


ASPX Page writes below code where you want to show the Menu

<div class="horizontalcssmenu" style="float: right;">

<ul id="cssmenu1">

<li style="border-left: 0px solid #202020;"><a href="#">HOME</a></li>

<li><a href="#">ABOUT US</a>

<ul>

<li><a href="#">Sample1</a></li>

<li><a href="#">Sample2</a></li>

<li><a href="#">Sample3</a></li>

</ul>

</li>

<li><a href="#">SERVICES</a>

<ul>

<li><a href="#">Sample1</a></li>

<li><a href="#">Sample2</a></li>

<li><a href="#">Sample3</a></li>

</ul>

</li>

</ul>

</div>



Style Sheet

Save file as Cssmenu.css

.horizontalcssmenu ul

{

margin: 0;

padding: 0;

list-style-type: none;

}

/*Top level list items*/

.horizontalcssmenu ul li

{

position: relative;

display: inline;

float: left;

}

/*Top level menu link items style*/

.horizontalcssmenu ul li a

{

display: block;

width: 90px;

/*width: 100px; Width of top level menu link items*/

padding: 4px 10px; /*border: 1px solid #202020;*/

border-left-width: 0;

text-decoration: none;

color: #ffffff;

font: bold 11px verdana;

font-variant: small-caps;

background-color: #757575;

text-align:left;

}

/*Sub level menu*/

.horizontalcssmenu ul li ul

{

left: 0;

top: 0;

border-top: 1px solid #202020;

position: absolute;

display: block;

visibility: hidden;

z-index: 100;

}

/*Sub level menu list items*/

.horizontalcssmenu ul li ul li

{

display: inline;

float: none;

}

/* Sub level menu links style */

.horizontalcssmenu ul li ul li a

{

width: 100px; /*width of sub menu levels*/

font-weight: normal;

padding: 2px 5px;

background: #757575; /* For editing sub menu hover backgroung color */

border-width: 0 1px 1px 1px;

}

.horizontalcssmenu ul li a:hover

{

/* background: white; For editing main menu hover backgroung color */

}

.horizontalcssmenu ul li ul li a:hover

{

background: #F06B00; /* For editing sub menu hover backgroung color */

}

.horizontalcssmenu .arrowdiv

{

position: absolute;

left: 0;

background-image: url(../images/icon.gif);

background-repeat: no-repeat;

background-position:center left;

}

.horizontalcssmenu .arrowdowdiv

{

position: absolute;

left: 0;

background-image: url(../images/icon_down.gif);

background-repeat: no-repeat;

background-position:center left;

}

* html p#iepara

{

/*For a paragraph (if any) that immediately follows menu, add 1em top spacing between the two in IE*/

padding-top: 1em;

}

/* Holly Hack for IE \*/

* html .horizontalcssmenu ul li

{

float: left;

height: 1%;

}

* html .horizontalcssmenu ul li a

{

height: 1%;

}

/* End */



Save file as Hmenu.js

//Horizontal Main Menu

var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas

var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu(){

for (var i=0; i<cssmenuids.length; i++){

var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")

for (var t=0; t<ultags.length; t++){

ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"

var spanref=document.createElement("span")

spanref.className="arrowdiv"

spanref.innerHTML=" "

ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)

ultags[t].parentNode.onmouseover=function(){

this.style.zIndex=100

this.getElementsByTagName("span")[0].className="arrowdowdiv"

this.getElementsByTagName("ul")[0].style.visibility="visible"

this.getElementsByTagName("ul")[0].style.zIndex=0

}

ultags[t].parentNode.onmouseout=function(){

this.style.zIndex=0

this.getElementsByTagName("span")[0].className="arrowdiv"

this.getElementsByTagName("ul")[0].style.visibility="hidden"

this.getElementsByTagName("ul")[0].style.zIndex=100

}

}

}

}

if (window.addEventListener)

window.addEventListener("load", createcssmenu, false)

else if (window.attachEvent)

window.attachEvent("onload", createcssmenu)