Monday, April 14, 2008

WILL CODE FOR FREE

No it’s not just a catchy title; I mean it. I WILL code for FREE. I am broadly available and would like to volunteer for software projects that will utilize my education/skills/experience or enable me to learn new technologies.

Why do I want to do this?

  • I have a professional degree and want to put it to good use. Under normal circumstances I would have resorted to seeking employment. Unfortunately, my VISA status does not allow me to work and hence the altruistic tone.
  • I fear I will get rusty by the time I am legally allowed to seek employment. I believe that can be avoided by contributing my skills towards some real world projects.

Why should you consider me?

  • I will cost you nothing, since you don’t have to pay me.
  • I have a Bachelors degree in Electronics Engineering and a Masters degree in Computer Engineering from a US university.
  • I have experience (4 years) developing software for diverse domains such as Automotive, Industrial Automation, and Finance.
  • I’ve had the privilege of dabbling with various software tools and technologies. I am good with VB.NET, Perl, InstallShield, and different Rational Tools.
  • I enjoy learning and have a short learning curve for new technologies and industry domains. I am open to re-tooling myself.
  • I like interacting with people. I am considered to be a good team player but I also work well independently with minimum supervision.
  • I am perseverant and take my work seriously. I possess good communication skills.
  • I have exposure to working in multi-cultural work environments and experience with global engineering.
  • I am well versed with SDLC processes, standards and tools.

That's it for here. If I seem like a person that you could use or need more information, please email me . I would love to hear from you.

Thank you for your time and consideration.

Friday, August 17, 2007

MERGE WOES WITH .resx FILES

A few days back, I undertook the task of revamping the GUI of the application that I maintain. The application’s code has been written using VB.NET and Rational ClearCase (2003.06.10+) is the version control/change management tool for the same.


A branch (let’s call it GUI branch) was created off the main branch. The GUI enhancements were performed on this GUI branch. This involved addition of some new controls, changing the properties of some existing controls for one of the form (frmMain.vb) files in the project. After the ‘new and improved’ GUI was given a green, I was faced with the task of merging the GUI branch code with the main branch.


When I attempted to merge the files from GUI branch to main, I received a message to the effect - some of the conflicts could not be resolved by ClearCase, pl. do so via manual merge. The said message was received for the files frmMain.vb (code file) and frmMain.resx (resource file that is automatically generated by .NET). The conflicts in the code file I could resolve, but the .resx file had a large number of conflicts to be resolved (100+). I did complete the manual merge, but obviously I was not sure what I was doing.

Having completed the merge manually I was left w/ code that crashed on execution. That’s when I started searching the Internet high and dry for possible pointers to solving the problem I was facing. I was confident of finding abundant literature on the subject since what I had attempted to do wasn’t anything other-worldly, besides the tools involved were prominent too. I was surprised at not finding much help on the subject. Just as I was about to abandon my search and consider myself ClearCase cursed, I came across this article.


I decided to give KDiff3 a try. On comparing the two .resx files that I was trying to merge I noticed that some of the merge conflicts were due to the insertion of new tags in the middle of one of the files. Clearly if these tags were moved to the end, some of the merge conflicts would disappear.


Unlike ClearCase the merge conflicts in KDiff3 appeared simple to understand and thus resolve. I completed the manual merge of the .resx files via KDiff3. I used KDiff3 as a stand-alone tool and the process was clumsy (copying the .resx files to be merged on my local drive, merging and copying the result to the ClearCase repository). But I got my code to work and was able ship the build! KDiff3 has won my trust.


I must admit that I have not given enough thought about reconfiguring the default IBM® Rational® ClearCase® XML type manager to use KDiff3 when using ClearCase diff merge tools. Whether I will do that sometime soon, is doubtful (for reasons not worth mentioning here). However I wanted to document this mental note here.


To those of you who have come across situations like this and have figured out a work-around; I would like to hear from you.


Another approach that I took to solving this problem was to see if the .resx file would be generated automatically at compile time if it was deleted. In spite of the online reading and hands-on tweaks with .resx files, my understanding of them is still very hazy. Any pointers to understanding resx files will also be greatly appreciated.


On that note…. Tschuss erstmal!





Friday, February 02, 2007

Of TreeView Nodes and their Fonts


If you ever happen to change (upgrade) the font (increase font size or make the font bold) of a node (Class TreeNode) in the TreeView (System.Windows.Forms.TreeView) and run your program, you will be sorry because the label of your node gets clipped!

The only way to work around this is apparently to set the font of your TreeView to the worst case condition; i.e. if you want to make some of the nodes bold then set the font to be bold. Change the font (from Bold to Regular) of the nodes when you actually add the nodes to the treeview.

Here is a quick example -

'Windows form designer generated code

