<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Jeremy Knight</title>
  <subtitle>Software Craftsman, Husband, Father</subtitle>
  <link href="https://www.jeremyknight.me/feed/feed.xml" rel="self" />
  <link href="https://www.jeremyknight.me/" />
  <updated>2026-02-16T00:00:00Z</updated>
  <id>https://www.jeremyknight.me/</id>
  <author>
    <name>Jeremy Knight</name>
  </author>
  <entry>
    <title>Git Repo Updates Made Simple</title>
    <link href="https://www.jeremyknight.me/2026/02/16/git-repo-updater/" />
    <updated>2026-02-16T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2026/02/16/git-repo-updater/</id>
    <content type="html">&lt;p&gt;As developers, we’re always looking to optimize our workflows. This PowerShell script, &lt;code&gt;Update-GitRepos&lt;/code&gt;, automates the process of keeping your Git repositories up-to-date. It’s a little helper that takes care of the grunt work for you.&lt;/p&gt;
&lt;h2 id=&quot;how-update-gitrepos-works&quot; tabindex=&quot;-1&quot;&gt;How &lt;code&gt;Update-GitRepos&lt;/code&gt; Works&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;Update-GitRepos&lt;/code&gt; function recursively scans a directory for Git repositories and performs the&lt;br&gt;
following actions for each one:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Parameters:&lt;/strong&gt; Accepts an optional &lt;code&gt;$RootDirectory&lt;/code&gt; parameter, which defaults to the current directory if not specified.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Directory Detection:&lt;/strong&gt; Uses &lt;code&gt;Get-ChildItem&lt;/code&gt; to find all directories within the specified root.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;.git&lt;/code&gt; Verification:&lt;/strong&gt; Confirms the presence of a &lt;code&gt;.git&lt;/code&gt; folder, providing a clear warning if a repository isn&#39;t found.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Branch Detection:&lt;/strong&gt; Intelligently determines the target branch – prioritizing &lt;code&gt;main&lt;/code&gt; and &lt;code&gt;master&lt;/code&gt;. The script handles the most common branch naming conventions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Branch Switching:&lt;/strong&gt; If your local branch isn&#39;t tracking the correct branch, the script automatically switches to it using &lt;code&gt;git switch&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fetch and Pull:&lt;/strong&gt; Executes &lt;code&gt;git fetch&lt;/code&gt; to download the latest changes and &lt;code&gt;git pull&lt;/code&gt; to merge them into your local branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-powershell-script&quot; tabindex=&quot;-1&quot;&gt;The PowerShell Script&lt;/h2&gt;
&lt;pre class=&quot;language-powershell&quot;&gt;&lt;code class=&quot;language-powershell&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Update-GitRepos&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;param&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;token namespace&quot;&gt;[string]&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$RootDirectory&lt;/span&gt; = &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Get-Location&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;token variable&quot;&gt;$originalLocation&lt;/span&gt; = &lt;span class=&quot;token function&quot;&gt;Get-Location&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;# Get all directories in the root directory&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;Get-ChildItem&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;Path &lt;span class=&quot;token variable&quot;&gt;$RootDirectory&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;Directory &lt;span class=&quot;token punctuation&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ForEach-Object&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token variable&quot;&gt;$folderPath&lt;/span&gt; = &lt;span class=&quot;token variable&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FullName
        &lt;span class=&quot;token variable&quot;&gt;$gitFolder&lt;/span&gt; = &lt;span class=&quot;token function&quot;&gt;Join-Path&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$folderPath&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;.git&quot;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Test-Path&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$gitFolder&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;Write-Host&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;No git repository found in: &lt;span class=&quot;token variable&quot;&gt;$folderPath&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;ForegroundColor Yellow
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;token function&quot;&gt;Write-Host&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Updating git repo in: &lt;span class=&quot;token variable&quot;&gt;$folderPath&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;ForegroundColor Cyan
        &lt;span class=&quot;token function&quot;&gt;Set-Location&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$folderPath&lt;/span&gt;

        &lt;span class=&quot;token comment&quot;&gt;# Get list of branches&lt;/span&gt;
        &lt;span class=&quot;token variable&quot;&gt;$branches&lt;/span&gt; = git branch &lt;span class=&quot;token operator&quot;&gt;--&lt;/span&gt;list &lt;span class=&quot;token punctuation&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ForEach-Object&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Trim&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;TrimStart&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;*&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Trim&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;token variable&quot;&gt;$targetBranch&lt;/span&gt; = &lt;span class=&quot;token variable&quot;&gt;$null&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$branches&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-contains&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;main&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token variable&quot;&gt;$targetBranch&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;main&quot;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;elseif&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$branches&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-contains&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;master&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token variable&quot;&gt;$targetBranch&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;master&quot;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$null&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-eq&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$targetBranch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;Write-Host&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Neither &#39;main&#39; nor &#39;master&#39; branch found in: &lt;span class=&quot;token variable&quot;&gt;$folderPath&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;ForegroundColor Yellow
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;token variable&quot;&gt;$currentBranch&lt;/span&gt; = &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;git branch &lt;span class=&quot;token operator&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;show-current&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Trim&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$currentBranch&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-ne&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$targetBranch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;Write-Host&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Switching to branch: &lt;span class=&quot;token variable&quot;&gt;$targetBranch&lt;/span&gt;&quot;&lt;/span&gt;
            git &lt;span class=&quot;token keyword&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$targetBranch&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

        git fetch
        git pull
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;# Restore the original location&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;Set-Location&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$originalLocation&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;how-to-use-it&quot; tabindex=&quot;-1&quot;&gt;How to Use It&lt;/h2&gt;
&lt;p&gt;The simplest way to use &lt;code&gt;Update-GitRepos&lt;/code&gt; is add it directly to your PowerShell profile. This allows it to be executed in any directory. You can find an example of my PowerShell profile here: &lt;a href=&quot;https://github.com/jeremyknight-me/scripts/blob/master/powershell/profile.ps1&quot;&gt;https://github.com/jeremyknight-me/scripts/blob/master/powershell/profile.ps1&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;profile-run&quot; tabindex=&quot;-1&quot;&gt;Profile Run&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to the root folder of your repositories.&lt;/li&gt;
&lt;li&gt;Run the command &lt;code&gt;Update-GitRepos&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;manual-run&quot; tabindex=&quot;-1&quot;&gt;Manual Run&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Save the Script: Save the script as &lt;code&gt;Update-GitRepos.ps1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run It: Navigate to the script’s location in PowerShell and execute the following but replace &amp;quot;C:&#92;Path&#92;To&#92;Your&#92;Repositories&amp;quot; with your repository folder’s path.&lt;pre class=&quot;language-powershell&quot;&gt;&lt;code class=&quot;language-powershell&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&#92;&lt;span class=&quot;token function&quot;&gt;Update-GitRepos&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ps1 &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;RootDirectory &lt;span class=&quot;token string&quot;&gt;&quot;C:&#92;Path&#92;To&#92;Your&#92;Repositories&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
</content>
  </entry>
  <entry>
    <title>FileSystemWatcher and .NET Workers</title>
    <link href="https://www.jeremyknight.me/2026/01/17/filewatcher-worker/" />
    <updated>2026-01-17T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2026/01/17/filewatcher-worker/</id>
    <content type="html">&lt;p&gt;I hadn’t touched a file watcher since the &lt;strong&gt;.NET Framework&lt;/strong&gt; days. When I recently needed to integrate one into a .NET 10 background worker, I expected to find a clean example online. Instead, every search result showed the same pattern: a &lt;code&gt;BackgroundService&lt;/code&gt; with an infinite loop and a &lt;code&gt;Task.Delay&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I kept looking because my first thought was: &amp;quot;This can&#39;t be how a file watcher &lt;em&gt;should&lt;/em&gt; be used&amp;quot;. I never did find an example of the solution described below so I wrote this post to document my approach.&lt;/p&gt;
&lt;h2 id=&quot;why-not-use-backgroundservice-+-infinite-loop&quot; tabindex=&quot;-1&quot;&gt;Why Not Use BackgroundService + Infinite Loop?&lt;/h2&gt;
&lt;p&gt;Many examples online show something like:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// code to configure / start watcher here&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;stoppingToken&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;IsCancellationRequested&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;await&lt;/span&gt; Task&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Delay&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This loop works, but it’s wasteful (polling every second), unnecessary (&lt;code&gt;FileSystemWatcher&lt;/code&gt; already raises events), and adds unnecessary code to maintain.&lt;/p&gt;
&lt;h2 id=&quot;my-solution:-ihostedservice&quot; tabindex=&quot;-1&quot;&gt;My Solution: IHostedService&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;BackgroundService&lt;/code&gt; is built on top of &lt;code&gt;IHostedService&lt;/code&gt; and is great when you need a long‑running loop inside &lt;code&gt;ExecuteAsync&lt;/code&gt;. But &lt;code&gt;FileSystemWatcher&lt;/code&gt; is event‑driven so implementing &lt;code&gt;IHostedService&lt;/code&gt; directly is a better fit. It lets you initialize the watcher in &lt;code&gt;StartAsync&lt;/code&gt; and dispose it cleanly in &lt;code&gt;StopAsync&lt;/code&gt; without any polling.&lt;/p&gt;
&lt;p&gt;Here’s a minimal example showing the recommended pattern.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;internal&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;sealed&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;FileWatcherWorker&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token type-list&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;IHostedService&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;IDisposable&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;readonly&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;ILogger&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Worker&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; _logger&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;FileSystemWatcher&lt;/span&gt; _fileWatcher&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;FileWatcherWorker&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;ILogger&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Worker&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; logger&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        _logger &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; logger&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        _fileWatcher&lt;span class=&quot;token punctuation&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;Task&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;StartAsync&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;CancellationToken&lt;/span&gt; cancellationToken&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        _logger&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;LogInformation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;FileWatcherWorker is starting: {time}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; DateTimeOffset&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        _fileWatcher &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            Path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/some/path&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// typically retrieved from configuration&lt;/span&gt;
            Filter &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;*.*&quot;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// ex: &quot;*.json&quot;, &quot;*.csv&quot;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

        _fileWatcher&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Created &lt;span class=&quot;token operator&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;FileSystemEventHandler&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;OnFileCreated&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        _fileWatcher&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;EnableRaisingEvents &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

        _logger&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;LogInformation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;FileWatcherWorker started: {time}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; DateTimeOffset&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; Task&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CompletedTask&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;Task&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;StopAsync&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;CancellationToken&lt;/span&gt; cancellationToken&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_fileWatcher &lt;span class=&quot;token keyword&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            _fileWatcher&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;EnableRaisingEvents &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            _fileWatcher&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

        _logger&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;LogInformation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;FileWatcherWorker stopped: {time}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; DateTimeOffset&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; Task&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CompletedTask&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;OnFileCreated&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;object&lt;/span&gt;&lt;/span&gt; source&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;FileSystemEventArgs&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        _logger&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;LogInformation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;File Created: {path}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FullPath&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Add logic to process the file here&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This solution reinforced my original thoughts when searching online: &lt;strong&gt;you don’t need an infinite loop.&lt;/strong&gt; By pairing &lt;code&gt;FileServiceWatcher&lt;/code&gt; with &lt;code&gt;IHostedService&lt;/code&gt;, you get:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;clean lifecycle management&lt;/li&gt;
&lt;li&gt;efficient event handling&lt;/li&gt;
&lt;li&gt;predictable startup and shutdown behavior&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you&#39;re interested in &lt;code&gt;FileSystemWatcher&lt;/code&gt;, I suggest reviewing the links below to discover the different events, performance and architectural considerations, etc. For example, one page discusses using &lt;code&gt;NotifyFilters&lt;/code&gt; to help reduce the number of events your system processes.&lt;/p&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-io-filesystemwatcher&quot;&gt;https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-io-filesystemwatcher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher&quot;&gt;https://learn.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.ihostedservice&quot;&gt;https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.ihostedservice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/core/extensions/timer-service&quot;&gt;https://learn.microsoft.com/en-us/dotnet/core/extensions/timer-service&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Hosting AI at Home with Ollama</title>
    <link href="https://www.jeremyknight.me/2025/06/27/host-ai-at-home-ollama/" />
    <updated>2025-06-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2025/06/27/host-ai-at-home-ollama/</id>
    <content type="html">&lt;p&gt;As AI becomes more ubiquitous, I wanted to explore what it meant to bring it closer to home &lt;em&gt;literally.&lt;/em&gt; My locally hosted AI environment is built on three pillars: &lt;strong&gt;privacy&lt;/strong&gt;, &lt;strong&gt;learning&lt;/strong&gt;, and &lt;strong&gt;family empowerment&lt;/strong&gt;. Here’s a look at why I created this setup, the tools I use, and how it’s helping me (and even my kids) explore AI in a secure, controlled environment.&lt;/p&gt;
&lt;h2 id=&quot;why-host-ai-locally&quot; tabindex=&quot;-1&quot;&gt;Why Host AI Locally&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;1. Learning by Building&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There’s no better way to learn how something works than to build and run it yourself. Hosting AI locally gave me hands-on experience with model tuning, prompt engineering, and container orchestration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Privacy and Control&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Public cloud models are convenient, but they raise questions about data usage and privacy. Running AI at home means no traffic leaves my network unless I say so.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Safe Access for My Kids&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By hosting models locally, I can provide my children with supervised access to AI tools. It’s a chance for them to explore, ask questions, and experiment within boundaries I can control.&lt;/p&gt;
&lt;h2 id=&quot;models-running-in-ollama&quot; tabindex=&quot;-1&quot;&gt;Models Running in Ollama&lt;/h2&gt;
&lt;p&gt;My local setup runs on &lt;a href=&quot;https://ollama.com&quot;&gt;Ollama&lt;/a&gt;, a fantastic tool for managing and running LLMs on local hardware. I’m currently using: llama, deepseek-r1, and gemma3.&lt;/p&gt;
&lt;p&gt;You can peek at my Docker Compose configuration here:&lt;br&gt;
&lt;a href=&quot;https://github.com/jeremyknight-me/scripts/blob/master/docker/ollama/compose.yaml&quot;&gt;ollama/compose.yaml&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-magic-of-openwebui&quot; tabindex=&quot;-1&quot;&gt;The Magic of OpenWebUI&lt;/h2&gt;
&lt;p&gt;One of the most important pieces of this setup is &lt;a href=&quot;https://github.com/open-webui/open-webui&quot;&gt;OpenWebUI&lt;/a&gt;. It provides a customizable, user-friendly interface to interact with local models via Ollama. What makes it truly powerful is the ability to tailor prompts, behaviors, and personas for specific users—especially useful when giving my kids access to AI in a controlled, age-appropriate way.&lt;/p&gt;
&lt;p&gt;This flexibility has made OpenWebUI essential for turning raw models into personalized, interactive tools for both learning and development.&lt;/p&gt;
&lt;h2 id=&quot;private-search-with-searxng&quot; tabindex=&quot;-1&quot;&gt;Private Search with searxng&lt;/h2&gt;
&lt;p&gt;To enhance offline or privacy-first capabilities, I also integrate &lt;a href=&quot;https://github.com/searxng/searxng&quot;&gt;searxng&lt;/a&gt;, a self-hosted meta-search engine that pulls results from multiple sources without logging or profiling. This allows for safe research and exploration, especially when guiding young learners through topics without exposing them to unnecessary tracking or ads.&lt;/p&gt;
&lt;h2 id=&quot;developer-use-cases&quot; tabindex=&quot;-1&quot;&gt;Developer Use Cases&lt;/h2&gt;
&lt;p&gt;When I&#39;m not using more advanced “agent-like” or &amp;quot;agentic&amp;quot; workflows, I use my setup for targeted development queries. For instance, debugging, exploring architectural decisions, writing unit tests, etc.&lt;/p&gt;
&lt;p&gt;Here’s a sample prompt I’ve used in OpenWebUI: &lt;a href=&quot;https://github.com/jeremyknight-me/scripts/blob/master/prompts/dotnet-developer.md&quot;&gt;dotnet-developer.md&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Having this kind of interaction offline and instantly accessible has been a game-changer for iterative development and learning.&lt;/p&gt;
&lt;h2 id=&quot;credit-where-it&#39;s-due&quot; tabindex=&quot;-1&quot;&gt;Credit Where It’s Due&lt;/h2&gt;
&lt;p&gt;This idea was inspired by &lt;a href=&quot;https://www.youtube.com/@NetworkChuck&quot;&gt;NetworkChuck&lt;/a&gt; fantastic video on hosting your own AI. His walkthrough helped me get started, and I highly recommend watching it if you want a visual step-by-step guide:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=Wjrdr0NU4Sk&quot;&gt;Self-Hosted AI in 2024: How To Run Private, Local AI Chatbots on Your Own Hardware&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;closing-thoughts&quot; tabindex=&quot;-1&quot;&gt;Closing Thoughts&lt;/h2&gt;
&lt;p&gt;Whether you&#39;re a developer, parent, or tech tinkerer, a locally hosted AI setup offers a rare combination of &lt;strong&gt;performance, privacy, and flexibility&lt;/strong&gt;. I’ve learned a lot through this process, and it’s opened a lot of curiosity and capability for my family too.&lt;/p&gt;
&lt;p&gt;If you’re considering doing something similar, I’d love to connect or answer questions. Feel free to explore my code and prompts on GitHub!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>The Developer Testing Toolbox</title>
    <link href="https://www.jeremyknight.me/2025/06/23/sqlsatbr-testing-toolbox/" />
    <updated>2025-06-23T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2025/06/23/sqlsatbr-testing-toolbox/</id>
    <content type="html">&lt;p&gt;I will be presenting &amp;quot;The Developer Testing Toolbox&amp;quot; at &lt;a href=&quot;https://sqlsaturday.com/2025-07-26-sqlsaturday1110/&quot; title=&quot;SQL Saturday Baton Rouge 2025&quot;&gt;SQL Saturday Baton Rouge 2025&lt;/a&gt; on July 26, 2025. Below is the topic information.&lt;/p&gt;
&lt;h3&gt;The Developer Testing Toolbox&lt;/h3&gt;
&lt;p&gt;This will be an intermediate topic and I&#39;ll be assuming developers already understand the basics of unit testing. All code examples will be in C#. Here&#39;s the session&#39;s description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Software testing is a vital skill for any developer who wants to deliver high-quality, reliable software. This session will explore unit testing and more advanced topics, such as mocking, integration tests, and mutation testing. It will also show tools and packages that can help you automate your testing process and make it more productive. Now includes .NET Aspire examples!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Presentation code can be found at &lt;a href=&quot;https://github.com/jeremyknight-me/presentations&quot;&gt;https://github.com/jeremyknight-me/presentations&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tooling Links&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unit Test Framework (&lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/core/testing/&quot;&gt;https://learn.microsoft.com/en-us/dotnet/core/testing/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;xUnit (&lt;a href=&quot;https://xunit.net&quot;&gt;https://xunit.net&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;FakeItEasy (&lt;a href=&quot;https://fakeiteasy.github.io&quot;&gt;https://fakeiteasy.github.io&lt;/a&gt;) or NSubstitute (&lt;a href=&quot;https://nsubstitute.github.io&quot;&gt;https://nsubstitute.github.io&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;WebApplicationFactory (&lt;a href=&quot;https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests&quot;&gt;https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;TestContainers (&lt;a href=&quot;https://dotnet.testcontainers.org&quot;&gt;https://dotnet.testcontainers.org&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Stryker (&lt;a href=&quot;https://stryker-mutator.io&quot;&gt;https://stryker-mutator.io&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Playwright (&lt;a href=&quot;https://playwright.dev&quot;&gt;https://playwright.dev&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;BenchmarkDotNet (&lt;a href=&quot;https://benchmarkdotnet.org&quot;&gt;https://benchmarkdotnet.org&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;k6 (&lt;a href=&quot;https://k6.io&quot;&gt;https://k6.io&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Verify (&lt;a href=&quot;https://github.com/VerifyTests/Verify&quot;&gt;https://github.com/VerifyTests/Verify&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Bogus (&lt;a href=&quot;https://github.com/bchavez/Bogus&quot;&gt;https://github.com/bchavez/Bogus&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Testing In-Depth</title>
    <link href="https://www.jeremyknight.me/2024/07/27/sqlsatbr-testing-in-depth/" />
    <updated>2024-07-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2024/07/27/sqlsatbr-testing-in-depth/</id>
    <content type="html">&lt;p&gt;I presented &amp;quot;Testing In-Depth&amp;quot; at &lt;a href=&quot;https://sqlsaturday.com/2024-07-27-sqlsaturday1076/&quot; title=&quot;SQL Saturday Baton Rouge 2024&quot;&gt;SQL Saturday Baton Rouge 2024&lt;/a&gt; on July 27, 2024. Below is the topic information.&lt;/p&gt;
