Youth culture killed my dog 12 to 16 of 22 articles Change bannerposts rsscomments rss

Greatest API design evar   02 Sep 04
[print link all ]

<pre> <steveny> Never do this: <steveny> Calendar calendar = Calendar.getInstance(Locale.US); <steveny> calendar.set(Calendar.MONTH, month); <steveny> calendar.set(Calendar.YEAR, year); <steveny> if it is the 31st now (the calendar.getInstance() returns the current time) <steveny> setting the month to a month with < 31 days <steveny> will cause the calendar be set to the 1st of the next month <darrend> niiiice <steveny> yep <richier> greatest API design evAR <steveny> so never do that ;) </pre>


XMLHttpRequest is your buddy   14 Aug 04
[print link all ]

I’ve added an autocomplete feature to liveUpdater.js that I’ve been harping on lately. The javascript is a bit more involved now, but I don’t think the Borges side of things has lost any of it’s charm.

  r.text_input_with_autocomplete(proc {}) do |text|
    if text.length > 0
      `grep -m 40 -i \"^#{text}\" /usr/share/dict/words`.split

I’ve set up a demo for your autocompleting pleasure. It seems to work ok on IE6 and Mozilla 1.7.2, but I’m sure it needs some work for other browsers. I would appreciate any patches that improve support for other browsers, fix bugs, or just clean up the javascript in general (I’m not quite a master of that language).


Borges gets DHTML   28 Jul 04
[print link all ]
Well, it’s a little bit late, but here it is: live_update.rb.

I think the client code ends up looking very nice.

        r.text_input_with_callback(proc {}) do |r2, text|
        if text.length > 1
            r2.div_named 'bar', `grep -i \"^#{text}\" /usr/share/dict/words`.gsub("\n", "<br/>")

You can see it in action here. I’ll post the code to the Borges mailing list, but it seems pretty dead lately.

I think this idea can pushed much further. I’ll get back to you with anything else I come up with on this front, but you have to promise to do the same.


Seaside gets DHTML   24 Jul 04
[print link all ]
I knew that things like autocomplete on text fields were possible, but I thought they would be clunky in practice. Even after seeing gmail in action I still didn’t get it. Well, I get it now. Try typing some things in the "Live Search" box on the right side of this page.

And now it comes to Seaside:

        What this means, effectively, is that invoking this handler makes a
        request in the background, which the webserver can respond to by
        returning a new version of any part of the current page that it likes.
        That part of the page gets swapped out seamlessly for the new version.
        The thing I like about this is that it gives all the power to the server
        side: only after having processed the request does the decision have to
        be made about what parts of the page are affected and need to be
        redrawn, and those parts can be sent back to the client.

So now I would like to get this going in Borges. If I don’t have something posted by Monday, call me out on it.


Nice quote   24 Jul 04
[print link all ]
        Methodologies do not succeed because they are aligned with some platonic
        Right Way to build software. Methodologies succeed because people make
        them succeed.


Copyright © 2017 Leslie A. Hensley