Tuesday, June 22, 2004

A Thinner Outlook

I was married 18 months yesterday (I love you babe!) and that, combined with a love of food, has increased my girth (okay, in reality, it started before we got married but I enjoy the excuse anyway). I play softball on my church softball league but only during the summer and finding time to workout seems hopeless. At this weight, I'm not going to run off the weight. When I was in college I lost around 40 pounds on the Atkins diet. I've put about 25 back on and it's time to regroup. I've tried Atkins a few times since putting on a few pounds, but to no avail. I've known some people whom have used the Weight Watcher Point system diet with success. So I'm trying that. I've created a simple "weigh in" web site on my home computer, complete with point calculator. However, it got me thinking about usability. Having it on a web site is all right. However, I would like to take a note out of both FranklinCovey's and NewsGator's books: Outlook integration.

A pleasant fiction:

I get to work this morning, fire up Outlook, and my Today page tells me that I've lost 5 pounds since last week. I click "Weigh In" and navigate to my weekly weigh in page. I can see a line graph of my progress and some encouraging messages from my Weight Watcher/Atkins/South Beach/etc RSS feed. There is a food/point search so I can see how many points are in my Krispy Kreme donut and a point calculator so I can figure out the points for items that aren't in the database. There is a grid with my weigh in history where each entry links to the calendar. I don't enter the foods I eat throughout the day but, suppose I do. I can see what I ate on any given day just by clicking on the entry. Suppose I also subscribe to a low-fat recipe RSS feed. Clicking on the feed adds the recipe (along with ingredients) to an appointment (with a reminder) so I know what to get at the grocery store for dinner tonight. I enter my weight and lament the Krispy Kreme donut.

Possibilities

I wonder if anyone would use such an addin. Perhaps the information is too personal to keep in Outlook. But maybe it's not. I keep email in my Outlook I don't really want anyone to see so I would probably not mind keeping my weight history in their either. Then again, I'm a guy. I wonder about the ladies...

Grace and Peace to you,
John

DataTable Field Dump

Sometimes I just don't want to look up which fields are being returned to me in a DataTable, especially from a Stored Procedure. So I created this VS.Net macro to dump the field names for a DataTable or DataView. I also have a macro for dumping an entire DataTable or DataView but access to the runtime debugger values is too painfully slow for practical use (it's okay if the row count is < 20). If anyone has any ideas for speeding this up, please comment.

Enjoy!

Grace and Peace to you,
John

Usage: Use by selecting a DataTable or DataView during runtime and double-clicking DumpDataColumns in the Macro Explorer.

http://webpages.charter.net/superjodash/Data_Field_Dump.txt

Note: I included a link to the macro source code as I could not get the VB web formatting to work.

Wednesday, June 16, 2004

Regular Expression

The situation

Regular Expressions are worth their weight in gold. I use them daily and can pretty much think in Regex when needed. But what about devs who have never seen one and need to create an expression right now? Sure, one could go to RegexLib and grab any of the hundreds of great expressions freely available. However, what if a custom expression is needed? I propose, and am in the process of developing, an easy to use, result based solution for creating regular expressions. No previous knowledge necessary.

What do I mean by result based? Excuse me while I grab my easel... I need a regular expression to validate a credit card. Simple enough, right? It might look something like this: ^5[1-5][\d]{14}$ (from the begging of the line, any value that starts with 51 through 55 and follows with 14 digits). Simple, right? What about dashes and spaces? Okay, how about: ^5[1-5][\d]{2}[\- ]*[\d]{4}[\- ]*[\d]{4}[\- ]*[\d]{4}$. We are starting to get a little more complex (we can optimize this but I will save that for another day). I would like a solution whereby I could enter "5411-1111-1111-1111" on the IDE canvas and get the pattern from the needed result.

Is there a way to represent a pattern visually without the visual representation becoming more complicated than the pattern itself?

Current tool box

I typically use Expresso for my quick and dirty regexes. I also sometimes use The Regulator  (which now has an intellisense pop-up. w00t!) for more complicated ones. In the super user category I put The Regex Coach. It is a great program for seeing the parse tree and having a "debugger" type interaction with the FSM. However, I already know how to write regular expressions and these applications are designed with that in mind.

What about existing visiual editors? There is really only one program I am aware of and it seems to be on the right track: The KDE RegExp Editor for linux with KDE (also available for Win32). This program basically visually represents a regular expression with a series of nested containers (groups and character classes). It's the most "visual" editor I've found for regex editing (although buggy on the Win32 edition It uses GTK+). In all the various ideas I've come up with (so far), I'm starting to wonder if this is the best visual option. My only beef with this solution is that is is designed for editing the pattern in a visual way; not visually designing the pattern.

YAREE (Yet Another Regular Expression Editor)

I've spent my idle moments (commuting to and from work, shopping with Kristin, watching TV) trying to come up with what I feel would be an easy and intuitive regex editor. I seem to always hit a road block when trying to decide the best way to visually represent a pattern. I don't want to rehash programs like The Regulator, The Regex Coach, or KDE's RegExp Editor (although I do want to incorporate many of the great ideas these programs exhibit). Instead, I want to focus on the end result. I want to visually work with the data I'm trying to match or split on. I want to abstract away the character classes and endless groupings.

I've run into hurdles while trying theorizing this utility. Below are a few hurdles I encountered:

  • Verboseness of expressions - Regex patterns are verbose in nature. Coming up with a way to express this verboseness visually is a challenge. I feel like this is a major bottleneck.
  • Lookaheads/lookbehinds/repeating/nested tokens - Representing things like nested double quotes and repeating values are going to be hard. This ties back in with the verboseness of the language. I think there are certain constructs that can be used as a pattern for repeating and nesting but the pattern may need to be tweaked by hand.
  • Optimizations
  • Plug-in architecture

I will think about this some more over the next few days. I know there is a way to do this. I just can't seem to see the forest for the trees.

Grace and peace to you,
John

Infamous first post

It's time to get the infamous first post out of the way:

I'm John Kemp and I'm a programmer. I live in St. Louis, MO with my beautiful wife Kristin.

I've been following the blogscence for a few years and even had a blog over at http://weblogs.asp.net/jkemp/ for a long time. However, I've never really been the journaling type and so I didn't write much (or at all). However, blogging has become an excellent social networking and word-of-mouth approach to getting "known" in this industry. Therefore, I have decided to try it again, this time on blogger.com. My ideas and thoughts will be available and yet not published on hugely syndicated lists. I'm still a little intimidated about others reading my posts. :)

Anyway, wish me luck.

Grace and peace to you,
John