Daniel Earwicker

Unless otherwise specified, all original code posted on this site is published under the MIT license.

Advertisements
  1. AspNyc
    August 30, 2009 at 3:05 am

    I came across an old post of yours ( http://stackoverflow.com/questions/616554/is-reflection-really-that-slow-that-i-shouldnt-use-it-when-it-makes-sense-to ), in which you said the following:

    “when you are reflecting to find all the types that support a certain attribute, you have a perfect opportunity to use caching. That means you don’t have to use reflection more than once at runtime.”

    That seems like something I’d want to do in a class that I’m building, but I don’t know how to do it. Here’s the code I have so far, taken from my recent question ( http://stackoverflow.com/questions/1352924/c-and-reflection ):

    public static void PrintAPI()
    {
    Type type = typeof(API);
    PropertyInfo[] props = type.GetProperties(BindingFlags.Public);

    // Sort properties alphabetically by name (http://www.csharp-examples.net/reflection-property-names/)
    Array.Sort(props, delegate(PropertyInfo p1, PropertyInfo p2)
    {
    return p1.Name.CompareTo(p2.Name);
    });

    foreach (PropertyInfo propertyInfo in type.GetProperties())
    {
    Console.WriteLine(“{0} [type = {1}]”, propertyInfo.Name, propertyInfo.PropertyType);
    }
    }

    Any suggestions how to go about caching the list of property names and types only at runtime? I’m brand-new to C# (coming from the dark ages of VBScript/Classic ASP), so my apologies if this is a really basic feature I’m missing.

    -= Jesse =-

  2. georgy
    September 24, 2010 at 3:08 pm

    Are you *that* Daniel Earwicker?

    http://www.youtube.com/user/danielearwicker

    If so, I’m totally impressed.

    • earwicker
      September 24, 2010 at 6:34 pm

      Yes I am, thanks!

  3. January 24, 2011 at 3:35 am

    I’ve been obsessively watching your youtube videos for a good while and then I stumbled upon an answer from a certain Mr. Earwicker on stackoverflow… could it be? Yes, yes it is. Cool 😀

    • earwicker
      January 24, 2011 at 3:01 pm

      Thanks!

  4. June 4, 2013 at 10:45 am

    Hi Daniel, would you be interested in an opportunity for angular, node, cloudant development? Probably 2-3 months worth of work and then on-going maintenance.

  5. May 6, 2014 at 4:38 pm

    How to contact you (technical questions about per & carota, to be used in the MELT monitor, see http://gcc-melt.org/) ? Basile Starynkevitch ….

  6. J. Merrill
    December 13, 2014 at 10:54 pm

    Please check my comment on your StackOverflow answer to http://stackoverflow.com/questions/730300/how-to-throw-exception-without-resetting-stack-trace/ — the link you posted is broken but I tell how to un-break it via Internet Archive.

  7. johnnyreilly
    January 20, 2015 at 9:04 am

    Daniel, did you grow up in Fleet by any chance? I knew a Daniel Earwicker at Junior school (I think)… Just wondering if it was you??

    • earwicker
      January 20, 2015 at 11:14 pm

      I am from around that way so it was probably me! I see you’re busy in DefinitelyTyped 🙂 I’ve been using TS for a year or so and last month started migrating the main project I work on, about 100,000 lines of JS. It’s genuinely great, I think. To be honest, I was making daily visits to the TS blog to see if they’d released 1.4 yet! I think that counts as a form of addiction.

      • johnnyreilly
        January 21, 2015 at 7:24 am

        Yup – I’ve been using typescript since it first announced. It’s brill. The project I’m just finishing was mostly built with it (well, the front end). I think the initial selling point for us was when we first changed a file from a JS suffix to a TS suffix it highlighted a glaring error in the code!

        If memory serves I came to tea at your house when I was about 7. It sounds like you don’t remember me though?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: