Blog Archives

Typesetting “C#” in LaTeX

How do you refer to the C# programming language in LaTeX? Simply typing C# doesn’t work because # is a special character in LaTeX. You could type C#. That works, but it looks a little odd. The number sign is

Tagged with: , ,
Posted in Typography

Stand-alone scientific code

Sometimes you need one or two scientific functions not included in your programming environment. For a number of possible reasons, you do not want to depend on an external library. For example, maybe you don’t want to take the time

Tagged with: ,
Posted in Python

Porting Python to C#

When people start programming in Python, they often mention having to type less: no braces, no semicolons, fewer type declarations etc. The difference may be more obvious when you go in the other direction, moving from Python to another language.

Tagged with: , ,
Posted in Python, Software development

C# math gotchas

C# has three mathematical constants that look like constants in the C header file float.h. Two of these are not what you might expect. The constant double.MaxValue in C# looks like the constant DBL_MAX in C, and indeed it is.

Tagged with: , ,
Posted in Math, Software development

Root-finding software in C#

Code Project just posted my article Three Methods for Root-finding in C#. The article discusses the pros and cons of bisection, Newton’s method, and Brent’s method and gives C# implementations of each. Related posts: C# random number generation code Free

Tagged with: ,
Posted in Math, Software development

C# random number generation code

This weekend Code Project posted an updated version of my article Simple Random Number Generation. The article comes with C# source code for generating random samples from the following distributions. Cauchy Chi square Exponential Inverse gamma Laplace (double exponential) Normal

Tagged with: , ,
Posted in Math, Software development

Visual Studio 2010 is a pig

Visual Studio 2010 has not made a good first impression. It took about a day to install. I was using the Visual Studio Ultimate Web Installer and much of the time was spent downloading bits. I’m sure it would have

Tagged with: ,
Posted in Software development

Solver Foundation optimization library

Microsoft’s Solver Foundation is a numerical optimization library capable of solving problems involving millions of variables and millions of constraints. When I listened Scott Hanselman interview Nathan Brixius from Microsoft’s Solver Foundation team, I expected Brixius to say that Solver

Tagged with: ,
Posted in Computing, Software development

Free C# book

Charles Petzold is a highly respected author in Windows programming circles. For years, his book was THE reference for Win32 API programming. I knew he had since written several books on .NET programming but I didn’t realize until I listened

Tagged with: , , ,
Posted in Software development

C# verbatim strings vs. PowerShell here-strings

C# verbatim strings and PowerShell here-stringsĀ have just enough in common to be confusing. The differences are summarized here. C# verbatim strings PowerShell here-strings May contain line breaks Must contain line breaks Only double quote variety Single and double quote varieties

Tagged with: , ,
Posted in PowerShell