Blog - Title

  • Fabulous Adventures In Coding

    Computing a Cartesian Product with LINQ

    • 18 Comments
    And here we have yet another post inspired by a question on StackOverflow : how do you compute the Cartesian product of arbitrarily many sequences using LINQ? (*) UPDATE: Ian Griffiths has an interesting series of articles that approaches this question...
  • Fabulous Adventures In Coding

    Travelogue

    • 13 Comments
    I've just returned from a week in Oslo, Norway, where I spoke at NDC 2010, immediately following a week in New Orleans, where I spoke at TechEd. I'm about nine hours jetlagged and glad to be home, though I had a lovely time. Many thanks in particular...
  • Fabulous Adventures In Coding

    Hide and seek

    • 8 Comments
    Another interesting question from StackOverflow. That thing is a gold mine for blog topics. Consider the following: class B { public int X() { return 123; } } class D : B { new protected int X() { return 456; } } class E : D { public int Y() { return...
  • Fabulous Adventures In Coding

    Don't repeat yourself; consts are already static

    • 20 Comments
    Today, another entertaining question from StackOverflow . Presented again as a dialogue, as is my wont. The specification says " even though constants are considered static members, a constant-declaration neither requires nor allows a static modifier...
  • Fabulous Adventures In Coding

    Live from New Orleans

    • 15 Comments
    Just a quick note that Mads, Luke and I are going to be on Channel 9 Live from TechEd this afternoon talking about C#, F# and whatever else strikes our fancy. It's live video; anything can happen. Tune in to www.msteched.com ; we're scheduled to be on...
  • Fabulous Adventures In Coding

    Better late than never

    • 5 Comments
    Good heavens, I just realized I completely forgot to post a link to this interview . I'm a year late, but better late than never. A year ago Ken stopped by my office and we had a very freewheeling, entertaining and rather random conversation about...
  • Fabulous Adventures In Coding

    Continuous as the stars

    • 8 Comments
    No computer stuff today. Martin Gardner - writer, skeptic, recreational mathematician - died recently. As a teenager I would scour the back room of Casablanca Books looking for back issues of Scientific American for interesting Mathematical Recreation...
  • Fabulous Adventures In Coding

    The traveling developer

    • 4 Comments
    Hey everybody, just a quick FYI, I will be attending TechEd New Orleans this year. I'll be hanging out at Mads' sessions, manning the booth and attending as many parties as I can fit in, so if you want to stop by and say hi, please do. I'll then be...
  • Fabulous Adventures In Coding

    Cast operators do not obey the distributive law

    • 23 Comments
    Another interesting question from StackOverflow . Consider the following unfortunate situation: object result; bool isDecimal = GetAmount(out result); decimal amount = (decimal)(isDecimal ? result : 0); The developer who wrote this code was quite...
  • Fabulous Adventures In Coding

    More Boring Metablogging

    • 8 Comments
    Hey everyone, those of you who read this blog on the main MSDN page rather than via your own RSS reader have probably noticed that the new default themes went live yesterday. I am aware that the new theme does not make particularly efficient use of...
  • Fabulous Adventures In Coding

    Every Program There Is, Part Nine

    • 3 Comments
    [This is the final part of a series on generating every string in a language. The previous part is here .] We seem to have a bit of a performance problem here. We could slap a profiler on it, and normally I’d recommend just that. But in this case, let...
  • Fabulous Adventures In Coding

    Every Program There Is, Part Eight

    • 1 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] OK, first things first. Let’s assume that we have a string that contains a grammar that has already been rewritten into our “nice...
  • Fabulous Adventures In Coding

    Every Program There Is, Part Seven

    • 2 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] Things seem to be going so well. We have a sketch of a recursive solution for enumerating all strings of a particular grammar and...
  • Fabulous Adventures In Coding

    Every Program There Is, Part Six

    • 1 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] The problem we ran into with our grammar-enumeration technique is that the recursion does not clearly reduce the problem to a smaller...
  • Fabulous Adventures In Coding

    Every Program There Is, Part Five

    • 4 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] Last time: Clearly we have reduced a problem of size k to multiple problems of size less than k-1, and so this is amenable to a recursive...
  • Fabulous Adventures In Coding

    Every Program There Is, Part Four

    • 9 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] Remember, the point of this exercise was to come up with a device to help me test parts of my compiler. To test binary trees as we...
  • Fabulous Adventures In Coding

    Every Program There Is, Part Three

    • 4 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] Suppose we want to write a grammar for a simplified C# class declaration. Let’s say that there are one-character identifiers, a class...
  • Fabulous Adventures In Coding

    Every Program There Is, Part Two

    • 10 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] Suppose we want to come up with a CFG for numbers with additions. Consider this very simple grammar with only one nonterminal. We...
  • Fabulous Adventures In Coding

    Every Program There Is, Part One

    • 14 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] We can now enumerate every binary tree and every arbitrary tree of a given size, and therefore we can enumerate all of them, period...
  • Fabulous Adventures In Coding

    Every Tree There Is

    • 19 Comments
    [This is part of a series on generating every string in a language. The previous part is here . The next part is here .] Last time we talked about how the number of binary trees with n nodes is C(n), where C(n) is the nth Catalan number. I asked if there...
  • Fabulous Adventures In Coding

    Every Binary Tree There Is

    • 47 Comments
    [This is the first part of a series on generating every string in a language. The next part is here .] The other day I wrote a little algorithm that did some operation on binary trees. I wanted to test it. I whipped up a few little test cases and it seemed...
  • Fabulous Adventures In Coding

    It's Essential!

    • 3 Comments
    My copy of Essential C# 4.0 just arrived, and it looks great. I was one of the technical reviewers of this book. Some books are a pain to edit, but the Essential C# series is one of my favourites. It totally lives up to its name; it really does give you...
  • Fabulous Adventures In Coding

    Ignoring parentheses

    • 16 Comments
    Yet another amusing question from StackOverflow : is there a difference between “return something;” and “return (something);” in C#? In practice , there is no difference. In theory there could be a difference. There are three interesting points...
  • Fabulous Adventures In Coding

    Precision and accuracy of DateTime

    • 30 Comments
    The DateTime struct represents dates as a 64 bit number that measures the number of “ticks” since a particular start date. Ten million ticks equals one second. That’s a quite high degree of precision . You can represent dates and times to sub-microsecond...
  • Fabulous Adventures In Coding

    Turning a bug into a feature

    • 15 Comments
    I was amused to read this post about an arithmetic bug which accidentally turned into an AI feature (found via Raymond’s recent link clearance .) It reminded me of a story that my friend Lars told me about working on a certain well-known first-person...
Page 7 of 32 (783 items) «56789»