Sunday, November 1, 2009

Mga Salawikain (The programmers' way)

Pag may tiyaga, may nilaga.
if (tiyaga.isEmpty) {nilaga.setEmpty( );}
Kung ano ang puno, sya rin ang bunga.
public class Bunga extends Puno

Nasa huli ang pagsisisi.
while(!EOF() ) {
    pagsisisi = false;
}
pagsisisi = true;
Pagkahaba-haba man ng prusisyon, sa simbahan pa rin ang tuloy.
for(int i=0; i <= n; i++){if(i=n) {Prusisyon[ i] = "Simbahan";} )
Ang hindi marunong magmahal sa sariling wika, daig pa ang hayop at malansang isda.
if (x.wika.isMahal( ) == false){
    isda.setMalansa = true;
    x > hayop;
    x > isda;
}
Maliit man ang butas, lumalaki.
while(butas < Long.MAX_VALUE) {
    butas++;
}
Anuman ang gagawin, makapitong isipin.
for (int i=1;i<=7;i++) {
   think();
}
Habang may buhay, may pag-asa.
while(alive) {
}
hope = 0;
Aanhin pa ang damo pag patay na ang kabayo?
public class Kabayo {
    private boolean isAlive;    
    public void feed(Object damo) {
        if(isAlive == false) {
            throw new RuntimeException( "Aanhin ko yang " + damo + "? Patay na ako eh.");
        } else {
            digest(damo) ;
        }
    }
}
Combo: Habang may buhay, may pag-asa.+ Kung gusto, maraming paraan; kung ayaw, maraming dahilan.
buhay = true;
do {
    pagasa = 1;  
    if(gusto == true)
        paraan++;
    else
        dahilan++;       
    buhay = isAlive(); // check if still alive       
} while(buhay) ;
pagasa = 0;
Habang maikli ang kumot, matutong mamaluktot.
while(kumot. length < person.height) {
    person.setPosition( "baluktot" );
}
Oo, inaamin ko, sila ay mga yakal, lawaan, apitong at narra, at kami ay saging lang. Pero maghanap kayo ng puno sa buong Pilipinas, saging lang ang may puso. Saging lang ang may puso!
Puno markLapid = new Saging();
markLapid.setMayPuso(true);
Puno[] philippineTrees = {new Yakal(), new Lawaan(), new Apitong(), new Narra(), markLapid};
for (Puno tree : philippineTrees) {
   if (tree.mayPuso( )) {
      System.out.println( "May puso!");
   } else {
      System.out.println( "Walang puso.");
   }
}
Nasa tao ang gawa nasa Diyos ang awa.
public class Tao {
    public void gawa() {
        ...
    }
}
public class Diyos {
    public boolean awa(Tao tao) {
        ...
    }
}
Ang taong nagigipit, sa patalim man ay kumakapit.
public class Tao {
    private boolean nagigipit;
    private boolean mayPatalim;    
    public void kapitPatalim( ) {
        if(nagigipit) {
            mayPatalim = true;
        }
    }
}

Cool Corporate Lessons

CORPORATE LESSON 1
     A man is getting into the shower just as his wife is finishing her shower when the doorbell rings. After a few seconds of arguing over which one should go and answer the doorbell, the wife gives up, quickly wraps herself up in a towel and runs downstairs.
     When she opens the door, there stands Bob the next door neighbour. Before she says a word, Bob says, "I'll give you $800 to drop that towel that you have on"
     After thinking for a moment, the woman drops her towel and stands naked in front of Bob. After a few seconds, Bob hands her $800 and leaves. Confused, but excited about her good fortune, the woman wraps back up in the towel and goes back upstairs. When she gets to the bathroom, her husband asks from the shower, "Who was that?" "It was Bob the next door neighbour," she replies. "Great," the husband says, "did he say anything about the $800 he owes me?"
Moral of the story:
If you share critical information pertaining to credit and risk in time, with your stakeholders, you may be in a position to prevent avoidable exposure.

CORPORATE LESSON 2
     A sales rep, an administration clerk and the manager are walking to lunch when they find an antique oil lamp. They rub it and a Genie comes out in a puff of smoke. The Genie says, "I usually only grant three wishes, so I'll give each of you just one." "Me first! Me first!"says the admin clerk "I want to be in the Bahamas, driving a speedboat, without a care in the world. Poof! She's gone.
     In astonishment, "Me next! Me next!" says the sales rep. I want to be in Hawaii, relaxing on the beach with my personal masseuse, an endless supply of pina coladas, and the love of my life." Poof! He's gone.
     OK, you're up," the Genie says to the manager. The manager says, "I want those two back in the office after lunch."
Moral of story:
Always let your boss have the first say.

CORPORATE LESSON 3
     A crow was sitting in a tree, doing nothing all day. A small rabbit saw the crow, and asked him, "Can I also sit like you and do nothing all day long?" The crow answered: "Sure, why not." So, the rabbit sat on the ground below the crow, and rested. All of a sudden a fox appeared, jumped on the rabbit and ate it.
Moral of story:
To be sitting and doing nothing, you must be sitting very, very high
up.

CORPORATE LESSON 4
     A turkey was chatting with a bull. "I would love to be able to get to the top of that tree," sighed the turkey, "but I haven't got the energy." "Well, why don't you nibble on some of my droppings?" replied the bull. "They're packed with nutrients." The turkey pecked at a lump of dung and found that it actually gave him enough strength to reach the lowest branch of the tree. The next day, after eating some more dung, he reached the second branch. Finally after a fourth night, there he was proudly perched at the top of the tree. Soon he was promptly spotted by a farmer, who shot the turkey out of the tree.
Moral of story:
Bullsh!t might get you to the top, but it won't keep you there.

CORPORATE LESSON 5
     A little bird was flying south for the winter. It was so cold the bird froze and fell to the ground in a large field. While it was lying there, a cow came by and dropped some dung on it. As the frozen bird lay there in the pile of cow dung, it began to realise how warm it was. The dung was actually thawing him out! He lay there all warm and happy, and soon began to sing for joy.
     A passing cat heard the bird singing and came to investigate. Following the sound, the cat discovered the bird under the pile of cow dung, and promptly dug him out and ate him.
Moral of story:
1) Not everyone who sh!ts on you is your enemy
2) Not everyone who gets you out of the sh!t is your friend.
3) And when you're in deep sh!t, it's best to keep your mouth shut

Source: Forwarded Email