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

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

December 2003 - Posts

  • VS.NET Help Lacking or am I spoiled by Google?

    When I search for “DataView“, I get 500 entries and I have to scroll down to the bottom to find the main class reference page.  I cant help thinking that if MS got together with Google, I could type “dahta veew” and it would politely say, “Did you mean System.DataView” and take me directly to the home page for the DataView class.  I know. This is too much to ask, but wouldn't it be cool?

    -Brendan

  • Cool Tool or Fun Toy?

    Via CodeProject, I came across AssemblyGrapher.  It will generate type graphs that look like this:

     

    Well sort of, anyway.  Here is the full assembly with all it's classes.  Anyone like spaghetti?

    -Brendan

  • Mary Chung's Dun Dun Noodles - Good food For Software Developers

    Went up to New England this year for the holidays and stopped into Mary Chung's on Mass. Ave. in Cambridge.  On Saturday and Sunday until 2 pm she serves Dim Sum, and let me tell you, it is out of this world!

    The cool thing about this place is that it's in spitting distance from MIT, and is always filled with portly guys with beards and ponytails dressed like some strange urban incarnation of Indiana Jones.  I always try to sit next to one of these tables to hear the conversations of Java, CORBA, Linux and other topics loosely or directly related to software development.  Probably not much .NET talk going on, but I could be wrong.

    Anyhow, on some days, I'd wager that 90% of the clientèle are somehow involved in high-tech.  Especially good are her DUN DUN Noodles.  So, if you're planning  a trip to Boston, don't miss out!

    -Brendan

  • Create a SQL Server View of your AD Users

    I posted about this earlier today, and the solution was so simple and straight-forward that I'm posting the solution in a separate post.  So, to create a view in SQL Server of your AD users, simply do this:

    Step 1: Create a linked server to your Active Directory

    sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'

    Step 2: Create a view in SQL server using OPENQUERY to select from Active Directory

    CREATE  VIEW dbo.vw_AD_USER_INFO
    AS

    SELECT * FROM OpenQuery(ADSI, 'SELECT title, displayName, sAMAccountName, givenName, telephoneNumber, facsimileTelephoneNumber, sn FROM ''LDAP://DC=whaever,DC=domain,DC=org'' where objectClass = ''User''')

    GO

    Now, this might not exactly work for you if your AD Schema is different than ours, etc, but for me it worked like a charm, and the general concept should apply to your LDAP server.

    -Brendan

  • From Active Directory to SQL Relational Data

    Here at the port, we use AD as our back-end user account and group store, like I'm sure many of you do.  To relate user data in our SQL database to these accounts, we have a slimmed down user table that looks like this:

    [GN_USER_ID] [int] IDENTITY (1, 1) NOT NULL ,
    [GN_USER_AD_LOGIN] [varchar] (50) NOT NULL ,
    [GN_USER_AD_GUID]  uniqueidentifier ROWGUIDCOL  NOT NULL

    etc.  We use the GN_USER_AD_GUID column to lookup the AD user in the store when we need user info, email, etc.  This works great, and we have a bunch of utilities to get the AD user, etc. But, my boss just came in and now wants to do some reporting on this data. 

    I'd like to create a cube that contains a bunch of user data, but the problem is much of the data is embedded in the AD store, and not in SQL.  It looks like I can use a the OLE DB Provider for Microsoft Directory Services is to create a linked server.  So here's my question. Has anyone out there done this?  I'm thinking that with Yukon, I'll be able to use our existing AD .NET classes and hopefully pull this AD data into the SQL world.

    -Brendan

  • In the "Yeah, but does it support the .NET Framework?" department

    Now, if we could write managed code to control Sony's new robots.  Now that would be cool!

    -Brendan

  • Naming Things

    A big part of our jobs as software engineers is to name stuff.  We do it all the time when naming variables, controls database tables, etc.  We all (hopefully) have guidelines and standards we follow when we're doing this kind of naming.  But, sometimes we have to name more abstract functionality, like a feature of an application, for example.  Today I had to come up with a name for the tab that identifies a control that shows user accounts that haven't been used in a while.  This is going to (hopefully) help us keep our active directory store of web site users clean.

    Well, it was kind of hard to come up with a good name!  Inactive Accounts made the most sense, grammatically, but is already part of the software vernacular for “accounts made inactive,” and that's not what we wanted to say.  So I went to my trusty thesaurus and looked up Inactive and within a few clicks ended up calling my tab, “Idle Accounts.”  I was pretty happy with this description, but now I'm wondering if there is a more systematic way of naming these abstract things.  There probably have been entire books written on the subject. 

    -Brendan

  • Where do we go from here?

    My good friend, Mark DiGiovanni, blogged on about other .NET languages, and he mentions *antique* software developers.  I'll let others out there comment on his pejorative use of *antique* to describe “seasoned” developers, but this kinda brings up something that I think about quite often. 

    What is the ultimate long-term career path for talented software engineers?  If you're worth your salt as a developer, and you enjoy it, you might want to continue doing software engineering.  But, you'll probably have to resist the requests from management and recruiters to put you into senior positions sooner or later.   Executive roles just aren't what most of us are born and bred for.  If you're like me, you'd need a good haircut and new clothes just to begin. Then you've got management skills to deal with, politics, etc.  Sooner or later, you're not writing code or engineering software anymore.  I've always used this analogy:  If a pitcher on a baseball team consistently wins games, do you make him first base coach?  Is he to be expected to know anything at all about coaching?

    But,  then again, what are our other choices?  Do we become teachers, authors, unemployed?  What if we can't teach?  What if we can't write?  What if we have a mortgage?  Is it possible to grow old being simply a software engineer?  If so, do  we eventually become *antique* ?

    -Brendan

  • SharePoint Part Caching (and RTFM)

    Okay.  Like most sane people, I try to do most things without reading the manual first.  So, I'm happily developing my SharePoint Portal web parts, and I'm storing data into the PartCache, using the following method.  The method takes 4 values, Storage type, a cache key, the data, and a System.TimeSpan value, like so:

    this.PartCacheWrite(Storage.Personal, "test", this.m_strvisibleCameras, new System.TimeSpan(30,0,0,0));

    There are no overloads, so you have to pass the TimeSpan.  Well, of course I assumed that the System.TimeSpan value was the time to live for the cache object. Right?  That would make sense, if you've used other cached objects, like Page.Cache. But, I wanted the cache to live forever, so I went looking into the docs and guess what the TimeSpan is for? From the FM:

    timeout   A System.TimeSpan that specifies the period during which PartCacheWrite attempts to write a value.

    Okay.  Well, I'm SURE they had a great reason for requiring this value and not providing an overload.  But all my code was giving the WebPart 30 days to attempt to write a value.  Next time, I'll try to RTFM.

    -Brendan

  • SharePoint Portal Server 2003 - First Impression

    So, I spent the week messing around with SharePoint Portal Server 2003, and I'll have to say, I'm really impressed.

    Installation: I got it up and running on a VMWare virtual Win 2003 server on my development machine here at work.  Setup was easy and straightforward.  I spent around three hours swapping various disks, etc.  Overall pretty painless.

    Creation of Portal Web Part.  I created the following Web Part in about 2 and 1/2 days, re-using our back-end VIT framework here for managing container statuses:

    The development process was what I expected, and was a breeze.  Anyone familiar with creating ASP.NET Custom controls will have no problem.  Good documentation from MS helped, and installation worked like the docs said.

    I then spent some time setting up a bug tracking web part, basing it on the out-of-the box portal list part.  That was really cool!  I created a pretty full-featured bug tracking app in about 30 minutes!  The guy that sits next to me was laughing because I just kept saying WOW!   This is really cool!

    Now, I'm not sure how long this honeymoon period will last, but I'm pretty psyched about it so far!

    -Brendan

  • Managing Multiple .config Files

    We're getting a lot of re-use out of our .NET framework here at the port.  We've got our public web site, Web Services, Windows Services, and now we're creating SharePoint Portal web parts - all using the same underlying managed framework.  I've run into a problem re-using .config files across applications.

    Here's the problem.  We have a class VIT.Common.Configuration with a bunch of static methods that encapsulate access to in .config files. This works great, but it's starting to get hard to manage, because I need copies of the <AppSettings> blocks in each .config file.  I'm having to keep at least 5 of these in sync, and it's only going to get worse.   I'm going to explore creating a WebService to make this stuff available from one source, but I've got some security concerns here.  Has anyone out there any thoughts about this direction?    Are there better ways to manage multiple configurations?

    -Brendan

  • Sysinternals Autoruns Tool

    I just love Sysinternals.  Every developer, in my opinion, should have a copy of their FREE tools.  I don't know what I'd do without DebugView for monitoring remote System.Diagnostics.Trace messages. Or FileMon for identifying and fixing file location and permission problems (expcially useful for fixing poorly developed apps when they break). Today I found another of their cool tools  called Autoruns that will show you what loads/runs on boot.

    -Brendan

More Posts