&lt;h3&gt;Testing In-Depth&lt;/h3&gt;
&lt;p&gt;This will be an intermediate topic and I&#39;ll be assuming developers already understand the basics of unit testing. All code examples will be in C#. Here&#39;s the session&#39;s description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Software testing is a vital skill for any developer who wants to deliver high-quality, reliable software. This session will explore unit testing and more advanced topics, such as mocking, integration tests, and mutation testing. It will also show tools and packages that can help you automate your testing process and make it more productive.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Presentation code can be found at &lt;a href=&quot;https://github.com/jeremyknight-me/presentations&quot;&gt;https://github.com/jeremyknight-me/presentations&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tooling Links&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unit Test Framework (&lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/core/testing/&quot;&gt;https://learn.microsoft.com/en-us/dotnet/core/testing/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;xUnit (&lt;a href=&quot;https://xunit.net&quot;&gt;https://xunit.net&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;FakeItEasy (&lt;a href=&quot;https://fakeiteasy.github.io&quot;&gt;https://fakeiteasy.github.io&lt;/a&gt;) or NSubstitute (&lt;a href=&quot;https://nsubstitute.github.io&quot;&gt;https://nsubstitute.github.io&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;WebApplicationFactory (&lt;a href=&quot;https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests&quot;&gt;https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;TestContainers (&lt;a href=&quot;https://dotnet.testcontainers.org&quot;&gt;https://dotnet.testcontainers.org&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Stryker (&lt;a href=&quot;https://stryker-mutator.io&quot;&gt;https://stryker-mutator.io&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Playwright (&lt;a href=&quot;https://playwright.dev&quot;&gt;https://playwright.dev&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;BenchmarkDotNet (&lt;a href=&quot;https://benchmarkdotnet.org&quot;&gt;https://benchmarkdotnet.org&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;k6 (&lt;a href=&quot;https://k6.io&quot;&gt;https://k6.io&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Verify (&lt;a href=&quot;https://github.com/VerifyTests/Verify&quot;&gt;https://github.com/VerifyTests/Verify&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Bogus (&lt;a href=&quot;https://github.com/bchavez/Bogus&quot;&gt;https://github.com/bchavez/Bogus&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>C# Syntax Lowering</title>
    <link href="https://www.jeremyknight.me/2024/05/24/syntax-lowering/" />
    <updated>2024-05-24T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2024/05/24/syntax-lowering/</id>
    <content type="html">&lt;p&gt;I was catching up on my ever-growing backlog of YouTube videos when I came across Nick Cosentino&#39;s video &amp;quot;&lt;a href=&quot;https://www.youtube.com/watch?v=MtXDh82zwns&quot; target=&quot;_blank&quot;&gt;UNEXPECTED 87% Performance Boost! - C# Collection Initializers&lt;/a&gt;&amp;quot;. The video piqued my interest and I came away knowing a little more about C#.&lt;/p&gt;
&lt;p&gt;I also went straight into Visual Studio to replicate his benchmarks and found a few interesting things due to lowering. The original benchmarks focused on &lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; so I started playing with different return types.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;MemoryDiagnoser&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;CollectionInitializerBenchmarks&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Benchmark&lt;/span&gt;&lt;span class=&quot;token attribute-arguments&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Baseline &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Classic_NoCapacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Benchmark&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Classic_SetCapacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token named-parameter punctuation&quot;&gt;capacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Benchmark&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;CollectionExpression_ReadOnlyCollection&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Benchmark&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;CollectionExpression_List&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Benchmark&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ManuallyAdd_NoCapacitySet&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; list &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Benchmark&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ManuallyAdd_CapacitySet&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; list &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After a few runs, I was curious to know what was going on behind the scenes with the collection initialization syntax &lt;code&gt;List&amp;lt;int&amp;gt; numbers = [];&lt;/code&gt;. Enter &lt;a href=&quot;https://sharplab.io/&quot; target=&quot;_blank&quot;&gt;SharpLab&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A large portion of changes to C# in recent years have been syntactical sugar that gets lowered. In a nutshell, lowering is rewriting a high-level syntax or language feature into lower-level equivalents. In C#, auto-properties are a great example as the auto-property syntax gets lowered into the full property with a backing field.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// auto-property&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; Test &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// lowered backing field and full property&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;Test&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt;k__BackingField&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; Test
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;CompilerGenerated&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;Test&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt;k__BackingField&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;CompilerGenerated&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;Test&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt;k__BackingField &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;SharpLab is my tool of choice for seeing lowered code and things got interesting when I started looking thru the &lt;a href=&quot;https://sharplab.io/#v2:CYLg1APgAgDABFAjAFgNwFgBQUDMCBMcAwgPYA2ZApgMYAuAliQHYCST9DAhmfQF6UAnAEKUm1ABYBbTgIDWAZzgBvLHDUI8LAEqVOwAPJMyAT1IUaDZgB4kMAHzEynefPrUA+gDkSRTgAdOag5jAAoASlV1KIBeByZKAHc4ABl6eVobRHtw5TgAIgBBPz8qPIAafKFOJmrOcvz9AWqAc0o8uABfDEwoyLVcOG1dAyNTcio6RiZM+zgAWWqAV24TAuBgLx9/QOCAZUpacL7lY6jU9JmHHnS4aLgAbQBdbqio69oAOjXgEMLi0rCL1eaneX3WvyqNRqeUBp3UoO+v0aLTasJ6wIQAHY4O8gWoOlhjgMhnpDCYzBNLNNbA4iE4XG53PtaL4AkFaKEIujgbE4PEkucMjSQtRtuzjCA4Dgwrk/iU2hU8pDavU8simK12l1jkTNDpSaMKRYppd5ksVsZvu5WTsOcyjtyTo6zmkhVkrq7bnzEiFpXjXgjwXKAf63q6wT8lbVoWiMTjw4i1U0NajQ+ooNjcccCZhdYN9SNyeNjdYacRi5NmABRAAefgElAZzHcBbJY3MlaYDrjvPuwYVlWjdUV6s1z0JjoGgtNRs7tfrjdczcF3Yxvf7quV0JHybHqF6mA6QA==&quot;&gt;lowered code for the different return types&lt;/a&gt; (I&#39;ve sorted the methods to make comparison easier).&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;CollectionInitializerBenchmarks&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Classic_NoCapacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; list &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ManuallyAdd_NoCapacitySet&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; list &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Classic_SetCapacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; list &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ManuallyAdd_CapacitySet&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; list &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        list&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;IReadOnlyCollection&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;CollectionExpression_ReadOnlyCollection&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt; array &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        array&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        array&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        array&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token generic-method&quot;&gt;&lt;span class=&quot;token function&quot;&gt;z__ReadOnlyArray&lt;/span&gt;&lt;span class=&quot;token generic class-name&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;array&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;CollectionExpression_List&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; list &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        CollectionsMarshal&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;SetCount&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;list&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;Span&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; span &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; CollectionsMarshal&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;AsSpan&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;list&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;/span&gt; num &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        span&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;num&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Apple&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        num&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        span&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;num&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Banana&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        num&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        span&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;num&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        num&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;Classic&lt;/code&gt; and &lt;code&gt;ManuallyAdd&lt;/code&gt; methods were pretty much as expected but the &lt;code&gt;CollectionExpression&lt;/code&gt; were VERY different. Not only can the collection initializer set the capacity to the given number of items but it lowers differently based on the return type. If C# updates further optimize the lowered code, we&#39;ll be able to take advantage of those optimizations with no code changes!&lt;/p&gt;
&lt;p&gt;For reference, here are the benchmark from one of my final runs:&lt;/p&gt;
&lt;table class=&quot;table table-sm&quot;&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;height: 13px;&quot;&gt;
            &lt;th style=&quot;height: 13px;&quot;&gt;Method&lt;/th&gt;
            &lt;th style=&quot;height: 13px;&quot;&gt;Mean&lt;/th&gt;
            &lt;th style=&quot;height: 13px;&quot;&gt;Ratio&lt;/th&gt;
            &lt;th style=&quot;height: 13px;&quot;&gt;Allocated&lt;/th&gt;
            &lt;th style=&quot;height: 13px;&quot;&gt;Alloc Ratio&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr style=&quot;height: 13px;&quot;&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;Classic_NoCapacity&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;13.204 ns&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;1.00&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;88 B&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;1.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;height: 13px;&quot;&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;Classic_SetCapacity&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;7.896 ns&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.60&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;80 B&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.91&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;height: 13px;&quot;&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;CollectionExpression_ReadOnlyCollection&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;5.812 ns&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.44&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;72 B&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.82&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;height: 13px;&quot;&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;CollectionExpression_List&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;9.031 ns&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.68&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;80 B&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.91&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;height: 13px;&quot;&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;ManuallyAdd_NoCapacitySet&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;12.276 ns&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.93&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;88 B&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;1.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;height: 13px;&quot;&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;ManuallyAdd_CapacitySet&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;8.265 ns&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.63&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;80 B&lt;/td&gt;
            &lt;td style=&quot;height: 13px;&quot;&gt;0.91&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Relavent Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.devleader.ca/2024/03/31/collection-initializer-performance-in-c-double-your-performance-with-what/&quot;&gt;Nick Cosentino&#39;s Post&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>SQL Saturday &#39;23 Presentations</title>
    <link href="https://www.jeremyknight.me/2023/06/27/saturday-baton-rouge-2023-presentations/" />
    <updated>2023-06-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2023/06/27/saturday-baton-rouge-2023-presentations/</id>
    <content type="html">&lt;p&gt;I will be presenting at &lt;a href=&quot;https://sqlsaturday.com/2023-07-29-sqlsaturday1060/&quot; title=&quot;SQL Saturday Baton Rouge 2023&quot;&gt;SQL Saturday Baton Rouge 2023&lt;/a&gt; on July 29, 2023.&lt;/p&gt;
&lt;h3&gt;Back to Basics: ADO.NET&lt;/h3&gt;
&lt;p&gt;This will be a beginner topic and I&#39;ll be assuming only basic understanding of Entity Framework. All code examples will be in C#. Here&#39;s the session&#39;s description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Microsoft says Entity Framework (EF) is &amp;quot;an object-relational mapper (or ORM) that eliminates the need for most of the data-access code that developers usually need to write&amp;quot;. This session will show the basics of data access that ORMs like EF tend to obscure. It will also show how to use &lt;a href=&quot;http://ADO.NET&quot;&gt;ADO.NET&lt;/a&gt; to integrate with and complement EF when it falls short.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Presentation code can be found at &lt;a href=&quot;https://github.com/jeremyknight-me/presentations&quot;&gt;https://github.com/jeremyknight-me/presentations&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SQL Saturday Baton Rouge 2023</title>
    <link href="https://www.jeremyknight.me/2023/06/26/sql-saturday-baton-rouge-2023/" />
    <updated>2023-06-26T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2023/06/26/sql-saturday-baton-rouge-2023/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;https://sqlsaturday.com/2023-07-29-sqlsaturday1060/&quot; title=&quot;SQL Saturday Baton Rouge 2023&quot;&gt;SQL Saturday Baton Rouge 2023&lt;/a&gt; is opened registration and the agenda has been published!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This free conference is open to the public and is perfect for students, CIO&#39;s, database administrators, developers, IT managers, server admins and job-seekers.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you&#39;re interested in development at all this is a must attend event. The sessions span multiple areas with tracks including: .NET, Business Intelligence, Career Development, PowerShell, SQL, Web/Mobile, etc. Please visit the website and sign up if you&#39;re interested.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SQL If Exists Then Drop (Updated)</title>
    <link href="https://www.jeremyknight.me/2022/12/12/sql-if-exists-then-drop/" />
    <updated>2022-12-12T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2022/12/12/sql-if-exists-then-drop/</id>
    <content type="html">&lt;p&gt;In my &lt;a href=&quot;https://www.jeremyknight.me/2022/12/2013/2013-04-15-sql-if-exists-then-drop/&quot;&gt;original post&lt;/a&gt; back in 2013, I described some ways to add &amp;quot;if exists then drop&amp;quot; statements to multiple SQL script types. I&#39;m well overdue for an update on that post as SQL Server 2016 added most of the below syntax. As with my last post, enjoy the quick reference!&lt;/p&gt;
&lt;h3&gt;Drop Statement &#39;IF EXISTS&#39; &lt;/h3&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;
&lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;FUNCTION&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;EXISTS&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterFunctionNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
GO

&lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;PROCEDURE&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;EXISTS&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterStoredProcedureNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
GO

&lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;EXISTS&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterTableNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
GO

&lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;VIEW&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;EXISTS&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterViewNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
GO&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Create or Alter Procedures&lt;/h3&gt;
&lt;p&gt;In addition to the above, you can now use &lt;code&gt;CREATE OR ALTER&lt;/code&gt; directly within your stored procedure script.&lt;/p&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;OR&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;PROCEDURE&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterStoredProcedureNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
	&lt;span class=&quot;token comment&quot;&gt;-- params here&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;BEGIN&lt;/span&gt; 
    &lt;span class=&quot;token comment&quot;&gt;-- sproc here&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;END&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Back to Basics: Unit Testing</title>
    <link href="https://www.jeremyknight.me/2022/08/05/back-to-basics-unit-testing/" />
    <updated>2022-08-05T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2022/08/05/back-to-basics-unit-testing/</id>
    <content type="html">&lt;p&gt;I will be presenting &amp;quot;Back to Basics: Unit Testing&amp;quot; at &lt;a href=&quot;https://sqlsaturday.com/2022-08-06-sqlsaturday1026/&quot;&gt;SQL Saturday Baton Rouge 2022&lt;/a&gt; on Aug 5, 2022. This will be a beginner topic and I&#39;ll be assuming no unit testing experience. All code examples will be in C#. Here&#39;s the description I sent in:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this session, we&#39;ll discuss the advantages, disadvantages, and best practices of unit tests. We&#39;ll then talk about the different unit testing tools and get into demos.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Presentation code can be found at &lt;a href=&quot;https://github.com/jeremyknight-me/presentations&quot;&gt;https://github.com/jeremyknight-me/presentations&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SQL Saturday Baton Rouge 2022</title>
    <link href="https://www.jeremyknight.me/2022/05/10/sql-saturday-baton-rouge-2022/" />
    <updated>2022-05-10T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2022/05/10/sql-saturday-baton-rouge-2022/</id>
    <content type="html">&lt;p&gt;It&#39;s back! &lt;a href=&quot;https://sqlsaturday.com/2022-08-06-sqlsaturday1026/&quot; title=&quot;SQL Saturday Baton Rouge 2022&quot;&gt;SQL Saturday Baton Rouge 2022&lt;/a&gt; has opened registration and a call for speakers!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This free conference is open to the public and is perfect for students, CIO&#39;s, database administrators, developers, IT managers, server admins and job-seekers.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you&#39;re interested in development at all this is a must attend event. The sessions span multiple areas with tracks including: .NET, Business Intelligence, Career Development, PowerShell, SQL, Web/Mobile, etc. Please visit the website and sign up if you&#39;re interested.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Bootstrap 5 CDN Fallback</title>
    <link href="https://www.jeremyknight.me/2021/01/08/bootstrap-5-cdn-fallback/" />
    <updated>2021-01-08T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2021/01/08/bootstrap-5-cdn-fallback/</id>
    <content type="html">&lt;p&gt;Bootstrap 5 has a lot of changes and one of them is the fallback method in case the CDN link doesn&#39;t load.&lt;/p&gt;
&lt;h3&gt;Vanilla HTML/JS&lt;/h3&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code class=&quot;language-markup&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;bootstrap&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// the bootstrap object is not present&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; newScript &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; document&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;script&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        newScript&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;src&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;js/bootstrap.bundle.min.js&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        document&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;head&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;appendChild&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;newScript&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;link&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;rel&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;stylesheet&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; 
  &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;onerror&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value javascript language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;onerror&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;href&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;css/bootstrap.min.css&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeAttribute&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;integrity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeAttribute&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;crossorigin&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token attr-name&quot;&gt;integrity&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;...&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; 
  &lt;span class=&quot;token attr-name&quot;&gt;crossorigin&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;...&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;ASP.NET Razor&lt;/h3&gt;
&lt;p&gt;Here is the Razor syntax for Bootstrap 5 fallback:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code class=&quot;language-markup&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token attr-name&quot;&gt;asp-fallback-src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;js/bootstrap.bundle.min.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token attr-name&quot;&gt;asp-fallback-test&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;window.bootstrap&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;link&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;rel&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;stylesheet&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token attr-name&quot;&gt;asp-fallback-href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;css/bootstrap.min.css&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token attr-name&quot;&gt;asp-fallback-test-class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;visually-hidden&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; 
  &lt;span class=&quot;token attr-name&quot;&gt;asp-fallback-test-property&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;position&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; 
  &lt;span class=&quot;token attr-name&quot;&gt;asp-fallback-test-value&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;absolute&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token attr-name&quot;&gt;integrity&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;...&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; 
  &lt;span class=&quot;token attr-name&quot;&gt;crossorigin&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;...&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These samples still use Bootstrap 4 but there are still a lot of good information on the following pages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Link Tag Helper -&lt;br&gt;
&lt;a href=&quot;https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/link-tag-helper&quot; target=&quot;_blank&quot;&gt;https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/link-tag-helper&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Script Tag Helper - &lt;a href=&quot;https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/script-tag-helper&quot; target=&quot;_blank&quot;&gt;https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/script-tag-helper&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Back to Basics: ADO.NET</title>
    <link href="https://www.jeremyknight.me/2021/01/05/back-to-basics-ado-net/" />
    <updated>2021-01-05T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2021/01/05/back-to-basics-ado-net/</id>
    <content type="html">&lt;p&gt;I will be presenting &amp;quot;Back to Basics: &lt;a href=&quot;http://ADO.NET&quot;&gt;ADO.NET&lt;/a&gt;&amp;quot; on Jan 13th to the &lt;a href=&quot;https://www.brdnug.org/&quot;&gt;Baton Rouge .NET User Group&lt;/a&gt;. This will be a beginner topic and I&#39;ll be assuming no &lt;a href=&quot;http://ADO.NET&quot;&gt;ADO.NET&lt;/a&gt; experience. All code examples will be in C#. Here&#39;s the description I sent in:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Microsoft says Entity Framework (EF) is &amp;quot;an object-relational mapper (or ORM) that eliminates the need for most of the data-access code that developers usually need to write&amp;quot;. This session will show the basics of data access that ORMs like EF tend to obscure. It will also show how to use &lt;a href=&quot;http://ADO.NET&quot;&gt;ADO.NET&lt;/a&gt; to integrate with and augment EF when it falls short.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
  </entry>
  <entry>
    <title>What Tools Do I Use? June 2020 Edition</title>
    <link href="https://www.jeremyknight.me/2020/06/30/what-tools-do-i-use-june-2020-edition/" />
    <updated>2020-06-30T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2020/06/30/what-tools-do-i-use-june-2020-edition/</id>
    <content type="html">&lt;p&gt;Having not done one of these since 2013, I thought it was time for an update! The following tools fit into two categories. I either use it daily or it&#39;s invaluable in specific situations (for example, taking screenshots or giving presentations).&lt;/p&gt;
