Scott Hanselman

The Woe: The ASP.NET Designer has screwed me again! (All my HTML and stuff is changed)

January 19, 2005 Comment on this post [1] Posted in ASP.NET | Bugs
Sponsored By

Matthew Adams calls it "The Woe" and has six great tips to help you work around it.  Here's his great description:

You have been happily working in the designer, laying out controls, binding in bits of logic, switching between the code view and the designer view, building, debugging. Then, all of a sudden, half your controls disappear, and/or some move to the top left, and/or all your embedded resources (images in particular) vanish without trace... Control-Z doesn't seem to work quite right... The black gloom of despair fogs the monitor, and you're forced to go and get a really strong cup of coffee. Before you start again.

Some folks see this all the time, others not often at all. Word is, this will be a thing of the past once ASP.NET 2.0 ships, but most of us will be dealing with ASP.NET 1.x for at least the next two years, if not longer.

Here is a summary of his six tips and you can get the complete commentary in his post "What has the designer done now?

Tip 1 - If you have a saved, corrupted file and are trying to recover from the woe, clean up the orphaned fields so that you can reuse the names.
Tip 2 - Always do a complete solution build before attempting to open any designers.
Tip 3 - Always close all of the designer windows before closing the solution.
Tip 4 - Close all designer windows before doing a build.
Tip 5 - In Case of Woe, Don't Panic. Don't press save. Don't press undo. Just close the designer window (and any applicable code windows) and say "no - I don't want to save the changes".
Tip 6 - Remove the references to the assemblies that contain the controls that vanished, and add them back again.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Reflections on turning 0x1F

January 19, 2005 Comment on this post [15] Posted in Musings | Tools
Sponsored By

I turn 0x1F* on Saturday which puts me with one foot squarely in the grave. There's no mistaking it, I'm old. I haven't been this old since I turned 0x1E, nearly a year ago.

I'm officially Sir now. I haven't been "dude"-ed at Blockbuster in at least five years, and the way the kid behind the counter looked at me when I asked for "The Breakfast Club" is still burned into my retina. You'd have thought I was asking for a silent film or something.

I went to Red Robin yesterday, a place I've been happily carded for years, but this time my receding hairline and advancing pooch caused the young greeter to immediately offer me a seat at the bar. I suspect he was right on the edge of helping me to the senior section until I shot a stern old-guy look at him.

I'm pulling gray hairs out of my once Magnum-PI-quality moustache. I'm wondering if I need more fiber in my diet. I'm disappointed when Law & Order is a repeat. I Tivo Oprah. I've said "these young punks" while at the mall. I wonder how parents let their daughters out of the house with their butts hanging out while simultaneously wondering where these chicks were when I was in High School. I watched Napoleon Dynamite with the wife recently and explained (in about 20 minutes) all the different sub-classes of Geek (Dork, Dweeb, Spazz, Stoner, Theater Geek, Computer Nerd, etc) and my standing in the genus. I played Bard's Tale on my C64 emulator recently and wonder why the graphics weren't as good as I remember them being. I started with 128kb and now have 2gig. My watch has more CPU power than my own failing mind.

Yep, it's a milestone, with 0x28 not far beyond, and beyond that, death.

On a related note, this Friday, I will be completely and totally prepared to enter High School.  I think I have the tools and emotional maturity now.

* That's 31 in Hex, just an FYI for my cousin Jack, who scored a 13 on the recent Nerd Test. He's "balanced" and goes "outside" and "gets involved with his community." Sheesh.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

newtelligence dasBlog Community Edition 1.7.5016.1 RELEASED!

January 19, 2005 Comment on this post [13] Posted in ASP.NET | DasBlog | Bugs
Sponsored By

dasblog-logo-200.jpgIt's been a long time since 1.6, but Omar, myself, and the dasBlogCE team are proud to announce availabilty of newtelligence dasBlog Community Edition 1.7.5016.1.  Thanks to Chris Anderson for starting it all with BlogX and thanks to Clemens for rewriting it all :) with the 1.6 codebase, and his support of the move to SourceForge. 

