The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,338 other followers

Archive for the ‘C#’ Category

c# – What should I do when I am forced to write unreachable code? – Stack Overflow

Posted by Jeroen Pluimers on 2014/09/09

Bosak posted an interesting piece of code on StackOverflow last year. His particular code was in C#, but it does not matter what kind of compiler you use:

Sometimes a compiler will complain about unreachable code, for instance when it thinks a function never returns a value.

But you know the program logic does.

Simple solution: When you have code that never should be reached: throw an appropriate exception.

public static int GetInt(int number)
{
    int[] ints = new int[]{ 3, 7, 9, int.MaxValue };
    foreach (int i in ints)
        if (number <= i)
            return i;

    return int.MaxValue; //this should be unreachable code since the last int is int.MaxValue and number <= int.MaxValue is allways true so the above code will allways return
}

The last return could be replaced like this, as proposed by Matt Houser: Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »

NTLM authentication: Connect to TFS 2013 Git Repository with LibGit2Sharp (via: Gáspár Nagy on software)

Posted by Jeroen Pluimers on 2014/08/26

I’m fighting some NTLM issues with a proxy server and this might come in handy one day: Connect to TFS 2013 Git Repository with LibGit2Sharp « Gáspár Nagy on software.

https://github.com/gasparnagy/Sample_NtlmGitTest/

–jeroen

 

Posted in .NET, C#, Development, NTLM, Power User, Software Development, Windows | Leave a Comment »

Tim Anderson on Developing an app on Microsoft Azure: a few quick reflections…

Posted by Jeroen Pluimers on 2014/08/14

Very nice summary: Developing an app on Microsoft Azure: a few quick reflections….

–jeroen

Posted in .NET, .NET 4.5, C#, C# 4.0, C# 5.0, C# 6 (Roslyn), Cloud Development, Development, Software Development, Visual Studio 2013, Visual Studio 2014, Visual Studio and tools, Windows Azure | Leave a Comment »

.NET/C#: Interesting DocX library to create OOXML documents for Word

Posted by Jeroen Pluimers on 2014/07/10

In case I need to export DocX in .NET again: DocX – Home.

(I did it both with Word Automation and OOXML, they were a pain).

–jeroen

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Development, Office, Office 2007, Office 2010, Office 2013, Office PIA, Software Development | Leave a Comment »

Some notes/links on Windows Debugging CLR applications

Posted by Jeroen Pluimers on 2014/07/02

I only need it every once in a while, so finding the right links and tips to help me usually takes too much time.

So here is a small list to get started:

Keywords: CLR, SOS.DLL, WinDbg, mscordacwks.dll, PSSCOR4

Some tips: Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Debugging, Development, Software Development | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 1,338 other followers

%d bloggers like this: