CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

August 2004 - Posts

  • Entity Collection View Class?

    As I'm working more and more with Entity Classes and Collections of them, I'm running into some interesting problems.  I've been able to DataBind my classes to things like DataGrids, no problem, but I'm finding myself wishing there were such a thing as a CollectionView class.  This would function like a DataView class does for DataBinding controls to DataSets.  Basically, what I need is a bind-able object that I could associate with my Entity Collections with a Filter property that would serve to show a subset of the entities in my collection that matched my view - or er... just what a DataView does, but for collections. 

    I have found a reference to System.ComponentModel.CollectionView, in the Longhorn SDK, but not sure if this is the same, and well, it's Longhorn.  Does anyone know if there's anything like this that can be used today?

    -Brendan

  • VERY Cool Winforms Data Binding Helper

    Roy has posted a very interesting Custom Attribute class that will simplify WinForms data binding... 

    [it's] is a simple Custom attribute that you can put on a control instance on the form (TextBox for example) that has some meta-data as to what data binding it will use at run time.

    I love stuff like this, it should be simple to convert this to work with ASP.NET controls too. 

    -Brendan

     

  • More GMail...

    This will be my last post about GMail accounts, promise.  Got 6 more today, and they keep coming, so if you want one, send email to brendan dot tompkins @ gmail.com.  I have a feeling that they're ready to open up GMail to everyone, so this will be a thing of the past shortly.

    -Brendan

  • Good Consulting Information is Hard to Find.

    I'm always interested in hearing DonXML's thoughts on consulting, as they usually jibe with my own. In fact, I first ran into him on line in some comments he left on a post I made about consulting rates.  

    Recently he's come up with a list of consulting guidelines. They're pretty insightful - check 'em out here.  The cool thing about this is that this is the stuff that no one tells you - or even talks about really. As a consultant, it's  difficult to get good information about how to navigate the complexities of staying employed. Your placement firm won't tell you what's good for you - I've found that they're usually the ones you have to protect yourself against. You can't really count on learning from other consultants either - most I've met are pretty tight-lipped about this sort of stuff.  So thankfully, there are guys like Don who take the time to post this kind of thing.

    -Brendan

  • More GMail Invites...

    Since I first started giving these things away last week, they've seemingly opened the floodgates with this email invite thing.  I've got 8 more to give away if anyone wants any, email me at brendan.tompkins@gmail.com. Rory has a whole list of bloggers giving away invites here too
  • Flooded with Gmail Invites...

    Dunno what has happend this week, but I've gotten a bunch of Gmail invites to hand out.  They seem to be giving me more every couple of days. 

    If you would like one, send me email to “brendan dot tompkins at gmail.com” and I'll set you up.  I've only got a few, so first come, first serve.

    Wow.  I gave away 5 in about as many minutes.  I'm sorry to say that they're all gone!

    -B

     

  • Exceptions vs. Error Codes

    This is something that I've wondered about.  This post here sums it up well.  In the comments, Andy writes :

    I totally agree. It can be summed up into one key rule: "never use exceptions for applicational logic or flow control"

    -Brendan

  • How To: Make a Web Smart Tag

    Last year I created a SmartTag for Office XP for internal use here at the Port.  It's been a success, and recently our director asked if I could do something similar for our Web Site.  Specifically, he wanted a popup context menu to appear whenever there was a container number on the site.  This menu would allow the user to perform specific tasks for that container. Luckily our container number follows a standard format (4 characters, followed by 6 or 7 Numbers) which makes picking them out of a stream with regex a fairly simple task. I was able to create a role-specific context menu for all container nubmers on our site.  Since we have a bunch of applications and reports that present container nubmers,  this Web Smart Tag instantly enbaled application functionality to all of these pages.  This is pretty powerful stuff, and we didn't have to touch each individual page's code to enable this.

    The end result works pretty well, so I thought I'd show how I did it here. My solution uses a technique for applying a filter to the outgoing http stream, as described here by Donny Mack.  It also uses the excellent MarkItUp Context Menu, by Darren Neimke (I'll post a link when to the download when I can find it again).

    First of all, if you're going to be creating a SmartTag, you're going to need something that follows a pattern that you can regex.  For example, social security #'s, phone #'s, email addresses are good candidates for a SmartTag, Surnames are not.

    So say you have your text that you are going to create your smart tag from, here's one way to create the tag.  This example uses ISBN #s and provides a context menu to allow lookup at Amazon or Barnes & Noble. You can download a web project here that demonstrates the technique in full.  Here's what the result looks like:

    A couple of caveats.  A real smart tag will have to account for all sorts of cases where the pattern is found and you don't want to create a tag.  For example, when your pattern occurs  inside a hyperlink. Be prepared to do some serious regex back referencing.  I'd suggest grabbing a copy of Roy's Regulator which is a fantastic tool for editing and testing regex.  Another gotcha is that this can slow down the processing of your site.  I actually had to do a number of performance enhancements before I could release the production code (like compiling the regex into an assembly, and only filtering certain pages) but generally this approach here works.

    -Brendan

  • Good SOA and Indigo Blog

    Rich Turner's blog has a lot of good information on SOA, including hot topics such as DataSets vs. Custom Entities, Remoting vs. ES vs. ASMX/WSE, etc... Check it out.  Answers a lot of questions that I've asked here about these things.

    -Brendan

     

  • Being Independent: Using a Pass-Through Agency

    Robert and James have recently posted some good information on going independent.  Scott also has a good series on being independent.  I posted a few times earlier this year about this as well.

    So you have a client and a project to work on... where do you go from there? I wanted to offer some insight into one of the most daunting aspects of being independent - HR and Accounting.  If you're going to go independent, here's what you'll have to be able to do for yourself:

    • Health insurance
    • Liability insurance
    • Workman's comp insurance
    • Federal taxes (corporate and payroll)
    • Social Security (corporate and payroll)
    • State taxes
    • Retirement
    • Invoicing
    • Contract negotiation/execution
    • Expense reimbursement

    and the list goes on... Fortunately, there are companies that will do this all for you, and more, usually referred to as pass-through agencies.  They have the added benefit of being able to get group insurance rates, and 401K plans - something that is not possible when you're completely independent.  The company I use, Independent Professional Services (http://www.iprofessional.com), will provide all of these services for a small, yearly capped percentage (4%). For me, this is money well spent. 

    -Brendan

     

  • Best Refactoring Tools?

    Does anyone know of any good refactoring tools for Visual Studio?  I've been playing around with ReSharper, and although it's pretty cool for refactoring, it pretty much kills the IDE for normal development.  It seems to override CodeRush's hooks too, and if I have to choose, it's CodeRush all the way...

    -Brendan

  • Announcing: WSMQ and XMLQ

    OBSOLETE CONTENT
    The author of this post has determined that this content is obsolete. Use at your own risk! Blog posts are a point-in-time snapshot of the blogger's thinking and should not be assumed to represent this blogger's current opinions. This post was left up for historical purposes.

    I've created two GotDotNet workspaces WSMQ, and XMLQ. 

    Web Service Message Queue (WSMQ)

    WSMQ is a simple message queuing application that supports queuing messages via a loosely coupled web service. It's underlying implementation uses something called XMLQ, which I've set up as a separate Workspace, since it can be used directly from within an application, such as a Windows service, Win forms or Web Forms app...

    XML Message Queue (XMLQ)

    XMLQ is a simple message queue that lets you queue messages, which are serialized to disk using XML. XMLQ currently supports the following features: Public Queues, Dynamic Queue Creation, Dead-Letter and Journal Queues.

    There's a lot of work to be done on both projects, including: Support for transactions, binary serialized messages, private queues, but basic public queues seem to be working pretty well.

    All are welcome, just send me a request!

    -Brendan

  • Nice Addin - GhostDoc

    From GhostDoc's site

    GhostDoc is an add-in for Visual Studio .Net 2003 for automatically
    generating those parts of a C# documentation comment that can be
    deduced from name and type of e.g. methods, properties or parameters.

    Just used it to doc a bunch of code!  Nice! Perhaps he'll win Roy's contest.

    -Brendan

  • Nice Fix for System.TimeSpan Serialization

    If you've tried to XML serialize a System.TimeSpan value, you may have noticed that your node is null, no matter what you set the TimeSpan value to be. There's a nice workaround to this posted here by  Ben Lucas.  Basically, you [XmlIgnore] your object's TimeSpan property, and add another that serializes the time span's ticks.  Pretty simple, but works great!

    [XmlIgnore]public System.TimeSpan TimeToBeReceived
    {
      get { return timeToBeReceived;}
     
    set
      
    {
             
    if (timeToBeReceived == value) return;
              timeToBeReceived =
    value;
       }
    }

    public long TimeToBeReceivedTicks
    {
      
    get { return timeToBeReceived.Ticks; }
      
    set { this.timeToBeReceived = new TimeSpan(value); }
    }

    So instead of this:

    <TimeToBeReceived />

    You get this:

    <TimeToBeReceivedTicks>864000000000</TimeToBeReceivedTicks>

    Thanks Ben!

    -Brendan

     

     

  • OT: Fat Boy Slim - Google First Dammit!

    Don't know if you've heard Fat Boy Slim's new single, but other than sounding like a bad rendition of a Beastie Boys song, it sounds like an add for Slashdot.  It goes :

    “Slash dot, slash dot, slash dot, slash dot, slash dot, slash dot, dot dot com!“

    ...Or something thereabouts. I don't think this was intentional, as a matter of fact, I don't think he knows anything about Slashdot.

    Don't get me wrong, I like Slashdot as much as the next guy, but this song is just awful, and even more intolerable because it sounds like an advertisement. 

    He should have Googled first.

     

More Posts Next page »