15 May 2008

Connect winxp lappy to kubuntu using samba

I want transfer files from my lappy to my kubuntu desktop FAST. I managed make my lappy talk to kubuntu via ssh (winscp), but not fast enough. Yeah, I know it caused by encrypt, bla bla ... I'm the only one who use LAN in my home, so who cares about security???

Anyway, since new to setup samba, I thought it just matter click Next, Next, ... and so on. Not that easy maa. After setup it in kubuntu, whenever I submit uname/passwd from windows xp, it keep popup the uname/passwd, without error msg. Spend hours RTFM, google , read article, ... then, manage to fix it. When troubleshoot, I reach to the:

C:\> net view \\bigboy
System error 5 has occurred.

Access is denied.


Then, it easier to fix when know cause of the problem. Just enable the 'encrypt password = yes'. I also added the samba user by smbpasswd

11 May 2008

Why I hate innerHTML

Why I hate innerHTML? Because IE suck! It doesn't work for select tag in IE. I have something like

<div>
<select id="foo"><option value="1">baz</option></select>
</div>


Javascript that doesn't work in IE:
document.getElementById("foo").innerHTML = '<option value="2">baz</option>';


Solution -- have to use DOM lah! Note that use innerHTML will destroy the tag events. My prefered solution:


document.getElementById("foo").options[0] = new Option("baz", 2);


Astute reader may ask, why not use dom method add() ? Again, because IE suck!


var x=document.getElementById("foo");
try
{
x.add(y,null); // standards compliant
}
catch(ex)
{
x.add(y); // IE only
}

http://www.w3schools.com/htmldom/met_select_add.asp

More love/hate on innerHTMl, http://www.wait-till-i.com/2006/04/18/innerhtml-vs-dom-pot-noodles-vs-real-cooking/