Archive for the 'Work' Category

Moonlighting

I first heard of this word when my former boss told me this line “Aha! You are moonlighting!”. I was clueless then what does that mean. I wanted to tell him, “what do you want me to do?” but the clarification came first of its meaning: “sideline aka work outside formal work (employment)”. Of course I was relieved when he said that it was OK (well not that he explicitly mentioned it though I never got any reprimand nor suspension out of that. :P). Well of course, as courtesy, you should inform your boss if you have any other work aside from your work just to put things properly and to prevent any conflict of interest that may arise.

Some time after, I encountered the word in an unexpected scenario: in the registration part of Visual Web Developer Express. On the bottom part of the registration, you can see the following:

untitled.jpg

Of course, you saw my answer (:P). Good thing the Microsoft guys know that some developers are really moonlighting. 😛

Advertisements

Sourcesafe Automation Tips

I am currently playing with the Visual Sourcesafe Automation for implementation in one of my projects. I was trying to traverse the files of a specific project (aka folder) and the code in Visual Basic.NET works like this:


Dim vssDB As IVSSDatabase = New VSSDatabase
vssDB.Open("srcsafe.ini location", "username", "password")
Dim sfolder As VSSItem
sfolder = vssDB.VSSItem("$/MyProject").Items(True).Item(1)

Dim xItem As VSSItem

For Each xItem In sfolder.Items(False)
System.Diagnostics.Debug.Print(xItem.Name & " - " & xItem.VersionNumber)
'xItem.Checkout()
'xItem.Checkin()
'xItem.Get("c:\\temp1")
Next

If I want to perform some of the operations (such as check in/out), I just have to modify the lines in the for each loop to work. Since I am a C# developer, I translated the same code and it appears like this:

IVSSDatabase vssDB = new VSSDatabase();
vssDB.Open("srcsafe.ini location", "username", "password");
VSSItem sfolder;

sfolder = vssDB.VSSItem("$/MyProject").Items(true).Item(1);

VSSItem xItem;

foreach ( xItem in sfolder.Items(false)) {
System.Diagnostics.Debug.Print(xItem.Name + " - " + xItem.VersionNumber);
//xItem.Checkout();
//xItem.Checkin();
//xItem.Get("c:\\temp1");
}

What keeps me wondering is that the code for VB works while the one for C# had errors. Specifically on line 5, it triggers an error that the VSSItem is not supported by the language. I made a workaround on the structure and the working version is this:

IVSSDatabase vssDB = new VSSDatabase();
vssDB.Open("srcsafe.ini location", "username", "password");
VSSItem sfolder;

sfolder = (VSSItem)vssDB.get_VSSItem("$/MyWebsite", false);

foreach ( VSSItem xItem in sfolder.get_Items(false)) {
string outputdisplay = xItem.Name + " - " + xItem.VersionNumber + "<br />";
Response.Write(outputdisplay);
//xItem.Checkout("comments_here", "checkout_location", 0);
//xItem.Checkin("comments_here", "checkout_location", 0);
}

Since C# doesn’t accept optional parameters, you need to fill-in for the parameters. I hope this one helps and makes sense for those who are working on Sourcesafe Automation. 🙂


Blog Stats

  • 3,978 hits
October 2017
S M T W T F S
« Nov    
1234567
891011121314
15161718192021
22232425262728
293031