|
This very dangerous for you, because such chiefs are running your company into trouble.
"Get Away while you can"
Greetings from Germany
|
|
|
|
|
Too true - but the comedy value of things going horrible wrong all the time is worth it
|
|
|
|
|
I know the "Mouse is starring at the snake" Story too much out of my own experience, so I made the princiole decision, if I am in such case I gotta do something. One option is ALWAYS "run away".
Greetings from Germany
|
|
|
|
|
you must work at my company... I'd laugh but it hurts too much. ((
|
|
|
|
|
Fun #1:
1. Go to any website (eg: Google Personalized HomePage)
2. Delete everything in the address bar
3. paste the following code in the address bar:
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300;
y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0;
i-DIL; i++){DIS=DI[ i ].style; DIS.position=’absolute’; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5;
DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval(’A()’,5); void(0);
4. Press enter and have fun!
Thanks to Grim.
Fun #2:
1. Go to Google Classic Homepage (*NOT Personalized Home.*))
2. Delete everything in the address bar
3. paste the following code in the address bar:
javascript:i=100;void(setInterval("i++;document.images[1].width=i",5),setInterval("i++;document.images[1].height=i",5),setInterval("i++;document.images[2].width=i",5),setInterval("i++;document.images[2].height=i",5),setInterval("i++;document.images[3].width=i",5),setInterval("i++;document.images[3].height=i",5),setInterval("i++;document.images[4].width=i",5)
,setInterval("i++;document.images[4].height=i",5) )
4. Press Enter
Thanks to Harpreet and Philip(Ye Maung).
Fun #3:
1. Launch Internet Explorer
2. Delete everything in the address bar
3. paste the following code in the address bar:
javascript:function flood(n) {if (self.moveBy) {for (i = 15; i > 0;i–){for
(j = n; j > 0; j–){self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0);
} } }}flood(6);{ var inp = "MIKE morf ,ecnavda ni RAEY WEN YPPAH ,iH"; var outp
= ""; for (i = 0; i <= inp.length; i++) {outp =inp.charAt (i) + outp ; }
alert(outp) ;}; reverse
4. Press Enter
Thanks to the author of this post.
Fun #4: last but not least
1. Launch Internet Explorer
2. Delete everything in the address bar
3. paste the following code in the address bar:
javascript:function reverse() { var inp = " )-: krow ru no yrrac ko.mih morf
nraeL .seod CNYS LEAHCIM ekil krow lufesu emos oD .esnesnon siht lla gniod rof
uoy gniyap ton si ynapmoC"; var outp = ""; for (i = 0; i <= inp.length; i++) {
outp = inp.charAt (i) + outp ; } alert(outp) ;}; reverse()
4. Press Enter
Source Download : [Funny] Playing with Javascript
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Well none of these did anything in either IE or FireFox, what was I supposed to see?
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
|
I tried them all in all browsers and nothing happens
"Well yes, it is an Integer, but it's a metrosexual Integer. For all we know, under all that hair gel it could be a Boolean."
Tom Welch
|
|
|
|
|
Have you downloaded the txt file? If you haven't, please download the txt file.
You can check the comments in that post. The script works for those commenter when they download the txt file. I think that copying code from post make some problems.
It should work on either firefox or IE6/7.
Please try again. Hope it works.
|
|
|
|
|
Turn on firebug and you will see it's doing a lot... errors.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
I'm sorry, but how does this fit into the Coding Horrors section? Have you encountered these items in development/production? They just seem to be "amusing" things to do with JavaScript.
|
|
|
|
|
I think it's clear that Michael Sync is a Coding Horror!
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
|
>>I think it's clear that Michael Sync is a Coding Horror!
>>Turn on firebug and you will see it's doing a lot... errors.
this is code horror..
|
|
|
|
|
yep very true
Regards,
Sylvester G
|
|
|
|
|
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
First one:
R=0;
x1=.1;
y1=.05;
x2=.25;
y2=.24;
x3=1.6;
y3=.24;
x4=300;
y4=200;
x5=300;
y5=200;
DI=document.images;
DIL=DI.length;
function A() {
for(i=0; i-DIL; i++) {
DIS = DI[ i ].style;
DIS.position="absolute";
DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5;
DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5
}
R++
}
setInterval("A()",5);
void(0);
It gave errors on DIS.position=’absolute’ and setInterval(’A()’,5)
Because ’ != '
|
|
|
|
|
nothing happened... what are we supposed to see?
|
|
|
|
|
Programming wth threads is not easy as many newbies think. A few years back my company was downsized and I had to take ownership of some code written by another programmer. The first thing I had to fix was some resource leaks when a given task was canceled. The task itself happened on a worker thread. The UI thread had a cacel button to cancel the task.
After examining the code, I found the following:
void CTaskProgessDialog::OnCancel()
{
TerminateThread(m_pWorkThread->m_hHandle);
}
void CWorkerThread::DoTask()
{
AcquireResources();
ReleaseResources();
}
|
|
|
|
|
That's a "double horror" - using TerminateThread, and not using RAII for handling resources (admitedly, it wouldn't help in this case, since TerminateThread does not unwind the stack).
I have learned some Erlang[^] recently, and it really made me re-think the way I write multithreaded code.
|
|
|
|
|
As mentioned the termination of a thread should be internal, not with a Terminate command. Set a flag and wait for self-termination. You never know if a thread has a socket or file open, or any other resources. You can't simply say, no thread can ever aquire resources, and with multi-core and multi-processor allowing two simultaneous operations, it is even more difficult to judge if a terminate signal will work without memory leak even with back-to-back aquire()/release() because the terminate can occur in the middle of aquiring, before releasing, or in the middle of releasing. Terminates should all be handled gracefully from inside. The "code that does something" needs to check for a terminate early flag and release resources (if any) and go on. Simply putting aquire/release back to back will not save you. This is a common failure even with experts on threading thinking that back-to-back operations will not be interrupted. It's all a roll of the dice, back to back operations may make you think everything is okay because chances are reduced, but eventually it will show up as a problem, and then it will be difficult to repeat it for debugging.
remember the core premise of threading: thou shalt not commit murder, all threads should be directed to suicide.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Sure!
I can't believe how many programmers (even experienced ones) don't know this.
|
|
|
|
|
"thou shalt not commit murder, all threads should be directed to suicide"
Nice.
Need Another Seven Acronyms... Confused? You will be...
|
|
|
|
|
Well - just got this code into review (this is the pseudocode version of a 2000 line routine - a coding WTF in its own right):
1. Begin Transaction
2. Update Table 1 with a single value
3. Update Table 1 with another value - to the same row as step 2.
4. Pop up message box to ask user to ring somebody to confirm that it is OK to continue.
5. Update Table 2
6. Commit Transaction The best bit is that the person who coded this, (supposedly an experienced developer), couldn't see that step 4a. User goes out for lunch, means that the transaction could effectively run for an hour or so.
|
|
|
|
|
Pete O`Hanlon wrote: Pop up message box to ask user to ring somebody to confirm that it is OK to continue.
Ohhh .....Thats what called User confirmation .....I thought something different....
Regards,
Sylvester G
|
|
|
|