This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Quick and dirty PS script for counting lines of code in a directory. Output is dumped to a simple CSV file. | |
#Note that this script doesn't count blank lines. | |
#Parameters: | |
# path - the path containing the code files (note that the script will recurse through subfolders | |
# outputFile - fully qualified path of the file to dump the CSV output | |
# include (Optional) - file mask(s) to include in the count (deafults to *.*) | |
# exclude (Optional) - file mask(s) to exclude in the count (defaults to none) | |
# Example (count lines in target path including *.cs but excluding *.designer.cs) | |
# .\countLOC.ps1 -path "C:\code\MyProject" -outputFile "C:\code\loc.csv" -include "*.cs" -exclude "*.designer.cs" | |
param([string]$path, [string]$outputFile, [string]$include = "*.*", [string]$exclude = "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @rootId HierarchyId = HierarchyId::Parse('/1/') | |
declare @descendantId HierarchyId = HierarchyId::Parse('/1/1/') | |
--make sense: | |
select @descendantId.IsDescendantOf(@rootId) --returns 1 | |
select @rootId.IsDescendantOf(@descendantId) --returns 0 | |
--not so much sense: | |
select @descendantId.IsDescendantOf(@descendantId) --returns 1 | |
select @rootId.IsDescendantOf(@rootId) --returns 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Microsoft.Tools.ServiceModel | |
{ | |
/// <summary> | |
/// Partial class / struct implementation for doing proper Equals behavior of the CFContactSerializerInfo struct | |
/// so that it can be properly used in the Dictionary in the CFClientBase. | |
/// </summary> | |
/// <typeparam name="TChannel"></typeparam> | |
public partial class CFClientBase<TChannel> | |
where TChannel : class | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
do | |
{ | |
Console.Write("Enter command or 'exit' to quit: > "); | |
var command = Console.ReadLine(); | |
if ((command ?? string.Empty).Equals("exit", StringComparison.OrdinalIgnoreCase)) | |
{ | |
Console.WriteLine("Quitting."); | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Message> | |
<Recepients /> | |
<Body>Hello World!</Body> | |
<IsIncoming>true</IsIncoming> | |
<IsRead>true</IsRead> | |
<Attachments /> | |
<LocalTimestamp>130892436116060259</LocalTimestamp> | |
<Sender>+15555555555</Sender> | |
</Message> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const long ticks = 635807955799055730; | |
var someDate = new DateTime(ticksValue); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var utcNowTicks = DateTime.UtcNow.Ticks; | |
const long fileTimestampTicks = 130892436116060259; | |
var ticksDiff = utcNowTicks - fileTimestampTicks; | |
var ticksDifTimeSpan = TimeSpan.FromTicks(ticksDiff); | |
var totalYears = ticksDifTimeSpan.TotalDays/365; | |
Console.WriteLine(totalYears); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const long fileTimestampTicks = 130892436116060259; | |
var windowsFileTimestampDate = DateTime.FromFileTime(fileTimestampTicks); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="create_pdf_form"> | |
<fieldset> | |
<legend>Create Customer Info Sheet PDF</legend> | |
<div> | |
<label id="first_name_prompt_id" for="first_name_input_id">First Name</label> | |
<input name="first_name_input" id="first_name_input_id"/> | |
</div> | |
<div> | |
<label id="last_name_prompt_id" for="last_name_input_id">Last Name</label> | |
<input name="last_name_input" id="last_name_input_id"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Drawing; | |
namespace ImageViewer | |
{ | |
internal class CustomListView : ListView | |
{ | |
/// <summary> | |
/// When called, this function should use the provided Graphics instance to paint all the provided images to the | |
/// control surface in a grid layout. |