Sunday, May 6, 2012

Tuesday, May 13, 2008

Moving the blog

I have moved my blog over to Live Spaces. Click here to go to new blog: http://sergeybarskiy.spaces.live.com/default.aspx

Tuesday, April 15, 2008

I had a task recently that involved automating communication with TFS server. I was rather unpleasantly surprised by lack of information in on line help on this subject. Granted, there were definitions of classes that are used for such task on MSDN, but no examples. Sad situation indeed. After some research, I was able to complete my task. It was indeed a trial and error process. The function below gets the latest from specified branch, using local path and server name as parameters. It only pull list of files from that folder, doing one level recursion.

Disclaimer:

This is a quick and dirty function I put together for my needs:

''' <summary>

''' Populates dataset with list of items from TFS server

''' </summary>

''' <param name="path">Local path to get the latest for such as c:sourcesomefolder</param>

''' <param name="serverName">Server name such as TFSServer</param>

''' <returns>True if no errors are thrown</returns>

''' <remarks></remarks>

Private Function GetFolderHistory(ByVal path As String, ByVal serverName As String) As Boolean

Dim returnValue As Boolean = True

Try

'create server object

Dim server As New TeamFoundationServer(serverName)

' create source control object

Dim version As VersionControlServer = CType(server.GetService(GetType(VersionControlServer)), VersionControlServer)

' limit based on changeset id

changeSetNumber = CInt(txtChangeSet.Text)

' paramters for getting latest call

' list of items to get

Dim itemSpecs As New List(Of ItemSpec)

'only specify local path

itemSpecs.Add(New ItemSpec(path, RecursionType.OneLevel))

'only get the latest

Dim versionSpec As VersionSpec = versionSpec.Latest

' get history data

Dim history As BranchHistoryTreeItem()() = version.GetBranchHistory(itemSpecs.ToArray, versionSpec)

' clear dataset with results

ItemsDataSet.Items.Clear()

Dim name As String

Dim changed As DateTime

Dim changeSetID As Integer

' run through items - 2- dimensional array of history

For counter As Integer = 0 To history.Length - 1

For counter1 As Integer = 0 To history(0).Length - 1

Dim item As BranchHistoryTreeItem = history(counter)(counter1)

' get each items's propeties

name = item.Relative.BranchToItem.ServerItem.Substring(item.Relative.BranchToItem.ServerItem.LastIndexOf("/") + 1)

changed = item.Relative.BranchToItem.CheckinDate

changeSetID = item.Relative.BranchToItem.ChangesetId

' compare to minimim change set id

If changeSetID > changeSetNumber Then

If item.Relative.BranchToItem.ItemType = ItemType.File Then

ItemsDataSet.Items.Rows.Add(New Object() {name, changed, changeSetID})

End If

End If

Next

Next

' update UI

ItemsBindingSource.DataSource = ItemsDataSet

grdItems.Sort(grdItems.Columns(2), System.ComponentModel.ListSortDirection.Descending)

If grdItems.Rows.Count > 0 Then

grdItems.Rows(grdItems.Rows.GetFirstRow(DataGridViewElementStates.None)).Selected = True

End If

Catch ex As Exception

MessageBox.Show(ex.Message, "Script", MessageBoxButtons.OK, MessageBoxIcon.Error)

returnValue = False

End Try

Return returnValue

End Function

Tuesday, April 1, 2008

Atlanta Code Camp

Last Saturday I had my first ever talk at Atlanta Code Camp. It really was a fun experience for me. I enjoyed spending the entire day with my piers. There were quite a few folks at the code camp who work with me at Magenic. I attended as many sessions as I could in time allotted.
My own presentation went pretty well, based on the feedback that I got after it.
I certainly hope that I will get an opportunity to talk more in front of other people. I guess I am a glutton for attention...
Here are Power Point slides converted to a movie.

Saturday, March 15, 2008

CSLA Training

I lead my first CSLA training session last week. I trained a customer in use of CSLA framework to develop business applications. I thoroughly enjoyed the entire process. I started the preparations a while ago, working on my own PowerPoint presentation, oriented toward training that lasts for about 1 day. This presentation contains major points of discussion and was primarily designed to keep me on track during training. The entire session lasted two days, with first day dedicated entirely to lecture-style CSLA training. Second day was dedicated to developing CSLA classes and getting an entire, albeit small, CSLA based project up and running. After the training I have a firm belief that practical exercises that trainees do on their own with help of the trainer are essential to success of CSLA training, and any technical training in general. In addition to that, I think two days should be the minimum length for CSLA training. Ideally, three days would be better. Then again, this would depend on the number of people in the audience.
I learned a bit about myself as well. More exactly, I became even more aware of how much I enjoy speaking in front of people. I think I am a glutton for attention :-).

Friday, March 7, 2008

Thoughts On Blogging

Yes, I officially crossed over to the dark side. I am talking about creating a blog.
For a long time I resisted the temptation to have my own blog. Seems like I needed a little push in order to do so. This push was provided by Atlanta Code Camp application. I needed to put down my blog address, so here it is.
I think I will enjoy blogging. My goal is to keep it purely technology oriented. I enjoy IT industry. I have been working in it for 12 years, and intend to stay working their until retirement (if that time ever comes that is - I have my doubts). Having said that, I enjoy what I do and have not intentions of quitting the wonderful field of software development.
More to come..