Erik Porter's Blog

Life and Development at Microsoft and Other Technology Discussions

News

    April 2005 - Posts

    VB Snippet Editor

    Woohoo...neat!

    http://msdn.microsoft.com/vbasic/downloads/2005/tools/snippeteditor/

    Posted: Apr 29 2005, 01:46 PM by HumanCompiler | with no comments
    Filed under:
    Random "Punch Myself" Moment

    I'm currently working on an application to schedule audits for the automotive industry.  Basically, I feel like I'm recreating Outlook's re-occurring appointments dialog, but on steroids.  Anyway, there is a schedule command line application that gets run every hour.  Every hour it checks every company's time zone to see if it's after midnight and then basically take all schedule patterns and create schedule instances for today from that.  For some strange reason we've been getting duplicates of each instance from today and in the past.  I looked at the code for the scheduled application and everything looks fine.  I run it myself, it works fine.  What's the deal?  Well, first things first, I'm not sure who at Microsoft designed the NT Scheduler dialog in Windows, but it is really confusing (but that's a whole other story).  Ok, so as I thought more about it I figured I must have something with the scheduling of the app wrong.  I look at it and it says:

    Every 1 hour(s) from 12:00 AM for 24 hour(s) everyday, starting 4/15/2005

    Looks pretty good to me.  What could be wrong?  Well, if I hadn't been so dumb, I might have thought through it more.  There are 24 hours in a day, but if you have an application that you want to run every hour all the time, it should only actually run every 23 hours or when it gets to the 24th hour, it is now actually running in the next day so you'll get two instances of your application spinning up and running at the same time.  Hence why we were getting 2 instances every day.  Aaahhh!!!  So yes, anyway, the more for today is if you need an application to run every hour all day, set the run time length to 23 hours, not 24.  *ouch*

    Posted: Apr 26 2005, 03:18 PM by HumanCompiler | with 2 comment(s)
    Filed under:
    Get IP Address of Router?!?! (and List Network Interfaces)

    Ok, so I've been rummaging through System.Net in Beta 2 and I'm impressed.  There's just a ton of new stuff that is rockin'!  However, what I'm really looking for is a way to figure out how to tell if my machine's IP address is a real internet address (if that's not possible, that's ok), but more importantly what my router's ip address is.  Does anyone know a way to accomplish this?  Sorry this is just a question entry, no real info!  :(  Er...wait, I've got one.  Want to list out all the network adapters on your machine and different bits of info about them like if they support IPv6, how many bytes have been sent in and out, etc ???  Take a look at System.Net.NetworkInformation.NetworkInterface.  There, now I don't feel so bad!  :P

    Dim Erik As New Person(Of Idiot)

    Person<Idiot> Erik = new Person<Idiot>();

    Posted: Apr 26 2005, 03:31 AM by HumanCompiler | with 19 comment(s)
    Filed under:
    Windows Quick Tip

    In light of seeing Paul Wilson's tip about hitting Ctrl+C on any object in SQL Server 2000 Enterprise Manager (which I already knew), I thought of another one of those "seems obvious now, but didn't used to be for me" tips.  Until a year ago, I didn't know this one existed, so don't feel bad if you didn't know it.

    Ever have a dialog come up on your screen or someone else's that you which you could e-mail to yourself or someone else?  Have you ever hit Alt+PrintScreen and pasted it into Word or something as an image and sent it to them?  Well, for pretty much any windows message box, you can actually hit Ctrl+C and it will copy the contents of the message box to the clipboard.  If you've always known about this one, good for you.  If you just learned it recently, join the party.  If you didn't know until just a few seconds ago, you're welcome.

    Posted: Apr 25 2005, 11:27 PM by HumanCompiler | with no comments
    Filed under: ,
    Your Linguistic Profile

    I'm sorry for the OT post here, but this is just too good to pass up.  I saw it over on Paul Wilson's Blog.  I was born, raised and am still currently living in Indiana.  Interesting that I have a slight hint of Dixie!  :P  Really though, I guess it's good that I'm 75% general.  It shows that our little school of less than 1,000 kids still taught us a thing'er two!  Weehaw!!!

    Your Linguistic Profile:

    75% General American English
    10% Midwestern
    10% Upper Midwestern
    5% Dixie
    0% Yankee
    What Kind of American English Do You Speak?
    Posted: Apr 25 2005, 11:16 PM by HumanCompiler | with 5 comment(s)
    Filed under:
    Quick ASP.NET Tip

    We've all got time for a quickie, right?  Well here you go.  Everyone and their mom (or not) may already do this already, but...

    Whenever I have some text to display on a page and the text is dynamic, my first thought is to just dump it out:

    <b>Name:</b> <asp:literal id="litName" runat="server"></asp:literal>

    Back in your code, you then say:

    litName.Text = User.FirstName & " " & User.LastName

    or something like that.  Typically though, I actually do it like this:

    <asp:literal id="litName" runat="server"><b>Name:</b> {0} {1}</asp:literal>

    Then the code of the page is like this:

    litName.Text = String.Format(litName.Text, User.FirstName, User.LastName)

    Main reason I do this is to plan for change.  If the designer wants to change something like say show LastName, FirstName just change the format and s/he's done.  No recompiling, just save and run and done.  You might ask why I included the header in there.  Mostly just because it makes me feel better.  Keeping all related text in the same literal.  In the first example, I as the developer would've had to make the change for the design in code, which IMO, sucks!  By having as much as possible in the ASPX related to formatting, a designer can separately make changes in their editor of choice and test it without having to ask me for new dll's.

    Posted: Apr 25 2005, 07:19 PM by HumanCompiler | with 3 comment(s)
    Filed under: ,
    MSN Messenger 7.0

    So since I have nothing new to talk about since everything at work is the same old boring stuff and I can't talk about my secret side projects yet and I've been too busy with wedding stuff to really play a lot with Beta 2, I thought I'd point out/discuss a couple neat features about MSN Messenger 7.0 that came out a couple weeks ago.

    First off, the new description box under your name is fantastic.  Before this version, people would change their names to express themselves in whatever way they felt like at the moment.  This was totally great because you got to see things about people that you possibly didn't know or just neat things like "I'm in Redmond" or "Work sucks" to name a few.  Add on top of that the ability to show what music you're listening too and this geek is in heaven.  I pulled up my list the other day and a fellow consultant I've been doing some work with lately happened to be listening to the same band I was.  He even was listening to the same album.  I messaged him to say, "Hey, did you start listening to them because you saw I was?"  He said yes and we giggled like the geeks we are and said what was even more geeky than him seeing what I was listening to and listening to it himself was that I actually noticed he did it.  ;)

    There are a ton of other features in the new version you should check out if you haven't installed it yet.  The contact card is pretty neat, but it would be nice if they'd open it up for us to put a different blog other than an MSN Spaces Blog.  It would also be nice for descriptions to do automatic links when I paste a link in there.  I can see why they maybe didn't add that feature, but if I have someone on my list, I trust them, so why not show links?  When listening to music, it's a link to MSN Music to check out the song and possibly buy it which is great, but this feature doesn't work half the time and returns nothing.

    Now for questions.  Does anyone know if the API's are open (they would have to be in some way I would think for the automatic "what i'm listening to" stuff) so we can make our own programs to set the description?  I would LOVE to write an app for my SmartPhone that links in with the Location Based Service and figures out where I am when I run it and sets the description on MSN to "Location: Fort Wayne, IN" or something like that.  Or even just an app that would run when I log in to say "@Work" or "@Home".  What about us uber geeks?  ;)

    UPDATE: Just saw Phil's talking about the music feature too!

    Posted: Apr 25 2005, 03:11 PM by HumanCompiler | with 5 comment(s)
    Filed under:
    Refactor! for Visual Basic 2005

    This is a really great refactoring tool that has now been released for free and will RTM when Visual Studio 2005 RTM's.  This is great and welcomed news since it was announced a while back that VB 2005 wouldn't have native refactoring in it.  The product looks great and again, it's free so have at it!  :)

    http://msdn.microsoft.com/vbasic/downloads/2005/tools/refactor/

    Posted: Apr 21 2005, 02:56 AM by HumanCompiler | with 1 comment(s)
    Filed under:
    WindowsForms 2.0 Settings

    Ok, I just had to share, because this is just too cool (sorry if you've already read about this).  Open up a new WindowsForms application (in VB, although I'm sure this works in C# too, just without the My stuff).  I'm using Beta 2 for this, but I believe it was in Beta 1 as well.  Go into the new Project Properties window and click on the Settings tab.  Add a new setting called "Name" of type String to the scope of User.  Now, open up Form1 and add a TextBox to it.  Select it and go to its properties and scroll down to ApplicationBindings.  Expand it and click the PropertyBindings ellipses.  Check the Text Property and associate it to the Name setting that you setup just a second ago.  Now run the application.  Put your name in the TextBox you created.  Close the application.  Run it again.  Your name's still there, woohoo!  Settings for your application that are user specific with zero code.  How hot is that?

    One thing to note is that when you change the File Version of the Assembly, the settings will be lost, but changing the Assembly Version will not lose any changes (this is a big change from Isolated Storage in .NET 1.1), which is great that you can now control that better.

    I am soooo going to use this one when I start doing some speaking on .NET 2.0!

    Posted: Apr 20 2005, 03:50 PM by HumanCompiler | with no comments
    Filed under: ,
    SQL Server 2000 Reporting Services New Web Site Deployment
    Ok, before I say anything I just want to say that SQL Server Reporting Services is one of the coolest and crappiest things ever!  :P  It is a really neat product and tons easier than Crystal Reports, but man oh man is it hard to setup.  Here's a great little article on how to set Reporting Services on a new Web Site other than Default Web Site, which is what all the examples I could find show.  The short version of the article is that to make Reporting Services work on a new web site in IIS, you have to make virtual directories under your new app called Reports and ReportServer and match every single setting exactly.  Once you do that, everything flies!
    More Posts Next page »