Friday, February 1, 2008

js: fun() alias to function()

I was trying to persuade on several forums and irc channels to be able to use in javascript
fun() as alias of function().
Especially with today ajax world and using function() all over the place I think it will make things much more readable and also easy to type and format.
Think about all those event handlers, closures, callbacks... I think it make sense !

Thursday, January 24, 2008

Weird programming errors..

I was playing with ExtJS (extjs.com) and was getting very weird error.
(Very nice framework by the way).
I wasn't able to .show() a dialog box, even that I clearly could see that the object was created.
What was my surprise that when I changed my HTML code from :

<body>
..... tags...
<div id="dlg" />
</body>

to this :

<body>
<div id="dlg" />
..... tags...
</body>

everything worked fine !!! As I understood later I don't need to provide the element for every component I use i.e. I can just instantiate it. Which is even better..

....

As we are on weird errors, here the "the" error of all times. May be you wont believe me but it is a true.
So couple of months ago I brought a laptop, so I decided to move my dev environment from my other machine to the laptop, so far so good.
Everything seemed OK. What I had was Mason(masonhq.com)/mod_perl 1.23! (afaik) and apache 2.2.8.
So what was the problem ? When I had the word "the" somewhere in perl code comment or in the HTML part of a page I got the result back as "text/plain", instead beign "text/html" no matter what I do.
The consequence of this was that I got the page as you normally see it in "View/Page source", instead of page being rendered !!!
Changes to apache config didn't work, setting the header manually inside the script and anything else I tried .. nope, zip, nada...nothing helped.

So let me repeat if I used the word "the" i got this problem (i still received the correct HTML data i.e. the script was parsed by Mason/mod_perl environment).
If for example I changed "the" to "th e" or "xthe" or even " 'the' " everything was OK.
I still don't know what caused the problem ;(, didn't have enough patience.
What I did was to downgrade to apache2.0 and everything ran fine..

so that is for now ;)

First post

As so many ppl around the world, I decided to start blogging too... let see what will happen ;)