Monday, June 30, 2008

Dependency Injection Containers Talk at SoCal Rock and Roll Code Camp

Thanks again to all of you who attended.  And to all of you who completed the evaluation forms.  I had a lot of fun doing the talk, and look forward to delivering improved versions of it in the future.

I've printed out my slides to a PDF and put it on the session's page on the code camp web site.  The sample code is also there now.  I've only included the first two samples, but they should be enough to get you started playing around with the Windsor Container if you're interested.

IMAG0084

I didn't include the third code sample.  As I mentioned it had some dependencies that I couldn't provide - on code developed in my workplace. 

But I hope to put something together to illustrate the points associated with that third, ill-fated, sample.  Expect to see something here on the blog. If you're interested and don't see anything, please feel free to nag.

IMAG0085

There are a few other resources I'd like to post - references to books and/or articles I mentioned in the talk.  Look for that by Tuesday morning.

If you want to pursue this topic further and are running into roadblocks and need a hand, please feel free to call or email me.  Or even post a comment on the blog.  I'll do what I can to help out.

Thanks again for attending the session.  I had a lot of fun.

Saturday, May 31, 2008

Professionalism, Programming, and Punditry and Success as a Metric

Scott Hanselman had a nice post in response to Jeff Atwood's post in response to Alastair Rankine's post "Blogging Horror". I don't feel the need to comment on Coding Horror beyond saying that I occasionally find some real jewels there. Good stuff for free.

But Scott's post struck a nerve. Here's some context.

I've been contemplating presenting at the local code camp for years now, but have never gotten around to actually doing it. I'd always figured that I should pick a topic on which I could speak with some authority. Makes sense I thought, but I was never able to pick one that moved me.

Localization is a nice, well circumscribed topic that I have engaged pretty thoroughly over the years. I have some hard earned experience, useful code and guidance borne of long hours. But I really find it difficult to care enough to put it all together into something that wouldn't risk being a waste of someone's time. So I've never done it.

The list of sessions for the code camp was posted a few weeks ago, and I'd been thinking that it would have been nice to see more and new sessions that addressed issues like SRP and OCP and Dependency Injection and other principles of good design. Maybe you've seen this coming, but I realized could do that session I wanted. Certainly then it would be on something that I actually cared about.

Of course the thing that's kept me from even considering it before is that I'm still learning, and still have a lot to learn. But I figured there's no reason that I can't do it based on my own struggles to make my code better.

I finally decided a week ago that I was actually going to do it. This past week's free time has been spent on reviewing literature, searching for good examples, and trying to make sure I've covered all the bases. I woke up at 4:30AM this morning and finally had the scenario for a good example. It was such a nice scenario that I couldn't get back to sleep.

So after I'd finished documenting my example this morning, it was really nice to see Scott's post about Jeff''s post about Alastair Rankine's post. Here's the best bit:
We're all just learning together. I started blogging so I could Google myself later, that's all. I taught as an adjunct professor so I could know the topics better as there is no better way to learn a thing deeply than to teach it. I worked on a few books so I could really dig deep, but I'm the first guy to say "dude, I have no idea." My brain bit-rots as yours does.
That is a nice bit of encouragement, isn't it?

Counting down four more weeks until the code camp and I don't even know if it is still open for submissions (hope so), but I'm going to do the work regardless of whether I can get in under the deadline. If I do it, you'll read about it here. But if I don't (and probably even if I do) it will all eventually find its way here.

We'll see what I can do . . .

Tuesday, November 15, 2005

Button Defaults in HTML

I'm going to forget this, so . . .

Managing the active or default button on web page is tricky, depending on what kind of button you are using. At least in IE.

Submit buttons (input type submit) don't give you any options. When your form gets focus, the first submit button gets the equivalent of a setActive(). You can try to call setActive() on subsequent submit buttons, but it doesn't make any difference.

This is a bummer if you've got a wizard interface, with Cancel, Back and Next all in a row at the bottom of your form. Note that System.Web.UI.WebControls.Button in ASP.NET renders to one of these buttons.

However, buttons rendered with the button tag are more forgiving. They haven't got any default behavior, but at least you can roll your own by monitoring keystrokes in keypress. To get my wizard controls buttons to function the way I want, I've created a System.Web.UI.WebControls.Button work-alike control which renders to a button tag instead of an input tag.

While we're at this, note that setActive() and focus() are two distinct methods, and accomplish different ends. I want my default button to be setActive() when I'm in any of the controls in my form, but the specific control I'm on has the focus.

Wednesday, October 26, 2005

Ellipsis in Internet Explorer

I forget this repeatedly - so here it is for future reference.

To get a string of indeterminent length to display inside a fixed width with ellipses indicating that it is longer, apply the following CSS styles:

overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

You'll also need to apply a width style. If you want your entire string to appear in a tool tip, put it into the title attribute of whatever element it is going into.

Wednesday, May 11, 2005

Gavin's Spring concert.

Friday, May 06, 2005

John witnessing to someone at the Taste of Mililani.