Archives

Archives / 2003
  • Potential Summer Internships

    Ok I have had an on campus interview with Microsoft for a summer internship and I received an email stating I will be flown up to Redmond sometime in January for a second interview. That should be fun.

  • Get Directory Size in .Net

    Here is a code snippet that someone else might find helpful. Also if anyone else knows a better way to do this please let me know.

    /// Returns the size of the directory in bytes
    public static long Size(System.IO.DirectoryInfo dirInfo)
    {
      long total = 0;
    
      foreach(System.IO.FileInfo file in dirInfo.GetFiles())
        total += file.Length;
      
      foreach(System.IO.DirectoryInfo dir in dirInfo.GetDirectories())
        total += Size(dir);
    
      return total;
    }
    

  • Master's Thesis Topic

    I'm finally settled down now in Blacksburg VA and have started my first semester in Virginia Tech's CS Master program. I have found a professor who is willing to be my research advisor and allow me to work on a research thesis dealing with Microsoft .Net. Now I need a topic.

  • Permutations in .NET

    Permutations in .NET Dr. James McCaffrey provides a nice introduction to "permutations" along with some .NET to generate them. He further goes on to use permutations for security purposes, but that's not all they're good for. [Chris Sells]
    Thanks Chris for the article I totally enjoyed it. Of course I'm a math person and I like that kind of stuff. I have allows wondered about a good, clean, efficient way to generate all permutations of a set, but I've just never really took the time to research or develop one. Dr. James McCaffrey did an excellent job of demonstrating this and gave a few examples of what you might apply permutations toward. So if you are interested in math things like I am I would recommend checking this article out.

  • Busy as a bee

    I have not been online much the past 3 weeks or so, In fact I haven't even had access to a computer. 

  • view

    Chris talks about learning to learn. I have to say I totally agree. All through college that is what I kept telling myself, I'm only here to learn how to learn.
    Anyway here is a little algorithm to answer "How to" questions according to Chris which I agree with.

    public void Why() 
    {    
      if(NotClear)
        Why(); 
    }
    
    If you think about it, this is human nature just remember when you were a child and asked Why, Why, Why...

  • Frozen Throne

    Warcraft III Frozen Throne Expansion Set was released today. I've got mine, what about you. Just when you think you might get some work done. :)

  • Quarter Century Old

    A quarter of a century ago my brain was plugged into the Matrix :)

    Man I feel like I'm getting old (although not as old as some of you) :)

  • UP Javascript

    Well I've started using Firebird after hearing about it from these weblogs. So far I like it and I think I'm about to make it my default browser.

    One thing I'm missing from my google toolbar in IE is the Up button to take me up one directory level. So I was thinking of a way to do this and so I decided to write a small bookmarklet:

    javascript:var loc=location.href.match(/(\w+:\/\/[\w.]+\/(?:[^\s\/]*\/)*)[^\s\/]+\/?/); if(loc!=null) void(location.href=loc[1]); UP

    I threw together a regular expression to parse the url to get the parent. I thought some other people may find this useful so there it is.

    NOTE: I have only tested this lightly in IE 6 and Firebird 0.6

  • Ingo's Nine Rules of Remoting

    In this article I try to shed some light on using Remoting in different environments and also recommend which features to use and which to avoid depending on your scenario. If you use Remoting or plan on doing so, this article will help you to avoid a number pitfalls which could lower or even kill your application's stability, reliability and scalability. Read here.

  • Online Bookmark Manager...

    I'm trying to find a good online bookmark manager I have looked into most of them that are list on http://useful.webwizards.net/wbbm.htm but I haven’t found one that I really like yet. Does anyone use one or know of one they think is good? There surely has to be a good one out there somewhere, but until I find one I guess I will have to write my own.

  • weblog Style Sheet

    I created my own style sheet for my weblog, check it out and let me know what you think.  Thanks Andrew for getting me started.  I must warn you that I'm really bad with colors but I did my best. :)  I'm open for suggestions.

  • Random Color from Known Color List

    Some one in an asp.net forum asked how to select a random color from the list of known colors so I wrote a little code to do this. I wrote a GetRandomColor and GetRandomNumber method which uses the RandomNumberGenerator from the System.Security.Cryptography namespace. As far as I know this is the best random number generator built into the .Net Framework.

  • Retrieve the current Framework Directory

    I needed the ablity to get the directory of the most current version of the framework on them machine, but there were no built in functions in the framework to do this (at least none that I could find). So I did a little hunting around and found where the framework installation path is stored in the registry and combined that with the Environment.Version to get the framework directory. Here is a sample function to retrieve the framework directory:

  • SourceForge.Net RSS Feeds

    I know that there has been some talk recently about the RSS feeds for projects hosted at SourceForge.Net but I also just discovered that there are some site wide RSS feeds as well.  Things like Site-wide news, Newly Registered Projects, Top Projects By Download and Top Projects By Activity to name a few.  You can find out about all their RSS here.  I need to stay up to date with projects going on there.  I always seem to forget about them, I guess because they don’t show up very much in google searches.

  • Minimize to SysTray

    I was checking out some of the links on Roy’s weblog and I noticed something called minimize magic so I checked it out.  I really like the idea of being able to minimize my active windows to the systray.  I felt that the particular program minimize magic was a bit sloppy.  So I googled for some other possible programs and I ran across AllToTray and I think it is a lot cleaner.  It does cost $10 but I think it is well worth it.  I actually don’t know how I have lived without a program like this.  It’s great.

  • Enlightenment

    I must be the last person to be "Enlightened" about using NedStat for webstats.  What stat collector do other people use?  Is there a webservice (free) that can collect webstats?  Is there something that can collect stats for rss feeds?

  • Parsing Web Command Line Args Example

    Recently I needed to pass parameters to a smart client exe, so with some assistance from some people on the Develop Mentor lists and some pure hammering of my head against the wall I came up with the following example. I hope this proves useful to others.

  • MyIE2

    A couple of weeks ago I saw mention of MyIE2 from Robert's Blog.  Tonight I finally got a chance to play around with it and it's pretty cool.  I think I'm going to use it as my web browser for a while. Here is a list of things that I like:

  • New .Net De-compiler

    Lutz Roeder has started a blog. If the name doesn't ring a bell, he's got a bunch of useful tools for .NET, including Refelector (for which he released a de-compiler plugin). Unfortunately, his RSS seems a little hosed (it contains unescaped HTML in the <description> tags), which we hope he gets fixed real soon now. Anyway, welcome!

  • Blog Shares

    Wow my valuation is $433.22!  I finally claimed my blog.

  • CodeProject RSS Feed moved.

    I believe that Codeproject is making an official rss feed, but who knows exactly when that will be done.  So as many of you already know I have created an unofficial feed.  There has been some issues with the feed though, namely I was hosting it from my Window XP machine which only allows for 10 concurrent connections.  It has been added to a lot of peoples RSS Aggregators so people are getting a “too many connections” error sometimes.  It has had more that 14,000 hits in the last week, granted most of those are hits from Aggregators.   I have moved it to http://wes.www4.dotnetplayground.com/codeprojectrss.aspx., but for now I have the old link http://www.puzzleware.net/CodeProject/rss20.aspx redirected to the new link so everyone should still be able to access it.  If anyone has some space and is willing to host the feed let me know and I will give you the code.

  • Big Day

    Well as I’ve posted before, for those interested.  I have decided to attend Virginia Tech’s CS grad program so I will be moving to Blacksburg, VA in August.  But even bigger news is that my fiancé (Ramola) and I are getting married July 18, in VA.  She is from India so in December we will be going to India to have an Indian wedding there.  This next year will be an interesting one for me. 

  • .Net vs Baseball

    I have been pretty quite as of late on the blogging front, primarily because I haven't been sitting at my computer as usual.  I have been getting outside and running more (preparing to run a 5k soon) since the nice weather has hit.  I have also been watching a lot of baseball.  Baseball has been my favorite sport since I was in junior high when the Reds swept the Athletics in the 1990 World Series.  Yes I'm a Reds fan I still support my home team, even if they do suck.  I have also been concentrating on my Yahoo Fantasy Baseball team, I’m in first right now yippy.  I guess it is a good idea for me to unplug from my computer every now and then. 

  • Symmetric Encryption/Decryption Example

    A friend of mine asked me today how one would go about encrypting something using the Rijndael algorithm (also known as AES) using the .NET framework. I’ve done some crypto work, so I whipped up a quick example for him. It turns out to be pretty much exactly the same as using any other symmetric algorithm like DES. I've posted the code and a brief explanation here.
    [CraigBlog]

  • .Net Regular Expression Site

    I ran across this pretty cool .Net Regular Expression site at www.dotnetcoders.com today, thanks to www.dotnetwire.com, and I figured I would pass it on.  I have been thinking about putting up a .Net Regular Expression Tester/Resource, something I could easily access for reference whenever I'm writing regular expressions.  I'll see, I may still put something together, if for no other reason than to learn more about regular expressions.

  • Back from Virginia, finally

    I spent the last 4 days in Blacksburg Virginia checking out Virginia Tech's campus.  I have decided to accept my TA offer from Virginia Tech and attend their CS grad program. 

  • TinyUrl

    TinyUrl is a service that allows you to turn those huge wrapping urls like this:

  • Completely online email clients

    I'm been trying to find the best completely online email client such as oddPost and fastmail.  I like oddPost's GUI but it doesn't have all the features, I like fastmail's features but it doesn't have a very good GUI.  Does anyone else use a completely browser based email client online that has a nice GUI and has a nice set of feature, especially the ability to check other pop/imap accounts?

  • Over write text in a window's console application

    Today I had a need to display a counter on a Console application and I was trying to think of a way to over write the existing number with the new number in the console window, using C#.  So after thinking about it for a minute it came to me, just write backspace characters.  Well anyways just incase anyone would ever need this here is a simple example: 

  • NiftyPortal

    I stumbled upon this pretty cool online news reader a while ago and I just happened to stumble upon it again and I figured that I would pass it along.  NiftyPortal

  • Using Embedded Images in ASP.Net V2

    Thanks to Yves and Peter for the advise I utilized your advise to create a new version my embedded Image example. I did switch to an ashx file, I didn't even know about this file type until now. I'm no longer passing in the assembly as a parameter but I didn't want to put the assembly in the config file either, so I figured that I would just test for the image by the passed in name in all the assemblies loaded into that AppDomain. There shouldn't be to many right? But you do have to make sure that embedded image has a unique name, that shouldn't be to hard though because you can prefix it by your namespace.

    <% @ webhandler language="C#" class="ImageHandler" %> 
    
    public class ImageHandler : System.Web.IHttpHandler 
    { 
      public void ProcessRequest(System.Web.HttpContext context) 
      { 
        string image = string.Empty;
        System.IO.Stream stream = null;
          
        try
        {
          context.Response.Clear();
    
          // Get Image Name from request
          image = context.Request["img"].Replace("/"".");   
      
          // Find image in loaded assemblies
          foreach(System.Reflection.Assembly asm in System.AppDomain.CurrentDomain.GetAssemblies())
          {
            stream = asm.GetManifestResourceStream(image);
            if(stream != null)
              break;
          }
          
          // Throw exception if image is not found
          if(stream == null)
            throw new System.Exception("Image not found in loaded assemblies");
                
          // Create an Image object from the stream
          System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
          
          // Save the Image stream to the output stream
          img.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
        }
        catch(System.Exception ex)
        {
          context.Response.Write("Exception: <BR>image = " + image + "<BR>" +
            ex.Message + "<BR>" + ex.StackTrace.Replace("\n""<BR>"));  
        }
        finally
        {     
          context.Response.End(); 
        }; 
      } 
       
      public bool IsReusable 
      { 
        get { return true; } 
      } 
    }
    

    So what do you guys think about revision 2?

  • Using Embedded Images in ASP.Net

    This will prevent me from having to copy all the images; all I would need to copy is the Assembly and the image.aspx file.  What do you guys think?  Does anyone see any potential problems with this?

  • Memobook and DevBuddy

    I ran across this free service for organizing notes from any where(with IE internet access).  It is called The Notes Bar. I was thinking that this is a good idea and maybe something along this idea can be developed for DevBuddy To where we can access todo lists, code snippets, articles, and alerts from anywhere.

  • .Net Rocks Talk Show

    I'm sure that most everyone has heard about this but if not Carl Franklin is creating some .Net Rocks radio talk shows.  Where he and Mark Dunn have interviewed people such as Alan Cooper, Chris Sells, Mark Anders, and many more.  They cover a lot of cool stuff about .Net.  I just downloaded all of them and I'm catching up with all the earlier shows. 

  • OddPost

    I'm considering moving away from outlook for a new internet based email client (that look pretty close to outlook) called oddPost.

  • MLB.TV

    For those of us who are baseball fans now we can watch all the baseball games online http://mlb.tv. I'm slowly eliminating the need for a television what so ever. Last year I would say about 80% of the TV I watched (which was not much) were baseball games. I don't know about everyone else but I know my computer has replaced my TV by a long shot. I spend at least 12 hours a day on the computer (that includes my 8 hours at work). Is this good for a person? I'm truly addicted to programming. I think I need to go to programmers anonymous.

  • Self-write: the program that writes itself

    I was wandering through Hugh Browns Website and I ran across this: Self-Write programming challenge.  I found it very interesting. He gave a solution for it in C so I'm going to try and do it in C#. If anyone already has a solution in C#, please don't post it because I want to try and figure it out myself first.

  • Auto Complete in VS.NET

    As I was typing code today I realized that I find myself typing CTRL-SPACE a whole lot. Is this just me or do other people do this as well?  For the people who don't know what this does it either drops down an intellisense list based on the context of where you are typing or if there is only one entry that matches what you have typed it will fill in the rest of you.  It is always nice to say some key strokes.

  • Design Patterns

    Lots of buzz about this at the moment so I thought I'd share the links I've built up so far...

  • Secure .Net Remoting

    I know this is probably old news to some people but If you haven't already seen this there are some nice resources on securing .net remoting, plus I'm going to be doing some of this in the near future so I thought I would post it so I don't forget where I found it.

  • Congress sets up cybersecurity panel

    Congress approved a Cyber Security Research and Development Act in November 2002 that would give universities about $900 million during the next five years to create security centers, recruit graduate students, and pay for research.

  • Listeners and Reflection

    So I was a little slow to catch onto these types...I was still writing to text files and adding message boxes all over the place.  Here is a decent 'How To' link for those interested:

  • Grad Schools

    Well I've got accepted to the CS Grad Program at the University of Tennessee and University of Virginia with a full assistantship to both. Now I'm waiting to for a response from Virginia Tech and then I can make a decision of where I want to go.  Assuming I get the accepted and get assistance from Virginia Tech I will be faced with a tough decision.

  • About Me

    For the most part not too many of you know much if anything about me, so I figured I would tell.

  • Using Serialization as a general Deep Copy

    I have a theory that I would like to run by everyone.  Assuming a class say TestClass is Serializable. Would the following function work in general to do a deep copy of that class?

  • How private are private fields?

    The other day when I was working on creating a object/assembly browser for the web I was thinking about the power of reflection.  Using reflection you can get access to any any part of a class including private members.  So I wrote a simple project to test and see I could change private fields using reflection, or call private methods using reflection.

  • VB.Net to C# code converter

    ImmuniCodeSM Introduces VBCSM - for Automatic Conversion of VB Source Code to C#
    VBC is the only software available that takes VB6 or VB.NET code and turns it into C# inside Visual Studio.NET. VBC is an Add-In for Visual Studio.NET, accessible from Visual Studios Tools menu. Translating a VB6 or VB.NET project file to C# takes just one click. ImmuniCode's VBC increases productivity, decreases labor cost, and simplifies the translation process from VB6 or VB.NET to C#. VBC is available at a special pre-release price until April 1, 2003.[.netWire]

  • Curiosity...

    Just out of curiosity I would like to know how many people (if any) are subscribed directly to my blog? 

  • File Uploading with ASP.Net

    File Uploading with ASP.NET
    A comprehensive tutorial on uploading files to server hard disk using built-in ASP.NET server controls. Describes how to upload more than one file, how to upload only image files, how to retrieve other form non-binary field values, how to view and delete files uploaded on the server, and so on. [.netWire]

  • Change file templates in VS.Net

    If you are like me every time you create a new file in VS.Net you change the way code is arranged or laid out.  Well here is a tip for you. 

  • Quick Reference Cards

    Maybe you guys have already seen this site but I just stumbled upon it today http://www.digilife.be/quickreferences/quickrefs.htm.  It has some good condensed reference cards for some (older) programming technologies. These could come in handy sometime if anyone ever needs a quick reference on something.  The uml reference would have came in handy a few weeks ago when I was looking for some nice clean examples.

  • NewsIsFree.com

    Does anyone use newsIsFree?  If so can you tell me if dotnetweblogs supports Blogger API or the metaWeblog API so that I can setup my blog through there site.  Also does anyone subscribe to there premium services, I'm wondering if they are useful? 

  • Why Did Google Want Blogger?

    This is an interesting article about how Google acquired Pyra Labs, the company behind Blogger, because of possible searching techniques.

  • Saving Application/User Settings using XmlSerialization

    Quite a few people seemed to like the XmlSerializer-based IConfigurationSectionHandler I wrote. Cool! A few people asked about how we could use this same technology to write to the config file, though. Of course, this is a Bad Idea. As anyone who has taken the plunge knows, normal users do not have permission to write to the application configuration file. What you are supposed to do is to write to one of the special folders under Documents and Settings. Here is s a simple helper class to help you do exactly that.[CraigBlog]

  • Y2K bug still alive

    106 woman was told she needed to goto first grade (because the computer thought she was 6)

  • The Last Configuration Section Handler I'll Ever Need

    I'm sure someone, somewhere has already written this, but I figured it out on my own today, and it's just too cool not to share. Basically, it's a bit of code that lets me store objects in my application of web configuration file, and all I have to do is write the type that holds the values.

  • C# Lexer/Parsers links

    There was a discussion on the DM lists about lexers and parsers so I just thought I would post some useful links and if anyone else knows of any links then by all means post them in the comments.

  • Collapsible code ... I love it

    I don't know about everyone else but I love collapsible code and regions in VS.Net.  I find myself breaking down all my classes into regions, such as Private Fields, Constructors, Public/Private Methods, Public/Private Properties, and Event Handlers.  And if you have learned the Ctrl+M, Ctrl+O(Collapse to Definitions) shortcut yet maybe you should.  I found myself hitting Ctrl+M, Ctrl+O every time I opened a code file so I created an addin that will collapse code to definitions every time I open a source file.  I love it.

  • Backup and running...

    Well I'm finally backup and running.  Yesterday with all the snow/sleet/ice in the Cincinnati area I was without power from about 5pm-10pm and to top that off once I got power back I was without my cable modem until this morning.  It is scary how helpless I feel without internet access. 

  • <acronym> tag

    Maybe I'm the last person to know about this tag, but when I ran accrossed it today I thought it was pretty cool.

  • Prevent your setting from being changed in Internet Explorer 6/Windows Explorer.

    Are you tired of your toolbars or status bar not staying the same way each time you start internet explorer or open a new window?  I hate it, so I have done some research and come up with this solution.  This solution works for me at least, I am running IE 6 SP1 with Windows XP professional SP1, I haven't tested in with others but I believe it should work with IE 5 and above and Windows 2000/XP.  Here is a list of steps to take:

  • Ingo newsletter

    I just subscribed to Ingo's newsletter, it is sure to be an excellent read.

  • .Net Websites

    I have created a list of .Net sites that I visit regularly under .Net Links.  Are there any other big sites on .Net that I'm missing?  If so then please leave a comment telling me. 

  • About Me

    For the most part not too many of you know much if anything about me, so I figured I would tell.

  • My very first blog entry!

    I have been reading all about the blog hype on the Develop Mentor lists and Chris Sells' Win_OT list so I figured I would give this a try.  I've ever been one to be very talkative but hey I will try anything once.