'TreeView Initialization. I only want the root node to be bold, but I set the default FontStyle to Bold

Me.tvwItems.Font = New System.Drawing.Font _

("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

Private Sub AddNodestoTreeView()

'Create font object to change FontStyle of the nodes other than the root node

Dim Font As Font

Font = New Font(tvwItems.Font, FontStyle.Regular)

'Child nodes added

'Change FontStyle for the nodes other than the root node

CurNode.NodeFont = Font

End Sub

I’d appreciate your inputs on smarter workarounds to this.

TIA!

Thursday, February 01, 2007

A Case for ClearCase


I think I am beginning to like ClearCase; it is - smart enough to do the things that I want it to do, ‘not-so-simple’ that I take its rate its simplicity as dumbness and cryptic enough to have me spend hours researching to find a solution when I am stuck. I quite enjoy the digging it requires me to do; hopefully it is the learning curve that I am slowly conquering. The journey hasn’t been smooth, just when I think things are rolling, I am faced with a quirky problem. I probably should have documented my notes much earlier, for better clarity and accuracy, oh well; here they are for your consumption anyway.

I use Rational ClearCase Explorer 2003.06.10+. I use ClearCase as the version control and change management solution for my VS.NET projects.

ADDING A VS.NET PROJECT TO SOURCE CONTROL –

  1. This is THE recommended way to add .NET project to source control.
  2. If a project has already been added to source control through some other method, then it is advisable to change the source control mechanism ASAP. To do so select the solution/project in the .NET explorer and click on File-> Change Source Control. In the window that appears select the rows and click Bind. The Connected column status for each row should appear checked and the Status column should display Valid after a successful Bind operation.
  3. The .suo and .vbproj files will NOT be added to source control if the recommended method of adding to source control is followed. These defaults should not be changed.
  4. Some ClearCase specific files will be added to ClearCase after this operation. It should be ensured that these files are not moved or deleted.

The next thing that you need to know to use ClearCase is writing config. specs. Unfortunately, I have not found a comprehensive guide that helps with writing config. specs. Do you know of any? Pl. point if you do…

THE EARLY HURDLES -



If you are working with a dynamic view you are likely to view the error above. To get past this hurdle, you will need to change the security settings of your machine. Alternatively you could switch to snapshot views.

CHANGING SECURITY SETTINGS OF YOUR MACHINE

  • Start the .NET Configuration 1.1 tool
  • Double click on Mscorcfg.msc in C:\WINDOWS\Microsoft.NET\Framework\V1.1.4322.
  • Double click on Microsoft .NET Framework 1.1 Configuration by going to Start->Control Panel->Administrative Tools.
    • Click on Runtime Security Policy. Then click on Increase Assembly Trust. Select “Make changes to this computer” and click next. Browse to . Click on open. Click next. Move arrow to Full Trust. Click next. Click Finish. Select “Adjust Zone Security”. Select “Make changes to this computer” and click next. My Computer and Local Intranet should have Full Trust selected. Click Next. Click Finish. Exit window. Restart computer.

    If not done correctly, you might get rid of the above mentioned error, but your code will break on you with the exception below. Time to re-trace steps and make sure security settings are set correctly. (To be honest, I don’t recollect the exact sequence of operations that led to this error.)



    ACCESS DENIED ERROR –

    To fix this, you will need to download and install the hotfix says Microsoft.

    If you are a command-line person, you will probably like to execute ClearCase Commands by clicking -

    Start->Run->cmd

    Hit Enter




    LINKS –

    ClearCase Commands1

    ClearCase Commands2

    ClearCase Book

    VS.NET metadata files

    Wednesday, February 01, 2006

    How To: Setup a blog with limited access (GO BLOSXOM!)

    Mood: Monday Blues

    Scene1: Monday morning at work. I need to get feedback about a product from users and domain experts. This feedback will determine (to an extent) the direction in which my project moves. So w/ a cup of hot coffee, I try to get my brain to wake up and think of how I can accomplish the task at hand. I know what I want; something that is far-reaching, simple yet secure. The coffee works and a couple of solutions come to mind. I try to analyze them but each solution seems to have some or the other drawback. Here are some of the options that I toyed around with -

    1. Meet-up in person…..sounds like a good idea to have the company buy me lunch! Nah, but this is not a far-reaching solution. I might end-up meeting only a handful of people. So DELETE it.
    2. Creating a web-page with the desired UI. (You don’t have to be a rocket scientist to figure that out….) Great! But who is going to do it and how much time will it take and all the resource issues and yess dealing w/ the red-tape. DITCH.
    3. Create a new wiki-page and ship the link. People can edit the page and post their feedback, comments. Umm….simple for me but maybe not so simple my target audience. BACKUP PLAN.
    4. Blog….Coolest and neatest. All I need to worry about is the IP and security issues and these ARE the major issues. WAY TO GO iff I can control and limit the access to this blog and also have control over where the content is saved.

    And so I begin my quest for such a blog provider! After about an hour of googling I stumble upon this post .

    Mood: Excited

    Scene2: Eureka! I see a ray of hope in Blosxom and eagerly plunge into its documentation. After some reading, I am 50% convinced that this might work and decide to give it a shot. I plan to try my hand at it for about a day, see what results I get and then make a decision.

    Mood: Jubilant. Professional decorum prevented me from doing a victory dance.

    Scene3: Proudly showing off my piece of work to colleagues, etc; receive appreciative comments, questions, “I-am-impressed-but-don’t-want-to-sing-praises” expressions, etc. Getting this blog up and running was a fun learning experience. Learnt some, refreshed some about Perl, CGI scripts, IIS and HTML.

    Mood: Anticipating

    Scene3: The next step before I actually use this for its intended purpose is of course to get the BOSS’S approval; me waiting for the same.

    HOW I DID IT

    1. Installed the “for everyone” version of Blosxom (V2.0) to run on my windows box.
    2. Downloaded and installed the MSI for Windows of ActivePerl.
    3. Installed IIS on my Windows box. (OS -Windows XP Professional). I host(IIS) my blog locally, so, all the content, including comments are saved on my machine.
    4. Enabled the comments and comments count feature for my blog using the pollxn plugin and pollxn’s plugin for Blosxom. With this, I can have my audience provide me feedback.
    5. I am using anonymous authentication method (default).
    6. Customized the look and feel of my blog using simple templates from the blosxom site.

    SEE, I TOLD YOU SO

    1. Follow instructions. They help.
    2. Knowing perl helps, but you will do fine if you don’t.
    3. Was a wee bit disappointed when I read the “Blosxom for windows – Coming soon”, after spending some time reading the documentation and getting all excited. Don’t worry. The “everyone” version works fine w/ windows.
    4. Windows XP Pro. does not have IIS installed by default. I had assumed it was. I was surprised that my machine did not have the Inetpub and wwwroot folders and went ahead and created them. Very soon I realized the mystery behind their absence; these folders are created during IIS installation.
    5. I had hoped to use the login plugin to have user authentication for my blog. But decided to skip that since my machine would be accessible only within my company domain and that was what I wanted.



    Tuesday, January 24, 2006

    Deploying VS.NET applications

    This post aims at documenting my learnings during the deployment of a VB.NET application using the setup and deployment wizard in VS.NET (Version 2003).

    To InstallShield or not is the question!

    I had used InstallShield for deploying my VB 6.0 application

    • I had looked at the setup and deployment wizard of VB 6.0 and thought it sucked. I thought it was too primitive.
    • I had the .MSI file of the previous version and realized that some quick modifications to this MSI and I would have the installer for the new version.

    Taking the path of minimum effort, I chose InstallShield at that time. ;)

    So when faced with the task of deploying my VB.NET application, I was in a dilemma whether to use InstallShield or the setup and deployment of VS.NET. After playing around with VS.NET’s setup and deployment wizard and inputs from a colleague, I decided that VS.NET it was! InstallShield has a lot of advanced functionalities but VS.NET had everything I needed. Besides I remember reading somewhere that being 3rd party products InstallShield etc do not guarantee correct deployment.

    ORCA

    Orca is a database table editor for creating and editing Windows Installer packages and merge modules. Trying to understand each and every table of an installer in detail is like experiencing an information avalanche (for me) and so I restricted myself to studying this information as and when and as much needed. Having ORCA definitely helps.

    Apparently some customizations for the installer can be done via ORCA alone. For ex. Asynchronous behavior between the installer and program launch after installation can be achieved by changing the Type entry for hex value row in the CustomAction table from 1554 to 1746. This does work, however what I would really like is that, the program should launch after I click the Close button on the installer i.e. the installer is DONE.

    Remember that the changes you make via ORCA will be gone every time you build your Installer project. So don’t forget to redo the ORCA edits!

    WISH

    I keep tweaking my code and thus need to remove and add the EXE to the installer project every time I generate a new EXE. Bad thing w/ this is that I need to re-exclude some files in the dependencies list, re-create all the shortcuts that I have created (because they reference the old EXE), and re-assign all the icon files. What is worse is that the project compiles even if I miss out on one of these and I discover the problem in the form of a non-informative error code, when I run the install. :( How I wish there was an option where by one could just refresh the EXE! (Maybe there is and just that I haven’t discovered it yet)

    WATCH OUT

    • Renaming a Custom Action = BAAD!
    • A “Just me” install will not uninstall an “Everyone” install.

    STILL SEEKING SOLUTIONS

    1. Launching program after Installer has completed installation.
    2. Installing the .NET framework on the m/c during installation if it is not found.
    3. Having the “Would you like to launch program name..” dialog at the end of the installation as per the norm. The Install sequence has 3 phases Install, Progress and End. The wizard disallows any dialogs after the Finish dialog. So even if I place the dialog just before the Finish dialog, the custom action responsible for launching the program runs before this Finish dialog and hence does not work out as I would like it to. As of now, I have my custom dialog somewhere in the Install sequence after the Read Me dialog (very weird!).

    TROUBLESHOOTING

    When faced with an aborted install and a message box with a “not-so-helpful” error code, try running the installer w/ the log option. The log file will hopefully have the clue to all your miseries.

    msiexec /I "installer.msi" /l*v "nameoflogfile"

    Don’t fret if nothing works….because there is always GOOGLE and all the good people in the internet community who share and help! :)

    useful links


    Tuesday, October 18, 2005

    DLL Fundas

    Excerpts from various articles related to DLLs and Registry.

    DLLs Vs EXEs

    Even though DLLs and applications are both executable program modules, they differ in several ways. To the end-user, the most obvious difference is that DLLs are not programs that can be directly executed. From the system's point of view, there are two fundamental differences between applications and DLLs:

    • An application can have multiple instances of itself running in the system simultaneously, whereas a DLL can have only one instance.

    • An application can own things such as a stack, global memory, file handles, and a message queue, but a DLL cannot.

    DLL BASICS

    • Each DLL has a set of classes.

    • Each class has its own set-up functions and sub-routines.

    • Public functions can be accessed outside of the DLL.

    • Private function cannot be accessed outside of the DLL.

    Use the following command to register a DLL

    regsvr32 path\DLLName.dll

    A message will tell you if it was successfully registered. If the registration did not work, make certain that you typed in the path and file name correctly.

    To unregister

    regsvr32 /u path\DLLName.dll

    When a program installs a library (DLL or OCX) file the program's install routine will typically "register" the file with the system. This process tells the system the libraries in the file are available for more than one program to use. (Some DLL or OCX files are self-registering.)

    COM class or Component Object Class (coclass)

    (from the Platform SDK: COM / COM Class Objects and CLSIDs)

    "A COM server is implemented as a COM class. A COM class is an implementation of a group of interfaces in code executed whenever you interact with a given object.

    There is an important distinction between a C++ class and a COM class. In C++, a class is a type. A COM class is simply a definition of the object, and carries no type, although a C++ programmer might implement it using a C++ class. COM is designed to allow a class to be used by different applications, including applications written without knowledge of that particular class's existence. Therefore, class code for a given type of object exists either in a dynamic linked library (DLL) or in another application (EXE)."

    COM object

    A COM object is an instance of a COM Class at the runtime.

    COM class object or Class Factory

    (from the Platform SDK: COM / COM Class Objects and CLSIDs)

    "The basic way to create an instance of a class (COM Class) is through a COM class object. This is simply an intermediate object that supports functions common to creating new instances (COM Object) of a given class (COM Class)."

    COM component

    COM component refers to a binary module, such as a DLL or an Executable. After registering, a component will expose one or more COM Class Object (or Object Factory).

    Type Library

    Type libraries contain the specification (metadata) for one or more COM elements, including classes, interfaces, enumerations, and more. These files are stored in a standard binary format. A type library can be a stand-alone file with the .tlb filename extension, or it can be stored as a resource in an executable file, which can have a .ocx, .dll, or .exe file name extension.

    COM IDs

    In COM world, you have to identify different pieces such as coclasses, interfaces, type libraries, applications, etc. These pieces must be unique in the world.

    COM uses the Globally Unique IDentifier (GUID) to define these different IDs.

    In an Interface Definition Language (IDL) file, you have to use the attribute uuid that stands for Universally Unique IDentifier. A UUID and a GUID are equivalent.

    So, what is a GUID? A GUID is a 128-bit number, usually represented in hexadecimal, which is guaranteed "to be unique across space and time". For example, the following number is a GUID:

    {60B4140E-B0A7-4540-B744-7E1A944E8C78}

    COM borrows this identify system to the Distributed Computing Environment (DCE) naming scheme. The DCE RPC system uses UUIDs.

    The main COM IDs are:

    * LIBID: the Type Library ID, based on GUID.

    * APPID: the Application ID, based on GUID.

    * CLSID: the COM Class ID, based on GUID.

    * IID: the Interface ID, based on GUID.

    * PROGID: the Program ID, based on a text string.

    Class registration and file extension informations are stored under the HKEY_LOCAL_MACHINE\Software\Classes key.

    Hope this information helps you stay away from DLL Hell!

    Some Resources

    COM Objects and Registry in a NutShell