&lt;h3&gt;The Data I Need When I Need It&lt;/h3&gt;
&lt;p&gt;I use a combination of four pieces of software to ensure that I always have all of the information I need at my fingertips. They are: OneDrive, OneNote, Bitwarden, and &lt;a href=&quot;http://Raindrop.io&quot;&gt;Raindrop.io&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.onedrive.com&quot; title=&quot;Microsoft OneDrive&quot;&gt;Onedrive&lt;/a&gt; is the Microsoft competitor to DropBox. The main reason that I use it is storage per dollar for my family (1 TB per user for up to 6 users for less than $100 a year).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.onenote.com&quot; title=&quot;Microsoft OneNote&quot;&gt;OneNote&lt;/a&gt; is Microsoft&#39;s note taking software. Evernote is a popular competitor and one that I have tried before. When OneNote was released for mobile, I immediately switched back. I do miss tags sometime but not the device limitations on their free tier.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://bitwarden.com/&quot; title=&quot;KeePass Password Manager&quot;&gt;Bitwarden&lt;/a&gt; is a password manager tool. We have passwords for everything now and they should all be unique and varied. How does it work? You create one password for your encrypted account and you place all of your other passwords into the software. There are multiple tools like LastPass, KeyPass, etc. but Bitwarden is open source and it allows me to easily share specified password securely with my wife.&lt;/p&gt;
&lt;p&gt;Last but definitely not least is &lt;a href=&quot;https://raindrop.io/&quot;&gt;Raindrop.io&lt;/a&gt;. It&#39;s a bookmark manager with full tagging support including drill down tag searching. As a developer, I tend to collect a lot of links to research, articles, etc. and this is an invaluable tool to keep it all organized. It also doubles as my recipe book!&lt;/p&gt;
&lt;h3&gt;Collaboration&lt;/h3&gt;
&lt;p&gt;I currently work on a hybrid team (some days in office and some days WFH) so having effective tools in place for collaboration and communication is a must.&lt;/p&gt;
&lt;p&gt;For task and backlog tracking, I use Azure DevOps at work and GitHub for other development projects.&lt;/p&gt;
&lt;p&gt;For voice, I use a combination of Microsoft Teams (work) and Discord (personal). They both have screen sharing features that come in extremely handy when working through code with another developer.&lt;/p&gt;
&lt;h3&gt;Let&#39;s Develop Something Already!&lt;/h3&gt;
&lt;p&gt;As a Microsoft developer with a heavy focus on web technologies, I currently have Visual Studio and Visual Studio Code installed. I run Visual Studio 2019 pretty lean now and install relatively few plugins compared to my 2013 edition. For Visual Studio Code, I install at least the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Azure Repos&lt;/li&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;li&gt;EditorConfig for VS Code&lt;/li&gt;
&lt;li&gt;Live Share&lt;/li&gt;
&lt;li&gt;PowerShell&lt;/li&gt;
&lt;li&gt;SQL Server (mssql)&lt;/li&gt;
&lt;li&gt;vscode-icons&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Everyone has their own favorite text editor and mine is &lt;a href=&quot;http://notepad-plus-plus.org/&quot; title=&quot;NotePad++&quot;&gt;Notepad++&lt;/a&gt;. It&#39;s always the first thing that I install on a new machine and I immediately set it as my default text viewer.&lt;/p&gt;
&lt;p&gt;A great tool for testing .NET code snippets, LINQ statements, etc. is &lt;a href=&quot;http://www.linqpad.net/&quot; title=&quot;LINQPad&quot;&gt;LINQPad&lt;/a&gt;. This little application is extremely feature packed and you&#39;ll find more ways to use it every time you open it.&lt;/p&gt;
&lt;h3&gt;Presentation Must Haves&lt;/h3&gt;
&lt;p&gt;If you&#39;re giving presentations or sharing screens often, I have a couple of recommendations.&lt;/p&gt;
&lt;p&gt;The first suggestion is &lt;a href=&quot;http://carnackeys.com/&quot; title=&quot;Key Jedi&quot;&gt;Carnac&lt;/a&gt;. Presenters tend to forget that the viewers don&#39;t know when you press Alt, Ctrl, etc. This is a little application displays those special combination keystrokes so that your audience doesn&#39;t get lost when you&#39;re flying around Visual Studio using only the keyboard.&lt;/p&gt;
&lt;p&gt;The second is &lt;a href=&quot;http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx&quot; title=&quot;ZoomIt&quot;&gt;ZoomIt&lt;/a&gt;. This application allows you to Zoom in and out of any application running in Windows. It also has some markup features which are quite nice once you get used to the keyboard shortcuts.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SQL Last Day of Month</title>
    <link href="https://www.jeremyknight.me/2018/04/27/sql-last-day-of-month/" />
    <updated>2018-04-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2018/04/27/sql-last-day-of-month/</id>
    <content type="html">&lt;p&gt;How do I get the last day of the month in a SQL query? Someone recently asked me this question and as with so many questions in development the answer is: it depends.&lt;/p&gt;
&lt;p&gt;Prior to SQL Server 2012, this is what typical T-SQL to compute last day of the month would look like:&lt;/p&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;DECLARE&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;@date&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;DATE&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;2017-12-15&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;token keyword&quot;&gt;DECLARE&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;@firstOfMonth&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;DATE&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; DATEFROMPARTS&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;YEAR&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;@date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;MONTH&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;@date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; DATEADD&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;DAY&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; DATEADD&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;MONTH&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;@firstOfMonth&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With SQL Server 2012 or later, the EOMONTH() gives you a much more concise option which looks like:&lt;/p&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;DECLARE&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;@date&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;DATE&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;2017-12-15&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; EOMONTH&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;@date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>How I Cut the Cord</title>
    <link href="https://www.jeremyknight.me/2017/02/04/how-i-cut-the-cord/" />
    <updated>2017-02-04T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2017/02/04/how-i-cut-the-cord/</id>
    <content type="html">&lt;p&gt;About a year ago, we decided to &amp;quot;cut the cord&amp;quot; and get rid of cable. We&#39;ve been extremely happy with our setup and multiple friends have asked which products and services we&#39;re using. As an answer to all the questions, here is a write up explaining our setup.&lt;/p&gt;
&lt;p&gt;We already had Netflix, Amazon, etc. for streaming content but local channels were a huge concern for us when we initially cut the cord. These usually include channels like your local CBS, ABC, NBC, etc. These cover most of the TV we watched on cable so it was extremely important that we kept access to them. And since we were spoiled by our DVR from the cable company, we weren&#39;t going to cut the cord until we had a system in place to allow us to watch on our own time. That meant we needed 2 things: an antenna and a DVR system that worked with HD antennas.&lt;/p&gt;
&lt;h3&gt;The Antenna&lt;/h3&gt;
&lt;picture&gt;
  &lt;source srcset=&quot;https://www.jeremyknight.me/2017/img/posts/2017/attic-antenna.avif&quot; type=&quot;image/avif&quot;&gt;
  &lt;source srcset=&quot;https://www.jeremyknight.me/2017/img/posts/2017/attic-antenna.webp&quot; type=&quot;image/webp&quot;&gt;
  &lt;img src=&quot;https://www.jeremyknight.me/2017/img/posts/2017/attic-antenna.jpg&quot; alt=&quot;&quot; class=&quot;img-fluid&quot;&gt;
&lt;/picture&gt;
&lt;div class=&quot;text-center&quot;&gt;&lt;em&gt;The strip of wood pictured has been replaced by 1 inch PVC so that the entire antenna can be pointed in the right direction.&lt;/em&gt;&lt;/div&gt;
&lt;p&gt;The first thing you will want to check is a site like &lt;a href=&quot;http://tvfool.com/&quot;&gt;TV Fool&lt;/a&gt; (&lt;a href=&quot;http://tvfool.com/&quot;&gt;www.tvfool.com&lt;/a&gt;) to ensure you have over the air near you. Visit the site and input your address and it will output a list of the channels near you color coded by the type of antenna you&#39;ll need. For TV Fool, green means an indoor or set top antenna will work. Yellow means you&#39;ll probably need at least an attic mounted antenna. Red means you&#39;ll need a roof mounted antenna and grey means you&#39;re probably out of luck.&lt;/p&gt;
&lt;p&gt;For some channels, we fall in the attic mount range so we went with the following antenna: &lt;a href=&quot;https://www.amazon.com/gp/product/B00CXQO00K/&quot;&gt;https://www.amazon.com/gp/product/B00CXQO00K/.&lt;/a&gt; We&#39;ve had little to no problems with the antenna and I&#39;d highly recommend it for anyone within the yellow or green ranges on TV Fool.&lt;/p&gt;
&lt;p&gt;Now that you&#39;ve got the antenna, head back to TV Fool and write down the direction that your antenna should be pointed. This makes a huge difference. We went from 11 channels on initial mounting to 30+ once the antenna was pointed in the right direction. You can user your phone&#39;s compass application for this.&lt;/p&gt;
&lt;p&gt;If you don&#39;t want a DVR, you&#39;ll need a coax splitter and coax cable runs to each TV that you&#39;ll be viewing live over the air TV. Most TVs today have built in capabilities for over the air HD TV.&lt;/p&gt;
&lt;h3&gt;The DVR System&lt;/h3&gt;
&lt;picture&gt;
  &lt;source srcset=&quot;https://www.jeremyknight.me/2017/img/posts/2017/tablo.avif&quot; type=&quot;image/avif&quot;&gt;
  &lt;source srcset=&quot;https://www.jeremyknight.me/2017/img/posts/2017/tablo.webp&quot; type=&quot;image/webp&quot;&gt;
  &lt;img src=&quot;https://www.jeremyknight.me/2017/img/posts/2017/tablo.jpg&quot; alt=&quot;&quot; class=&quot;img-fluid&quot;&gt;
