Youth culture killed my dog 11 to 15 of 22 articles Change bannerposts rsscomments rss

ImageMagick rules the Gimp   05 Sep 04
[print link all ]

I’ve always been jealous of graphic artists. They juggle dozens of layers and composite images with ease with their fancy photoshops and gimps. I’ve tried several times to do some simple tasks with the Gimp and was defeated in each case. So I’ve found myself going hat in hand to the “graphics guy” (no slight intended to the ladies; I’ve just never worked with a female graphic artist) for even the simplest of buttons and on personal projects I’ve just had to do without.

I’ve used ImageMagick occasionally over the years for converting between formats and checking image sizes. I recently stumbled on this great set of examples by Anthony Thyssen of using ImageMagick for complex multi-step manipulations. When you add in a terrific set of Ruby bindings, the result is graphical independence for people such as myself.

While I’ve still got a long way to go before I master these new techniques, I have used them to generate a banner for this page and a few buttons for a work project. Here’s the source of my banner generating script and you can try it out by clicking the Change banner link at the top of the page. Expect the banner to become ever more decedent as I add tricks to my tool box.


|

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
    end
  end

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/>")
                end
        end

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.

www.cincomsmalltalk.com/userblogs/avi/blogView?showComments=true&entry=3268075684

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.


|

 

Copyright © 2024 Leslie A. Hensley