ShowUsYour<Blog>

Irregular expressions regularly

July 2003 - Posts

There and back again.

Today I had to call a .NET component from an ASP page so, being the mungey .NET kinda guy that I am I decided to wrap the call in a .NET webservice and invoke a call using an XmlHttp GET request.  It all went fine and I was able to encapsulate most of the harder stuff within the .NET code to make my life easier and add a bit of RAD "oomph" to the overall process.

Then I noticed that the last parameter that was being passed in the sample code that I was following:

this.Request.Url.AbsoluteUri

Ahh, the old Uri.AbsoluteUri trick eh?  Wow, how long has it been since I've had to know what each of the ServerVariables represent again?  :-)  Here was my munged up, ASP code used to build a representation of that string value:

"http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")

 

Posted: Jul 31 2003, 02:40 PM by digory | with no comments
Filed under: , ,
ICollection: a peek under the covers

I just noticed that Robert McLaws blog'ged about an article of mine that he'd recently read.  I remember writing that article a year or so ago now and in it I describe how to create a strongly typed collection that uses abstraction to hide the underlying datatypes.  This is cool because you can easily switch the type that stores lists of data without consumers of your type being affected, yet, you get strongly typed collections that ensure more errors will be picked up at design time (because you're passing less System.Object's all around the place).

Creating Custom Collections
http://www.flws.com.au/showusyourcode/codelib/code/customcollections.asp?CatID=5

After writing that article I headed under the covers to look at what makes a collection "special".  I'd recommend that article for anybody that likes to understand what makes things tick.  For example, how do the following Types differ semantically?: ArrayList, HashTable, Queue, Stack, IDictionary or, even a database index and, how would their underlying data be stored in memory, interested?  Read on...

Creating dynamic data structures
http://www.flws.com.au/showusyourcode/codeLib/code/BinaryTree.asp?catID=5

I love it when people read and comment on stuff that I've written because I mostly write about stuff that I had to spend many hours finding out for myself.  The article titled "Creating dynamic data structures" took me - literally - days of studying and it was only with the help of some very intelligent friends that I actually got that article across the line.  I'd like to publically thank my good friend Bill Wilkinson for the dozens of e-mails that he sent to me that helped me to understand Binary Trees (as opposed to BTrees!).

Finally, having explained how to "roll-your-own" strongly typed collections it's valid to point out that future CLR support for parametric polymorphism and the subsequent implementation of generics by the main languages is going to change a lot of this for language consumers like us!

Posted: Jul 27 2003, 09:49 PM by digory | with 2 comment(s)
Filed under: ,
Some blog changes

I'm in the middle of upgrading some parts of my blog.  The most important change is that I'm going back and categorizing all of my blog entries.  This is important and, if you have a blog and haven't been categorizing your entries then I'd highly recommend doing do. 

I've also altered the title of my blog.  This is beacause of the fact that I have a site named ShowUsYourCode and, I'll potentially have many other "ShowUsYour{Object} types of projects over the years, so, the new name better reflects the reuse of "ShowUsYour(obj)" and gives me better design time performance ;-).

Finally, this weekend I'll be upgrading my other lists of links to better reflect the blogs that I'm currently tracking.  

RegexLib.com

Over the past 3 or 4 months I've been involved in adding some new features to RegexLib.com.  Firstly, we changed the look-and-feel of the site (thanks to Thomas 'Aylar' Johansen) to give it a friendly look and to change the navigation structure.

Secondly, we implemented categories of patterns.  This makes it much easier to find the type of pattern that you are looking for.  Clicking on the 'Patterns' link on the top navigation bar brings you to a page where you can get a "tabbed" view of patterns by category.  It's useful because, if you're looking for a pattern to match an e-mail address then you click on the "Email" tab and search through the (currently) 14 patterns in that category.

Finally, I added the ability to leave comments against patterns.  So, clicking on the first pattern in the [Email] patterns category you can see that that particular pattern [ http://www.regexlib.com/REDetails.aspx?regexp_id=26 ] has generated a great deal of conversation.

So, if you're looking for a regex, I highly suggest that you "scoot" over to regexLib and take a look through the current patterns.  If you find a pattern that suits your needs, leave a comment to that effect and, likewise, if a pattern is incorrect leave a message as to what would break it.

You can also Register to add your own patterns - http://www.regexlib.com/Register.aspx.  In the very near future I will add the ability to filter patterns by author.  This will have the effect that you can easily use RegexLib as your own, personal library of patterns.

Feel free to leave a comment if there's any other features that you'd like to see added!

Posted: Jul 26 2003, 11:13 AM by digory | with 10 comment(s)
Filed under: ,
WindowsForms.NET - a useful library of articles.

I got an e-mail from a work colleague yesterday expounding the virtues of the WindowsForms site - nod, I'd agree with that - it's nice.  At the time I just filed the e-mail away and grinned, knowing that there was another enlightened .NET'ter amid the throng { aloof aren't I? }.  Anyways, this morning I decided that I should reply to him and let him know that I thought that it was great that he'd found the site and to thank him for the link; as I'm replying I notice a little footnote in his mail: "HINT: Click on articles Tab and search for 'smart client'."  HOLY CRAP I thought! {click}

 http://www.windowsforms.net/Default.aspx?tabindex=3&tabid=40

You know, I've been to that site "hundreds" of times and never clicked on the articles link... cool stuff!

[Listening to: Fortune plango vulnera by BOSTON SYMPHONY ORCHESTRA]

Posted: Jul 25 2003, 11:57 AM by digory | with 2 comment(s)
Filed under:
objects, relational data, reflection, performance, types and metadata - a monograph by Darren Neimke

