A Blog by Scott Isaacs

Tag: Development

Whoops!

So I was upgrading this site from Community Server RC3 to 1.0 tonight.  No database changes were needed — just a file copy.  No problem, right? 

Wrong! 

I forgot that I had modified the skin that I’m using to be more like what I wanted.  Even worse, I forgot that there was an unmodified version of this skin included in the CS install.  So, I overwrote all of my skin changes. 

Sigh.

I think I’ve mostly got it back to how it was earlier today, and I’m making my changes in a new skin directory so that I don’t do this again.  If something doesn’t look right to you, let me know.

IE Stuff: Open Highlighted URL In New Window

This is something very small that I hacked out for myself a couple years ago.  It allows you to select an un-linked URL on a web page, such as “scottisaacs.com”, and easily navigate to it.  What you do is highlight the URL that you want to visit, right-click, and select “Open Highlighted Link in New Window”.

This will modify your registry and if you don’t know what that implies, then you probably won’t want to install this. 

Use this at your own risk! Here is the ZIP download.

Deeper in .NET 2005

As you may or may not know , I am pretty heavily involved in the local .NET community and serve as the Vice President of the WI .NET Users Group.  Well this weekend, March 5, is our third annual day long extravaganza – Deeper in .NET 2005

Well, I don’t know if extravaganza is the right word.  Let me check.

(Searching the web…)

OK, Dictionary.com defines extravaganza as “an elaborate, spectacular entertainment or display”.  I guess extravaganza is the right word after all.

I am SO excited about this.  I’m such a geek.  Our group is one of the 10 largest .NET user groups in the world!  And get this: This is going to be the largest .NET user group event ever!!  Right now we already have over 400 registrants.  If you’re going to be anywhere near Milwaukee this Saturday, you need to be there.  But register now so you can be sure to get in and get fed — mentally and literally (there’s lunch).

We’ve got an awesome lineup of speakers:

Topics look great too!  Distributed objects, ASP.NET 2.0, Smart Client…

To top it off, Jacob Cynamon is hosting a lunch Q&A session featuring Scott Guthrie, Chris Mayo, Rob Howard, and Jason Beres who will answer questions regarding .NET architecture and design considerations not covered in their presentations.  Watch for the e-mail to come out to all registered WI .NET UG members soon.  If you want to know more about this, then you need to register on the WI .NET UG site.

It’s this Saturday, March 5, 2005 at the Radisson by Mayfair Mall.  Late registration and check-in starts at 7:00 AM and things get kicked off at 7:45.

Seriously, you should check it out!  I’ll be there all day — come see me and say hi!

Code Generation – ‘The EXE’

OK.  So last week I mentioned that I had been working on a code generator for myself.  For what it’s worth, I am actually posting the EXE here. 

Use this at your own risk!  Here is the ZIP download.

In the ZIP there are five files:

  • The EXE
  • A Help file (if you can call it that)
  • A default settings file
  • Two files used to infer the DB schema.  These came from CodeSmith.  If it is wrong for me to include these files, someone will tell me and I’ll have to remove them from the ZIP.  At that point, I’ll either add instructions to get them from CodeSmith, or write my own (UGH!).

Contact me if you have any questions.  I’m sure it’s still buggy.  It also has a number of limitations, such as:

  • It only works with SQL Server.
  • It expects only one Primary Key column.  In fact, I think it might be expecting a numeric auto number column.
  • It only generates VB.NET code.
  • There are likely a multitude of others limitations.

In short, this was for me.  It is written around my own “practices”.  It hasn’t been tested nearly enough to be considered solid, so don’t count on that.  I only use it as a starting point, and I can’t recommend that it be anything other than that for you.

That said, please try it if you want, and let me know what you think.  If anyone feels like writing some more thorough documentation, especially as it relates to the generated code, I’ll give you a copy of this app for free.  😉  Also, if you find that my generated code could use certain improvements, please send contact me to let me know.

For what it’s worth, it also runs from your USB drive, but then if you’re into .NET code, you probably expected that it would.

Update (2/28/2005): I have uploaded a new ZIP because I found a bug in the first version.

Next Week’s Task List = Same as This Week’s

Did you ever finish a week at work and realize that your task list for next week is nearly identical as the one for this week?

That’s pretty discouraging for me. 

This week was full of those “emergency things” that popup and need immediate attention.  That, coupled with the fact that I didn’t do a good job identifying the scope of some other things, has led to my current situation.

I know that I’ll get it all done, and my boss and coworkers are understanding, but I still feel awkward when my status update is “same as last week”.

Sigh.

Someone please tell me I’m not the only one…

Code Generation

So over the last couple weeks I’ve spent a grand total of about 30 hours ironing out what I need from a code generator (screen shot).  It’s not as flexible as CodeSmith is (i.e., no templates), but it does what I want, and it does it every time.  Maybe someday after I add a few more “desired” features and work out more of the kinks, I’ll post the app and/or source up here.  (Translation: You’ll be lucky if you ever see it.)  The source isn’t pretty — it’s just basically a top down application that retrieves schema info from the database and does its best to turn that into VB code.

Anyway, it’s pretty basic.  What it boils down to is that you specify a SQL connection string and it generates the BOL and DAL code as well as the SQL stored procedures need to operate.  The generated code comes from a “template” that I built based on code from other generators, and code I hand-wrote that I wished had been generated.  There was a project at work where, over time, I ended up spending probably 30 hours just on this could-be-generated code alone.  Now that code comes out in about 10 seconds.  Obviously I still have code to write, but the tedious stuff is done.  Here is a brief list of what my code generator does and does not do.

Current Features

  • Generate BOL code (Base and Safe classes)
  • Generate DAL code (Base and Safe classes)
  • Generate SQL stored procedure script
  • Allows for saving and retrieving project settings to a “.genproj” file (I made that extension up myself.  What do you think?)

Possible Future Features

  • Generate Base and Safe classes for the test project (NUnit tests)
  • A simple WebForms data editing tool
  • A simple WinForms data editing tool
  • More options in the UI to select which items to generate on a table by table basis
  • Support for SQL Server views (in addition to tables)
  • Other features that I should have written down, but have since forgotten

Now that I have this code generator complete (with the exception of detailed testing), a friend sent me a link to this blog entry on his site.  It’s about CodeDom.  His blog links to this article on DevX.

I should have researched this first!

It looks like it would have been much more cumbersome to build my generator, but I could have built in to generate code in any language, and even compile it on the fly!  Hmmm.  Should I go back to the drawing board?  I probably should, but doubt that I will…

If you have any feature suggestions for my code generator, list them here as comments, and I’ll consider adding them.  My goal isn’t for this to become the super-awesome-generates-code-for-every-situation code generator.  I just want it to save me time on the normal, tedious, boring, everyday stuff!

Milwaukee Nerd Dinner

I’ve never been to one of these meetings yet, but have a couple friends who have.  I’m going to try to make it to February’s Meeting.

Page 6 of 6

Powered by WordPress & Theme by Anders Norén