Tuesday, December 1, 2009

Delicious bookmarks on Google Chrome

hi,

Below is a work around to get affect near to the Firefox one. you may follow one of the below approaches.

1. Google and drag the delicious bookmark onto the bookmark toolbar. OR
2. Right click on bookmark toolbar, and say add page.

Now opent he bookmark manager (right clik on bookmark toolbar). Right click on the delicious icon and say edit. IN the javascript source copy the below content:

javascript:(function(){var%20a=window,b=document,c=encodeURIComponent,d=a.open("http://delicious.com/save?url="+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&v=5&jump=yes',"bkmk_popup","left="+(screen.width-880)/2+",top="+(screen.height-620)/2+",height=620px,width=880px,resizable=1,alwaysRaised=1,scrollbars=0");a.setTimeout(function(){d.focus()},300)})();

I am using this and am able to bookmark the page similar to firefox. The left bar etc.. i think i will develop it in near future.

gud luck.

Tuesday, September 29, 2009

Q

If carrots are so good for the eyes, how come I see so many dead rabbits on the highway?

J

Dexter had just returned from two weeks of vacation. He asked his boss for two more weeks off to get married.
"What!" shouted the boss? "I can't give you more time now. Why didn't you get married while you were off?"
"Are you nuts?" replied Dexter. "That would have ruined my whole vacation.”

-----------------


A woman, searching for a job, inquired about the benefits. The Personnel Manager informed her they had group health and life insurance, but the costs were deducted from the employee's pay.
She said, "My last employer had full health coverage, as well as five years salary for life insurance and a month's sick leave AND they paid the full premiums."
"I can't help but asking madam why you would leave a job with such benefits," the interviewer replied.
The woman shrugged her shoulders and said, "The company went bankrupt.”

-------------------



Monday, September 21, 2009

Jokes

I have a confession to make, ever since I have
known u,
Its kinda hard for me to forget u.
Every night u appear in my dreams
And I find my self shouting.... .
BHOOT !!! BHOOT !!!

I look at the stars, the stars r beautiful
Then I look at you......
I ......
I .......
I rather look at the stars again. *****

Why do Sardars always smile during lightning storms?
They think their picture is being taken.

u r 100% beautiful, u r 100% lucky
u r 100% sweet , u r 100% nice
and u r 100% stupid to believe these words

Good looking people r hard to find.
That's why u don't ......
That's y u don't see me often.

An issue:
----------
Once a sardarji was traveeling in the last compartmrnt of Tamilnadu express from Chennai to Delhi .The train would run for some 6 hours at a stretch and stop for just 10 minutes in a station . Every time the train stops he had to run one furlong into the station to eat and drink . By the time he reached Delhi he was so vexed with the journey and lodged a complaint in the complaint book . It reads as follows -
To the Hon'ble Railway minister ,
You do not know the difficulties of people travelling in the last compartment of such a lengthy train such as the Tamilnadu Express . Each time it halts in a station, you have to run one mile into the station and eat some thing and before you reach the compartment the train starts moving . It is a real hell . So , from now onwards I recommend that ' the last compartment in Tamilnadu Express may be kept in the middle of the train and not at the end of the train '..

Q

Defeat never comes to any man until he admits it

the image speaks for it self


sardar again

there isa mirror that killed evryonewho lied
french:i think i dont smoke[died]
American:i think i love my wife[died]
Sardar:i think.......................[died]

sardar again

Santa meets his friend Bunta
Santa : A & B, A & B, A & B, A & B, A & B...!
Bunta : Oye, Iska Matlab ?
Santa : Kuch Nahin Yaar, I Mean Long Time No C..!


Santa : I tried your number so many times, it always said 'Switched Off'!"
Banta : Nahi Pape, it's my HELLO TUNE!

Santa : When I get mad at you,you never fight back.How do you control your anger?
Jasmeet : I clean the toilet bowl.
Santa : How does that help?
Jasmeet : I use your toothbrush!

Sunday, August 30, 2009

Google code

Yest i wanted to publish my work related to javascript here and blogger had irritated me to the extent possible. It doesnt allow me to put HTML content and if i put it in Edit HTML mode then it uses its itelligence to destory my code and indentations. Finally i used Text area tag of HTML to do it. Even in this the blogger inserted un-necessary irritating
codes. huh! how do i get over this?

Then thought if content delivery sites can help me and went to Ziddu.com; now this fellow doesnt allow me to  upload HTML content. oh god!

I remembered i read about cloud computing at one of the sun forums; and heard Google gives an app engine. I tried with google and uploadded an applicaiton on that app server to serve my file.

I dont know how long will he let the content exist there; i didnt make any effort to know it either.:(

Ok what ever, finally got my things working on Google App server serverd via google CDN; he was mentionling about some payment on his site (if i read it right then it comes in when hits > 5million peryear?)

finlly happy ending.

Accordian -starting

below is the code that creates multiple divs one below the other and when clicked flies them down. This is a very very naive form of accordian implementation, however a good start. Hope some body out there is searchig for a simple example of how this one works. View source for this iframe below to get the src code.

Saturday, August 29, 2009

funny ans


2 women in heaven

1st woman: Hi! My name is Sandra.
2nd woman: Hi! I'm Sylvia. How'd you die?

1st woman: I froze to death.
2nd woman: How horrible!

1st woman: It wasn't so bad. After I quit shaking from the cold, I began to get warm & sleepy, and finally died a peaceful death. What about you?

2nd woman: I died of a massive heart attack. I suspected that my husband was cheating, so I came home early to catch him in the act. But instead, I found him all by himself in the den watching TV.

1st woman: So, what happened?

2nd woman: I was so sure there was another woman there somewhere that I started running all over the house looking.
I ran up into the attic and searched,and down into the basement. Then I went through every closet and checked under all the beds.
I kept this up until I had looked everywhere, and finally I became so exhausted that I just keeled over with a heart attack and died.

1st woman: Too bad you didn't look in the freezer---we' d both still be alive.

PRICELESS!

Q


Wednesday, August 19, 2009

Q

Never interrupt your enemy when he is making a mistake.
-Napoleon Bonaparte (1769-1821)


Tuesday, August 18, 2009

Q

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein (1879-1955)


Sunday, August 16, 2009

Drag

I jus did some experiment to get the drag drop func of elements and finally below is the code i could get working; The element gets draged on mouse over.

there are a few issues.. say when u make a quick drag and the mouse goes out .. i.e.. the element is not attached to the mouse evet. Ok the blogger isnt allowing me to put the HTML code. I m putting the css + js. Just include the div with id called draggableId in ur html nd things should work.

var origX;
var origY;
var flag=false;
function drag(){
var evt=window.event;
var v1 =evt.clientX + document.body.scrollLeft - document.body.clientLeft;
var v2 =evt.clientY + document.body.scrollTop - document.body.clientTop;
if(!flag){
flag=true;
origX=v1;
origY=v2 - 10 ;
}
var deltaX=v1-origX;
var deltaY=v2-origY;
var divEle = document.getElementById('dragableId');
//alert('>>' + divEle.offsetLeft);
divEle.style.left = divEle.offsetLeft + deltaX;
divEle.style.top = divEle.offsetTop + deltaY;
origX=v1;
origY=v2;
}

div.dragable{
position:absolute;
background:yellow;
right:500px;
top:300px;
padding:20px;
}

[div id='dragableId' class='dragable' onmousedown='drag();' onmousemove='drag()' ]
This is dragable
[/div]

A more nices + complicated impl is at: http://www.brainjar.com/dhtml/drag/

Saturday, August 15, 2009

Ek chotisi love story

Once upon a time, a guy asked a girl 'Will you marry me?'
The girl said, 'NO!' And the guy lived happily ever after and rode motorcycles and went fishing and hunting and played golf a lot and drank beer and scotch and left the toilet seat up and farted whenever he wanted.

Tuesday, August 11, 2009

Writing content at the cursor location in text area

This was the problem and it ate all my day. Mozilla is a good boy and gives an attibute which can help, but IE.. aaah! what ever, the below is the code to do the same.

     var objTextArea = dc('contentId');
     objTextArea.focus();
       document.selection.createRange().text = link.innerHTML;
       objTextArea.caretPos = document.selection.createRange().duplicate();

actually i got this from this site: http://forums.aspfree.com/html-javascript-and-css-help-7/tip-adding-text-in-caret-position-of-textarea-39329.html; infact he gives a working html code also.

Monday, August 3, 2009

Saturday, July 25, 2009

Object oriented JS

I was going th the object oriented js and below is the basic example


function base (){};
base.prototype.foo=function(){
alert('base prototype foo');
};

var b = new base();
b.foo = function(){alert('base.foo');};

function sub(){};
sub.prototype=b;

function subsub(){};
subsub.prototype= new sub();

function sss(){};
sss.prototype=new subsub();

function test(){
//var b = new base();
alert('b.foo\n' + b.foo);
//alert('b.prototype foo\n' + b.prototype);
//var s0 = new sub();
//alert('s0.foo\n'+ s0.foo);
//alert('s0.prototype.foo\n' + s0.prototype.foo);
var ss= new sss();
alert( 'sss.foo\n' + ss.foo);
alert(sss.toString());
//ss.foo();
ss.prototype.foo();
};
test();








base is extended by sub, which is further extended by subsub. We create a new instance of this subsub and call the inherited method. simple.

Monday, July 20, 2009

Never argue with woman..

Never Argue with a Woman

One morning the husband returns after several hours
of fishing and decides to take a nap.
Although not familiar with the lake,
the wife decides to take the boat out.
She motors out a short distance,
anchors, and reads her book.


Along comes a Game Warden in his boat.
He pulls up alongside the woman and says,
'Good morning, Ma'am. What are you doing?'
'Reading a book,' she replies,
( thinking , 'Isn't that obvious ? ')



'You're in a
Restricted Fishing Area,' he informs her.



'I'm sorry, officer, but I'm not fishing. I'm reading'




'Yes, but you have all the equipment.
For all I know you could start at any moment.
I'll have to take you in and write you up.'



'For reading a book,' she replies
,

'You're in a Restricted Fishing Area,'
he informs her again,
'I'm sorry, officer, but I'm not fishing.
I'm reading'



'Yes, but you have all the equipment.
For all I know you could start at any moment.
I'll have to take you in and write you up.'



'If you do that,
I'll have to charge you with sexual assault ,'
says the woman.



'But I haven't even touched you,' says the game warden.



'That's true, but you have all the quipment.
For all I know you could start at any moment.'


'Have a nice day ma'am,' and he left.


MORAL :
Never argue with a woman who reads.
It's likely she can also think.

some images ....








Just for laughs

Woman inspires us to great things, and prevents us from achieving them.

"There's a way of transferring funds that is even faster than electronic banking. It's called marriage."

"I've had bad luck with both my wives. The first one left me, and the second one didn't."

Two secrets to keep your marriage brimming
1. Whenever you're wrong, admit it,
2. Whenever you're right, shut up.

The most effective way to remember your wife's birthday is to forget it once...

My wife and I were happy for twenty years. Then we met..

A good wife always forgives her husband when she's wrong.

First Guy (proudly): "My wife's an angel!"
Second Guy: "You're lucky, mine's still alive."

Wear the seat belt

Thursday, July 16, 2009

Thats MOM




WHEN I CAME DRENCHED IN THE RAIN…………………

BRO SAID : “ WHY DON’T YOU TAKE AN UMBRELLA WITH YOU?”

SISTER SAID:”WHY DIDN’T YOU WAIT TILL IT STOPPED”

DAD ANGRILIY SAID: “ONLY AFTER GETTING COLD YOU WILL REALISE”.

BUT MY MOM AS SHE WAS DRYING MY HAIR SAID”

“STUPID RAIN”


Tuesday, July 14, 2009

LockedHard Drive weight increasing?

heres a funny post my friend had just forwarded me... hope the author wanted to spread some smile and hence asked it.

http://social.answers.microsoft.com/Forums/en-US/vistahardware/thread/720108ee-0a9c-4090-b62d-bbd5cb1a7605

Monday, July 13, 2009

Art of dying....

q

Atom Bomb : An invention to end all inventions.



Boss : Someone who is early when you are late and late when you are early.



Cigarette : A pinch of tobacco rolled in paper with fire at one end and a fool on the other.


Etc. : A sign to make others believe that you know more than you actually do.



Experience : The name men give to their mistakes.

Opportunist : A person who starts taking a bath if he accidentally falls into a river.



Optimist : A person who while falling from Eiffel tower says midway "See I am not injured yet."
Smile : A curve that can set a lot of things straight.



Tears : The hydraulic force by which masculine will-power is defeated by feminine water power.

Q

Q

Don't take life too seriously; you'll never get out of it alive

Wednesday, July 8, 2009

Simple answers...

Sometimes, some of life's most difficult questions have a very simple
answers / solutions .........



Once upon a time a married couple celebrated their 25th marriage
anniversary. They had become famous in the city for not having a single
conflict in their period of 25 years. Local newspaper editors had
gathered at the occasion to find out the secret of their well known
"happy going marriage".

Editor: " Sir. It's amazingly unbelievable. How did you make this
possible? "
Husband recalling his old honeymoon days said: " We had been to Shimla
for honeymoon after marriage. Having selected the horse riding finally,
we both started the ride on different horses.

My horse was pretty okay but the horse on which my wife was riding
seemed to be a crazy one. On the way ahead, that horse jumped suddenly,
making my wife topple over. Recovering her position from the ground, she
patted the horse's back and said "This is your first time.". She again
climbed the horse and continued with the ride. After a while, it
happened again. This time she again kept calm and said "This is your
second time" and hopped back on the horse and continued riding. When the horse dropped her third time, she
silently took out the revolver from the purse and shot the horse dead !!


I shouted at my wife: "What did you do, you psycho. You killed the poor
animal. Are you crazy?"

She gave a silent look and said: "This is your first time!!!"

Husband: "Well, that's it. We are happy ever after."

Sunday, July 5, 2009

Suicide

Gratitude

THIS WOMAN IN THE VIDEO FOUND THIS LION INJURED IN
THE FOREST READY TO DIE. SHE TOOK THE LION WITH HER
AND NURSED THE LION BACK TO HEALTH. WHEN THE LION
WAS BETTER SHE MADE ARRANGEMENTS WITH A ZOO TO
TAKE THE LION AND GIVE IT A NEW AND HAPPY HOME.

THIS VIDEO WAS TAKEN WHEN THE WOMAN AFTER SOME TIME
WENT TO GO VISIT THE LION TO SEE HOW HE WAS DOING.


Bow and Arrow !!

What a pilot!

Saturday, June 27, 2009

Terracotta like implementation :: code

So this is what we thought:

The user object we remove all the field variable initializations and replace them with our custom code. So, the user says

this.list = new ArrayList(),

and during the byte code construction we will mke this equivalent to

this.list= new MyList().

Now the successive updates now happen over MYList which records the deltas.

So, say our object is UserAttributes::

public class UserAttributes implements Interceptable {

@LIST(3)
private ArrayList alias;

public List getAlias() {
return alias;
}

public void setAlias(ArrayList alias) {
this.alias = alias;
}

public static void main(String[] argv) {
UserAttributes u = new UserAttributes();
u.alias = new ArrayList();
System.out.println("alias::" + u.alias + " class:" + u.alias.getClass());
}
}


Now to replace the newArrayList() where ever possible we write a point cut as follows in InAspect.aj file

public aspect INAspect {

pointcut listCut(List value, LIST in) : set(@LIST * * ) && args(value) && @annotation(in);

@SuppressWarnings("unchecked")
void around(List value, LIST in) :listCut(value,in) {
System.out.println("**annotation " + thisJoinPoint + " ann:"
+ in.value());
value = new MyList(in.value());
value.add("val 1");
proceed(value, in);
}
}

Now the sop of the UserAttributes gives the out put as MyList class with one entry in it. Let me put few words abt the listCut.

  1. set(@LIST * * )&& @annotation(in) => cut all the modifying fields of the fields annotated with LIST annotation. Pickeup the annotation into in variable
  2. pointcut listCut(List value...args(value)=> picks up the modifying data as value variable. If u modify the value then it makes modification in the userAttributes class and thats what happens in the advice: around...
  3. proceed continues with the remaining point cuts (if any)


Terracotta like implementation

Terracotta, in one line, is the fast transport layer btw multiple JVMs. How is hte speed achieved? Simple he transfers the delta that happened in an object i.e.. if the object has changed one field variable then he transfers only that variable reather the entire object.

So we had an idea:
We need to transmit data from our Java servers to the Client where the end user plays his game and we thought why not take this terracotta apprach?

Aspect J:
here comes the here (as of now, to the knowledge we have till now). Now we want to manipulate the byte code that is generated by javac so that the new byte code now has new code which is intelligent enough to pickup the deltas between two consecuting updates of the object.

Aspect J

This is open source project and as any other open source it suffers in low documentation, So i thought i will put my work here so that it may help out somebody there trying to figure out the solutions.

Starting point:
  1. Aspect J site; get the eclipse plugin installed (2.0) Actually the plugin keeps u started off blackboxing the intricacies of compiling etc.
  2. Get the basic understanding of the technology jargon is here: https://www.ibm.com/developerworks/java/library/j-aspectj/
  3. in this link search for pointcut/ joinpoint/ advice and u are at their definitions
  4. Open eclipse and start experimenting.

Opensource

I worked using open source projects like:: Apache softwares, Java and proprietary software like Oracle etc; one ironical difference i see if you get issues: Oracle forums (leaving the pure db alone otherwise... say Oracle AQ/ Streams/ collab suite) especially are stale. A lot of times i had asked and nobody replies, the forum seems like making us a fools. Or at most one guy comes out asking us for the db details which version. I dont understand how these guys can be so irresponsible? We pay to them and they are so mean. Meta link is another such a place. I actually heard that they ask u too many un necessary qns and eat away weeks of time.

Sun Java forums are the best of all the things i had ever seen. Put a qn and within 1 hr u get the soln, unless its some R&D type of a qn. Apache forums u get within 1 day. So nice... we take their work for free still they server us good.