Delete an un-deletable file !

October 24th, 2007

I was pestered by this stupid windows error that it cannot delete a file because it was being used ! I made sure that none of the applications.. are accessing it. But there must be some code written by M$ guys which made sure that the file was locked.

Cannot delete Filename. Access is denied. The source file may be in use.

I resolved it after a peek >>Here<< .

This file was a normal video file, and the only reason windows would access it is to create a thumbnail. But this video file additionally is corrupt which adds to the problem. So there definitely is a bug in Windows thumbnail creation software, which “keeps-on-trying” to create a thumbnail thereby keeping a lock on this file.. And hence the problem.

If any M$ guy has access to the source.. Let me know if i cornered the bug !..

Author: Categories: Swaroop's Blogs Tags:

Fire Fox – Bug or feature ?

October 22nd, 2007

Was working on a very simple form and found out that Firefox behaves differently in case of Form Reset.

The problem is, Firefox is unable to reset “hidden” inputs in the form, Internet explorer on the other hand clears out all the variables of the form. A simple code to check the same is below..

<script>
function someFunction() {
document.getElementById(‘hid’).value = “Hiding”;
document.getElementById(‘vis’).value = “Visible”;
}
</script>

<form name=”one” id=”one”>

<input type=”hidden” id=”hid” name=”hid” value=”">
<input type=”text” id=”vis” name=”vis” value=”">

<input type=”button” value=”click” onclick=”someFunction()”>
<input type=”reset” value=”Reset form”>
<input type=”button” value=”What is in Hidden Field?” onClick=”alert(document.getElementById(‘hid’).value)”>
</form>

If you want to have a look at this working example. Open >>this<< in both the browsers.

These are tested in Firefox 2.0.0.8 and IE 6.0

Ofcourse, there are other “bug-or-feature-god-knows” such as after an F5, the hidden values still retain values.. A Strong Reload (CTRL-F5) should be done.. More details here.

Author: Categories: Swaroop's Blogs Tags:

Javascript Multiple Tabs – Add Tabs dynamically

October 16th, 2007

Was in need for such a code but only found scripts and pages from Google with static usage. I am sure there must be source samples for adding tabs dynamically when required, but just didn’t find any at this point of time.. So here is my source sample for that..

So i m using existing tab logic from Tab Content Script v2.0. and with the help of this tutorial to add/remove html elements dynamically. The code is as follows

