Creating iCal Files in c#

I use DDay.Ical, its good stuff. Has the ability to open up an ical file and get its data in a nice object model. It says beta, but it works great for us. Edit Nov 2016 This library has been deprecated, but was picked up and re-released as iCal.NET by another dev. Notes about the …

Read more

Argument order to std::min changes compiler output for floating-point

minsd a,b is not commutative for some special FP values, and neither is std::min, unless you use -ffast-math. minsd a,b exactly implements (a<b) ? a : b including everything that implies about signed-zero and NaN in strict IEEE-754 semantics. (i.e. it keeps the source operand, b, on unordered1 or equal). As Artyer points out, -0.0 …

Read more

How to deploy after a build with TeamCity?

This article explains how to call Microsoft’s WebDeploy tool from TeamCity to deploy a web application to a remote web server. I’ve been using it to deploy to a test web server and run selenium tests on check-in. http://www.mikevalenty.com/automatic-deployment-from-teamcity-using-webdeploy/ Install WebDeploy Enable Web config transforms Configure TeamCity BuildRunner Configure TeamCity Build Dependencies The MSBuild arguments …

Read more

default override of virtual destructor

Is it correct to use both keywords “override” and “=default” in the destructor of Child class? Will compiler generate correct virtual destructor in this case? Yes, it is correct. On any sane compiler, if the code compiles without error, this destructor definition will be a no-op: its absence must not change the behavior of the …

Read more

Best way to update LINQ to SQL classes after database schema change

You can use SQLMetal.exe to generate your dbml and or cs/vb file. Use a pre-build script to start it and target the directory where your datacontext project belongs. C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\sqlmetal.exe /server:<SERVER> /database:<database> /code:”path\Solution\DataContextProject\dbContext.cs” /language:csharp /namespace:<your namespace>

Generating a Random Decimal in C#

EDIT: Removed old version This is similar to Daniel’s version, but will give the complete range. It also introduces a new extension method to get a random “any integer” value, which I think is handy. Note that the distribution of decimals here is not uniform. /// <summary> /// Returns an Int32 with a random value …

Read more