Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Aristotle (5147)

Aristotle
  pagaltzis@gmx.de
http://plasmasturm.org/

Blah blah blah blah blah [technorati.com]

Journal of Aristotle (5147)

Thursday August 10, 2006
03:30 AM

Honorary mention for the Daily WTF Awards

[ #30584 ]

Y’all know about the The Coral Content Distribution Network, right? If you don’t, and you’re putting large files online, you should: it’s a free edge network. (Like Akamai – you’ve heard of them, right? They’re the reason Google always loads fast.) Only you don’t need to pay up big bucks and then set up stuff on the server end, like with Akamai: you just stick .nyud.net:8090 at the end of the hostname part of any HTTP URI. When someone accesses that URI the first time, the Coral network picks up a copy from the original server and caches it. As long as the file is in cache, anyone who asks for it gets his copy from a nearby Coral node, whose bandwidth generally dwarfs the original server’s. It’s a very cool project and service.

It’s so much cooler than their homepage HTML.

See, they have this little form on the page, for people who don’t understand technobabble and all that crazy talk about “hostnames” – just put the URI in the text box and it sends you to a CoralCDN-served version of the URI. That is nice.

Much unlike the HTML:

<center>
   <input type=text size=14 id="theurl"
          value="www.cnn.com" onKeyPress="return isEnter (this, event)">
   <input type=button name="go" value="Go"
    onClick="window.open (coralize (document.getElementById ('theurl').value))">
</center>

Ah well. They skipped the redirector script on the server, and just use the Javascript string functions to inject the .nyud.net:8090 part at the right place of the user’s input and then set window.location. Right?

Right?

<script type="text/javascript">
function coralize (urlField)
{
  var hdr   = "http://redirect.nyud.net:8090/?url=";
  var total = hdr.concat(urlField);
  return new String (total);
}
function isEnter (urlform, key)
{
  var keycode;
  if (window.event)
    keycode = window.event.keyCode;
  else if (key)
    keycode = key.which;
  else
    return true;
  if (keycode == 13)
    window.open(coralize(urlform.value))
  return true;
}
</script>

Err, right.

Someone tell me what would have been wrong with this:

<form action="http://redirect.nyud.net:8090/" method="get">
<center>
   <input name=url type=text size=14 value="www.cnn.com">
   <input type=submit value="Go">
   <!-- look ma, no Javascript! -->
</center>
</form>

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I guess that confirms the old adage that for any simple, straightforward problem exists an equally Byzantinely circonvoluted solution.

    (although I guess that in these days and age of AJAX, our Rude Golberg-wannabe could have done much, much worse...)
    • Speaking of which, the-place-i-work-for quite possibly be using Yahoo UI (or,
      similar) -- collection of JavaScript code, uses anonymous functions to pretend
      class-y -- just to have expanding menus based on mouse movement. That does not
      faze the head developer as, paraphrased here, all the code would be only be some
      80-100 kB and would be cached for a week; further, the appearance of JavaScript
      code used as OO-like trumps the previous objection in any case.

      Ok, I can discount the last reason as OOP seems to be *S
      --
      - parv