<head>
<link rel=”stylesheet” type=”text/css” href=”tabcontent.css” />
<script type=”text/javascript” src=”tabcontent.js”>
/***********************************************
* Tab Content script v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
</head>
<input type=”hidden” name=”noTabs” id=”noTabs” value=”4″>
<h3>Demo #1- Basic implementation</h3>
<ul id=”countrytabs” class=”shadetabs”>
<li><a href=”#” rel=”country1″ class=”selected”>Tab 1</a></li>
<li><a href=”#” rel=”country2″>Tab 2</a></li>
<li><a href=”#” rel=”country3″>Tab 3</a></li>
<li><a href=”#” rel=”country4″>Tab 4</a></li>
</ul>
<div id=”parent” name=”parent” style=”border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px”>
<input type=”hidden” name=”noTabs” id=”noTabs” value=”4″>
<div id=”country1″ class=”tabcontent”>
Tab content 1 here<br />Tab content 1 here<br /></div>
<div id=”country2″ class=”tabcontent”>
Tab content 2 here<br />Tab content 2 here<br /></div>
<div id=”country3″ class=”tabcontent”>
Tab content 3 here<br />Tab content 3 here<br /></div>
<div id=”country4″ class=”tabcontent”>
Tab content 4 here<br />Tab content 4 here<br /></div></div>
<script type=”text/javascript”>
var countries=new ddtabcontent(“countrytabs”)
countries.setpersist(true)
countries.setselectedClassTarget(“link”) //”link” or “linkparent”
countries.init()

function addTab() {
var numi = document.getElementById(‘noTabs’);
var num = (document.getElementById(‘noTabs’).value -1)+ 2;
numi.value = num;
// first add to list
var ti = document.getElementById(‘countrytabs’);
var newLi = document.createElement(‘li’);
newLi.innerHTML = ‘<a href=”#” rel=”country’+num+’”>Tab ‘+num+’</a>’
ti.appendChild(newLi);
// then add the content.
var ni = document.getElementById(‘parent’);
var newdiv = document.createElement(‘div’);
var divIdName = ‘country’+num;
newdiv.setAttribute(‘id’,divIdName);
newdiv.setAttribute(‘class’,'tabcontent’);
newdiv.innerHTML = ‘dynamically added’;
ni.appendChild(newdiv);
countries.init();
}

</script>
<p><b><a href=”javascript: countries.expandit(3)”>Click here to select last tab</a></b></p>
<hr />

<a href=”javascript:addTab()”>Add More Tabs</a>

———————

Hope this helps ppl who r in need of this feature..

Update: will upload an example as requested !

———————

Author: Categories: Swaroop's Blogs Tags:

Banta and his beer…

October 5th, 2007

Banta walks into a bar for a bar and takes a seat. However, just as the bartender put the beer on the bar, there was a loud disturbance outside. Hey ran out to see what was going on but soon went back to drink his beer.

When he got back he found his glass empty and a note saying: “Thanks for the beer!”

Banta was a little ticked-off but ordered another beer anyway. Again, just as the bartender put the beer down a loud crash was heard in the street. Thinking that someone ran into his parked car, Banta runs outside to check on things. Seeing that his car was okay he returned to the bar and again found his glass empty and another note that said: “Thanks again, this was as good as the first one.”

Well he still hadn’t had a beer to quench his thirst, so he ordered another. Just as the bartender put the beer down, a series of shots were heard outside. This time Banta wasn’t going to lose his beer to anybody. So he spit into the beer and left a note saying, “Enjoy, I just spit into the beer.” He then ran outside to see what had happened.

When Banta returned he was delighted to find that his beer was just where he left it.

However this time the note said: “You enjoy, I spit in it too!”

Author: Categories: Swaroop's Blogs Tags:

Hare Krishna

September 18th, 2007

हरे कृष्ण हरे कृष्ण,
कृष्ण कृष्ण हरे हरे,
हरे रामा, हरे रामा,
रामा रामा, हरे हरे

इसके बारे में अधिक जानकारी केलिए जाये याहापर

Author: Categories: Swaroop's Blogs Tags:

The Arrival of the New Monitor

September 14th, 2007

Its been sometime, that i’ve got a new monitor.. Forgot to talk about it.. I felt like writing about it because there were not many reviews about this model “ViewSonic vx1932wm“.

The Pros

  • This has a 19″ Wide Screen with 1440×900 resolution
  • Has a 2ms Response Time gray to gray.. Suitable for Gaming – I’ve played CS v1.6 on this till now.. Looks more than fine.
  • The Monitor setup was pretty much simple, just had to install drivers and had to change the resolution. (its the same case with any other monitor.. yet to check if this is fine with Linux as well).
  • The Contrast ratio is kool as well.

& The Cons

  • This LCD is viewable only in a straight angle, so all the people wishing to watch something on the screen better sit in front of the monitor.. Side viewing is almost impossible.
  • Has built speakers which are hardly useful for me, i already own a Creative 4.1 Sound Blaster. I wish there was something else instead of this.. May be the iPod dock provided in 1945wm.

Anyway, next stop – A DVD Writer… !

Author: Categories: Swaroop's Blogs Tags:

Electrified !

August 31st, 2007

You r looking at the Visual – Lightning hits a plane in mid-air !

Imagine… What would be the passenger’s condition like if it really conducts the amount of electricity

This image is hot linked and the original source is Forever Geek

Author: Categories: Swaroop's Blogs Tags:

Terrorism and its relatedness !

July 10th, 2007

Just going through one of the News posts at Rediff.com and found out that Musharaff, the Pakistan President has quite a close relatedness with AlQaeda…

Look what Rediff image search shows for a search of “al qaeda”.

Its either Mush having close ties with the Terrorist organization or is it the problem with Rediff Image search contexting algorithm.. !

Author: Categories: Swaroop's Blogs Tags:

Migrating…

July 5th, 2007

Just a recap of the activities in the past 1 week.

  • Taken back my resignation.
  • Got Blacklisted for some misunderstanding by my Dream company.
  • Going to Hyderabad on this Friday, 06th July 2007.

Hyderabad Charminar

Here i come.. !

Author: Categories: Swaroop's Blogs Tags:

Sushmit’s Marriage

June 23rd, 2007

Mark your calendars…21st July was Sushmit’s Marriage Day.. Wish him at his Orkut Profile.

Follow the link on the photo below to visit more photos.

Sushmit and Pooja got Wed

Author: Categories: Swaroop's Blogs Tags: