background preloader

C#

Facebook Twitter

Standard ECMA-334. Standard ECMA-334 C# Language Specification 5th edition (December 2017) This specification describes the form and establishes the interpretation of programs written in the C# programming language. It describes The representation of C# programs; The syntax and constraints of the C# language; The semantic rules for interpreting C# programs; The restrictions and limits imposed by a conforming implementation of C#. This specification does not describe The mechanism by which C# programs are transformed for use by a data-processing system; The mechanism by which C# applications are invoked for use by a data-processing system; The mechanism by which input data are transformed for use by a C# application; The mechanism by which output data are transformed after being produced by a C# application; The size or complexity of a program and its data that will exceed the capacity of any specific data-processing system or the capacity of a particular processor;

Why doesn't the End Task button end my task immediately? - The Old New Thing. Commenter littleguru asks, "Why does the End Now button not kill the process immediately? " When you click the End Now button, the process really does end now, but not before a brief message from our sponsor. When you kill a hung application, Windows Error Reporting steps in to record the state of the hung application so it can be submitted to the mother ship (with your permission). If you are running Windows XP or Windows Vista, you can briefly see a process called dumprep.exe or WerFault.exe; these are the guys who are doing the data collection. After being uploaded to Microsoft, these failure reports are studied to determine why the application stopped responding and what could be done to fix it.

If you don't want Windows Error Reporting to collect application crash and hang reports, you can disable it from the Group Policy Editor under Windows Error Reporting. Of course, if you do this, then you don't get to vote on which program crashes and failures Microsoft should work on fixing. C# 4.0 and beyond by Anders Hejlsberg | Matthijs Hoekstra. Suggestion Box 3 - The Old New Thing. Recursion and Dynamic Programming - Fabulous Adventures In Coding. Back in May we were discussing the merits and drawbacks of recursive programming techniques -- that is, writing functions which break down problems into sub-problems, and then call themselves. The drawback of such an approach is that in some cases, you end up doing way more work than necessary. The example I used was the naïve Fibonacci algorithm: function fib(n) { if (n == 1 || n == 2) return 1; return fib(n-1) + fib(n-2);} This is an exponential algorithm -- calculating the first few numbers is very cheap, but once we get up into the tens and twenties, you very quickly end up doing millions of recursive steps.

Something that you might notice is that since fib(20) cannot possibly need to calculate more than 19 distinct previous fib values, that most of those millions of calculations are the same ones being done over and over again. (ASIDE: This seemingly obvious argument has a name: the Pigeonhole Principle.) How do we solve this problem? Here's a solution without memoization: