• MohamedG's Log

    Code Churn

    • 0 Comments
    Lines of code that are added, removed, or changed from a build to another are referred to as churned. Code churn is a good measure to quantify the amount of change in your project. When you use team foundation to build your project, code coverage will...
  • MohamedG's Log

    Pseudo-localization

    • 0 Comments
    It's an economic need to develop international software as you need to reach as many customers as possible all over the world. Let's tackle a simple scenario, imagine that you will develop an application that has a bilingual UI: English and Arabic. It...
  • MohamedG's Log

    Shelving

    • 0 Comments
    As the feature’s name suggests, you can have shelves of your code set aside the same way you use real shelves. In a library, when you shelve a book to read another or to write a paper, others now can read it. The difference in source control is that it...
  • MohamedG's Log

    File System Limits

    • 0 Comments
    When you create a file or a folder, do you check that the full path is not too long?! Make sure that you handle the PathTooLongException : Try to exceed the maximim lenght on Windows, and you'll get this error: Here are some limits...
  • MohamedG's Log

    How to: Label items in a changeset using tf label?

    • 0 Comments
    We can specify the versionspec to tf label either by supplying the /v or /version argument (for example, /v:C1256), or by appending it to the itemspec (for example, foo.cs;C1256). Here's an example that attaches the "goodbuild" label to version 1256 of...
  • MohamedG's Log

    April's fool: BSOD screen saver

    • 0 Comments
    A nice harmless April's fool is to install BSOD screen saver , it looks so real and it can fake HDD activity! Just make sure your teammates won't restart your machine :)
  • MohamedG's Log

    Not checked out and not read-only

    • 0 Comments
    To list files that are not checked out and not read-only, you can use tfpt online. The command is used to create pending edits on non-read-only files that don't have pending edits. The tool also classifies the items into sets: items with potential add...
  • MohamedG's Log

    Using the /version argument

    • 0 Comments
    Whenever you need to specify the version for an item, you can use /version or /v. By default, it takes a changeset id, so don't use the C prefix with it. You can use L, D, or W if you want to specify a label, date, or workspace version respectively. There...
  • MohamedG's Log

    How to: Show deleted item in Source Control Explorer?

    • 0 Comments
    You can use the /deleted switch with tf dir to list deleted items along with existent items. To undelete an item, you need to know its deletion ID, which will be a number preceded by X, for example: tf undelete $/proj/foo/bar.cs;X1234 To show deleted...
  • MohamedG's Log

    Nullable Value Types

    • 0 Comments
    Can you assign null to int?? Read carefully before you answer, this is a trick question! You can do that by using nullable value types: int? x = null ; To check if the nullable value has a value, you can use the .HasValue property. If the value...
  • MohamedG's Log

    ?? Operator

    • 0 Comments
    The ?? operator is used to return the left operand if it's not null, otherwise, it returns the right operand. It's equivalent to (left != null ? left : right). string a = null ; object b = a ?? new object (); object c = b ?? "b is null!" ; int ? x...
  • MohamedG's Log

    Code Snippet: switch

    • 0 Comments
    Type sw to select switch: Double tab to expand: Choose the switch_on parameter, in this case I have a parameter of type DayOfWeek (enum): Voilà:
  • MohamedG's Log

    Impersonation

    • 0 Comments
    Impersonation lets you execute code using another user identity. In the WindowsIdentity class, there's a method called Impersonate, it allows you to impersonate the user specified by the WindowsIdentity instance. Just remember to call Undo to get back...
  • MohamedG's Log

    Fiddler

    • 0 Comments
    Don't worry, this post isn't about music or violins, it's about a web debugging proxy. Fiddler is an excellent tool to trace the HTTP/HTTPS traffic and debug it too. It's extensible, it's free, and it's awesome. Try it yourself: http://www.fiddler2.com...
  • MohamedG's Log

    How to: Sync to a specific time and date?

    • 0 Comments
    Using tf.exe, you can get a specific version using its time and date: tf get /version:"D:02/08/2008 1:00:00 AM" The DateTime format that you use should be one of the formats supported by the .Net framework. So, D2008-02-08T01:00 works, while D2008...
  • MohamedG's Log

    How To: Unlock files locked by others?

    • 0 Comments
    It happens so many times that a developer forgets to unlock files in his workspace before leaving the team for a vacation or for good. To solve this problem, there are several options: remove the lock (this won't work if exclusive checkout is enabled...
  • MohamedG's Log

    How to: Find the latest changeset you have on a workspace?

    • 0 Comments
    To know the answer to this question, you can run the following command: tf history . /stopafter:1 /v:1~W /r That's it :)
Page 5 of 5 (117 items) 12345