I've just been informed that my recent post about the starter kits is the most visited blog-entry on weblogs.asp.net!

 ASP.NET Starter Kits - mining for jewels
 http://weblogs.asp.net/dneimke/posts/9253.aspx

...what's more, if I'm reading the numbers correctly, it would appear that the next most popular post has only about 1/3rd the number of visits, how about that eh :-)

My favourite online resource

My favourite list or newsgroup would have to be the Regex list over at ASPAlliance:

     http://www.aspalliance.com/lists/SignUp/list.aspx?l=68&c=16

I've found that it's the best place to get involved in interesting regex discussions - and some debates too :).

A couple of new faces have appeared of late.  One notable name is Wayne King (Microsoft).  It's always good to test your knowledge with people that have Wayne's level of knowledge. 

Posted: Jul 24 2003, 04:24 PM by digory | with no comments
Filed under:
How to raise your community profile

Yesterday a friend e-mailed me and "ranted" about some stuff.  I never get sick of "rants" or "ramblings" they're the best kinds of conversations.  The kind where I can just say what I'm actually thinking without having the burden of wondering whether or not I sound like a complete idiot!  One part of his "rant" asked about how I'd managed to get involved with things such as ASPInsiders  (A question similar to this was also asked on Scott Mitchell's blog recently).

Having glorified my status by telling him about all the stuff that I've done in the past, I paused to reflect on the ASPInsiders group itself. 

People in that group are, on the whole, a bunch of individuals that have shown great interest and dedication in helping out within the community in some way over an extended period of time. 

Just about everyone will have heard of members such as G. Andrew Duthie, Scott Mitchell, Dino Esposito, Steve Smith and Dan Wahlin (to name a few) and are eminently aware of their vast inputs and achievements over an extended period of time.  There are other members - such as Scott Cate, David Penton, Brad Kingsley and Colt Kwong - who have been just as active in different roles.

What I'm building up to here is that, members of that group have, over time, built a level of trust both between individual members and also between Microsoft and the group as a complete entity.

If you're a single guy or gal out there today, and you are wondering how you can start to raise you community profile I'd offer this advice.  Plan to be recognized as "active".  It won't take long to stand out in the crowd - remember that, of the 50 or so members of the ASPInsiders, there's always at least a few of them either moderating ASP.NET forum posts, ASPAlliance lists posts or attending INETA group member meetings.

Work out how you can get involved, and plan to do it consistently.  It doesn't matter whether you're doing something high profile such as writing an ASP.NET bestseller, answering questions on a list, or even uploading useful helper widgets for the community to use and benefit from.  Just start by getting recognized.  Pretty soon, you'll find that, even the current ASPInsider members start turning to you as a trusted source of information!

... now, of course, having mentioned all of that I should also add that, while elevating one's presence in the community will no doubt help get to get you noticed for things like AspInsiders, I should be note that it is not the mission of the ASPInsiders group's mission to recognize community involvement, but rather to provide early feedback to the ASP.NET product team on upcoming features of future versions of ASP.NET.

 


A quick riddle
Think of words ending in -gry. Angry and hungry are two of them. There are only three words in the English language. What is the third word? The word is something that everybody uses everyday. If you have listened carefully, I've already told you what it is.

Webservice architecture for online/offline applications

I'm currently writing a utility application to keep track of CodeSnippets, Favourites Links etc and, as a feature of the application, users will have the ability to take the application offline for extended periods of time and still be able to fully maintain the data while in the disconnected state - i.e.: Add/Edit/Delete/Read - not dissimilar to what the TaskVision application does.  Users may also have more than one client interface to the application - consider a WindowsForms app at work and a WebForms app running on PocketPC. 

For the purposes of discussion consider this scenario:

The application that I'm building will manage all of a users code snippets.  Code snippets appear in Categories, and Categories also be broken into sub-categories.

    - VB
        - StringHandling
            - snippet A
            - snippet B
    - C#
        - Conversion
            - snippet C
    - Misc
        - Sorting
            - snippet D

My biggest issues were: how to manage concurrency between multiple, disconnected clients and how to minimize the amount of data that I would be sending across the wire?  From what I've seen, it's not such an issue with TaskVision because of the kind of data that is being exchanged.  The data also has the potential to get big'gish, for example, given 300 snippets at an average size of 1K (including the snippet and other attributes) you'd be looking at serializing nearly .5Mb across the wire for all snippet and category data.

For those that have developed an interest in this type of problem, I've documented my chosen approach and you can view it here:

http://www.flws.com.au/MergeConflicts.html

...basically, it involves a hierarchically structured DataSet being passed between a central Service and the remote clients. Record locking conflicts are resolved through the use of an incrementing key and the size of the dataset is reduced by only passing data that has changes.  Conflicts are reported to the clients in exactly the same manner as with the TaskVision applciation, that is, via ROWVERSION'ing on the rows of the DataTables.

I hope to create a more formal "spec" of the architecture and prototype it over the coming week or two.

Regex Workbench V2

Today I discovered that Eric Gunnerson has been blogging!  While browsing some of his older entries I noticed that he's recently updated the Regex WorkBench (with Examine-o-matic!):

    http://blogs.gotdotnet.com/ericgu/commentview.aspx/3eaf7ed2-d76b-427a-913c-79284e11e9cd

You really learn a lot about all aspects of programming, application development and application packaging when you learn from people such as Eric.

This was the first major WinForms app that I ever pulled apart (well over a year ago now) and, combined with Chris Sells's regex tool helped me immensely when it came to building RegexSnippets:

    http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=43D952B8-AFC6-491B-8A5F-01EBD32F2A6C

Posted: Jul 23 2003, 09:58 AM by digory | with 1 comment(s)
Filed under:
More Posts Next page »