Thursday, March 11, 2010 Register  Login
RSS Feeds
Categories
  
Blog Archives
  
Blog

Code

    New version of SVNManagerLib on CodePlex

     820 Views ::  0 Comments RSS comment feed

    I just finished creating a new release on CodePlex for SVNManagerLib 0.5.6. Here is a list of what is new:

    NEW - Upgraded the solution to Visual Studio 2008.
    NEW - Started introducing interfaces
    NEW - Introduced lazy loading of anything below repository level
    NEW - Deprecated SVNController for SubversionServerController
    NEW - Deprecated SVNRepository for ISubversionRepository, SubversionRepositoryBase, and SvnServeRepository. This will open the way for eventually adding Apache support.
    NEW - Broke out RepositoryRootDirectoryDoesNotExistException into a file
    NEW - Added support for using a global configuration file.
    NEW - Added support for Subversion Realms.
    NEW - Finished the code for loading dump files. Hasn't been tested yet!
    NEW - Added RepositoryRootDirectoryDoesNotExistException.cs to help deal with the issue of disconnected mapped drives in Vista.
    NEW - Many little code refactorings to help readability

    http://www.codeplex.com/svnmanagerlib

    posted @ Tuesday, February 10, 2009 1:58 AM by Hector Sosa, Jr

    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    SVNManagerLib and Linux

     562 Views ::  0 Comments RSS comment feed

    I was installing one of my new 1 tb drives on my system at home. I went ahead and moved all my virtual machines to this new drive. While doing this, I found that I had downloaded a VMWare image from the Mono Project. This has Mono 2.0.1 and Suse 11.0. Since I was wide awake from my migraine medication, I decided to see if could still compile SVNManagerLib on Linux. To my delight, MonoDevelop compiled it fine, without any errors. Here's a screeshot fo SVNManagerLib compiled in MonoDevelop 1.0 running in Suse 11.0:

    svnmanagerlib compiled in MonoDevelop 1.0

    And here is a screenshot of the TestHarness winform app compiled successfully as well:

    And here is the TestHarness running from MonoDevelop:

    This is soooo cool! I just downloaded the zip file from the CodePlex page at www.codeplex.com/svnmanagerlib I clicked on the Source tab, then downloaded the last changeset. It worked without any changes to the source. This is the library that powers PainlessSVN and SVN Backup Widget.

    Now I just need to find a good tutorial on how to install Subversion in Suse 11. I'm a total n00b when it comes to Linux, and none of the How-To docs out there have helped me here. Anybody has a good resource for installing Subversion in Suse 11?

    posted @ Sunday, January 11, 2009 2:02 AM by Hector Sosa, Jr

    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    Sending license key emails from DotNetNuke

     822 Views ::  1 Comments RSS comment feed

    The integration that I had with my ecommerce DNN module (ActivePurchase) broke when I moved the site to PowerDNN. I have been fighting with this for a couple weeks now.

    Here's what happened:
    The part that sends the serial number did not work anymore, because the SMTP server was not on the same network. Changing the settings did not work at first. I went googling for sending emails from DNN. I got some good hits for sending email from inside DNN modules.

    The API for this is fairly simple (relatively). You first make a reference to DotNetNuke.Services.Mail. Then you make a call to the Mail.SendMail() method, with the appropriate parameters. There are 5 overloads. The call from a module would look like this:

    DotNetNuke.Services.Mail.Mail.SendMail(FromAddress, SendTo, "", Subject, Body, "", "", "", "", "", "")

    Well, that didn't work. So now I was scratching my head.

    I am using a special type of integration called a custom step, which is just an assembly in the bin directory for the DotNetNuke install. I had to go and dig into the event log that DNN keeps. There were several exceptions there. The message was that the SMTP connection needed to be authenticated. WTF??

    Custom DNN modules use the SMTP settings that the administrator has setup. However, the custom step does not get treated as a module. So I had to do this:

    DotNetNuke.Services.Mail.Mail.SendMail(FromAddress, SendTo, "", Subject, Body, "", "", "", "", UserName, Password)

    Once I did that, the custom step started sending emails like before. YES!

    Now that this is fixed, I can get my undivided attention back to PainlessSVN and SVN Backup Widget stuff.

    posted @ Monday, November 24, 2008 10:29 PM by Hector Sosa, Jr

    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    PainlessSVN now integrated with the Shell icons

     702 Views ::  0 Comments RSS comment feed

    I finally got PainlessSVN to read the icons that are associated with files in the Windows shell. That took some Win32 API hacking though.

    Here's a screenshot of the left hand side treeview:

    Here is a screenshot of the details pane:

     

    I got the base code for doing this from this Microsoft link:

    www.microsoft.com/downloads/details.aspx

    This code is VB.NET, but it's fairly easy to convert to C#. Ok, I cheated. I pasted the VB.NET code into SharpDevelop 3.0, and let it convert it to C#. Didn't have to change anything. Visual Studio took the code without complaining.

     

    posted @ Sunday, September 07, 2008 4:18 PM by Hector Sosa, Jr

    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    Retrieving login data for DotNetNuke

     704 Views ::  0 Comments RSS comment feed

     


    Well, I had a hair pulling session trying to recover the passwords on my hobby site. Both my admin and host paswords got hosed, so I couldn't just login and fix them.
    I first went Googling to find a winform app to help with this problem. Well, all the solutions were just modules to install on your DotNetNuke installation. Since I can't even login as host, this approach is just totally useless. Thankfully, DNN uses the ASP.NET 2.0 Membership Providers.
    So, I started with Membership.Provider.RetrievePassword(). Oops, "Bad Data". Crap! I tried other account passwords with the same result. Double-Crap! I modified my little winform app, to now reset passwords. This time I used Membership.Provider.ResetPassword(). Got a new password for host, and I was able to login now. YES! I'm using .NET 2.0 for this winform app.
    So if you want to get this working, here is what you need to do:
    Make sure that you include the following sections from your DNN's website web.config file:
    connectionStrings
    system.web
    You only need the membership and machineKey sections inside system.web.
    Import System.Configuration and System.Web into your project. All of the needed API calls will be under Membership.Provider namespace. You'll find a lot of samples on how to use on Google.


    Anyways, I wanted to put it somewhere, so that I can find it later, WHEN I would need to do this again.

    posted @ Monday, June 16, 2008 11:09 AM by Hector Sosa, Jr

    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    Little visual tweak

     502 Views ::  0 Comments RSS comment feed

    I have several Subversion servers on my network, so I'm registering new servers in PainlessSVN fairly often. I got tired of trying to figure out what server I was hooked to, so I added a little visual tweak on the server node.

    Server node has server name and drive

    So now, I can tell exactly what server I'm working with at a glance. I will probably end up adding the ability to keep several servers registered, a la Enterprise Manager and SQL Server Management Studio.

    I had to mess with Win32 APIs in order to get this working correctly. Here are the API calls that I used:


    public
    const uint DRIVE_UNKNOWN = 0; // unknow drive type
    public
    const uint DRIVE_NO_ROOT_DIR = 1; // invalid root path was given to the function
    public
    const uint DRIVE_REMOVABLE = 2; // removeable drive like a floppy
    public
    const uint DRIVE_FIXED = 3; // a fixed drive like a hard disk
    public
    const uint DRIVE_REMOTE = 4; // a network drive
    public
    const uint DRIVE_CDROM = 5; // a cd-rom drive
    public
    const uint DRIVE_RAMDISK = 6; // a ram disk
     
    [DllImport("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    public
    static extern uint GetDriveType(string lpRootPathName);

    [DllImport("mpr.dll")]
    [return: MarshalAs(UnmanagedType.U4)]
    public
    static extern int WNetGetUniversalName(
    string
    lpLocalPath,
    [MarshalAs(UnmanagedType.U4)] int dwInfoLevel,
    IntPtr
    lpBuffer,
    [MarshalAs(UnmanagedType.U4)] ref int lpBufferSize);

    posted @ Wednesday, April 02, 2008 10:22 PM by Hector Sosa, Jr

    Posted in: PainlessSVN, Code
    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    Updated code for file path to file URL

     488 Views ::  5 Comments RSS comment feed

    After some more testing I found that the URIBuilder class does not work correctly with UNC path. Here's the updated code: 

    public static string PathToFileUrl( string pathToConvert )
    {
        string fileURL = "";
        bool isUNC;
        UriBuilder fileURI = null;
     
        // This is to capture whether the incoming path is
        // an UNC path or not.
        if ( pathToConvert.StartsWith( @"\\" ) )
        {
            isUNC = true;
        }
        else
        {
            isUNC = false;
        }
     
        try
        {
            fileURI = new UriBuilder( pathToConvert );
        }
        catch( UriFormatException ex )
        {
            // This is for debugging
            string msg = ex.Message;
        }
     
        if ( isUNC )
        {
            if ( fileURI != null ) fileURL = fileURI.ToString();
        }
        else
        {
       if ( fileURI != null ) fileURL = fileURI.ToString().Replace( "file://", "file:///" );
        }
     
        return fileURL;
    }

    posted @ Wednesday, October 31, 2007 12:33 AM by Hector Sosa, Jr

    Posted in: Code
    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    Code to convert a file path to a file URL

     567 Views ::  0 Comments RSS comment feed

    I had an interesting time fixing a bug in PainlessSVN when using UNC paths. I had a function in SVNManagerLib that converted the path to the file:/// format. This is what the original looked like: 

    public static string PathToFileUrl( string pathToConvert )
    {
         string parsedDir = "";
         StringBuilder arg = new StringBuilder();
     
         parsedDir = pathToConvert.Replace("\\", "/");
     
         arg.Append("file:///");
         arg.Append((char)34);
         arg.Append(parsedDir);
         arg.Append((char)34);
     
         return arg.ToString();
    }

    That didn't quite work. I did some Googling and found the answer. Let me post the code first then, I'll explain:

     

    public static string PathToFileUrl( string pathToConvert )
    {
        UriBuilder fileURL = new UriBuilder( pathToConvert );
     
        return fileURL.ToString();
    }

    The UriBuilder is a special class that helps build valid URIs. I keep learning this lesson over and over... Don't re-invent the wheel, just use what the .NET framework already has. There's quite a bit in there. I've been using .NET since 2002, and I keep finding these little nuggets.

    posted @ Tuesday, October 16, 2007 8:11 PM by Hector Sosa, Jr

    Posted in: PainlessSVN, Code
    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    Windows subliminal messages about taking a NAP...

     648 Views ::  0 Comments RSS comment feed

    When debugging MMC snapins, you have to add them to the MMC console manually. I found something quite amusing that I haven't noticed before. I was actually thinking that I needed a nap, when I noticed this:

    I thought that was pretty amusing, but that might be because I'm pretty tired.

    posted @ Sunday, September 09, 2007 4:43 PM by Hector Sosa, Jr

    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

    Good-bye NAnt, Hello FinalBuilder

     667 Views ::  0 Comments RSS comment feed

    I have been using NAnt since around version 0.81. It is more powerful than batch files, but still as annoying. Unfortunately, NAnt has stagnated at version 0.85. It can't compile solutions, so you have to shell out to MSBuild in order to do that.  Anything more complex than copying, zipping, and compiling turns into a morass of back referencing spaghetti. The one thing that could had kept NAnt shinning would have been a nice editor that was NAnt aware.

    The only thing I've found to edit NAnt scripts in a contextual fashion was Nantpad. Unfortunately, this is priced above the sweet spot price for mISV. I've found that this price is around $150 for most developer tools. Anymore than that, has to be justified in doing more than one thing. My personal feeling is that NAnt is going to go the way of NDoc. The reasoning behind that could be a whole post in itself, but I'm not going to that today.

    Enter Finalbuilder. I have been following this tool since the time it was a one man operation. Back then it was listed with AtoZed Software's website. The company has since grown and now host their own website. Back then I was a Delphi and VB6 programmer, doing system-type programming. I built tools for automating business processes, much like what FinalBuilder does now.

    The beauty of FinalBuilder, is that I had only had to look at the help once, in all the years I had used it for work. Not only is it fairly intuitive to use, but it is a joy to work with. It doesn't get in my way. I know that Joel Spolsky uses it to do regular system maintenance activity at FogCreek. You can read what he says here: http://www.joelonsoftware.com/news/20020813.html

    FinalBuilder is out of the sweet pricing spot I mentioned before, but it can justify the price, because it does the automation well for many things, not just doing daily builds. Just as Joel's team, I'm going to be using it to automate several of my system maintenance tasks.

    I already been using it for building Beta 1. It has saved me about 45 minutes for the build time. The other big allure is that I now have a repeatable build process. This has also cut down on the manual typos that can creep in when doing NAnt scripts. I want to absolutely automate anything that I'm doing. I just don't have the time to be monkeying around, especially now that I'm much older (40 in a couple months). Monkey businesses is for younger people.

    I find that FinalBuilder is the most polished build system in this class of software produts. I have tried several others. Here are the competitors:

    I haven't used Automated Build Studio, but to be honest, I don't see how it could beat FinalBuilder. I think that the main reason for this, is that I, as a customer, have access to Vincent, the creator. That personal relationship/touch will trump any other emotional argument every time. I know a couple mISVs that use Automated Build Studio, and they tell me that they don't have that personal touch with that product. I always favor smaller companies, especially because of this personal touch. This touch is what is missing in today's business environment.

    I'm going to cut this short here. I was in the hospital earlier today, and I'm still under the weather. I'm surprised that I was able to be this coherent at all. Maybe I just write better when I'm on drugs, Promethazine at this moment. LOL. Anyways, I hear my bed calling to me.

    posted @ Wednesday, August 29, 2007 10:02 PM by Hector Sosa, Jr

    Posted in: Code, .NET Tools
    Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us
    Page 1 of 2First   Previous   [1]  2  Next   Last   
    Terms Of Use | Privacy Statement | SystemWidgets
    Copyright 2002-2010 by SystemWidgets
    Google Analytics Alternative