Monday, February 28, 2005

I've been toying with ECMAScript for the past week or so, mostly to update some dynamic user interface elements in a web application we have.  Every time I use it, I'm always impressed at the cool things I can do with it.  It also makes me wish that Microsoft had not messed with it as part of the CLR (JScript.NET).  Their newest version of JScript seems to merely make it into an alternate syntax, and not really take advantage of what it could do as a prototype-driven language with closure support.

I found this article that claims that it is the world's most misunderstood language.  I think I agree.  It's incredibly powerful, but very underutilized because of the confusion surrounding it.  Closures coupled with prototypes can yield some very slick code if you understand what you're doing (and I guess maybe that's the problem).  All you really need is a nice IDE to help you manage your objects and their prototype chain.

I'm also getting more into Python and Ruby, which are also very slick.  I'm just not sure how they should fit into a project.  In general, a project with fewer languages is more maintainable.  But imagine trying to build a skyscraper when your only tool is a hammer that works really well. (OK, maybe hammer is not the best analogy.  Maybe a blowtorch?  I don't know)

[UPDATE] I just had to include this link, where the author shows us how to do lot of different code reuse patterns, including multiple inheritance in Javascript.  My favorite quote:

This large set of code reuse patterns comes from a language which is considered smaller and simpler than Java

posted on Monday, February 28, 2005 10:56:23 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Sunday, February 27, 2005

I've been playing with the Flickr API alot, experimenting with some different things that I have planned for the future.  One of the things I'd like to do is to create context sensitive image collages on the fly for my blog entries.  Thought I'd show you this cool example from a first-pass collage creator.

collage creator.jpg

Of course most collages wouldn't have this many pictures, but I thought it was cool.  I need to do some randomizing.  I'm filling from the upper left corner in diagonals for reasons you'll see when I get it working the way I want.

I've also been playing with some client-side Flickr stuff using XmlHTTPRequest to dynamically load images for a slide show type thing like MSN spaces has.  I might upload an example of that later.

posted on Sunday, February 27, 2005 6:46:19 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Friday, February 18, 2005

I just got back from Brad's talk at the Austin .NET User's Group meeting.  It was my first meeting, and I felt a little bad about not being a more active part of the local community.  It was a solid, interesting talk, even though I was pretty familiar with both topics (exceptions and memory management).  I managed to ask an intelligent question about a change in Whidbey regarding unhandled exceptions on all threads terminating the app rather than on the main thread only.  My question was on the ThreadAbortException, which seemed like a monkey wrench in that plan.  Turns out that there's nothing to worry about there as that exception is already pretty special.

Despite the great technical content, these were my favorite quotes (emailed to myself via my mobile so I wouldn't forget them:

  • Everyone should be using ... using (referring to C#'s using blocks)
  • It's like feeding peanut butter to a dog (referring to using some of the new GC (garbage collector) methods to help in memory management.)

I'm always really impressed with the CLR team's desire to do the right thing with the framework and to help developers do the right thing. Thanks for adding Austin to your "world tour", Brad. BTW, the slide template seemed like the right choice to me.

posted on Friday, February 18, 2005 6:35:46 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Thursday, February 17, 2005

Since my last rant about vending machine prices, they've raised the price to 70 cents for 12 oz. cans here at work.  Ridiculous.  I only wish I knew who "they" was so I could complain.

posted on Thursday, February 17, 2005 10:34:23 AM (Pacific Standard Time, UTC-08:00)  #    Comments [3]
 Tuesday, February 15, 2005
Turns out, my problem with metadata in my pictures was I didn't have the latest RAW support installed.  This was evidently something that Adobe fixed.  Oh well, at least I learned alot about XMP and got more of the Flickr API implemented.  I'll have to come up with a strategy for replacing 1GB of pictures.  I also want to add a few more steps in my processing.  Alot of the pictures turned out a little dull.  I think I won't be in such a hurry to get them uploaded in the future.
posted on Tuesday, February 15, 2005 8:15:06 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Saturday, February 12, 2005

Whew, what an ordeal.  I finally got my Adobe Photoshop CS in the other day, and last night, I created a "Droplet" for batch converting all my raw files from my Canon Digital Rebel. Droplets are a really sweet feature that lets you create a little executable from recorded actions for batch operations.  So, I burned through about 2000 images, creating big jpgs suitable for uploading to my newly upgraded Flickr account.  It was getting pretty late, so I fired up an uploader an set it to upload my 1GB limit (roughly 900 pictures).

This morning, I checked my account, only to find that none of the metadata had been uploaded.  All my images appeared to have been taken on Feb 11, 2005...uh oh.  So, I set out to find out what happened.  Turns out, Photoshop saves the metadata in it's XMP format within the file. XMP is simply an rdf encoding of the data in an XML payload within the file.  It's actually pretty cool, but Flickr doesn't read this data yet.  So I set out to "fix" my pictures, since I can't upload anymore until next month and I have lots more to upload.

After looking at lots of libraries and Adobe's XMP SDK, I decided it would be easy enough to pull the data out myself.  So, I built a little app using my FlickrApi library I just created that would blast through my uploaded pictures, find the corresponding image on my local pc, pull the xmp data out of the file, and set the "date taken" on the Flickr site.  That way, I can at least organize them more easily.

It worked perfectly.  It blasted through about 900MB in less than a minute.  Look for the pictures as I tag them, annotate them, and change them from private to public.  I'll have to see if there's a way to have Photoshop preserve that data next time because I'd really like to have the rest of the metadata available.  I'll probably make my XMP parser available as well if anyone's interested.  As far as I know, there is not another managed implementation available.

posted on Saturday, February 12, 2005 2:59:33 PM (Pacific Standard Time, UTC-08:00)  #    Comments [5]
 Friday, February 11, 2005

Last night, I made alot of progress creating a .NET API for Flickr.  There doesn't seem to be alot of activity on the Flickr.NET project, and I don't like some of the decisions they made in the design.  They seem to have taken a direct wrapping approach to it rather than designing an API that fits in the .NET world.  It's amazing how spoiled you get when you're used to using good API's.  You start saying things like, "You mean I get an array back from this method?  Eww."  or "That's a silly name for that member."  Of course, it's probably appropriate to note that Flickr.NET seems to have been created with an emphasis on uploading.  I'm more interested in sifting through the metadata.

Anyway, I've got most of the functionality that I'm interested in implemented, and I'll be doing the rest a little at a time.  I've used the design guidelines fairly strictly, and I think I'm coming up with something that's really approachable for .NET users, and is still correlated enough to the Flickr API documentation that the parallels are easily discoverable.  You may notice some bizarreness here as I play with the different kinds of integration I have planned for my blog.

posted on Friday, February 11, 2005 7:36:12 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
Our church is doing a new pictorial directory this year, and last night was our night to go up and get our pictures taken.  I usually dread those events because they want to take alot of pictures and then pressure you into buying them.  This, however, was the best experience I have ever had.  We filled out a paper that let us define what we were interested in, and the photographer used that to determine what kind of pictures to take.  I indicated we weren't interested in any, so he took a total of 6 pictures.  We picked one for the directory, and we were done.  Our appointment was at 9:00pm.  We got there a little early, and were back in the car at 9:05.
posted on Friday, February 11, 2005 7:14:31 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Thursday, February 10, 2005

I typically use the well-done MSN Web Messenger at work to avoid firewall issues, and to avoid stomping on our company's branded version of messenger (which sucks BTW).  When attempted this morning, I got the following message:

We can't sign any more people in right now. Please try signing in again later.

I wonder if it's just a web messenger problem or MSN messenger in general.

[UPDATE] Now I'm getting the ASP.NET "Server Too busy" exception, so I'm betting it's a web messenger only thing.

posted on Thursday, February 10, 2005 7:17:30 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Wednesday, February 09, 2005

This is one of the coolest things I've seen in a long time.  Try my flickr name (marklio).  It lets you drill through my contacts and see their information.  Keeping clicking and you'll see all kinds of cool things.  It really helped me see Flickr as a web service rather than just a photo sharing site.  It gave me alot of ideas.  Things like using tag matching to automatically creating blog entry backgrounds that are relevant to the content.  I'm going to be playing with that.

Their API is really nice and well-documented.  Some people made a .NET wrapper for the API, but it's not up-to-date and I wasn't really impressed with the design.  I'll probably roll my own and just implement the things I need as I go.

 

posted on Wednesday, February 09, 2005 8:52:26 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Tuesday, February 08, 2005

In an earlier post, I mentioned that I wished HttpModules were more scriptable in ASP.NET.  You can easily create Controls, Pages, HttpHandlers, and web services all without having to compile anything, but as far as I know HttpModules have to be compiled and registered in the web.config in order to start working.

So, I created a ScriptableHttpModule.  You register it in the config the same as a regular module, but it allows you to create .asmodx files that are compiled and called just like regular modules and give you the same kind of dynamic compilation model as the other .asXx files.  I'm still tweaking it a bit, but it looks pretty promising.

posted on Tuesday, February 08, 2005 6:39:29 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]

marklio.com, as well as my dad's site bellcountyblogger.com, is now being served from a real server!  I just made the switch a little earlier today to a hosting company.  I've been really impressed with them so far.  The transition was absolutely seamless, although I am still hammering out some email details that were not available before.  I'm discontinuing the gallery in favor of hosting all my images on Flickr.  That way all those images won't take a bit out of my bandwidth (although I have plenty).  Hopefully that will provide a better experience for everyone, especially once they integrate photo printing.  My redirector will continue redirecting the old dnsalias addresses.  Hopefully those will all get cleaned up before my port 80 gets blocked. Up until now, I've been relying on the business class cable modem service provided by my employer, but they're discontinuing that soon and the standard package blocks port 80.

posted on Tuesday, February 08, 2005 6:30:30 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]