As you've probably heard, dasBlogCE 1.7 has dozens of new features and some major performance enhancements. DasBlog-run blogs have previously survived several SlashDotting's

Starting with 1.7, dasBlog is now newtelligence dasBlog Community Edition and has a rich Version History.

Some related links:

Feel free to donate to support DasBlog if it makes you happy. Any $ will go to pay for bandwidth on various dasBlogCE supporting websites. I can guarantee I won't buy beer with it, but I may buy Diet Rite.

 

UPDATE: Not all the mirrors have dasBlog yet, but you can get the bits here (NOTE: cut and paste, the clickthrough won't work. Make sure you're getitng 1.7.5016.1.)
http://osdn.dl.sourceforge.net/sourceforge/dasblogce/dasBlog_1.7_Web_Files.zip

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Why you can't Double.Parse(Double.MaxValue.ToString()) or System.OverloadExceptions when using Double.Parse

January 18, 2005 Comment on this post [4] Posted in Web Services | XML
Sponsored By

This was an interesting one. A fellow here was returning double.MaxValue in an XML element and was seeing:

System.InvalidOperationException : There is an error in XML document (1, 539).----> System.OverflowException : Value was either too large or too small for a Double.

It seems that while he was sending out Double.MaxValue the system was unable to use Double.Parse() on it. In other words, he wasn't able to "roundtrip" his value, like Double.Parse(Double.MaxValue.ToString()).

The problem stems from there being no 1:1 representation between decimal and floating point numbers. For example, how do you express 2/3? Do you say 0.6666666667? You've rounded up. You can't say 0.66666 with that little bar on the top. So, you either have to round up (creating data) or limit the digits (losing data). 

//This will throw a System.OverflowException…
double d1 = double.Parse( "1.79769313486232E+308" );

Change the last digit:

double d2 = double.Parse( "1.79769313486231E+308" );
//This will work.

A few interesting articles I found referenced in Google Groups:

INFO: Precision and Accuracy in Floating-Point Calculations: Q125056
INFO: IEEE Floating-Point Representation and MS Languages: Q36068

Semi-Conclusion

Using Edge Cases as Magic Numbers is more evil than using Magic Numbers

Quasi-Conclusion

However, you can use Double.MaxValue.ToString("R") to prefer roundtrips over precision. From the MSDN Help:

The round-trip specifier guarantees that a numeric value converted to a string will be parsed back into the same numeric value. When a numeric value is formatted using this specifier, it is first tested using the general format, with 15 spaces of precision for a Double and 7 spaces of precision for a Single. If the value is successfully parsed back to the same numeric value, it is formatted using the general format specifier. However, if the value is not successfully parsed back to the same numeric value, then the value is formatted using 17 digits of precision for a Double and 9 digits of precision for a Single. Although a precision specifier can be appended to the round-trip format specifier, it is ignored. Round trips are given precedence over precision when using this specifier. This format is supported by floating-point types only.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Another dasBlog Slashdot, this time Greg Hughes' CopsOnTop Charity...audioblogging in Kilimanjaro

January 17, 2005 Comment on this post [4] Posted in DasBlog | Diabetes
Sponsored By

Any moment now, the blog that Greg Hughes setup for CopsOnTop is going to get Slashdotted. I was chatting with Greg, and he was telling me how cool it is that the cops are climbing Kilimanjaro as a memorial to a fallen officer. They are blogging via Satellite Telephone to AudioBlog.com and the posts are being posted to their Climbing Blog (running dasBlog 1.6). I was just submitting the story to get him some traffic. I didn't think it'd be accepted within 4 minutes of posting it! Greg didn't have time to upgrade to dasBlog 1.7 (RC this week) so we'll see what happens.

GlucoPilot writes "Apparently a charity called Cops On Top" is climbing Kilimanjaro as a memorial to the late Officer Isaac Espinoza of the SFPD. That in itself is pretty amazing, but the ./ amazing thing is that they are AudioBlogging the whole thing via Satellite Phone by calling to an audioblogging site and having their MP3s automatically posted to their dasBlog (open source blogging system) at http://www.copsontop.com/climblog. Cool stuff. Their latest blog post is at 15,500 ft."

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.