&lt;/picture&gt;
&lt;p&gt;For the DVR, we decided on a 4-tuner Tablo TV DVR (&lt;a href=&quot;https://www.tablotv.com/&quot;&gt;https://www.tablotv.com/&lt;/a&gt;) which allows recording up to 4 shows at a time. The Tablo requires a single coax run from the antenna to the Tablo and an external hard drive. To help you select a hard drive, their website has both a &lt;a href=&quot;https://www.tablotv.com/blog/tablo-usb-hard-drive-specifications-suggestions/&quot;&gt;suggestions page&lt;/a&gt; and a &lt;a href=&quot;https://community.tablotv.com/t/tested-hard-drives/130&quot;&gt;community driven thread&lt;/a&gt; to ensure you buy a hard drive that will work with the system. If you want to grab the drive that we purchased, it&#39;s a &lt;a href=&quot;https://www.amazon.com/gp/product/B00TKFEEJ4/&quot;&gt;3TB Seagate&lt;/a&gt; (&lt;a href=&quot;https://www.amazon.com/gp/product/B00TKFEEJ4/&quot;&gt;https://www.amazon.com/gp/product/B00TKFEEJ4/&lt;/a&gt;). I doubt we&#39;ll ever fill the drive but it gives us the ability to save movies and TV shows for as long as we want.&lt;/p&gt;
&lt;p&gt;The Tablo connects directly to the antenna then connects to your router and uses your home network to deliver content to the different devices in your home. That does means you&#39;ll need a device to watch the content at each location. We already had a Roku device on each TV for Netflix, Amazon, etc. so we simply had to download the &lt;a href=&quot;https://channelstore.roku.com/details/44281/tablo-tv&quot;&gt;Tablo app from the Roku channel store&lt;/a&gt;. They have apps for most devices out there though and you can check to see if yours is supported here: &lt;a href=&quot;https://www.tablotv.com/tablo-products/&quot;&gt;https://www.tablotv.com/tablo-products/&lt;/a&gt;. I&#39;ve also installed their &lt;a href=&quot;https://www.tablotv.com/blog/tablo-ota-dvr-app-now-available-xbox-one/&quot;&gt;Windows app&lt;/a&gt; on all of our computers.&lt;/p&gt;
&lt;h3&gt;Product and Service Links&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Antenna: &lt;a href=&quot;https://www.amazon.com/gp/product/B00CXQO00K/&quot;&gt;https://www.amazon.com/gp/product/B00CXQO00K/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;DVR: &lt;a href=&quot;https://www.tablotv.com/&quot;&gt;https://www.tablotv.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;DVR Hard Drive: &lt;a href=&quot;https://www.amazon.com/gp/product/B00TKFEEJ4/&quot;&gt;https://www.amazon.com/gp/product/B00TKFEEJ4/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Roku: &lt;a href=&quot;https://www.roku.com/&quot;&gt;https://www.roku.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Tablo&#39;s App List: &lt;a href=&quot;https://www.tablotv.com/tablo-products/&quot;&gt;https://www.tablotv.com/tablo-products/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Update on ASP.NET Forms Bootstrap Menu Control</title>
    <link href="https://www.jeremyknight.me/2017/01/24/update-on-asp-net-forms-bootstrap-menu-control/" />
    <updated>2017-01-24T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2017/01/24/update-on-asp-net-forms-bootstrap-menu-control/</id>
    <content type="html">&lt;p&gt;I finally took the time to move my &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; Forms Bootstrap Menu Control code over to a &lt;a href=&quot;https://github.com/knight0323/aspnet-forms-bootstrap-menu&quot;&gt;GitHub repository&lt;/a&gt;. Because of the move, I&#39;ve closed the comments on the &lt;a href=&quot;https://www.jeremyknight.me/2017/01/2014/2014-02-25-asp-net-forms-bootstrap-menu-control/&quot;&gt;original post&lt;/a&gt; in hopes of moving all discussion regarding the control to its repository.&lt;/p&gt;
&lt;p&gt;I&#39;ve also built out 2 separate example projects. The first shows how to use the control with just the class file. The second shows how to use the control by referencing the project from a separate class library.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Using a Recursive CTE to Build Paths</title>
    <link href="https://www.jeremyknight.me/2015/09/25/using-a-recursive-cte-to-build-paths/" />
    <updated>2015-09-25T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2015/09/25/using-a-recursive-cte-to-build-paths/</id>
    <content type="html">&lt;p&gt;Here&#39;s the scenario. You have a hierarchical data set like categories, folders, etc. and you need to output the entire path for each.&lt;/p&gt;
&lt;p&gt;Let&#39;s say we take the category example and we have a table that looks like:&lt;/p&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Category&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt; 
  &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Id&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;IDENTITY&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;NOT&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
  &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Name&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;nvarchar&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;max&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;NOT&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
  &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;ParentCategoryId&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
  &lt;span class=&quot;token comment&quot;&gt;-- normal PK script removed to keep this short &lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To get the full path for each category, the SQL would look like:&lt;/p&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;WITH&lt;/span&gt; CTE_CategoriesWithPaths &lt;span class=&quot;token keyword&quot;&gt;AS&lt;/span&gt; 
&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt; 
  &lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; 
    c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Id&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
    c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
    c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ParentCategoryId&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
    c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Name &lt;span class=&quot;token keyword&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; 
  &lt;span class=&quot;token keyword&quot;&gt;FROM&lt;/span&gt; Category c 
  &lt;span class=&quot;token keyword&quot;&gt;WHERE&lt;/span&gt; c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ParentCategoryId &lt;span class=&quot;token operator&quot;&gt;IS&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;NULL&lt;/span&gt; 
  &lt;span class=&quot;token keyword&quot;&gt;UNION&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;ALL&lt;/span&gt; 
  &lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; 
    c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Id&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
    c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
    c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ParentCategoryId&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
    cte&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Name &lt;span class=&quot;token keyword&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; 
  &lt;span class=&quot;token keyword&quot;&gt;FROM&lt;/span&gt; 
    Category c 
    &lt;span class=&quot;token keyword&quot;&gt;INNER&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;JOIN&lt;/span&gt; CTE_CategoriesWithPaths cte &lt;span class=&quot;token keyword&quot;&gt;ON&lt;/span&gt; c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ParentCategoryId &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; cte&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Id 
  &lt;span class=&quot;token keyword&quot;&gt;WHERE&lt;/span&gt; c&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ParentCategoryId &lt;span class=&quot;token operator&quot;&gt;IS&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;NOT&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;NULL&lt;/span&gt; 
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 
&lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; 
&lt;span class=&quot;token keyword&quot;&gt;FROM&lt;/span&gt; CTE_CategoriesWithPaths&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>ASP.NET Forms Disabled CSS for BootStrap</title>
    <link href="https://www.jeremyknight.me/2015/02/19/asp-net-forms-disabled-css-for-bootstrap/" />
    <updated>2015-02-19T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2015/02/19/asp-net-forms-disabled-css-for-bootstrap/</id>
    <content type="html">&lt;p&gt;The following CSS is to handle &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.enabled(v=vs.110).aspx&quot; title=&quot;WebControl.Enabled Property on MSDN&quot;&gt;Enabled&lt;/a&gt; set to true in any &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol(v=vs.110).aspx&quot; title=&quot;WebControl Class on MSDN&quot;&gt;WebControl&lt;/a&gt;.&lt;/p&gt;
&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;/* -- Bootstrap Additions - ASP.NET Disabled ----------------- */&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;input[type=&quot;radio&quot;].aspNetDisabled,
input[type=&quot;checkbox&quot;].aspNetDisabled,
.radio-inline.aspNetDisabled,
.checkbox-inline.aspNetDisabled,
.radio.aspNetDisabled label,
.checkbox.aspNetDisabled label&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; not-allowed&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.btn.aspNetDisabled&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;pointer-events&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; not-allowed&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;opacity=65&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; .65&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.btn-default.aspNetDisabled,
.btn-default.aspNetDisabled:hover,
.btn-default.aspNetDisabled:focus,
.btn-default.aspNetDisabled:active,
.btn-default.aspNetDisabled.active&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #ccc&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.btn-primary.aspNetDisabled,
.btn-primary.aspNetDisabled:hover,
.btn-primary.aspNetDisabled:focus,
.btn-primary.aspNetDisabled:active,
.btn-primary.aspNetDisabled.active&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #428bca&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #357ebd&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.btn-success.aspNetDisabled,
.btn-success.aspNetDisabled:hover,
.btn-success.aspNetDisabled:focus,
.btn-success.aspNetDisabled:active,
.btn-success.aspNetDisabled.active&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #5cb85c&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #4cae4c&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.btn-info.aspNetDisabled,
.btn-info.aspNetDisabled:hover,
.btn-info.aspNetDisabled:focus,
.btn-info.aspNetDisabled:active,
.btn-info.aspNetDisabled.active&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #5bc0de&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #46b8da&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.btn-warning.aspNetDisabled,
.btn-warning.aspNetDisabled:hover,
.btn-warning.aspNetDisabled:focus,
.btn-warning.aspNetDisabled:active,
.btn-warning.aspNetDisabled.active&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #f0ad4e&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #eea236&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.btn-danger.aspNetDisabled,
.btn-danger.aspNetDisabled:hover,
.btn-danger.aspNetDisabled:focus,
.btn-danger.aspNetDisabled:active,
.btn-danger.aspNetDisabled.active&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #d9534f&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #d43f3a&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.dropdown-menu &gt; .aspNetDisabled &gt; a,
.dropdown-menu &gt; .aspNetDisabled &gt; a:hover,
.dropdown-menu &gt; .aspNetDisabled &gt; a:focus,
.dropdown-menu &gt; li &gt; a.aspNetDisabled,
.dropdown-menu &gt; li &gt; a.aspNetDisabled:hover,
.dropdown-menu &gt; li &gt; a.aspNetDisabled:focus&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #777&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token selector&quot;&gt;.dropdown-menu &gt; .aspNetDisabled &gt; a:hover,
.dropdown-menu &gt; .aspNetDisabled &gt; a:focus,
.dropdown-menu &gt; li &gt; a.aspNetDisabled:hover,
.dropdown-menu &gt; li &gt; a.aspNetDisabled:focus&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; not-allowed&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; transparent&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;progid&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;DXImageTransform.Microsoft.&lt;span class=&quot;token function&quot;&gt;gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;enabled = false&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>ASP.NET Membership Log Out</title>
    <link href="https://www.jeremyknight.me/2015/01/30/asp-net-membership-log-out/" />
    <updated>2015-01-30T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2015/01/30/asp-net-membership-log-out/</id>
    <content type="html">&lt;p&gt;My boss likes to say &amp;quot;never use the words &#39;simple&#39; or &#39;easy&#39; in our line of work&amp;quot; and today was one of those days that demonstrates exactly why he loves this saying.&lt;/p&gt;
&lt;p&gt;We were asked to setup an auto logout feature that redirects to the login screen. I&#39;ve done so much Windows Authentication work that I&#39;ve never actually had to build this functionality. I went straight to my favorite search engine and I found the following code.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;FormsAuthentication&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;SignOut&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
Session&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Abandon&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
FormsAuthentication&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;RedirectToLoginPage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Everyone was commenting about how this worked great and lo and behold it wasn&#39;t working. More research and I found an article that explained that the above neglected to clear cookies sometimes and that to 100% ensure a sign out you should clear the forms authentication and session cookies.&lt;/p&gt;
&lt;p&gt;The following code is what I ended up using in our application. It only expires the cookies that are forms authentication and session related.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;FormsAuthentication&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;SignOut&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
Session&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Abandon&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; cookies &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;List&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token string&quot;&gt;&quot;ASP.NET_SessionId&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
    FormsAuthentication&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;FormsCookieName&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
    &lt;span class=&quot;token string&quot;&gt;&quot;.ASPXROLES&quot;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token keyword&quot;&gt;foreach&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; cookie &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; cookies&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Request&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Cookies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;AllKeys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Contains&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;cookie&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        Request&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Cookies&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;cookie&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Expires &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; DateTime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;AddYears&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
FormsAuthentication&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;RedirectToLoginPage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Testable WebForms with MVP</title>
    <link href="https://www.jeremyknight.me/2014/08/02/testable-webforms-with-mvp/" />
    <updated>2014-08-02T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2014/08/02/testable-webforms-with-mvp/</id>
    <content type="html">&lt;p&gt;Presentation materials for my &amp;quot;Testable WebForms with MVP&amp;quot; are available at the links below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Slides: &lt;a href=&quot;https://docs.com/knight0323/1116/testable-webforms-with-mvp&quot;&gt;https://docs.com/knight0323/1116/testable-webforms-with-mvp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Code: &lt;a href=&quot;https://github.com/knight0323/presentations/tree/master/testable-webforms-mvp&quot;&gt;https://github.com/knight0323/presentations/tree/master/testable-webforms-mvp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>SQL Saturday Baton Rouge 2014</title>
    <link href="https://www.jeremyknight.me/2014/07/07/sql-saturday-baton-rouge-2014/" />
    <updated>2014-07-07T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2014/07/07/sql-saturday-baton-rouge-2014/</id>
    <content type="html">&lt;p&gt;First, &lt;a href=&quot;http://sqlsaturday.com/324/eventhome.aspx&quot; title=&quot;SQL Saturday Baton Rouge 2014&quot;&gt;SQL Saturday Baton Rouge 2014&lt;/a&gt; has opened registration and placed the session list online. If you&#39;re interested in development at all this is a must attend event. The sessions span all areas of development. The tracks include: .NET, Business Intelligence, Career Development, CIO/IT Manager, DBA, IT Pro, PowerShell, SharePoint, SQL Dev, and Web/Mobile dev. Please visit the website and sign up if you&#39;re interested.&lt;/p&gt;
&lt;p&gt;Secondly, I will be presenting &amp;quot;Testable WebForms with MVP&amp;quot;. This will be an intermediate topic and I&#39;ll be assuming experience using &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; WebForms and a basic understanding of unit testing. All code examples will be in C#. Here&#39;s the description I sent in:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;MVC is all the rage but what about all the code you already have written in &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; WebForms? How can you make it maintainable and testable? In this session, I&#39;ll show how you can make WebForms applications testable using Model-View-Presenter.&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>ASP.NET Forms Bootstrap Menu Control</title>
    <link href="https://www.jeremyknight.me/2014/02/25/asp-net-forms-bootstrap-menu-control/" />
    <updated>2014-02-25T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2014/02/25/asp-net-forms-bootstrap-menu-control/</id>
    <content type="html">&lt;p&gt;&lt;strong&gt;UPDATE: I have closed the comments for this post. If you&#39;d like to discuss the &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; Forms Bootstrap Menu Control, please visit the GitHub repository located at: &lt;a href=&quot;https://github.com/jeremyknight-me/aspnet-forms-bootstrap-menu&quot;&gt;https://github.com/jeremyknight-me/aspnet-forms-bootstrap-menu&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;When I couldn&#39;t find an &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; Form menu control that was compatible with Bootstrap 3.1, I did what every other developer would do: I created one. Enjoy!&lt;/p&gt;
&lt;p&gt;Here&#39;s the HTML markup view:&lt;/p&gt;
&lt;pre class=&quot;language-aspnet&quot;&gt;&lt;code class=&quot;language-aspnet&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navbar navbar-inverse navbar-static-top&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;role&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navigation&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navbar-header&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;button&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;button&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navbar-toggle&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;data-toggle&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;collapse&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;data-target&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;.navbar-collapse&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;sr-only&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Toggle navigation&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;icon-bar&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;icon-bar&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;icon-bar&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;button&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navbar-collapse collapse&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;jk:&lt;/span&gt;BootstrapMenu&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;BootstrapMenu1&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;server&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;HighlightActive&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;True&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Items&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Link&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;NavigateUrl&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Link&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;NavigateUrl&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Drop Down&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Link&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;NavigateUrl&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Link&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;NavigateUrl&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Link&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;NavigateUrl&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Link&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;NavigateUrl&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;MenuItem&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Nothing&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;Items&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;jk:&lt;/span&gt;BootstrapMenu&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--/.nav-collapse --&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here&#39;s the HTML markup view for using with a SiteMapDataSource:&lt;/p&gt;
&lt;pre class=&quot;language-aspnet&quot;&gt;&lt;code class=&quot;language-aspnet&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navbar navbar-inverse navbar-static-top&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;role&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navigation&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navbar-header&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;button&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;button&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navbar-toggle&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;data-toggle&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;collapse&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;data-target&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;.navbar-collapse&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;sr-only&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Toggle navigation&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;icon-bar&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;icon-bar&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;icon-bar&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;button&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;navbar-collapse collapse&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;jk:&lt;/span&gt;BootstrapMenu&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;BootstrapMenu2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;server&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;DataSourceId&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;SiteMapDataSource1&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;asp:&lt;/span&gt;SiteMapDataSource&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;SiteMapDataSource1&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;server&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;ShowStartingNode&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;False&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--/.nav-collapse --&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In either case you&#39;ll need a page directive&lt;/p&gt;
&lt;pre class=&quot;language-aspnet&quot;&gt;&lt;code class=&quot;language-aspnet&quot;&gt;&lt;span class=&quot;token page-directive tag&quot;&gt;&lt;span class=&quot;token page-directive tag&quot;&gt;&amp;lt;%@ Register&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;TagPrefix&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;jk&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Namespace&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;JK.BootstrapControls&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Assembly&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;JK.BootstrapControls&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token page-directive tag&quot;&gt;%&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Updates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2017 January 23: Closed comments to push conversation to GitHub repository.&lt;/li&gt;
&lt;li&gt;2015 January 19: Added zip file sample project for download to OneDrive.&lt;/li&gt;
&lt;li&gt;2014 August 15: Added page directive needed to use control in page markup&lt;/li&gt;
&lt;li&gt;2014 April 11: Updated to work with SiteMapDataSource&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Uncle Bob on Professional Software Development</title>
    <link href="https://www.jeremyknight.me/2014/02/10/uncle-bob-on-professional-software-development/" />
    <updated>2014-02-10T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2014/02/10/uncle-bob-on-professional-software-development/</id>
    <content type="html">&lt;p&gt;This is a video that I think every software developer should watch. It&#39;s a great talk about professionalism and craftsmanship within the industry.&lt;/p&gt;
&lt;iframe src=&quot;https://player.vimeo.com/video/43536488?h=71268ab104&quot; width=&quot;640&quot; height=&quot;360&quot; frameborder=&quot;0&quot; allow=&quot;autoplay; fullscreen; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;a href=&quot;https://vimeo.com/43536488&quot;&gt;Robert C. Martin - Professional Software Development&lt;/a&gt; from &lt;a href=&quot;https://vimeo.com/ndcconferences&quot;&gt;NDC Conferences&lt;/a&gt; on &lt;a href=&quot;https://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Link: &lt;a href=&quot;https://vimeo.com/43536488&quot;&gt;https://vimeo.com/43536488&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The video is from the 2012 Norwegian Developers Conference.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>What Tools Do I Use? Oct 2013 Edition</title>
    <link href="https://www.jeremyknight.me/2013/10/10/what-tools-do-i-use/" />
    <updated>2013-10-10T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2013/10/10/what-tools-do-i-use/</id>
    <content type="html">&lt;p&gt;At Houston TechFest 2013, Claudio Lassala presented &amp;quot;&lt;a href=&quot;http://lassala.net/2013/10/03/material-from-my-presentations-at-htf-2013/&quot; title=&quot;Claudio Lassala&#39;s Material from Houston TechFest 2013 Presentations&quot;&gt;Want to Build Software? Get Your Act Together First!&lt;/a&gt;&amp;quot;. It got me thinking about how I work and what software I would recommend. The following tools fit into two categories. I either use it daily or it&#39;s invaluable in specific situations (for example, taking screenshots or giving presentations).&lt;/p&gt;
&lt;h3&gt;The Data I Need When I Need It&lt;/h3&gt;
&lt;p&gt;I use a combination of three pieces of software to ensure that I always have all of the information I need at my fingertips. The three are: SkyDrive, OneNote, and KeePass.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://windows.microsoft.com/en-US/skydrive/download&quot; title=&quot;Microsoft SkyDrive&quot;&gt;SkyDrive&lt;/a&gt; is the Microsoft DropBox competitor. I use it for a 2 reasons. The first reason is it that it offers more storage for free. SkyDrive gives 7 GB while DropBox gives 2 GB. I actually have 25 GB due to an old SkyDrive promotion. The second reason is that I can view and edit all of my files directly through a browser. This has become extremely important to me. For example, I was recently in a meeting and a presentation that I was working on came up. I didn&#39;t have my laptop but the meeting room had a computer connected to the screen. I was able to log into my SkyDrive and review the presentation directly from my SkyDrive.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://office.microsoft.com/en-us/onenote/&quot; title=&quot;Microsoft OneNote&quot;&gt;OneNote&lt;/a&gt; is Microsoft&#39;s note taking software. Evernote is a popular competitor and one that I have tried before. When OneNote was released for my mobile platform, I immediately switched back. Now I have access to my notes anywhere I have my phone or have access to an internet browser (I can view and edit my OneNote notebooks through SkyDrive).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://keepass.info/&quot; title=&quot;KeePass Password Manager&quot;&gt;KeePass&lt;/a&gt; is a password manager tool. We have passwords for everything now and they should all be unique and varied. How does it work? You create one password for your encrypted KeePass file and you place all of your other passwords into the file.&lt;/p&gt;
&lt;h3&gt;Collaboration&lt;/h3&gt;
&lt;p&gt;I currently work on a distributed team so having effective tools in place for collaboration and communication is a must.&lt;/p&gt;
&lt;p&gt;For task and backlog tracking, we use Team Foundation Server. If TFS wouldn&#39;t be available, I would be using &lt;a href=&quot;https://trello.com/&quot; title=&quot;Trello&quot;&gt;Trello&lt;/a&gt; or a tool with similar features.&lt;/p&gt;
&lt;p&gt;For voice, we use &lt;a href=&quot;http://www.skype.com&quot; title=&quot;Skype&quot;&gt;Skype&lt;/a&gt;. It&#39;s simple, effective, and proven. Its screen sharing feature comes in handy if it&#39;s just a quick discussion. For more complex screen sharing, we use &lt;a href=&quot;http://www.teamviewer.com&quot; title=&quot;TeamViewer&quot;&gt;TeamViewer&lt;/a&gt;. TeamViewer allows users to pass control around. This comes in extremely handy when working through code with another developer. Another plus is that TeamViewer has official apps for Android, Windows 8, Windows Phone 8, and iOS.&lt;/p&gt;
&lt;h3&gt;Let&#39;s Develop Something Already!&lt;/h3&gt;
&lt;p&gt;I have already mentioned that I work in a Microsoft development team so Visual Studio is a must. I currently have 2010 and 2012 installed on my machine but we will be moving everything to 2013 on its release. If you&#39;d like to know which plugins I&#39;m using for Visual Studio, see my post &amp;quot;&lt;a href=&quot;https://www.jeremyknight.me/2013/10/2011/2011-08-26-visual-studio-add-ons/&quot; title=&quot;Visual Studio Add-ons&quot;&gt;Visual Studio Add-ons&lt;/a&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;Everyone has their own favorite text editor and mine is &lt;a href=&quot;http://notepad-plus-plus.org/&quot; title=&quot;NotePad++&quot;&gt;Notepad++&lt;/a&gt;. It&#39;s always the first thing that I install on a new machine and I immediately set it as my default text viewer. I&#39;ve recommended it to every developer friend that I know. It has lots of goodies throughout the program including plugins. For example, the Compare plugin has taken the place of WinMerge on my machines and ToolBucket let&#39;s me easily generate GUIDs and lorem ipsum, encode/decode to base 64, and more.&lt;/p&gt;
&lt;p&gt;A great tool for testing .NET code snippets, LINQ statements, etc. is &lt;a href=&quot;http://www.linqpad.net/&quot; title=&quot;LINQPad&quot;&gt;LINQPad&lt;/a&gt;. This little application is extremely feature packed and you&#39;ll find more ways to use it every time you open it. One of my favorites is the ability to generate the SQL for a LINQ statement.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.my-debugbar.com/wiki/IETester/HomePage&quot; title=&quot;IETester&quot;&gt;IETester&lt;/a&gt; by DebugBar is a must have for web developers wanting to test their website&#39;s rendering in multiple IE versions.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://getgreenshot.org/&quot; title=&quot;Greenshot&quot;&gt;Greenshot&lt;/a&gt; is my go to application for screenshots. It has multiple capture modes and a built in image editor which allows you to edit an image before saving the final version.&lt;/p&gt;
&lt;h3&gt;Presentation Must Haves&lt;/h3&gt;
&lt;p&gt;If you&#39;re giving presentations or sharing screens often, I have a couple of recommendations.&lt;/p&gt;
&lt;p&gt;The first suggestion is &lt;a href=&quot;http://osherove.com/tools/&quot; title=&quot;Key Jedi&quot;&gt;Key Jedi&lt;/a&gt;. Presenters tend to forget that the viewers don&#39;t know when you press Alt, Ctrl, etc. This is a little application displays those special combination keystrokes so that your audience doesn&#39;t get lost when you&#39;re flying around Visual Studio using only the keyboard.&lt;/p&gt;
&lt;p&gt;The second is &lt;a href=&quot;http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx&quot; title=&quot;ZoomIt&quot;&gt;ZoomIt&lt;/a&gt;. This application allows you to Zoom in and out of any application running in Windows. It also has some markup features which are quite nice once you get used to the keyboard shortcuts.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lazy Strategy Pattern</title>
    <link href="https://www.jeremyknight.me/2013/05/02/lazy-strategy-pattern/" />
    <updated>2013-05-02T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2013/05/02/lazy-strategy-pattern/</id>
    <content type="html">&lt;p&gt;The following are some code samples that show how to use Lazy to clean up how your objects are initialized when using the Strategy pattern in .NET. The following code is taken from the &lt;a href=&quot;http://DimeCast.Net&quot;&gt;DimeCast.Net&lt;/a&gt; Strategy pattern video. It uses an enum to select the correct logging strategy and logs the given message. The original code from the video before Lazy is applied looks like (by the way, I&#39;m only posting the sections relevant to strategy and lazy):&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;LoggingService&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token type-list&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;ILoggingService&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;readonly&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Dictionary&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; strategies&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;LoggingService&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;Dictionary&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;DefineStrategies&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;DefineStrategies&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Event&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;EventLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Repository&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;RepositoryLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Trace&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;TraceLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here is the same code using the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd642331.aspx&quot; title=&quot;Lazy(T) Class&quot;&gt;Lazy&amp;lt;T&amp;gt;&lt;/a&gt; class in the System namespace.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;LazyLoggingService&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token type-list&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;ILoggingService&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;readonly&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Dictionary&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Lazy&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; strategies&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;LazyLoggingService&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;Dictionary&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Lazy&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;DefineStrategies&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;DefineStrategies&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Event&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;Lazy&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;EventLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Repository&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;Lazy&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;RepositoryLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Trace&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;Lazy&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;TraceLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And one final time just in case you don&#39;t have access to Lazy&lt;T&gt;. This uses delegates to accomplish the same thing as the Lazy&lt;T&gt; class. I&#39;ll be using the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb534960.aspx&quot; title=&quot;Func(TResult) Delegate&quot;&gt;Func&amp;lt;TResult&amp;gt;&lt;/a&gt; delegate.&lt;/T&gt;&lt;/T&gt;&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;DelegateLoggingService&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token type-list&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;ILoggingService&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;readonly&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Dictionary&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Func&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt; strategies&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;DelegateLoggingService&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;Dictionary&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Func&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Logger&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;DefineStrategies&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
    &lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;DefineStrategies&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Event&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;EventLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Repository&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;RepositoryLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strategies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LoggingStrategy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Trace&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;TraceLogger&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now that all the code is out of the way, let&#39;s talk a little about why you would want to use this. Let&#39;s look at the original code sample. The DefineStrategies function initializes a Logger object and adds it to the Dictionary. Every single Dictionary.Add call in the original code is initializing an object. That&#39;s additional memory and processing time for every object. By using Lazy(or the delegate method shown above), you postpone the initialization of the object until you actually ask for it.&lt;/p&gt;
&lt;p&gt;Lazy initialization may not work well for everything but I&#39;ve found that it makes strategy implementations much more lean and efficient in terms of machine resources.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SQL If Exists Then Drop</title>
    <link href="https://www.jeremyknight.me/2013/04/15/sql-if-exists-then-drop/" />
    <updated>2013-04-15T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2013/04/15/sql-if-exists-then-drop/</id>
    <content type="html">&lt;p&gt;This is one topic that I continually find myself refering to my notes and bookmarks on and I&#39;ve finally decided to add this piece of very good reference information to my own blog.&lt;/p&gt;
&lt;h3&gt;Tables&lt;/h3&gt;
&lt;p&gt;Option 1:&lt;/p&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; OBJECT_ID&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;enterTableNameHere&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;U&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;IS&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;NOT&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;NULL&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;BEGIN&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterTableNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;END&lt;/span&gt;
GO&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Option 2:&lt;/p&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;EXISTS&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;FROM&lt;/span&gt; dbo&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sysobjects
    &lt;span class=&quot;token keyword&quot;&gt;WHERE&lt;/span&gt; id &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; object_id&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;N&lt;span class=&quot;token string&quot;&gt;&#39;[dbo].[enterTableNameHere]&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;token operator&quot;&gt;AND&lt;/span&gt; OBJECTPROPERTY&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;id&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; N&lt;span class=&quot;token string&quot;&gt;&#39;IsUserTable&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;BEGIN&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterTableNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;END&lt;/span&gt;
GO&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Views&lt;/h3&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;EXISTS&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;FROM&lt;/span&gt; INFORMATION_SCHEMA&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;VIEWS
    &lt;span class=&quot;token keyword&quot;&gt;WHERE&lt;/span&gt; TABLE_SCHEMA &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;enterSchemaNameHere&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;AND&lt;/span&gt; TABLE_NAME &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;enterViewNameHere&#39;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;BEGIN&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;VIEW&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterViewNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;END&lt;/span&gt;
GO&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;stored-procedures&quot; tabindex=&quot;-1&quot;&gt;Stored Procedures&lt;/h2&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;EXISTS&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;FROM&lt;/span&gt; dbo&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sysobjects
    &lt;span class=&quot;token keyword&quot;&gt;WHERE&lt;/span&gt; id &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; object_id&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;N&lt;span class=&quot;token string&quot;&gt;&#39;[dbo].[enterStoredProcedureNameHere]&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token operator&quot;&gt;AND&lt;/span&gt; OBJECTPROPERTY&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;id&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; N&lt;span class=&quot;token string&quot;&gt;&#39;IsProcedure&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;BEGIN&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;PROCEDURE&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterStoredProcedureNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;END&lt;/span&gt;
GO&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;User-Defined Functions&lt;/h3&gt;
&lt;pre class=&quot;language-sql&quot;&gt;&lt;code class=&quot;language-sql&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;EXISTS&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;FROM&lt;/span&gt; INFORMATION_SCHEMA&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ROUTINES
    &lt;span class=&quot;token keyword&quot;&gt;WHERE&lt;/span&gt;   ROUTINE_NAME &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;enterFunctionNameHere&#39;&lt;/span&gt;
    &lt;span class=&quot;token operator&quot;&gt;AND&lt;/span&gt; ROUTINE_SCHEMA &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;dbo&#39;&lt;/span&gt;
    &lt;span class=&quot;token operator&quot;&gt;AND&lt;/span&gt; ROUTINE_TYPE &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;FUNCTION&#39;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;BEGIN&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;FUNCTION&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;dbo&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;enterFunctionNameHere&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;END&lt;/span&gt;
GO&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Visual Studio Tips and Tricks: Debugging</title>
    <link href="https://www.jeremyknight.me/2013/04/01/visual-studio-tips-and-tricks-debugging/" />
    <updated>2013-04-01T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2013/04/01/visual-studio-tips-and-tricks-debugging/</id>
    <content type="html">&lt;p&gt;Visual Studio Tips and Tricks was a topic in our local user group a while back. I decided why not do a series of videos instead of trying to publish all of the tips in a PowerPoint or some write up. Everything shown here can be done in at least Visual Studio 2010 and Visual Studio 2012.&lt;/p&gt;
&lt;p&gt;The debugging video below is part 2 of this video series:&lt;/p&gt;
&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/8wgY2f3PN5s?si=NXK17_RqxeMsdAyL&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
</content>
  </entry>
  <entry>
    <title>March 2013 Nicholls Presentation</title>
    <link href="https://www.jeremyknight.me/2013/03/27/march-2013-nicholls-presentation/" />
    <updated>2013-03-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2013/03/27/march-2013-nicholls-presentation/</id>
    <content type="html">&lt;p&gt;This post will contain the information from my presentation at Nicholls State University on March 26, 2013.&lt;/p&gt;
&lt;p&gt;Code: &lt;a href=&quot;https://github.com/knight0323/presentations/tree/master/nsu-2013-03&quot;&gt;https://github.com/knight0323/presentations/tree/master/nsu-2013-03&lt;/a&gt; Slides: &lt;a href=&quot;https://docs.com/knight0323/2320/nicholls-dev-presentation-march-2013&quot;&gt;https://docs.com/knight0323/2320/nicholls-dev-presentation-march-2013&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Presentation Information&lt;/h3&gt;
&lt;p&gt;The general Visual Studio Tips and Tricks information can be found in my video linked below. I will be creating a Debugging Tips and Tricks video soon. &lt;a href=&quot;http://jeremyknight.wordpress.com/2013/03/18/visual-studio-tips-and-tricks/&quot;&gt;http://jeremyknight.wordpress.com/2013/03/18/visual-studio-tips-and-tricks/&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Additional Reading Resources&lt;/h3&gt;
&lt;p&gt;Here is a list of resources for anyone that would like to do additional reading and/or research:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ASP.NET&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Official Site: &lt;a href=&quot;http://www.asp.net/&quot;&gt;http://www.asp.net/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Wikipedia: &lt;a href=&quot;http://en.wikipedia.org/wiki/ASP.NET&quot;&gt;http://en.wikipedia.org/wiki/ASP.NET&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;LINQ&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wikipedia: &lt;a href=&quot;http://en.wikipedia.org/wiki/Language_Integrated_Query&quot;&gt;http://en.wikipedia.org/wiki/Language_Integrated_Query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;MSDN: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb308959.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/bb308959.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;101 Examples: &lt;a href=&quot;http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b&quot;&gt;http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Entity Framework&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Official Site: &lt;a href=&quot;http://www.asp.net/entity-framework&quot;&gt;http://www.asp.net/entity-framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;MSDN: &lt;a href=&quot;http://msdn.microsoft.com/en-us/data/ef.aspx&quot;&gt;http://msdn.microsoft.com/en-us/data/ef.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Wikipedia: &lt;a href=&quot;http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework&quot;&gt;http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;ASP.NET&lt;/span&gt; AJAX Control Toolkit&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CodePlex Project: &lt;a href=&quot;http://ajaxcontroltoolkit.codeplex.com/&quot;&gt;http://ajaxcontroltoolkit.codeplex.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Sample Site: &lt;a href=&quot;http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/&quot;&gt;http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Visual Studio Tips and Tricks</title>
    <link href="https://www.jeremyknight.me/2013/03/18/visual-studio-tips-and-tricks/" />
    <updated>2013-03-18T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2013/03/18/visual-studio-tips-and-tricks/</id>
    <content type="html">&lt;p&gt;Visual Studio Tips and Tricks was a topic in our local user group a while back. I decided why not do a video instead of trying to publish all of the tips in a PowerPoint or some write up. Everything shown here can be done in at least Visual Studio 2010 and Visual Studio 2012.&lt;/p&gt;
&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/kVQXIhOMXbk?si=iQ_TTtLrMS28mGeO&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;</content>
  </entry>
  <entry>
    <title>A Simple CSV Export?</title>
    <link href="https://www.jeremyknight.me/2013/02/14/a-simple-csv-export/" />
    <updated>2013-02-14T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2013/02/14/a-simple-csv-export/</id>
    <content type="html">&lt;p&gt;The following programming anecdote was posted by a former colleague on his Facebook page today:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A couple of years ago a fellow developer was asked to take some data and export it to CSV format. He took some time and researched a library. After, the manager/architect/lead developer (all the same person), questioned why he took that time, and why he didn&#39;t just string.Join() them together and move on. He rattled off a few special cases, escaping characters etc. and stood by his decision though the person questioning still thought it a poor one.   About once a month since then I hear a new story about home-grown, handmade CSV functionality breaking because it didn&#39;t account for a case, character or something previously unexpected.&lt;/p&gt;
&lt;p&gt;It&#39;s a reminder to me that no matter how simple the task appears to be, a thought should be given to it&#39;s longevity, future usage, and potential expectations long after the initial case for creation has been forgotten. A small investment now can go a long way.&lt;/p&gt;
&lt;p&gt;&amp;quot;The only way to go fast is to go well&amp;quot;   For those curious, the chosen library at the time: &lt;a href=&quot;http://kbcsv.codeplex.com/&quot;&gt;http://kbcsv.codeplex.com/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Well said.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Wireless Security Tip: Don&#39;t Connect Automatically</title>
    <link href="https://www.jeremyknight.me/2013/02/12/wireless-security-tip-dont-connect-automatically/" />
    <updated>2013-02-12T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2013/02/12/wireless-security-tip-dont-connect-automatically/</id>
    <content type="html">&lt;p&gt;I have a quick tip that will exponentially increase your laptop, tablet, or even phone security. When you&#39;re setting up your wireless connections, there are 2 options that you should never turn on: 1) &amp;quot;connect automatically when this network is in range&amp;quot; or &amp;quot;start this connection automatically&amp;quot; and 2) &amp;quot;connect even if the network is not broadcasting&amp;quot;.&lt;/p&gt;
&lt;p&gt;You can blame hidden wireless networks for this gaping security hole. The How-To Geek has a really good &lt;a href=&quot;http://www.howtogeek.com/howto/28653/debunking-myths-is-hiding-your-wireless-ssid-really-more-secure/&quot; title=&quot;Debunking Myths: Is Hiding Your Wireless SSID Really More Secure?&quot;&gt;article&lt;/a&gt; explaining why you shouldn&#39;t use hidden wireless networks.&lt;/p&gt;
&lt;h3&gt;Why should I turn off these convenience features?&lt;/h3&gt;
&lt;p&gt;When you use the auto connect features of WiFi, your device will seek out the wireless connection. In the process of seeking out the connection, it also broadcasts the connection information. Devices such as WiFi Pineapples can be built to scan for the broadcasts coming from your devices. Once it has found a device, it automatically configures a matching connection and allows you to connect. Once you&#39;re connected, your internet traffic can be monitored.&lt;/p&gt;
&lt;p&gt;The following comes directly from the product information of &lt;a href=&quot;http://hak5.org/store/wifi-pineapple-version-2&quot; title=&quot;Hak5 Wifi Pineapple&quot;&gt;Hak5&#39;s WiFi Pineapple&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You see most laptops have network software that automatically connects to access points they remember. This convenient feature is what gets you online without effort when you turn on your computer at home, the office, coffee shops or airports you frequent.&lt;/p&gt;
&lt;p&gt;Simply put, when your computer turns on the wireless radio send out out beacons. These beacons say “Is such-and-such wireless network around?” Jasager, German for “The Yes Man”, replies to these beacons and says “Sure, I’m such-and-such wireless access point – let’s get you online!”&lt;/p&gt;
&lt;p&gt;Of course all of the Internet traffic flowing through the pineapple such as e-mail, instant messages and browser sessions are easily viewed or even modified by the pineapple holder.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
  </entry>
  <entry>
    <title>.NET String Concatenation</title>
    <link href="https://www.jeremyknight.me/2012/05/04/net-string-concatenation/" />
    <updated>2012-05-04T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2012/05/04/net-string-concatenation/</id>
    <content type="html">&lt;p&gt;String concatenation is a tool on every developer’s tool belt but in .NET there are multiple ways to accomplish it. There are also a lot of conflicting articles, posts, etc. on the subject. When should you use StringBuilder? When should you use string formatting? This article will hopefully shine some light on when to use each method.&lt;/p&gt;
&lt;h3&gt;Which Methods Were Tested?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The concatenation operator. In C#, it is the + operator. In &lt;a href=&quot;http://VB.NET&quot;&gt;VB.NET&lt;/a&gt;, it is the &amp;amp; operator.&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.string.concat.aspx&quot; title=&quot;String.Concat Method&quot;&gt;String.Concat()&lt;/a&gt; method.&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx&quot; title=&quot;StringBuilder Class&quot;&gt;System.Text.StringBuilder&lt;/a&gt; class.&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.string.format.aspx&quot; title=&quot;String.Format Method&quot;&gt;String.Format()&lt;/a&gt; method.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;How Were They Tested?&lt;/h3&gt;
&lt;p&gt;A console application was prepared to test operation scenarios. The scenarios were timed using the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx&quot; title=&quot;Stopwatch Class&quot;&gt;System.Diagnostics.Stopwatch class&lt;/a&gt;. The full Visual Studio solution can be found in &lt;a href=&quot;http://jeremyknight.codeplex.com/&quot; title=&quot;Jeremy Knight - Code samples, snippets, etc from my personal blog.&quot;&gt;my CodePlex project&lt;/a&gt;.&lt;/p&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2012/img/posts/2012/screenshot-single-run.png&quot; alt=&quot;&quot; class=&quot;mx-auto d-block mb-3&quot;&gt;
&lt;h3&gt;What Were the Results?&lt;/h3&gt;
&lt;h5&gt;Scenario 1: Loop Concatenation&lt;/h5&gt;
&lt;p&gt;The Loop Concatenation scenario was built to test string concatenation within a loop. This data set had the most straight-forward results. The StringBuilder class gives the best performance when using concatenation in this scenaraio.&lt;/p&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2012/img/posts/2012/string-concat-loop-results.png&quot; alt=&quot;&quot; class=&quot;mx-auto d-block&quot;&gt;
&lt;div class=&quot;text-center&quot;&gt;&lt;em&gt;Loop Concatenation Results (in milliseconds)&lt;/em&gt;&lt;/div&gt;
&lt;p&gt;Code sample using StringBuilder in this scenario:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; builder &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;StringBuilder&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;/span&gt; i &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;iterations&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    builder&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Append&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;x&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; testString &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; builder&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Scenario 2: Full Name Concatenation&lt;/h5&gt;
&lt;p&gt;The Full Name Concatenation scenario was built to test simple string concatenation in which few concatenations occur. It concatenates first name, a space, and last name. This is commonly used to build display names for a UI. These results point to the String.Concat method as the most efficient way to concatenate small numbers of strings.&lt;/p&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2012/img/posts/2012/string-concat-full-name-results.png&quot; alt=&quot;&quot; class=&quot;mx-auto d-block&quot;&gt;
&lt;div class=&quot;text-center&quot;&gt;&lt;em&gt;Full Name Concatenation Results (in ticks)&lt;/em&gt;&lt;/div&gt;
&lt;p&gt;Code sample using String.Concat in this scenario:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; first &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;John&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; last &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Deaux&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; fullName &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Concat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;first&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; last&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Scenario 3: Long Text Concatenation&lt;/h5&gt;
&lt;p&gt;The Long Text Concatenation scenario was built to test long concatenations in which many concatenations occur. It simulates building the body of an email message. These results also point to the String.Concat method as the most efficient. Comparing the prior scenario with this scenario you can begin to see pattern. As you add concatenations, the efficiency of String.Format and StringBuilder (when out of a looping scenario) declines.&lt;/p&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2012/img/posts/2012/string-concat-long-text-results.png&quot; alt=&quot;&quot; class=&quot;mx-auto d-block&quot;&gt;
&lt;div class=&quot;text-center&quot;&gt;&lt;em&gt;Long Text Concatenation Results (in ticks)&lt;/em&gt;&lt;/div&gt;
&lt;p&gt;Code sample using String.Concat in this scenario:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; newLine &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Environment&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;NewLine&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;John Deaux&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; email &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;john.deaux@123.me&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; subject &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;The Subject of the Message&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; product &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;ABC&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; feature &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;XYZ&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; body &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;The comment(s) made about product/feature.&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt; values &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;Name: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; newLine&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;Email: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; email&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; newLine&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;Subject: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; subject&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; newLine&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;Product: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; product&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; newLine&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;Feature: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; feature&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; newLine&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;Message: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; newLine&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; body
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; emailBody &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Concat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;values&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Scenario 4: Date Concatenation&lt;/h5&gt;
&lt;p&gt;The Date Concatenation scenario was built to test the formatting of dates. It formats a date into the sortable format of 2011-12-31T15:30:15. Of the people I&#39;ve talked to about this little experiment, this one has surprised the most. Why? Because it is highly touted by articles, books, and even Microsoft as the way to format data and it&#39;s &lt;em&gt;extremely&lt;/em&gt; inefficient. The String.Format method is slower and less efficient than every other method tested, including the StringBuilder class, for formatting DateTime objects as strings.&lt;/p&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2012/img/posts/2012/string-concat-date-results.png&quot; alt=&quot;&quot; class=&quot;mx-auto d-block&quot;&gt;
&lt;div class=&quot;text-center&quot;&gt;&lt;em&gt;Date Concatentation Results (in ticks)&lt;/em&gt;&lt;/div&gt;
&lt;p&gt;Code sample using String.Concat in this scenario:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;DateTime&lt;/span&gt; date &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; DateTime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; values &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        date&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Year&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;0000&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;-&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        date&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Month&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;00&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;-&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        date&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Day&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;00&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;T&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        date&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Hour&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;00&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;:&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        date&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Minute&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;00&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&quot;:&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        date&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Second&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;00&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; sortable &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Concat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;values&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Yes, you did read that correctly. The above code is &lt;em&gt;a lot&lt;/em&gt; faster and more efficient than:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; sortable &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Format&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;{0:u}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; DateTime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// or&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; sortable &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Format&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;{0:yyyy-MM-ddTHH:mm:ss}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; DateTime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>My Visual Studio Theme</title>
    <link href="https://www.jeremyknight.me/2012/04/18/my-visual-studio-theme/" />
    <updated>2012-04-18T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2012/04/18/my-visual-studio-theme/</id>
    <content type="html">&lt;p&gt;So I&#39;ve finally published my Visual Studio theme on the &lt;a href=&quot;http://studiostyl.es/&quot; title=&quot;Studio Styles - Custom Styles for Visual Studio&quot;&gt;Studio Styles&lt;/a&gt; website. It&#39;s a customized version of the &lt;a href=&quot;http://winterdom.com/2007/10/ragnarokavs2005colorscheme&quot;&gt;Ragnarok Grey theme&lt;/a&gt; created by Tomas Restrepro. I darkened the background then had to make a few other subtle changes for readability due to the darker background.&lt;/p&gt;
&lt;p&gt;Ragnarok Dark as I&#39;ve chosen to call it can be found here: &lt;a href=&quot;http://studiostyl.es/schemes/ragnarok-dark-grey-customized&quot;&gt;http://studiostyl.es/schemes/ragnarok-dark-grey-customized&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And remember to rate it if you like it!&lt;/p&gt;
&lt;p&gt;Now a bonus for those of you that use ReSharper. The following line pasted into the bottom of the items section in the XML downloaded from the site before you import will make those To Do Comments and Not Implemented Exceptions stand out.&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code class=&quot;language-markup&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;Item&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;ReSharper Todo Item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Foreground&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;0x0000FFFF&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;Background&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;0x02000000&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;BoldFont&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Yes&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>2012 Baton Rouge SQL Saturday &amp; Tech Day</title>
    <link href="https://www.jeremyknight.me/2012/04/18/2012-baton-rouge-sql-saturday-tech-day/" />
    <updated>2012-04-18T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2012/04/18/2012-baton-rouge-sql-saturday-tech-day/</id>
    <content type="html">&lt;p&gt;The information for this year&#39;s Baton Rouge SQL Saturday &amp;amp; Tech Day came online this past week. It&#39;s scheduled for August 4, 2012.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Free SQL Server, SharePoint and .NET training!  Chance to win great prizes!  What more could an IT Professional ask for?  If this sounds good to you, then don’t miss your opportunity to attend SQL Saturday #150 and TECH Day, the largest FREE training event in Louisiana dedicated exclusively to SQL Server, .NET, Development, SharePoint and Business Intelligence.   This is a COMMUNITY driven event!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For more information visit the official website at: &lt;a href=&quot;http://sqlsaturday.com/150/eventhome.aspx&quot;&gt;http://sqlsaturday.com/150/eventhome.aspx&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Back to Basics: System.String</title>
    <link href="https://www.jeremyknight.me/2011/10/28/back-to-basics-system-string/" />
    <updated>2011-10-28T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/10/28/back-to-basics-system-string/</id>
    <content type="html">&lt;p&gt;For such a simple concept, the string class is, in my opinion, one of the most complex classes in the System namespace. The MSDN page for String Class is 53 printed pages excluding the 2 additional pages of comments.&lt;/p&gt;
&lt;h3&gt;What is System.String?&lt;/h3&gt;
&lt;p&gt;In the .NET framework, the string type is a reference type. It is not a value type as is often the belief. It is an object that consists of a collection of System.Char values in sequential order. Characters within the string can be referenced as follows:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foo &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;bar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;char&lt;/span&gt;&lt;/span&gt; r &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; foo&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Immutable&lt;/h3&gt;
&lt;p&gt;The string type is also immutable. You cannot change the contents of a string without reflection or &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms228599.aspx&quot; title=&quot;[MSDN] How to: Modify String Contents&quot;&gt;unsafe code&lt;/a&gt;. The methods, operators, etc. that appear to modify a string actually return a new string with the modified contents. The Replace function of the string object is a great example of this. You cannot simply call the Replace method. You have to return the results of the method to a string variable.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foo &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;abc&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
foo &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; foo&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Replace&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;abc&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;xyz&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Concatenation and the Compiler&lt;/h3&gt;
&lt;p&gt;The compiler does some interesting things when working with strings. For example, when concatenating with variables in a single statement:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foobar &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; foo &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; bar&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token comment&quot;&gt;// compiler sees the above as:&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foobar &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Concat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;foo&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; bar&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When you use constants such as literals and const string members, the compiler knows that all the parts are constant and it does all the concatenation at compile time, storing the full string in the compiled code.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foobar &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;foo&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;bar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token comment&quot;&gt;// compiler sees the above as:&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foobar &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;foo bar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foo &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;foo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foobar &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; foo &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;bar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token comment&quot;&gt;// compiler sees the above as:&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foobar &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;foo bar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;String.Empty versus &quot;&quot;&lt;/h3&gt;
&lt;p&gt;And finally, there is a difference between string.Empty and “”. When you use “”, .NET creates an object but when you use string.Empty it does not. The difference may be small, but its a difference that can make a performance impact.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; foo &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// creates an object&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; bar &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Empty&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// doesn&#39;t create an object&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Null Coalescing Operator</title>
    <link href="https://www.jeremyknight.me/2011/10/27/null-coalescing-operator/" />
    <updated>2011-10-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/10/27/null-coalescing-operator/</id>
    <content type="html">&lt;p&gt;In C# 2.0, Microsoft introduced the null coalescing operator (??). The ?? operator is a shorthand notation for returning a default value if a reference or &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx&quot; title=&quot;Nullable Types (C# Programming Guide) - MSDN&quot;&gt;Nullable&lt;T&gt;&lt;/T&gt;&lt;/a&gt; type is null.&lt;/p&gt;
&lt;p&gt;The examples below show how the null coalescing operator achieves the same result as traditional conditional statements but with less lines of code. Both sets of examples use property getter methods with assumed fields.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference Examples with Conditional Statements&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;MyObject&lt;/span&gt; MyObjectProperty
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;myObject &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;MyObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;myObject&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Reference Examples with Null Coalescing Operator&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;MyObject&lt;/span&gt; MyObjectProperty
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;myObject &lt;span class=&quot;token operator&quot;&gt;??&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;MyObject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Nullable&lt;T&gt; Example with Conditional Statements&lt;/T&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;/span&gt; Number
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;nullableNumber&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;HasValue&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;nullableNumber&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Value&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Nullable&lt;T&gt; Example with Null Coalescing Operator&lt;/T&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;/span&gt; Number
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;nullableNumber &lt;span class=&quot;token operator&quot;&gt;??&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The main argument against the ?? operator is that developers don&#39;t understand it so it makes the code less readable and maintainable. This is a poor argument in my opinion. As developers, we should never stop trying to improve both ourselves and our teams. This is something that can be taught over lunch one day.&lt;/p&gt;
&lt;p&gt;More reading: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms173224(v=VS.100).aspx&quot; title=&quot;?? Operator (C# Reference) - MSDN&quot;&gt;?? Operator (C# Reference) - MSDN&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>HTML5 and target=&quot;_blank&quot;</title>
    <link href="https://www.jeremyknight.me/2011/09/24/html5-and-target-blank/" />
    <updated>2011-09-24T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/09/24/html5-and-target-blank/</id>
    <content type="html">&lt;p&gt;I posted a &lt;a href=&quot;http://jeremyknight.wordpress.com/2010/11/27/jquery-xhtml-strict-target-blank-solution/&quot; title=&quot;jQuery XHTML Strict Target=”_blank” Solution&quot;&gt;jQuery solution to the XHTML Strict Target=&amp;quot;_blank&amp;quot; problem&lt;/a&gt; a while back. Well I finally had some free time to start delving deep into HTML5. Low and behold the W3C has removed the deprecated status from the &amp;quot;_blank&amp;quot; value for the target attribute. What does that mean?&lt;/p&gt;
&lt;p&gt;That means that target=&amp;quot;_blank&amp;quot; is 100% valid in HTML5!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Get a String from a MemoryStream</title>
    <link href="https://www.jeremyknight.me/2011/09/09/get-a-string-from-a-memorystream/" />
    <updated>2011-09-09T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/09/09/get-a-string-from-a-memorystream/</id>
    <content type="html">&lt;p&gt;The &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.io.memorystream.aspx&quot; title=&quot;MSDN article for MemoryStream&quot;&gt;MSDN article for MemoryStream&lt;/a&gt; has this example of outputting a string to the console.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Main&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt; args&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt;&lt;/span&gt; count&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;byte&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt; byteArray&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt; charArray&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;UnicodeEncoding&lt;/span&gt; uniEncoding &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;UnicodeEncoding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;token comment&quot;&gt;// Create the data to write to the stream.&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;byte&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt; firstString &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; uniEncoding&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetBytes&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Invalid file path characters are: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;byte&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt; secondString &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; uniEncoding&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetBytes&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetInvalidPathChars&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;MemoryStream&lt;/span&gt; memStream &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;MemoryStream&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Write the first string to the stream.&lt;/span&gt;
        memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Write&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;firstString&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; firstString&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Length&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
        &lt;span class=&quot;token comment&quot;&gt;// Write the second string to the stream, byte by byte.&lt;/span&gt;
        count &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;count &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; secondString&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Length&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;WriteByte&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;secondString&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;count&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
        &lt;span class=&quot;token comment&quot;&gt;// Write the stream properties to the console.&lt;/span&gt;
        Console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token string&quot;&gt;&quot;Capacity = {0}, Length = {1}, Position = {2}&#92;n&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Capacity&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Length&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Position&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
        &lt;span class=&quot;token comment&quot;&gt;// Set the position to the beginning of the stream.&lt;/span&gt;
        memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Seek&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; SeekOrigin&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Begin&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
        &lt;span class=&quot;token comment&quot;&gt;// Read the first 20 bytes from the stream.&lt;/span&gt;
        byteArray &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;byte&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Length&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        count &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Read&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;byteArray&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
        &lt;span class=&quot;token comment&quot;&gt;// Read the remaining bytes, byte by byte.&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;count &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Length&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            byteArray&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;count&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Convert&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToByte&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;memStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ReadByte&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
        &lt;span class=&quot;token comment&quot;&gt;// Decode the byte array into a char array&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// and write it to the console.&lt;/span&gt;
        charArray &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;char&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;uniEncoding&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetCharCount&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;byteArray&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; count&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        uniEncoding&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetDecoder&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetChars&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;byteArray&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; count&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; charArray&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        Console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;charArray&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I have a problem with code examples that try and do too much. Here is a much less complex example of writing a string to the console from a MemoryStream.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Main&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt; args&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; memoryStream &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;MemoryStream&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; streamWriter &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;StreamWriter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;memoryStream&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; streamReader &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;StreamReader&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;memoryStream&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; invalidPath &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetInvalidPathChars&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        streamWriter&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Invalid file path characters are:&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        streamWriter&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;invalidPath&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
        streamWriter&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Flush&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        memoryStream&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Position &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
        &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt;&lt;/span&gt; stringToOutput &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; streamReader&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ReadToEnd&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        Console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;stringToOutput&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Visual Studio Add-ons</title>
    <link href="https://www.jeremyknight.me/2011/08/26/visual-studio-add-ons/" />
    <updated>2011-08-26T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/08/26/visual-studio-add-ons/</id>
    <content type="html">&lt;p&gt;I&#39;ve been getting the same question a lot lately. What plugins, enhancements, extensions, etc. do you use in Visual Studio? So here&#39;s the surprisingly short list:&lt;/p&gt;
&lt;h3&gt;ReSharper&lt;/h3&gt;
&lt;p&gt;The ReSharper website says:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ReSharper is a renowned productivity tool that makes Microsoft Visual Studio a much better IDE. Thousands of .NET developers worldwide wonder how they&#39;ve ever lived without ReSharper&#39;s code inspections, automated refactorings, blazing fast navigation, and coding assistance.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I can tell you the &amp;quot;.NET developers worldwide wonder how they&#39;ve ever lived without ReSharper&amp;quot; is completely true. Once you learn to use it, you&#39;ll never want to code without it. I remember the first week I used it I was angry at myself for waiting so long to get my hands on it.&lt;/p&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jetbrains.com/resharper/&quot; title=&quot;Official ReSharper Site&quot;&gt;Official Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/EA4AC039-1B5C-4D11-804E-9BEDE2E63ECF?SRC=Home&quot; title=&quot;MSDN VS Gallery: ReSharper&quot;&gt;MSDN VS Gallery: ReSharper&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;StyleCop&lt;/h3&gt;
&lt;p&gt;The official product description reads:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;StyleCop analyzes C# source code to enforce a set of style and consistency rules. It can be run from inside of Visual Studio or integrated into an MSBuild project. StyleCop has also been integrated into many third-party development tools.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The ability to run a tool and have it tell you where to fix your styling is invaluable. Create a custom configuration file (agreed upon by the team of course) and then share it with your team or even better integrate it into you build server. This will ensure that a field is formatted like a field should be consistently in every file. No more style switches per file.&lt;/p&gt;
&lt;p&gt;Oh and by the way, the latest release works with ReSharper to allow for quick cleanup of any errors found.&lt;/p&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://stylecop.codeplex.com/&quot; title=&quot;Official StyleCop Site&quot;&gt;Official Site&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Search References&lt;/h3&gt;
&lt;p&gt;(Note: This is built into VS 2012 and beyond) How and why the functionality of this gallery extension isn&#39;t built into Visual Studio completely baffles me. This simple extension adds a search box to the top of the .Net tab on the Add References dialog.&lt;/p&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2011/img/posts/2011/search-references.png&quot; alt=&quot;&quot; class=&quot;mx-auto d-block&quot;&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/02c0bded-4739-40ec-af07-9eb002a27246/&quot; title=&quot;MSDN VS Gallery: Search References&quot;&gt;MSDN VS Gallery: Search References&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Snippet Designer&lt;/h3&gt;
&lt;p&gt;If you write code that is structurally the same over and over again, you should learn to build snippets. If you want to build snippets, you want to take a look at this extension. Snippet Designer allows you to highlight code and export as snippet. It has a great GUI for adding in replacement sections, setting the properties of your snippet, etc.&lt;/p&gt;
&lt;p&gt;Here is a screenshot of Snippet Designer being used to edit my null coalescing operator snippet.&lt;/p&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2011/img/posts/2011/snippet-designer.png&quot; alt=&quot;&quot; class=&quot;mx-auto d-block&quot;&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://snippetdesigner.codeplex.com/&quot; title=&quot;Official Snippet Designer Site&quot;&gt;Official Site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/B08B0375-139E-41D7-AF9B-FAEE50F68392&quot; title=&quot;MSDN Visual Studio Gallery: Snippet Designer&quot;&gt;MSDN VS Gallery: Snippet Designer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Calculate Elapsed Time in .NET</title>
    <link href="https://www.jeremyknight.me/2011/06/23/calculate-elapsed-time-in-net/" />
    <updated>2011-06-23T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/06/23/calculate-elapsed-time-in-net/</id>
    <content type="html">&lt;p&gt;I came across this while preparing an upcoming blog entry and felt the need to share. I was looking for a way to calculate the time of an operation. I searched over and over again only to find the following pattern:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;DateTime&lt;/span&gt; startTime &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; DateTime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// do operation&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;DateTime&lt;/span&gt; endTime &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; DateTime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Now&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;TimeSpan&lt;/span&gt; runTime &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; endTime &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt; startTime&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately, this pattern isn&#39;t very accurate and rarely outputs anything other than zero on simple operations. I needed to output elapsed time for even these simple operation so I kept searching until finally I came across the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx&quot; title=&quot;System.Diagnostics.Stopwatch MSDN Page&quot;&gt;System.Diagnostics.Stopwatch&lt;/a&gt; class. The code is more readable and (after a bit of testing) is capable of tracking the elapsed time of simple operations.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Stopwatch&lt;/span&gt; stopwatch &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;Stopwatch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
stopwatch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// do operations&lt;/span&gt;
stopwatch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;TimeSpan&lt;/span&gt; runTime &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; stopwatch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Elapsed&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;long&lt;/span&gt;&lt;/span&gt; runTimeMilliseconds &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; stopwatch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ElapsedMilliseconds&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;long&lt;/span&gt;&lt;/span&gt; runTimeTicks &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; stopwatch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ElapsedTicks&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hopefully, putting this out there will help people find this method much quicker than I did. And as my mother used to tell me: just because everyone else does it, it doesn&#39;t make it right.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SP 2010 Site Collection PowerShell Script</title>
    <link href="https://www.jeremyknight.me/2011/06/10/sp-2010-site-collection-powershell-script/" />
    <updated>2011-06-10T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/06/10/sp-2010-site-collection-powershell-script/</id>
    <content type="html">&lt;p&gt;The following script is what we&#39;ve been using to create site collections with their own database in SharePoint 2010.&lt;/p&gt;
&lt;pre class=&quot;language-powershell&quot;&gt;&lt;code class=&quot;language-powershell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;Add-PSSnapin&lt;/span&gt; Microsoft&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;SharePoint&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;PowerShell –ErrorAction SilentlyContinue
 
&lt;span class=&quot;token comment&quot;&gt;## Configure the script&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$databaseName&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;SP_Content_Database_Name&quot;&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$webApplicationUrl&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;http://localhost&quot;&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$siteCollectionUrl&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;http://localhost/sites/siteName&quot;&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$siteCollectionName&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;Site Collection Name&quot;&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$siteCollectionOwner1&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;DOMAIN&#92;user1&quot;&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$siteCollectionOwner2&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;DOMAIN&#92;user2&quot;&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$siteCollectionTemplate&lt;/span&gt; = &lt;span class=&quot;token string&quot;&gt;&quot;STS#1&quot;&lt;/span&gt;
 
&lt;span class=&quot;token comment&quot;&gt;## Create the database&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;New-SPContentDatabase&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;Name &lt;span class=&quot;token variable&quot;&gt;$databaseName&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;WebApplication &lt;span class=&quot;token variable&quot;&gt;$webApplicationUrl&lt;/span&gt;
 
&lt;span class=&quot;token comment&quot;&gt;## Create the site collection&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;New-SPSite&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;URL &lt;span class=&quot;token variable&quot;&gt;$siteCollectionUrl&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;OwnerAlias &lt;span class=&quot;token variable&quot;&gt;$siteCollectionOwner1&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;SecondaryOwnerAlias &lt;span class=&quot;token variable&quot;&gt;$siteCollectionOwner2&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;ContentDatabase &lt;span class=&quot;token variable&quot;&gt;$databaseName&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;Name &lt;span class=&quot;token variable&quot;&gt;$siteCollectionName&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;Template &lt;span class=&quot;token variable&quot;&gt;$siteCollectionTemplate&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Download the above code at: &lt;a href=&quot;https://gist.github.com/4488619&quot;&gt;https://gist.github.com/4488619&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you need a list of site templates available on the machine you can run:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;Get&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;SPWebTemplate &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; Sort&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;Object &lt;span class=&quot;token string&quot;&gt;&quot;Title&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Developing Custom SharePoint Web Parts</title>
    <link href="https://www.jeremyknight.me/2011/02/27/sps-nola-2011-develop-custom-web-parts/" />
    <updated>2011-02-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/02/27/sps-nola-2011-develop-custom-web-parts/</id>
    <content type="html">&lt;p&gt;I presented &amp;quot;Developing Custom Web Parts&amp;quot; at the recent SharePoint Saturday New Orleans 2011. Here&#39;s the description was:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Web parts are a logical starting point for &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; developers to begin their journey into SharePoint. This session focuses on the ins and outs of web part development as well as web part and SharePoint development best practices. Code examples will use C#.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The materials (code and PowerPoint deck) from my presentation can be downloaded using the following links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Code: &lt;a href=&quot;https://jeremyknight.wordpress.com/2011/02/26/sps-nola-2011-presentation-materials/&quot;&gt;https://jeremyknight.wordpress.com/2011/02/26/sps-nola-2011-presentation-materials/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Slides: &lt;a href=&quot;https://docs.com/knight0323/6081/developing-custom-sharepoint-web-parts&quot;&gt;https://docs.com/knight0323/6081/developing-custom-sharepoint-web-parts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>MCPD Web Developer 4</title>
    <link href="https://www.jeremyknight.me/2011/02/17/mcpd-web-developer-4/" />
    <updated>2011-02-17T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/02/17/mcpd-web-developer-4/</id>
    <content type="html">&lt;p&gt;Right on the heels of the upgrade to Web Developer 3.5, I took the test for an upgrade to .NET 4. I&#39;ve finally caught up to the latest release. I have to say this was the longest Microsoft certification test that I&#39;ve taken. It was over 80 questions long and split into 4 sections. For a second I thought my test would be lost. When I clicked to finish the exam the testing software crashed. Fortunately, everything was there just like I left it when they rebooted the computer.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SharePoint Saturday New Orleans 2011</title>
    <link href="https://www.jeremyknight.me/2011/01/18/sharepoint-saturday-new-orleans-2011/" />
    <updated>2011-01-18T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/01/18/sharepoint-saturday-new-orleans-2011/</id>
    <content type="html">&lt;p&gt;First, &lt;a href=&quot;http://www.sharepointsaturday.org/neworleans/default.aspx&quot; title=&quot;SharePoint Saturday New Orleans 2011&quot;&gt;SharePoint Saturday New Orleans 2011&lt;/a&gt; has &lt;a href=&quot;http://spsnola2011-ws.eventbrite.com/&quot; title=&quot;SharePoint Saturday New Orleans 2011 Registration&quot;&gt;opened registration&lt;/a&gt; and placed the session list online. If you&#39;re interested in SharePoint at all this is a must attend event. The sessions span all areas of SharePoint including project management, end users/power users tools, administration, architecture, development and more.&lt;/p&gt;
&lt;p&gt;Secondly, I will be presenting &amp;quot;Developing Custom Web Parts&amp;quot;. No SharePoint experience required but I am recommending &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; experience if you attend. Here&#39;s the description I sent in:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Web parts are a logical starting point for &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; developers to begin their journey into SharePoint. This session focuses on the ins and outs of web part development as well as web part and SharePoint development best practices. Code examples will use C#.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
  </entry>
  <entry>
    <title>MCPD Web Developer Upgraded to 3.5</title>
    <link href="https://www.jeremyknight.me/2011/01/04/mcpd-web-developer-upgraded-to-3-5/" />
    <updated>2011-01-04T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2011/01/04/mcpd-web-developer-upgraded-to-3-5/</id>
    <content type="html">&lt;p&gt;Over the holidays, I upgraded my MCPD to .NET 3.5. Now only one more to go to catch up to latest release. This was my first upgrade so I didn&#39;t know what was going on until after I was done. They split the upgrade up into 2 banks of questions representing the 2 tests for that MCPD. Just a heads up for those wondering why you get told you&#39;ll get 40-something questions and end up with 1 of 20-something on the first screen.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>jQuery XHTML Strict Target=&quot;_blank&quot; Solution</title>
    <link href="https://www.jeremyknight.me/2010/11/27/jquery-xhtml-strict-target-blank-solution/" />
    <updated>2010-11-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/11/27/jquery-xhtml-strict-target-blank-solution/</id>
    <content type="html">&lt;p&gt;As many of you know, XHTML Strict does not allow the target attribute within &lt;a&gt; tags. I have been using a JavaScript solution which I found online a few years back. The code was a bit verbose so I decided to update it using jQuery.&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;$&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;function &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    $&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&#39;a&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;rel&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;external&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&#39;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        $&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&#39;target&#39;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &#39;_blank&#39;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With the above code in place, simply put rel=&amp;quot;external&amp;quot; on any anchor tags that need to open in a new window.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SharePoint Web Part XML Properties</title>
    <link href="https://www.jeremyknight.me/2010/11/24/sharepoint-web-part-xml-properties/" />
    <updated>2010-11-24T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/11/24/sharepoint-web-part-xml-properties/</id>
    <content type="html">&lt;p&gt;When building a web part for SharePoint, you can use the .webpart file to set default values for almost all of the properties of that web part. But many people don&#39;t know what those properties are or what they pertain to. Below is a listing of all the properties of an empty web part:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code class=&quot;language-markup&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;webParts&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;webPart&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://schemas.microsoft.com/WebPart/v3&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;metaData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;type&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;yourTypeHere&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;importErrorMessage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Cannot import this Web Part.&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;importErrorMessage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;metaData&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;properties&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;AllowClose&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;bool&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;True&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;AllowConnect&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;bool&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;True&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;AllowEdit&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;bool&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;True&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;AllowHide&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;bool&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;True&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;AllowMinimize&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;bool&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;True&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;AllowZoneChange&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;bool&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;True&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;CatalogIconImageUrl&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;string&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;ChromeState&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;chromestate&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Normal&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;ChromeType&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;chrometype&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Default&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Description&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;string&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;My WebPart&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Direction&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;direction&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;NotSet&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;ExportMode&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;exportmode&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;All&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Height&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;unit&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;HelpMode&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;helpmode&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Navigate&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;HelpUrl&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;string&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Hidden&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;bool&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;False&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Title&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;string&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Web Part Title&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;TitleIconImageUrl&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;string&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;TitleUrl&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;string&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Width&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;unit&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;properties&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;webPart&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;webParts&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For a definition and list of possible values for each of these properties, you can visit the MSDN pages for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart_properties.aspx&quot; title=&quot;MSDN page for ASP.NET WebPart object&quot;&gt;System.Web.UI.WebControls.WebParts.WebPart&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart_properties.aspx&quot; title=&quot;MSDN page for SharePoint WebPart object&quot;&gt;Microsoft.SharePoint.WebPartPages.WebPart&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;What about custom properties?&lt;/h3&gt;
&lt;p&gt;You can use SharePoint to create a reference for the properties of your web part. Install your web part, setup the web part the way you would like it by default, and then use the Verbs menu to Export the web part. Locate the exported file, open it in your favorite editor, and your XML is there!  Simple right?&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Programmatically Update Web Part Properties</title>
    <link href="https://www.jeremyknight.me/2010/11/13/programmatically-update-web-part-properties/" />
    <updated>2010-11-13T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/11/13/programmatically-update-web-part-properties/</id>
    <content type="html">&lt;p&gt;Have you ever wanted to give your users access to the personalized properties of a web part through a custom interface built into a web part? In &lt;a href=&quot;http://ASP.NET&quot;&gt;ASP.NET&lt;/a&gt;, updating these properties and more importantly persisting the changes was a pretty straight forward process. Unfortunately, the same straight forward techniques can not be used when developing a SharePoint web part.&lt;/p&gt;
&lt;p&gt;The code below is a very simple web part inheriting from &lt;em&gt;System.Web.UI.WebControls.WebParts.WebPart&lt;/em&gt;. It consists of a TextBox and a Button but it illustrates a complete solution for persisting personalization changes to the SharePoint database programmatically.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ComponentModel&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Web&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Web&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;UI&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Web&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;UI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebControls&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Web&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;UI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebControls&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebParts&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;Microsoft&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;SharePoint&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;Microsoft&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;SharePoint&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebControls&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;Microsoft&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;SharePoint&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebPartPages&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
&lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;token namespace&quot;&gt;UpdatePropertiesWithCode&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;UpdateMeWebPart&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;UpdateMeWebPart&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token type-list&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Web&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;UI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebControls&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebParts&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebPart&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;TextBox&lt;/span&gt; MessageTextBox&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Button&lt;/span&gt; SaveButton&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
        &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Category&lt;/span&gt;&lt;span class=&quot;token attribute-arguments&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;My Configuration&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;WebBrowsable&lt;/span&gt;&lt;span class=&quot;token attribute-arguments&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;WebDescription&lt;/span&gt;&lt;span class=&quot;token attribute-arguments&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Message to display.&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;WebDisplayName&lt;/span&gt;&lt;span class=&quot;token attribute-arguments&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Message&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token attribute&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Personalizable&lt;/span&gt;&lt;span class=&quot;token attribute-arguments&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;PersonalizationScope&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;User&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; Message &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
        &lt;span class=&quot;token keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;CreateChildControls&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            MessageTextBox &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;TextBox&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            MessageTextBox&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Text &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Message&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
            SaveButton &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            SaveButton&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Text &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Save&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            SaveButton&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Click &lt;span class=&quot;token operator&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;EventHandler&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;SaveButtonClick&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
            Controls&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;MessageTextBox&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            Controls&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;SaveButton&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
        &lt;span class=&quot;token keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;token return-type class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;SaveButtonClick&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;object&lt;/span&gt;&lt;/span&gt; sender&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;EventArgs&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Message &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; MessageTextBox&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Text&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
            &lt;span class=&quot;token class-name&quot;&gt;SPWeb&lt;/span&gt; web &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; SPContext&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Current&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Web&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token class-name&quot;&gt;SPFile&lt;/span&gt; file &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; web&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetFile&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;HttpContext&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Current&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Request&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Url&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token class-name&quot;&gt;SPLimitedWebPartManager&lt;/span&gt; manager &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; file&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetLimitedWebPartManager&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;PersonalizationScope&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;User&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token class-name&quot;&gt;System&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Web&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;UI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebControls&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebParts&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebPart&lt;/span&gt; webPart &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; manager&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;WebParts&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ID&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;UpdateMeWebPart&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;webPart&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Message &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Message&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
            &lt;span class=&quot;token keyword&quot;&gt;try&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                web&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;AllowUnsafeUpdates &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                manager&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;SaveChanges&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;webPart&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;finally&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                web&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;AllowUnsafeUpdates &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Web Parts Presentation Materials</title>
    <link href="https://www.jeremyknight.me/2010/11/12/web-parts-presentation-materials/" />
    <updated>2010-11-12T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/11/12/web-parts-presentation-materials/</id>
    <content type="html">&lt;p&gt;The materials (code and PowerPoint deck) from my presentation last night can be downloaded using the following link:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://jeremyknight.codeplex.com/releases/view/55567&quot; title=&quot;T-SQL Padding Functions (v1.0)&quot;&gt;Web Part Presentation Material (.zip)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I will also be posting the code to &lt;a href=&quot;http://jeremyknight.codeplex.com&quot; title=&quot;Personal CodePlex site of Jeremy Knight&quot;&gt;my CodePlex repository&lt;/a&gt; for online viewing.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Setup a &#39;Get Public Key&#39; Tool</title>
    <link href="https://www.jeremyknight.me/2010/11/08/setup-a-get-public-key-tool/" />
    <updated>2010-11-08T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/11/08/setup-a-get-public-key-tool/</id>
    <content type="html">&lt;p&gt;If you&#39;re a SharePoint developer, you&#39;ve run into public key tokens but what you might not know is that Visual Studio comes with an executable that can make retrieving them a much easier process.&lt;/p&gt;
&lt;p&gt;The following steps will add a &amp;quot;Get Public Key&#39; option to your Tools menu in Visual Studio:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click &#39;Tools &amp;gt; External Tools&#39;&lt;/li&gt;
&lt;li&gt;Click &#39;Add&#39; and a new entry will appear&lt;/li&gt;
&lt;li&gt;In the &#39;Title&#39; field type: Get Public Key&lt;/li&gt;
&lt;li&gt;Click the &#39;...&#39; button and navigate to the appropriate sn.exe&lt;/li&gt;
&lt;li&gt;If VS 2008: C:&#92;Program Files&#92;Microsoft SDKs&#92;Windows&#92;v6.0A&#92;Bin&#92;sn.exe&lt;/li&gt;
&lt;li&gt;If VS 2010*: C:&#92;Program Files (x86)&#92;Microsoft SDKs&#92;Windows&#92;v7.0A&#92;Bin&#92;sn.exe&lt;/li&gt;
&lt;li&gt;In the &#39;Arguments&#39; field type: -Tp &amp;quot;$(TargetPath)&amp;quot;&lt;/li&gt;
&lt;li&gt;Select &#39;Use Output window&#39; checkbox&lt;/li&gt;
&lt;li&gt;Click &#39;OK&#39;&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2010/img/posts/2010/external-tools.png&quot; alt=&quot;&quot; class=&quot;img-fluid&quot;&gt;
&lt;p&gt;This will save you a ton of time if you are still using tools like Reflector to get the public key.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;* This path is from a 64-bit version of Windows.&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Prompt Users to Save Changes</title>
    <link href="https://www.jeremyknight.me/2010/11/03/prompt-users-to-save-changes/" />
    <updated>2010-11-03T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/11/03/prompt-users-to-save-changes/</id>
    <content type="html">&lt;p&gt;Want to be able to prompt users if they have unsaved data and they close out the browser? Unfortunately, I&#39;ve yet to find a cross browser solution but in Internet Explorer and Firefox the onbeforeunload event gives you just that ability. The event will fire when a user closes the browser or when a user navigates to a different URL. Simply have the function assigned to the event return the string you wish to display to the users.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;onbeforeunload &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;clientX &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;||&lt;/span&gt; window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;clientY &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;You have unsaved changes. Are you sure you wish to leave this page?&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above code is setup to only work on the browser or tab close button. Remove the if statement if you want it to work when a user navigates away from the page.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>November 11th Speaking Engagement</title>
    <link href="https://www.jeremyknight.me/2010/10/25/nov-11-speaking-engagemen/" />
    <updated>2010-10-25T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/10/25/nov-11-speaking-engagemen/</id>
    <content type="html">&lt;p&gt;I will be presenting at the November 11th meeting of the &lt;a href=&quot;http://www.gnospug.com&quot; title=&quot;Greater New Orleans SharePoint User Group&quot;&gt;Greater New Orleans SharePoint User Group&lt;/a&gt;. The topic will be &lt;strong&gt;SharePoint Web Parts and Best Practices&lt;/strong&gt;. The presentation will focus on the 2010 product family and all code will be released after the presentation.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SQL Server Foreign Keys and Indexes</title>
    <link href="https://www.jeremyknight.me/2010/10/23/sql-server-foreign-keys-and-indexes/" />
    <updated>2010-10-23T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/10/23/sql-server-foreign-keys-and-indexes/</id>
    <content type="html">&lt;p&gt;This is another one of those cases that just beats it into your head to stop making assumptions.&lt;/p&gt;
&lt;p&gt;My first delve into RDBMS&#39;s was MySQL. When you create a Foreign Key in MySQL, it will create an &lt;a href=&quot;http://www.w3schools.com/sql/sql_create_index.asp&quot; title=&quot;SQL Index - w3schools.com&quot;&gt;Index&lt;/a&gt; for you. Unfortunately, I assumed that SQL Server would do the same. Then about a year ago, I was researching ways to speed up some of the queries in a customer&#39;s application when I came across &lt;a href=&quot;http://stackoverflow.com/questions/836167/does-a-foreign-key-automatically-create-an-index&quot; title=&quot;Does a foreign key automatically create an index?&quot;&gt;a thread on StackOverflow&lt;/a&gt;. What did I find? I was making the wrong assumption and you have to create both the Foreign Key and Index in SQL Server.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Article: 10 Steps to Better SharePoint Development</title>
    <link href="https://www.jeremyknight.me/2010/10/21/article-10-steps-to-better-sharepoint-development/" />
    <updated>2010-10-21T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/10/21/article-10-steps-to-better-sharepoint-development/</id>
    <content type="html">&lt;p&gt;Save it. Print it. Do whatever you normally do to catalog your favorite articles but this article by David Mann isn&#39;t just a must read for SharePoint developers everywhere. This article can be used as a checklist or roadmap in any of your future SharePoint development.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.sharepointproconnections.com/article/sharepoint-development/10-Steps-to-Better-SharePoint-Development.aspx&quot; title=&quot;10 Steps to Better SharePoint Development&quot;&gt;http://www.sharepointproconnections.com/article/sharepoint-development/10-Steps-to-Better-SharePoint-Development.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I will clarify his point on unit testing though. We all know it can be done with expensive products but they aren&#39;t needed to get worthwhile coverage ratios. Steps 3 and 6 (Patterns and Refactoring) go a long way in making your SharePoint code more unit test friendly. The Patterns and Practice group he mentions have examples of SharePoint code using Repository, MVP, and Service Locator patterns. As you add each one of these to your code, you&#39;ll see it become more flexible and unit test friendly.&lt;/p&gt;
&lt;p&gt;Also, his point on throwing exceptions doesn&#39;t mean run out and drop unnecessary try/catch blocks all over your code. If you&#39;re building a library and you find yourself with an empty catch block, you need to assess whether that try/catch is actually necessary or if you can just allow the error to bubble up.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SQL Saturday #28: Baton Rouge</title>
    <link href="https://www.jeremyknight.me/2010/08/11/sql-saturday-28-baton-rouge/" />
    <updated>2010-08-11T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/08/11/sql-saturday-28-baton-rouge/</id>
    <content type="html">&lt;p&gt;This Saturday (August 14th) LSU will be hosting SQL Saturday #28. The all day event will feature a number of great sessions and speakers. If you&#39;re a technology professional in the Baton Rouge area, this event is a must. Along with the speakers and sessions, there will be plenty of local technology professionals attending (close to 600 registered attendees) which should make it a great event for networking.&lt;/p&gt;
&lt;p&gt;The local user groups will also have a table setup to help spread the word. If you&#39;re interested in getting involved with the .NET, SQL, or SharePoint user groups, please stop in and say hello. I&#39;ll probably spend most of the day at the table talking up the New Orleans SharePoint User Group.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SharePoint Web Part Maintenance Page</title>
    <link href="https://www.jeremyknight.me/2010/07/28/sharepoint-web-part-maintenance-page/" />
    <updated>2010-07-28T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/07/28/sharepoint-web-part-maintenance-page/</id>
    <content type="html">&lt;p&gt;On any web part page in SharePoint, you can append ?contents=1 to your query string to show the Web Part Maintenance page. For example: &lt;a href=&quot;http://www.yourdomain.com/default.aspx?contents=1&quot;&gt;http://www.yourdomain.com/default.aspx?contents=1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This works in both SharePoint 2007 and SharePoint 2010.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>VirtualBox UUID Change Script</title>
    <link href="https://www.jeremyknight.me/2010/07/10/virtualbox-uuid-change-script/" />
    <updated>2010-07-10T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/07/10/virtualbox-uuid-change-script/</id>
    <content type="html">&lt;p&gt;&lt;em&gt;UPDATE: Oracle has decided to change the command from setvdiuuid to sethduuid for version 4 of VirtualBox. Please make this correction if you are using version 4.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;How many times do you simply copy a virtual hard drive when you want to stand up a development environment? In &lt;a href=&quot;http://www.virtualbox.org/&quot; title=&quot;VirtualBox&quot;&gt;VirtualBox&lt;/a&gt;, it isn&#39;t as simple as a simple copy, paste, and rename. Each virtual hard drive in the VirtualBox world (.vdi files) gets its own universally unique identifier, or UUID. When you copy a vdi file with your file explorer it also brings over the UUID. Fortunately, VirtualBox has a command to generate a new UUID for a copied vdi file.&lt;/p&gt;
&lt;pre class=&quot;language-powershell&quot;&gt;&lt;code class=&quot;language-powershell&quot;&gt;&lt;span class=&quot;token operator&quot;&gt;%&lt;/span&gt;ProgramFiles%&#92;Oracle&#92;VirtualBox&#92;VBoxManage&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;exe internalcommands setvdiuuid&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Being in the SharePoint development world, I create new virtual machines all the time so I created a script to take care of the UUID change. I have a batch file named &lt;em&gt;changeUUID.bat&lt;/em&gt; that this script is contained.&lt;/p&gt;
&lt;pre class=&quot;language-powershell&quot;&gt;&lt;code class=&quot;language-powershell&quot;&gt;@&lt;span class=&quot;token function&quot;&gt;ECHO&lt;/span&gt; OFF
&lt;span class=&quot;token keyword&quot;&gt;IF&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;%1&quot;&lt;/span&gt;==&lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt; GOTO Error
&lt;span class=&quot;token string&quot;&gt;&quot;c:&#92;Program Files&#92;Oracle&#92;VirtualBox&#92;VBoxManage.exe&quot;&lt;/span&gt; internalcommands setvdiuuid &lt;span class=&quot;token operator&quot;&gt;%&lt;/span&gt;1
GOTO &lt;span class=&quot;token keyword&quot;&gt;Exit&lt;/span&gt;
:Error
&lt;span class=&quot;token function&quot;&gt;ECHO&lt;/span&gt; No file path given!
:&lt;span class=&quot;token keyword&quot;&gt;Exit&lt;/span&gt;
PAUSE&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Gist Link: &lt;a href=&quot;https://gist.github.com/knight0323/4488526&quot;&gt;https://gist.github.com/knight0323/4488526&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;NOTE: VirtualBox does offer a command called &lt;em&gt;clonevdi&lt;/em&gt; which will copy the vdi and ensure a new UUID is assigned to the clone. The &lt;em&gt;setvdiuuid&lt;/em&gt; command is just a personal preference.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>InfoPath Data into SharePoint List and SQL</title>
    <link href="https://www.jeremyknight.me/2010/07/02/infopath-data-into-sharepoint-list-and-sql/" />
    <updated>2010-07-02T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/07/02/infopath-data-into-sharepoint-list-and-sql/</id>
    <content type="html">&lt;p&gt;A client wished to push data into their SQL databases from an InfoPath form. Usually quite a simple task but the form was published to a SharePoint library and had fields &lt;a href=&quot;http://blog.ksenthil.net/archive/2009/07/25/promoting-properties-e28093-expose-infopath-fields-as-site-columns.aspx&quot; title=&quot;Publish InfoPath fields to expose them to SharePoint&quot;&gt;published&lt;/a&gt; so they could be displayed in the library. We looked into a few different mechanisms but ultimately decided on a workflow set to start on creation or update of a list item. The workflow consisted only of a code block that produced the contents of the XML file stored in the SharePoint library and passed it into a stored procedure. The following code block was used produced the entire contents of the XML file as well as the file name.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;/*
The variable workflowProperties is an instance of SPWorkflowActivationProperties:
SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
*/&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;workflowProperties&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Item&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;File&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Exists&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// get file contents&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; contents&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;StreamReader&lt;/span&gt; reader &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token constructor-invocation class-name&quot;&gt;StreamReader&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;workflowProperties&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Item&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;File&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;OpenBinaryStream&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        contents &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; reader&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ReadToEnd&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;string&lt;/span&gt;&lt;/span&gt; fileName &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Path&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;GetFileNameWithoutExtension&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;workflowProperties&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Item&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;File&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Name&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At this point, you can use code to get specific values or pass the entire XML string to SQL depending on your requirements. I would recommend using SharePoint&#39;s unique ID for the list item to identify the record in SQL. This will allow you to synchronize any CRUD operation on the SharePoint record to the SQL record.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Browser List Form Editing</title>
    <link href="https://www.jeremyknight.me/2010/06/24/browser-list-form-editing/" />
    <updated>2010-06-24T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/06/24/browser-list-form-editing/</id>
    <content type="html">&lt;p&gt;Want the ability to add web parts and edit a List&#39;s Form pages in the browser? SharePoint comes with a built in feature that in my opinion isn&#39;t advertised enough to developers. At the end of you List Form URL, simply add the query string &lt;code&gt;toolpaneview=2&lt;/code&gt;. It will look like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;http://yourSharePointUrl/Lists/ListName/ListFormView.aspx?toolpaneview=2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Where &lt;code&gt;ListFormView.aspx&lt;/code&gt; is either &lt;code&gt;AllItems.aspx&lt;/code&gt;, &lt;code&gt;NewForm.aspx&lt;/code&gt;, &lt;code&gt;DispForm.aspx&lt;/code&gt;, or &lt;code&gt;EditForm.aspx&lt;/code&gt; using the default names.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Having Datasheet View Issues?</title>
    <link href="https://www.jeremyknight.me/2010/06/17/having-datasheet-view-issues/" />
    <updated>2010-06-17T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/06/17/having-datasheet-view-issues/</id>
    <content type="html">&lt;p&gt;If you&#39;re using Office 64-bit and you&#39;re having issues with SharePoint&#39;s datasheet view, this post is for you.&lt;/p&gt;
&lt;p&gt;Our team recently upgraded the software on our equipment and Office 2010 64-bit was our chosen Office version. Soon after, people started asking why the datasheet view was no longer working.  It just so happens that SharePoint&#39;s datasheet view doesn&#39;t play nice with 64-bit client software.&lt;/p&gt;
&lt;p&gt;Why? The datasheet view uses a 32-bit ActiveX control. Internet Explorer 64-bit disables the datasheet view and without a 32-bit Office install IE 32-bit will give the following error:&lt;/p&gt;
&lt;img src=&quot;https://www.jeremyknight.me/2010/img/posts/2010/error.jpg&quot; alt=&quot;&quot; class=&quot;img-fluid&quot;&gt;
&lt;p&gt;Don&#39;t fret though. There will be no need to downgrade to a 32-bit version of Office. This problem can be fixed by installing the &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&amp;amp;displaylang=en&quot; title=&quot;2007 Office System Driver: Data Connectivity Components&quot;&gt;2007 Office System Driver: Data Connectivity Components&lt;/a&gt;. Once the downloaded AccessDatabaseEngine.exe is installed, the datasheet functionality should work in both SharePoint 2007 and SharePoint 2010.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>MCTS: MOSS 2007 Application Development</title>
    <link href="https://www.jeremyknight.me/2010/04/26/mcts-moss07-app-dev/" />
    <updated>2010-04-26T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2010/04/26/mcts-moss07-app-dev/</id>
    <content type="html">&lt;p&gt;It&#39;s long overdue but I finally decided to take the MCTS Microsoft Office SharePoint Server 2007 Application Development certification test this past Friday. I now have both development certifications for SharePoint 2007 and just in time with SharePoint 2010 right around the corner.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>MCTS 70-561 ADO.NET</title>
    <link href="https://www.jeremyknight.me/2009/09/01/mcts-70-561-ado-net/" />
    <updated>2009-09-01T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2009/09/01/mcts-70-561-ado-net/</id>
    <content type="html">&lt;p&gt;I took the &amp;quot;MCTS: Microsoft .NET Framework 3.5, &lt;a href=&quot;http://ADO.NET&quot;&gt;ADO.NET&lt;/a&gt; Application Development&amp;quot; test yesterday. I passed but there were a few curve balls. For the most part though, it seemed like if you study at all the process of elimination can get you through this test. Most questions had at least 2 answers that could easily be eliminated.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Computer Induced Headache</title>
    <link href="https://www.jeremyknight.me/2009/07/22/computer-induced-headache/" />
    <updated>2009-07-22T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2009/07/22/computer-induced-headache/</id>
    <content type="html">&lt;p&gt;My mother-in-law to be was having some computer troubles and she asked me to look at it. (It was freezing at the Windows XP screen with the blue progress bar.) I picked it up about a week ago and I finally got around it looking at it last night. The first step of getting her data off was simple enough. I threw in the Ubuntu live CD and moved her files onto my 160GB portable drive.&lt;/p&gt;
&lt;p&gt;Then I sat down to reinstall her copy of Windows. Here is where the fun began boys and girls. It froze up on the &amp;quot;Setup is Starting Windows&amp;quot; screen. I did some research online and found this [thread](&lt;a href=&quot;http://www.hardwareanalysis.com/content/topic/13533/&quot;&gt;http://www.hardwareanalysis.com/content/topic/13533/&lt;/a&gt; &amp;quot;Windows XP PRO freezes on &amp;quot;Setup is starting Windows&amp;quot; text screen &amp;quot;) which matches my problem perfectly. I must have exhausted every possible solution listed in the entire thread to no avail... And then, by complete chance, I look off to the side and see a gutted tower with only a motherboard and cpu left in it. About four hours into this at this point, I figure why not...&lt;/p&gt;
&lt;p&gt;I rip everything out of her computer, throw it together this old case, and start her XP install again. It runs on the first try. It must have been a cpu/motherboard issue considering the only things that changed were the motherboard and cpu, and the computer had just run a Ubuntu live without any issue.&lt;/p&gt;
&lt;p&gt;And people wonder why I stopped fixing computers on the side when I got a job after college...&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>T-SQL String Padding Functions</title>
    <link href="https://www.jeremyknight.me/2009/06/10/t-sql-string-padding-functions/" />
    <updated>2009-06-10T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2009/06/10/t-sql-string-padding-functions/</id>
    <content type="html">&lt;p&gt;Some time ago I found myself needing to format the data within a dataset. I thought about writing the code for it but then realized that a SQL implementation would probably be more efficient. I wrote two functions fPadLeft and fPadRight to allow a varchar(MAX) to be padded with any character (in my case it was zeros).&lt;/p&gt;
&lt;p&gt;Here&#39;s the fPadRight function:&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;CREATE &lt;span class=&quot;token return-type class-name&quot;&gt;FUNCTION&lt;/span&gt; fPadRight 
&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token return-type class-name&quot;&gt;@OrigString&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;VARCHAR&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;MAX&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; NULL&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    @&lt;span class=&quot;token class-name&quot;&gt;PadLength&lt;/span&gt; INT &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token return-type class-name&quot;&gt;@PadChar&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;CHAR&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &#39;&#39;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token return-type class-name&quot;&gt;RETURNS&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;VARCHAR&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;MAX&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
AS
BEGIN
    DECLARE &lt;span class=&quot;token return-type class-name&quot;&gt;@Result&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;VARCHAR&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;MAX&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
    DECLARE @&lt;span class=&quot;token class-name&quot;&gt;OrigLength&lt;/span&gt; INT&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;token class-name&quot;&gt;SET&lt;/span&gt; @OrigLength &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;LEN&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;@OrigString&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
     
    IF &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;@OrigLength &lt;span class=&quot;token operator&quot;&gt;&gt;=&lt;/span&gt; @PadLength&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    BEGIN
        &lt;span class=&quot;token class-name&quot;&gt;SET&lt;/span&gt; @Result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; @OrigString
    END
    ELSE
    BEGIN
        &lt;span class=&quot;token class-name&quot;&gt;SET&lt;/span&gt; @Result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;  @OrigString &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;REPLICATE&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;@PadChar&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; @PadLength &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt; @OrigLength&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    END
 
    RETURN @Result
END
GO&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The entire scripts, including if exists logic, are included in the following links:&lt;/p&gt;
&lt;p&gt;Pad Right: &lt;a href=&quot;https://gist.github.com/4488425&quot;&gt;https://gist.github.com/4488425&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Pad Left: &lt;a href=&quot;https://gist.github.com/4488465&quot;&gt;https://gist.github.com/4488465&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>MCTS WSS 3.0 App Dev</title>
    <link href="https://www.jeremyknight.me/2009/04/01/mcts-wss-30-app-dev/" />
    <updated>2009-04-01T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2009/04/01/mcts-wss-30-app-dev/</id>
    <content type="html">&lt;p&gt;I took my third MS certification test Monday. The test was MCTS Windows SharePoint Services 3.0 Application Developmetn. After working almost solely on SharePoint for the past year and cramming for the pass two weeks, I would have been extremely embarrassed had I not passed.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>MCTS Web Apps</title>
    <link href="https://www.jeremyknight.me/2008/08/04/mcts-web-apps/" />
    <updated>2008-08-04T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2008/08/04/mcts-web-apps/</id>
    <content type="html">&lt;p&gt;I took my second MS certification test earlier today and am now a MCTS in .NET Framework 2.0 Web Applications. (MCTS = Microsoft Certified Technology Specialist) Now I can get back to my friends who have seen me become a phantom for the last week or so due to my cram sessions. 🙂&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Let the adventures begin!</title>
    <link href="https://www.jeremyknight.me/2008/07/25/let-the-adventures-begin/" />
    <updated>2008-07-25T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2008/07/25/let-the-adventures-begin/</id>
    <content type="html">&lt;p&gt;I spent last week in a hotel room so that I could attend more SharePoint training. The class was extremely useful and I learned a lot of new and interesting things. Unfortunately, it seems like the more that I delve into SharePoint the faster I find out how much left there is to learn.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>First MS Cert</title>
    <link href="https://www.jeremyknight.me/2008/01/27/first-ms-cert/" />
    <updated>2008-01-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2008/01/27/first-ms-cert/</id>
    <content type="html">&lt;p&gt;It&#39;s official. I took my first Microsoft certification (Exam 70-528 .Net 2.0 Web-Based Client Development) and passed with flying colors. I was a bit nervous going into the exam as the test prep book had some really hard questions. Fortunately, the test ended up being really easy after all the prep I put myself through because of those questions.&lt;/p&gt;
&lt;p&gt;I plan on finishing up this semester (final toward Masters degree) and then I&#39;m going to try to get at least one certification test done every 3-4 months. I may even get another one done during the semester since I&#39;m being sent to two SharePoint development classes.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Know thy Google!</title>
    <link href="https://www.jeremyknight.me/2007/03/10/know-thy-google/" />
    <updated>2007-03-10T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2007/03/10/know-thy-google/</id>
    <content type="html">&lt;p&gt;A friend of mine just posted an excellent piece of information entitled &amp;quot;&lt;a href=&quot;http://joefruchey.com/blog/wp-trackback.php?p=536&quot; title=&quot;Search Google like a Pro by Joe&quot;&gt;Search Google like a Pro&lt;/a&gt;&amp;quot;. He covers a lot of advanced searching syntax that will help anyone who has ever been lost on the internet superhighway. It is a great read for all and those that liked my previous &amp;quot;&lt;a href=&quot;https://www.jeremyknight.me/2007/03/2006/2006-07-20-advanced-google-features/&quot; title=&quot;Advanced Google Features&quot;&gt;Advanced Google Features&lt;/a&gt;&amp;quot; will love this post.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Programmer Personality Test</title>
    <link href="https://www.jeremyknight.me/2007/03/01/programmer-personality-test/" />
    <updated>2007-03-01T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2007/03/01/programmer-personality-test/</id>
    <content type="html">&lt;p&gt;I found this and thought that it was pretty interesting. I&#39;ve just went through all the personality tests I can think of in my Organizational Behavior class but this one was right up my ally.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.doolwind.com/index.php?page=11&quot; title=&quot;The Programmer personality Test&quot;&gt;The Programmer Personality Test&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here&#39;s what mine ended up looking like:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Your programmer personality type is: &lt;strong&gt;PHTB&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You&#39;re a Planner.&lt;/strong&gt; You may be slow, but you&#39;ll usually find the best solution. If something&#39;s worth doing, it&#39;s worth doing right.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You like coding at a High level.&lt;/strong&gt; The world is made up of objects and components, you should create your programs in the same way.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You work best in a Team.&lt;/strong&gt; A good group is better than the sum of it&#39;s parts. The only thing better than a genius programmer is a cohesive group of genius programmers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You are a liBeral programmer.&lt;/strong&gt; Programming is a complex task and you should use white space and comments as freely as possible to help simplify the task. We&#39;re not writing on paper anymore so we can take up as much room as we need.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
  </entry>
  <entry>
    <title>Is your favorite application portable?</title>
    <link href="https://www.jeremyknight.me/2007/01/23/is-your-favorite-application-portable/" />
    <updated>2007-01-23T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2007/01/23/is-your-favorite-application-portable/</id>
    <content type="html">&lt;p&gt;I just have to mention one of my new favorites. The website &lt;a href=&quot;http://www.portableapps.com&quot;&gt;www.portableapps.com&lt;/a&gt; has a great program suite for portable applications. Their suite works with most portable hardware (USB flash drive, iPod, portable hard drive, etc.) and for those that do not wish to use the entire suite they also have a pretty nice library of portable applications. Best of all - its completely free.&lt;/p&gt;
&lt;p&gt;I personally use their Lite Suite. OpenOffice was a bit much for me to put on a thumbdrive and between the Lite&#39;s AbiWord and the fact that most pc&#39;s have office software I decided against it.. I&#39;ve customized it a bit so with the suite I always have Firefox, Filezilla, Notepad++, Foxit Reader, and 7-Zip just a few clicks away on any computer.&lt;/p&gt;
&lt;p&gt;Thanks PortableApps!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Secure Computing: Up-To-Date Anti-Virus</title>
    <link href="https://www.jeremyknight.me/2007/01/16/securing-computing-up-to-date-anti-virus/" />
    <updated>2007-01-16T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2007/01/16/securing-computing-up-to-date-anti-virus/</id>
    <content type="html">&lt;p&gt;What is the number one reason why most people with virus prevention programs installed on their computer become infected? The answer is quite simple. The virus prevention software isn’t kept up-to-date.&lt;/p&gt;
&lt;p&gt;Anti-virus software is only as good as its virus definition database and its detection software. Commercial anti-virus vendors only provide adequate updates to the virus definition and the detection software as long as the customer has paid for the updates. Today, most vendors provide 1 year of updates with the purchase of their products and many consumers choose not to renew update subscriptions after the initial period. Unfortunately, by not extending subscriptions consumers leave their computers at risk of infection.&lt;/p&gt;
&lt;p&gt;Fortunately, free anti-virus vendors have been getting better and better reviews giving consumers another solution. There are three free anti-virus solutions that I would recommend: &lt;a href=&quot;http://www.free-av.com/&quot; title=&quot;AntiVir Website&quot;&gt;AntiVir Personal&lt;/a&gt;, &lt;a href=&quot;http://www.avast.com/&quot; title=&quot;Avast Website&quot;&gt;Avast Home Edition&lt;/a&gt;, and &lt;a href=&quot;http://free.grisoft.com/&quot; title=&quot;AVG Free Website&quot;&gt;AVG Free&lt;/a&gt;. These all have comparable features, free updates, and you can checkout &lt;a href=&quot;http://www.av-comparatives.org/&quot; title=&quot;AV Comparatives&quot;&gt;http://www.av-comparatives.org/&lt;/a&gt; for comparisons of their effectiveness against malicious code.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>iPod Battery Not Holding a Charge?</title>
    <link href="https://www.jeremyknight.me/2006/08/27/ipod-battery-not-holding-a-charge/" />
    <updated>2006-08-27T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2006/08/27/ipod-battery-not-holding-a-charge/</id>
    <content type="html">&lt;p&gt;Next time you think your battery is going bad in your iPod because it doesn&#39;t hold a charge anymore just try draining the battery completely.&lt;/p&gt;
&lt;p&gt;If you&#39;ve read through the blog, you know that I own a 30GB iPod video (&lt;a href=&quot;http://www.jeremyknight.me/post/new-ipod&quot; title=&quot;Link to New iPod Post&quot;&gt;Post&lt;/a&gt;). I bought it so that I could have something to listen to while I&#39;m at work and I found that it can easily go the entire work day on a single charge. But, one day recently, I went to work, turned on my iPod, and about 3-4 hours later my iPod showed low battery. I couldn&#39;t figure out what was going on and immediately I thought that my battery was going bad. Then I calmed down and started thinking about it. Never in the time that I had owned my iPod, had I ever let the battery discharge. It was worth a shot since I thought I&#39;d be buying a new battery or even iPod. I just let my iPod play until the battery was completely dead and when I got home from work that night I plugged it in to charge overnight. The next morning when I got to work I turned it on and let it play. I left work that day and it was still going strong, EQ and all.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Advanced Google Features</title>
    <link href="https://www.jeremyknight.me/2006/07/20/advanced-google-features/" />
    <updated>2006-07-20T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2006/07/20/advanced-google-features/</id>
    <content type="html">&lt;p&gt;Unbeknown to most, the seemingly simple Google Search box is really very powerful. The following examples are just some of the ways that Google Search can be used.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Google Calculator&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Google allows you to do calculations right in the search box. You can do basic arithmetic (+, -, /, *) but it also allows for a few other calculations.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt; Percentage of: 45% of 39 Raise to a power: 2^5 or 2**5 Convert Units: 300 Euros in USD&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Google Safe Search&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Every now and then you want to search for a topic that you know may return some adult results. For those of us that don&#39;t want to be bothered with adult content, Google has provided a way to prevent adult content from displaying in results. The following example shows what you would type if you wanted to search Google for &amp;quot;sex education&amp;quot; and not have adult sites in your search results.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt; safesearch: sex education&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Generic&lt;/strong&gt; safesearch:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Special Searches with Google&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can easily find the definition of words, movie information and showtimes, phone numbers, and even your local weather using Google.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Generic&lt;/strong&gt; define: phonebook: bphonebook: rphonebook: movie: weather&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt; define:words phonebook: New Orleans, LA bphonebook: New Orleans, LA rphonebook: New Orleans, LA movie: Superman Returns weather New Orleans, LA&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For the phonebook information, &amp;quot;bphonebook&amp;quot; searches business numbers only while &amp;quot;rphonebook&amp;quot; searches residential numbers only.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Site Specific Searches with Google&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Google provides users with ways to search only within one website and to find all pages linked to a specific webpage.&lt;/p&gt;
&lt;p&gt;To search within a website:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Generic&lt;/strong&gt; site:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt; contact information site:www.jeremyknight.me&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To find all linked pages:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Generic&lt;/strong&gt; link:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt; link:www.jeremyknight.me&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you would like to learn more about Google&#39;s &amp;quot;hidden&amp;quot; features, please visit: &lt;a href=&quot;http://www.googleguide.com/advanced_operators_reference.html&quot; title=&quot;Google Advanced Operators (Cheat Sheet)&quot;&gt;Google Advanced Operators (Cheat Sheet)&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Handling New Windows in Strict DTDs</title>
    <link href="https://www.jeremyknight.me/2006/06/06/handling-new-windows-in-strict-dtds/" />
    <updated>2006-06-06T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2006/06/06/handling-new-windows-in-strict-dtds/</id>
    <content type="html">&lt;p&gt;Kevin Yank on SitePoint has an article named &amp;quot;New-Window Links in a Standards-Compliant World&amp;quot; which explains a great javascript alternative to help with the Strict DTDs&#39; lack of the anchor&#39;s target attribute.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.sitepoint.com/article/standards-compliant-world&quot;&gt;http://www.sitepoint.com/article/standards-compliant-world&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Phishing and Pharming, Awareness and Prevention</title>
    <link href="https://www.jeremyknight.me/2006/05/05/phishing-and-pharming-awareness-and-prevention/" />
    <updated>2006-05-05T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2006/05/05/phishing-and-pharming-awareness-and-prevention/</id>
    <content type="html">&lt;p&gt;Argueably one of the main security topics in recent years has been the onset and prevalence of phishing and pharming scams. Unfortunately, while many end users have heard of these threats, they remain unaware of the severity of these very dangerous scams. Users should educate themselves not only on prevention techniques but also on the scams’ processes. This article is meant to provide users with a non-technical explanation of phishing and pharming, as well as prevention techniques&lt;/p&gt;
&lt;h3&gt;Phishing&lt;/h3&gt;
&lt;p&gt;Phishing is a form of identity theft in which phishers, people that use phishing, create websites that appear to belong to legitimate companies. Phishers usually draw users to these fraudulent sites by sending websites links in authentic-looking emails, which could even include the real company’s logo. If a user is drawn to the phisher’s website and submits his or her personal information, the information is submitted to the phisher.&lt;/p&gt;
&lt;p&gt;For example, a user receives a fake email supposedly from Bank XYZ with a link back to the site asking you to click on the link. That user then clicks the link and is sent to a page which looks like the XYZ login page but the address in the address bar at the top of the browser is not correct. When the user types in his or her user information, they aren’t logged into XYZ but instead the phisher now has his or her user information and can log into their XYZ account.&lt;/p&gt;
&lt;h3&gt;Pharming (aka Domain Spoofing)&lt;/h3&gt;
&lt;p&gt;Pharming occurs when a hacker “poisons” the domain name, or web address (&lt;a href=&quot;http://www.google.com&quot;&gt;www.google.com&lt;/a&gt;, &lt;a href=&quot;http://www.yahoo.com&quot;&gt;www.yahoo.com&lt;/a&gt;, etc), of a website and redirects users from the “poisoned” website to another website usually owned by the hacker. Once at the hacker’s site, the pharming process is identical to phishing. Users submit information to the hacker’s site but are truly submitting their information directly to the hacker.&lt;/p&gt;
&lt;p&gt;Unfortunately, this technique can cause large groups of users to be driven to fraudulent sites even if they type in the correct URL, or web address. The larger the website address “poisoned” the larger the pharming scam. For example, if &lt;a href=&quot;http://www.google.com&quot;&gt;www.google.com&lt;/a&gt; has been “poisoned,” when you type in &lt;a href=&quot;http://www.xyz.com&quot;&gt;www.xyz.com&lt;/a&gt; you would not be taken to the real XYZ page but one of the hacker’s choosing. If the page is created to look the same as the real site then it may be hard to tell that pharming has occurred since the address bar will still say &lt;a href=&quot;http://www.xyz.com&quot;&gt;www.xyz.com&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Phishing and Pharming Prevention&lt;/h3&gt;
&lt;p&gt;** As a general rule NEVER click a web address inside of an email. Even though the email seems to be from someone you know or an organization you know to be safe simply open your browser (Internet Explorer, Firefox, etc.) and navigate to the website without using the link in the email.&lt;/p&gt;
&lt;h5&gt;Phishing&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Watch the address bar! Phishing does not disguise the URL in the address bar so you will be able to see the difference in the address bar at the top of your browser. If phishing is occurring the URL, or web address, will be incorrect.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you think that you may have fallen victim to this, the best advice is to login to the real website and change your password. This will negate the information that the phisher obtained but I must stress that this be done immediately so as not to give the phisher time to change your password or collect your information.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;Pharming&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You CANNOT rely on the address bar. The address bar will look correct but you will not be on the website that it says.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check names on authentication certificates. If the name doesn’t match the site you want to go to, leave the site and contact a tech to verify the authenticity of a site.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
</content>
  </entry>
  <entry>
    <title>What is RSS?</title>
    <link href="https://www.jeremyknight.me/2006/03/05/what-is-rss/" />
    <updated>2006-03-05T00:00:00Z</updated>
    <id>https://www.jeremyknight.me/2006/03/05/what-is-rss/</id>
    <content type="html">&lt;p&gt;RSS, or Really Simple Syndication, is a format for sharing website content. RSS allows you to subscribe to websites that offer RSS feeds. Today you can find RSS feeds on news sites such as CNN and Wired, blog sites, and many more. The list of uses for RSS, as well as the list of sites using it, is growing daily.&lt;/p&gt;
&lt;p&gt;Software is needed to read RSS feeds, and, to the delight of many users, it can be found for your computer as well being offered as a service by some websites. Sites like &lt;a href=&quot;http://www.google.com/reader/&quot;&gt;Google Reader&lt;/a&gt; and &lt;a href=&quot;http://www.protopage.com/&quot;&gt;Protopage&lt;/a&gt; allow users to keep there RSS feeds online so that they may read them from any computer, while programs like &lt;a href=&quot;http://www.mozilla.com/&quot;&gt;Mozilla&#39;s Firefox&lt;/a&gt;, &lt;a href=&quot;http://www.feedreader.com/&quot;&gt;Feedreader&lt;/a&gt;, and &lt;a href=&quot;http://www.sharpreader.net/&quot;&gt;SharpReader&lt;/a&gt; allow users to view feeds from the comfort of their own home. For those that wish to read their feeds from home but don&#39;t want additional programs, email programs are starting to integrate RSS reading functionality. &lt;a href=&quot;http://www.mozilla.com/&quot;&gt;Mozilla&#39;s Thunderbird&lt;/a&gt; email program already has this capability while &lt;a href=&quot;http://www.microsoft.com/&quot;&gt;Microsoft&lt;/a&gt; has said the next version of Outlook will have it included.&lt;/p&gt;
&lt;p&gt;If you have further questions about RSS, please feel free to ask them in this topic.&lt;/p&gt;
</content>
  </entry>
</feed>
