Wednesday, June 14, 2006

a dapper world

well now that dapper has gone final (aka Ubuntu version 6.06 has been released) I've installed it on my laptop. Unfortunately I've been too busy to test the beta's or 'flight' versions hat have been released during it development cycle so I have only myself to blame that I need to use the following work around to get suspend working (found on this blog entry):


One thing about sleep: vbetool needs to save and restore your video state in order to have working video on resume. Currently, on Macbooks this is broken. This is caused by a mistake: the vbesave init script comes before the acpi init script. This means that laptop-detect will report to vbesave that you are not on a laptop and vbesave will not save your vbestate. Matthew Garrett is working on a fix, but in the mean time a workaround is to edit /usr/sbin/laptop-detect and insert a line 'exit 0' right after the #!/bin/sh (always report that we're a laptop).


Not pretty, but since I'm pretty sure my laptop should infact be running inlaptop mode, I think its ok for now.

also to get my funky special acer keys to work (especially the little flashing "you've got mail" light) I needed to do the following:
$ sudo -s
# echo "acerhk" >> /etc/modules
# exit

Well, at least its supposed too. My keys work, but no flashing light yet...

[Update] Bah, dont know whta happened at first, but a reboot later and my you-have-mail blinken light is going strong once more.
Now I just need to figure out how to get my new rt2500 wifi card working with NetworkManager, but thats a story for another day...

Labels:

Friday, June 02, 2006

fight the future

According Javascripts creator (Brendan Eich) blog this is the future of JS:
http://developer.mozilla.org/presentations/xtech2006/javascript/

Well if thats the future JS, I'm buying a tardis and staying in the past.
I'm definitely in the camp that would like to have the current bugs fixed but have the core language left well alone.
To explain why I think this way, I should give some background:
I've been a Java programmer (mainly J2EE) for the last 6 odd years and its only recently (triggered by all the ajax hype and being sick of the huge bloated ediface that J2EE has become) that I've taken the time to learn Javascript and discovered what a wonderful little language it is. And I use "little" in a very positive sense, its one of the things that really attracted me to it, unlike much more complex languages like Java or even complex scripting languages (perl, python).
Infact I'm now so firmly on the JS bandwagon using it not only for browser client-side work, but also server side via the brillant Helma Webapp framework/server.
Having now done close to 5 months of solid JS server side development, including almost work on over a dozen small apps (2 already in production use) I really am appreciating the power of using a scripting language to do web development "in the small" as well as the simpliticity and yes, elegance of JS.
Now of course there is no reason why I can't just stick with the current javascript "1" for my server-side coding even if Mozilla and others push ahead with JS2, but one of the other big reasons I like using JS is that I now only need to use 1 language for both server and client side coding (with only the occasional drop into Java for a bugfix or using a 3rd party lib, since Helma is written in Java).
Now the above are all just personal reasons for leaving JS as is, but here is a more pragmatic one:
for good or bad, I belive a lot of JS's popularity comes from its small size and simplicity, its an easy language to learn and use, yet is still powerful and flexible enough to handle a amazing variety of tasks.
But its still a scripting language and as such it should not be used where its not the best solution - "programming in the large" is one such place scripting languages do not belong. For that is why we have Java and with Rhino we can have the best of both worlds, using each language for the tasks that suit it best. Making JS2 a 'a Java/Python lite" and trying to get it to work for programming in the large is just not going to work, what you will get is a new language which will no longer be suitable for the quick, simple programming "in the small" tasks that its used for now.
Of course I doubt this little rant and others like it will have any effect on stopping JS2, since it seems that its being strongly pushed by Brendan and alot of the big powers in the web browser world, but you never acheive anything without trying...

Labels:

Thursday, June 01, 2006

the little things

here's something I learnt the hard way a couple days ago and thought I'd better put it here so I don't forget it next time:
Javascript event handlers (eg. onclick) execute a whole block of javascript, not just necessarily 1 statement. This is easy to forget if all you are doing is calling a function (eg. verifyDelete()) and want to use the return value of the functions as return value of the event handler ( because if you give a event handler a return value of 'false' it won't execute the action it was called on - ie. a lcik on a link won't actually cause the browser to load that link).

Thus, this doesn't work:

<a href="delete" onclick="verifyDelete();"> Delete Me </a>

while this does:

<a href="delete" onclick="return verifyDelete();"> Delete Me </a>

Yes the return statement is important, since even though I'm doing just one function call in the onlcik handler definition, I could quite as easily have written 100 statements (seperated by semicolons) so without the return thres no way for the onlcik handler to know what the return value from my block of code is.

Labels: