TFS Cube - Total Lines of Code appears incorrect? - tfs

I'm using the TFS cube as documented here and am getting a curious result for 'total lines'. If I look at a file inside of visual studio, I see that a file is perhaps 42 lines long (total, comments, whitespace, and all). However, when I ask the TFS cube for that same information, it tells me that the file is almost - but not exactly - twice its size.
I have my pivot table set up as follows:
Report Filter includes a specific team project, and is filtered on file extension (.cs)
Row labels set to Filename.Parent_ID
Values set to 'Total Lines'
I've looked at the MSDN guidance here and can't see what I've done wrong, other than noting that I have not selected an individual build (if i do so, I get no results).
Edit: As it may be relevant, I'm using TFS 2008 SP1 with SQL 2005 standard. There is a note on the MSDN page which cautions me that SQL 2005 Standard does not support perspectives, and 'the cube elements from all perspectives reside in the team system data cube'. I'm not sure what that means for this problem, if anything.

Check your linebreaks in the files : does numbers change if you convert files between windows/linux line endings?
Please add lines with 60, 90, 150, 200 characters and check how many added lines will be reported. Might be some work-wrapping.

Related

I want to know Complete project line of code in TFS project collection

Team,
Could you please help on the advise.
I want to know how to calculate the line of code for my TFS project collection. I need for entire instance to calculate the line of code.
Please advise. Thank you
Note: I'm assuming you're using TFVC, not Git.
You should be able to get this from the data warehouse (Tfs_Warehouse) assuming you have Reporting Services configured.
There is a Code Churn table. I believe you should be able to sum the NetLinesAdded field to get the total number of lines of code.
The Analysis Cube has a Total Lines field, as well.
However, you can also get this information from your file system with PowerShell, for example:
(gci -Path 'C:\Users\Daniel\Source\Repos\' -rec -Include '*.cs' | select-string .).Count
This comes with the caveat that "lines of code" is, in almost every single case, a totally meaningless, worthless number.

Calculated automatically completed work in TFS 2013 Agile template

How can I implement cumulative automatically hours in completed work field? I tried to use Aggregator plugin but it not working for me. I need to sum all change in remaining work.
I used Agile template, VS 2013 and TFS 2013.4
<!--Sum all remaining work -->
<AggregatorItem operationType="Numeric" operation="Sum" linkType="Self" linkLevel="1" workItemType="Task">
<TargetItem name="CompletedWork"/>
<SourceItem name="RemainingWork"/>
</AggregatorItem>
Can you help me?
If you're using the Scrum Process Template I don't think you have enough data to calculate this. The Remaining Work field is not a good option to try to capture this. I may start the day with Remaining Work = 8, work 6 hours on the item, but at the end of the day recognize that there is still 4 hours of work left (it was bigger than originally estimated). In that case the remaining work would only decrease by 4 even though I worked 6 hours.
If you need to capture actual work completed, you should be using a separate field on the Work Items. Both the Agile and CMMI process templates have fields for this. If you stick with the Scrum template I'd suggest adding a Completed Work field in addition to the Remaining Work field.

write a script in mql4 to edit symbol window

I am trying to write my first script in MQL4 and had hopefully a few basic questions.
1) I am aware that I can write a script and drag and drop it on a symbol window to execute the script. I was wondering though if there was a way to reference a symbol window through the code?
Is it just like the code below,
WindowHandle("EURUSD", PERIOD_M1)
2) Is there anyway to specify the time horizon of a symbol window. For example say I want the symbol window to show me the EURUSD 1 minute data from 4th March 2012 10:10 am to 4th December 2012 4pm? Can you also specify the number of bars to show on the chart at anyone time?
3) Can you draw a line on the chart using a script? I think I read you cannot - that you would need to write a custom indicator? I understand using a script however that you can annotate the chart with a text object though.
A3: Yes, you can
A2: No, any code is sub-ordinated to the pre-set MT4.Graph instance
In other words, your code ( any MQL4 ( well, valid as far as Build 711 )) cannot moderate the outer-container ( the MT4.Graph ), be it zoom, Y-scale, changing it's Period and other "given" features, some of which may be editable by user ( but not by the code )
A1: No, but ... might be you read about some
This is rather dangerous zone. Imagine a MT4 Terminal, that has a live-session, if there were such WindowHandle( "EURUSD", PERIOD_M1 ) and if there were six graphs for [EURUSD,M1]. Which way should the identification / execution follow? No, this is left intentionally as a "Human-step", because executing any kind of code is associated with risks and may create huge if not fatal losses ( as the code runs blind and deaf and VERY FAST ).
While there are some dirty techniques to identify/swap MT4-"window" these techniques are highly dependent on O/S services. For normal use, I would dare rely on any of those I have read about so far.

Determining the size of deltas in TFS

Our TFSVersionControl database has grown significantly in the past couple years, and is edging on 80GB. Unfortunately, we're in an environment where every gig of data storage is internally charged at a high rate, so there's lots of focus on keeping storage growth to a minimum.
I believe the majority of growth is happening because we chose to store binary files in our repository. This is something we will be remedying in the medium term.
In the short-term, there are a few places where we do not need to keep a history of our binaries. Particularly in our mainline branch and our development branch, so we're looking into doing a TF Destroy on these binaries and recreating them as part of the upcoming release.
What I'd like to know is: Is there any way to run a query against the TFSVersionControl database to understand which files are storing deltas that are over a given size?
Ideally, what I'd like to know is for a given path (item spec), for each file, the base size, and the total size of the deltas.
I think this page may be what you're looking for.
Just like asking someone else will often drive you to find your own answer, I did some additional digging, and came up with this:
select ver.VersionFrom, ver.Command, ver.ChildItem, tf.*, ct.CreationDate, ct.OffsetFrom, ct.OffsetTo, DataLength(ct.Content) as Size
from tbl_version ver with (nolock)
inner join tbl_file tf with (nolock) on tf.FileId = ver.FileId
inner join tbl_content ct with (nolock) on ct.FileId = tf.fileid
where parentpath = '$\ProjectName\Branch\Folder\'
ORDER BY ver.ChildItem, Ver.VersionFrom
--where fullpath = '$\ProjectName\Branch\Folder\FileName.cs\'
The query as written will iterate through all files in a particular path and will retrieve a record per checkin. The calculated Size field will show you the size in bytes of the delta. I'm not sure if this is compressed size or "actual" size.
The commented "where" statement will show you the same for an indvidual file.
Note that the typical forward slashes ("/") are stored in the database as backslashes ("\"), and there is always a trailing backslash at the end.
If you pull this data into Excel, you can quickly create a pivot table on it to calculate the sizes (or you can add them up manually).

How to print Zweckform 4737 labels?

I am trying to print a load of Zweckform 4737 labels from a web page. From reading around it sounds like it's more robust to generate a PDF than to use print stylesheets.
There are various libraries out there in various languages for doing this...but unless your specific label is supported, you need to know the exact measurements of the label yourself. Unfortunately it seems the Zweckform 4737 is not widely supported. (I will be using a Ruby library at the end of the day, but that's by the by.)
I have looked online but I cannot find the Zweckform 4737's measurements. I know the basics: 29.6mm x 63.5mm, 3 per row, 27 per sheet. But I also need (I think) the sheet's left and bottom margins, and the horizontal gap between labels if any.
Does anyone know where I can find this information? Or should I simply trawl around office stationery shops looking for a pack of the labels and just measure them with a ruler?
Aimee Daniells showed me that the Open Office label wizard has all the information I need.
Thanks Aimee!

Resources