Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Contents tagged with Software Development

  • Notes on the software build process

    The build process is more than just a compilation of the code that is done on a developer's workstation, a good build process is able to generate the final set of artifacts that is sent to the user in one step. For e.g. a build process for a desktop application would build the installer, documentation, licenses etc. for the entire product, in case of a web application the build will compile the code files, supporting assets and deploy to a test or staging server. A good build system should be configurable and able to build multiple editions of the product.

  • VSS Automation script

    In our company we have a policy of creating a checkin mail that describes the files that you are checking in and what changes or bugs have been fixed in that checkin. The process of creating the mail involved opening VSS and then getting a list of all checked out files and then copying and pasting that to the mail. I've always wanted to get into windows scripting and i thought what better oppurtunity than this. So i wrote this small script that gets a list of all checked out files from VSS and then creates a new mail with the required info already filled in.
     
     
      var oVss = new ActiveXObject("SourceSafe");
      oVss.Open("
    <Insert path to srcsafe.ini>");
      var oProj = oVss.VSSItem("<Insert project path e.g. $/");
        
      var allProjects = new Array();
      allProjects = GetAllProjects(oProj,allProjects);
        
      var output = "";
      var projItem;
      var projEnumerator = new Enumerator(allProjects);
      for (; !projEnumerator.atEnd() ; projEnumerator.moveNext() )
      {
          projItem = projEnumerator.item();
          var checkouts = GetCheckedOutFiles(projItem);
       
          if(checkouts.length > 0)
          {
              output += projItem.Spec + "\n";
              var checkoutEnumerator = new Enumerator(checkouts);
              for(;!checkoutEnumerator.atEnd();checkoutEnumerator.moveNext())
              {
                  var checkoutItem = checkoutEnumerator.item();
                  output += "\t" + checkoutItem + "\n";
              }
        
              output += "\n";
          }
      }
      
      var olApp = new ActiveXObject("Outlook.Application");
      var mailItem = olApp.CreateItem(0 /*olMailItem*/);
      mailItem.Recipients.Add("<Insert e-mail address to send mail to>");
      mailItem.Body = "\n" + output;
      mailItem.Display();
      
      function GetCheckedOutFiles( projectItem )
      {
          var checkouts = new Array();
          var itemEnumerator = new Enumerator(projectItem.items(false));
          for(; !itemEnumerator.atEnd(); itemEnumerator.moveNext())
          {
              var item = itemEnumerator.item();
              //File
              if(item.Type == 1/*VSSITEM_FILE*/ && item.IsCheckedOut == 2 /*VSSFILE_CHECKEDOUT_ME*/)
              {
                   checkouts.push(item.Name);
               }
           }
           return checkouts;
      } 
      
      function GetAllProjects( rootItem )
      {
          var projects = new Array();
          var items = new Enumerator(rootItem.items(false));
       
          for(;!items.atEnd();items.moveNext())
          {
              var item = items.item();
              //Project
              if(item.Type == 0 /*VSSITEM_PROJECT*/)
              {
                  projects.push(item);
          
                  var subProjects = GetAllProjects(item);
                  var subProjectEnumerator = new Enumerator(subProjects);
                  for(;!subProjectEnumerator.atEnd();subProjectEnumerator.moveNext())
                  {
                      var subProjectItem = subProjectEnumerator.item();
                      projects.push(subProjectItem);
                  }
              }
       }
        return projects;
      }
      
      function printItems(items, prop)
      {
          var itemEnumerator = new Enumerator(items);
          for(;!itemEnumerator.atEnd();itemEnumerator.moveNext() )
          {
              var item = itemEnumerator.item();
              WScript.Echo(item[prop]);
           }
      }

  • Damn CS-RCS

    Yesterday, i installed CS-RCS from ComponentSoftware, i was looking for a configuration management component which we could integrate into our product which needs to support document versions. ( I still haven't found any suitable candidates) So anyways i try to open the solution today and it says that source control status is invalid. After beating my head for one hour trying to figure out what was wrong with VSS i saw that the repository selected was CS-RCS...aaargh, the least these guys could have done was provide a SCC switcher like these guys and this guy and this guy and this guy have already done.  Is that too much to ask? (Even i didn't know there were so many options before i googled)

    It turns out that CS-RCS changed my SCC provider to CS-RCS now to restore it i had to execute ssint.exe from vss\win32 folder and i could access source control now. But the episode was really nasty, especially  coming from a company that makes configuration management tools. So if any guys from ComponentSoftware are listening,  please provide a SCC switcher or atleast restore the previous one on uninstallation.

  • The x86 Prayer

    Found this amazingly geek goody on Matt's site ( Shame on you if you don't know who he is) . I was literally ROTFL after reading this,

    Our Caller, who art on the stack frame
    Hallowed be thy Parameters
    Thy Address Space come
    Thy I/O be done
    In Registers, as it is in Memory
    Give us this day our periodic timeslices
    And forgive us our page faults
    As we forgive those who pass invalid parameters
    Lead us not to unconditional JMPs
    But deliver us from segment registers
    For thine is the Address Space, the Registers, and the I/O ports
    Jmp $
    Ret

  • Identity Crisis

    I had  been trying to connect my laptop to my home pc using a cross cable for so many days. Finally yesterday i decided to get it done no matter what.  The problem was that despite all  proper TCP/IP settings the two computers were not able to ping each other. I cleared my ARP cache, reinstalled the cards, changed subnets and IP addresses but to no avail. The green light was flashing on both cards and yet somehow they could not ping each other.
     
    Well after going through all the settings again and again and again, it finally hit me, both comps were named 'Sijin' , that might be causing the problem. So i renamed my home pc and after a reboot i had two way pinging wooooooot!!! :D :D
     
    Moral of the day : Give your babies seperate names.