/ domm

I hack Perl for fun and
profit.

Atom Icom Follow me on Atom!
<<<<<<<<<<
06.05.2005: wedding-eve party
05.05.2005: linux audio
03.05.2005: school; party; cpants; work; perl workshop
28.04.2005: Delayed birthday present
27.04.2005: RT #12345
21.04.2005: Signs
20.04.2005: new server; HOP
06.04.2005: openguides; javascript

This morning after boxing I met with Maks to solve an annyoing bug in vienna.openguides.org. The problem was that German Umlaute where mangled (sometimes). With some help from Kake we at least knew where to start looking, and after copious use of

print STDERR "..."

we tracked the problem down to a call to HTML::Parser.

After some looking at manpages etc I updated to the newest version of HTML::Parser and ... problem solved! Yay!

Oh, and yesterday I had to face the horros of JavaScript. One project needed some form fields prefilled depending on a value selected in a select box. After figureing out the JS code necessary (

var land=document.seas.staat.options[document.seas.staat.selectedIndex].value;

, ouch) I worte a small script that generated the 50 lines of JS code necessary to have an pseudo associatve array. 50 lines of boring

Vorwahl["AT"]="+43 ";

Original: http://use.perl.org/~domm/journal/24038

Legacy comments

Juerd: arrays (orignal post)

All arrays in Javascript are associative. In fact, every object is an array and every array is an object. Methods are just array elements.



foo.bar and foo["bar"] are the same thing. foo.0 or foo[0] is also the same thing, if bar is foo's first element.



Consider: vorwahl = { NL: "+31", BE: "+32", US: "+1", ... };

kungfuftr: Re:arrays (orignal post)

var current = document.seas.staat.selectedIndex;

var select  = document.seas.staat.options;

var land    = select[current].value;

Surely this a a lot more simple that having some external way of doing things?

Juerd: Re:arrays (orignal post)

var staat = document.seas.staat;

var land = staat.options[staat.selectedIndex].value

Comments (via disqus)

01.04.2005: Austrian vs German ways of saying 'goodbye'
25.03.2005: CPANTS: author highscores
>>>>>>>>>>