Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

jj5 jj5 Yeah. We got goth served.
  • Error Handling, use exceptions?

    spod wrote:
    You are right that the base class librarys throw in common cases. Some of these behaviors are wrong imo in .net 1.0 /1.1 ( Int32.Parse( "cat" ) shouldn't throw for example ). Most of these are addressed in Whidbey with the addition of TryParse() etc.


    Where can I find the doco for the Whidbey APIs? Or, what is the TryParse() signature?

    I'd rather have an IsParseable(String) or IsValid(String) method, and have Parse(String) throw.

    I don't like methods that return status codes, and prefer to avoid default values (which I'm guessing TryParse will accept?) when possible.

    John.

  • null + null = ?

    I think I jumped the gun a little too quick on this one. I didn't look at the IL. Obviously what happened here is that C# compiler decided that null + null was a constant expression and substitued it with an empty string.

    So it was the C# compiler that decided that the type of the null references concatenation was 'string'. I'm not sure where this behavior would be documented, but I'm sure it would be..

    You can't compile something like this:

          object a = null;
          object b = null;
          Console.WriteLine((a + b).GetType());

    Nor can you compile something like this:

      public class MyType {
        public static MyType operator + (object a, object b) {
          // ..
        }
      }

    I can't imagine any other 'null + null' case that the CLR might actually see at runtime (i.e. where the type information was missing). With the type information present there are rules for determining which operator overload will get called..

    So, this is a C# language feature it would seem. I wonder what happens in other .NET languages..

    John.

  • null + null = ?

    The reason for null + null == String.Empty will be because the + operator is defined on string and takes two string references. It would seem that concatenation of two null strings has been defined as an empty string.

    It's an interesting observation. I guess somewhere it's probably defined that the string operators will always be called in this case. I tried to create a class that also defined a + overload but the string overload was always called..

    There're tonnes of little things like this in framework. Try casting null to a SqlBinary for example, then try casting null to SqlBoolean.. they're both nullable types.. Wink

    Did you know that true is an operator..?

    John.

  • .NET Framework, Excel Object Library reference

    Did you figure out that you need to create a COM interop assembly?

    Check out the .NET Framework Type Library to Assembly Converter: tlbimp.exe

    John.

  • Don Box's Spoutlet

    scobleizer wrote:
    Well, Barry Bonds fails 70% of the time. It's just that when he doesn't fail he's so freaking amazing.

    If he were to come up to you and say "I'm the best player in baseball right now" would that be arrogant? Or the truth?


    I don't know who Barry Bonds is.

    I thought that article was pretty cool.

    I think it's funny that this thread demonstrates how easy it is to embed scripts in posts. I've been resisting the temptation all night to write a script that changed the Avatars for 'The Crew' to something that I deemed more amusing. Would I get sued for that?

    What's the go with /Msgs/Default.aspx?MessageID=999 ??

    John.

  • Channel 9 needs

    I'm not interested in T-shirts.

    John.

  • Don Box's Spoutlet

    DiegoV wrote:
    By the way, I liked my musings so much I will publish them on my own blog. Next time we can discuss why the only valid way to asses ones right to be arrogant is thru extensive external feedback. We can also analyze the concept of "relative stupidity" and why I should never post anything past midninght.


    Cool. I'll check it out.

    DiegoV wrote:
    P.S.: Who is gonna tell Don Box his comments feed is here?


    Bags not me! He might come over here and tear me to shreds with scathing comments! Smiley

    John.

  • Show us your workspace

    Gabba wrote:
    Do you think you can find some pics? How was it set up?


    There is only one photo that I know of that I have of it. Which is a shame. I have no idea where that photo is, but assuming it hasn't been lost it'll be at my parents place somewhere, which isn't anywhere near where I am right now..

    Unfortnately, I had a bulky 17" CRT that I needed to install. I had removed the dashboard, etc. and installed my own framework. I had a plank where the gear stick used to be which is where my mouse was, and I had a wooden framework where my keyboard sat (where the glove box used to be) inclined towards me. I had punched out the front window, and angle grinded off the bonnet and built a housing for my computer in there, with an area for my monitor to sit above it. I used old cardboard boxes (fridge boxes) to seal off the area infront of the car and above the windscreen, so the front looked kind of boxy and awkward as a result, but I painted it, so it still looked cool.

    For the subsonic attentuator I just got an old 'game backpack' from the bargain big at Jaycar (they were a bad idea, they were supposed to make the games more 'exciting' but all they really did was ruin your back, they came out price at $300, but I got one for $10 when everyone realised that they sucked) and I ripped out the driver (basically it was similar to a normal speaker). I drilled four holes in it around the edges, got some sturdy bolts and bolted it to the bottom of the car, immediately under the front passenger seat. It bought new meaning to the word 'bass'. Heh, heh. Smiley Basically because it was so firmly attached to the car body, when it hammered the entire car shook. I went to great lengths to make sure that everything was a 'sturdy' as I could make it, to avoid crappy fuzzy noises that you can get as a result of low frequency sounds (like rattling windows, etc.). The shot-gun in Quake II was the worst, if I picked up one of those in a game my entire neighborhood knew about it. Big Smile

    I just had the four tires from the car laid sideways on the ground and sat the entire car body on that. This was good too, because it sat on 'solid rubber' which meant it could shake properly, without vibrating too much. Because everything was sealed and painted black (inlucding the windows), it was always pitch-black in there except for the glow of the monitor (so it didn't matter if it was day or night or whatever).

    It was pretty cool. I used to pretty much live in there. It was really comfortable too, because car seats are basically designed well, and you can really *recline* in them. Definitely the best 'work space' I've ever had. It wasn't very portable though. I used to live in the garage, so it was basically 'in my bedroom' as it were. (oh, and I had a drum kit too, no pool table though! I used to collect old gaming consoles, I think I had, um, all of them? Smiley

    John.

  • Show us your workspace

    Gabba wrote:
    The company runs from my Garage, we have a pool table, a drum kit, a bitchin mp3 server/player, lots of games and we somehow manage to do some work occaisionally.


    That's cool. Smiley

    When I was in high-school I got a broken down Dihatsu Charade that I had to tow to my house. I ripped everything out except the front passenger seat (that's on the left in my country) and sat it on its old tires. I installed all my computers and sound system in there (quite a few, my PII, an old Amiga, a really old IBM-JX, a TV, etc.). The grand-daddy of them all was the subsonic attenuator that I bolted to the bottom of the car, so when I got hit with a rocket in Quake II I *really* knew about it.

    Oh, and I painted it black, including the windows, and spray painted 'The Machine' over the side doors in high-gloss red paint (that dripped a little to look extra intimidating). Most awesome car EVER!

    If only I could find a picture..

    John.

  • Show us your workspace

    My web-cam sux for taking good pictures, but here is where I spend my days (and nights) working (ok, ok, blogging and working on my caffeine addiction) with my sh1t keyboard. When I'm tired I sleep.

    John.