Scott Hanselman

DevConnections and PNPSummit MVC Demos Source Code

November 9, '07 Comments [23] Posted in ASP.NET | Source Code | Speaking
Sponsored By

110207_2058_AnnouncingT1 Folks are chomping champing at the bits to get their hands on the MVC bits. There will be a CTP very soon, so hang in there and be patient. Bits will come as soon as possible, truly.

Until then, I talked to BradA and got permission to share with you the source code of all the demos that Phil, Chris, myself and others worked on and showed at the two conferences minus all DLLs.

<disclaimer>
To be clear, these demos are demos. They were put together for the talks. You won't be able to compile or run them, and they don't represent anything other than interesting proofs of concept for the purpose of demo'ing. They are useless for anything other than reading. If they kill your flowers, it's no one's fault but your own. Read at your own risk and for your own edification. These demos don't represent the final product, nor do they even represent anything other than being an interesting curiosity. Everything can and will change and likely already has.
</disclaimer>

Here they are:

Enjoy. Also, as an aside, I encourage you to go get the new ".NET Framework 3.5 Commonly Used Types and Namespaces" poster and find a printer large enough to print it out.

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

That Sinking Feeling and Repairing a Corrupt WAV File

November 9, '07 Comments [15] Posted in Podcast | Tools
Sponsored By

I've been up on campus talking at the PNPSummit and in my spare time recording podcasts with interesting people. A particularly cool show that'll be coming up very soon ran pretty long, and filled up my 1 gig CF Card. I had to transfer that now "part 1" off that disk and keep recording "part 2." My editor Lawrence will then stitch the two files together and make the transition sound natural.

I uploaded the two parts and went along with my day. However, I got a call from the guys saying that the file wouldn't open and that it might be corrupt. Yikes. This has happened before, but it's usually just a transmission error. I opened the original file and....crap!

Windows Media Player

It won't open. Hm. Well, I figured that some WAV file programs are more strict than others. Perhaps I could open it in another program.

Well, shoot. It's not opening in any programs. That's not cool. I tried WAV Saver and while I see on the net that lots of folks have had success with it, for me it crashed as I clicked repair. Apparently my file was messed up in a special way.

As I Googled around for answers and the program "GoldWave" kept coming up. It's apparently very well thought of.

When I dragged the corrupt file into GoldWave I got this friendly dialog:

File Format

This is cool because here I can get to the RAW PCM data. I just needed to tell the system what the original recording was in. Since we're on Intel, we're little endian. The recording was in stereo, at 44.1kHz and was 24-bit. Also, anything over 12-bit is usually signed. So, I'm feeling good at this point. However:

GoldWave - [mel sampat part 2 - ORIGINAL.wav]

...I ended up with a screen full of white noise. Bummer. At this point, I'm getting close to giving up. Then, on a whim, I remembered that you can click the tiny down arrow next to the Open button in the Visual Studio Open File Dialog.

image

I selected Binary Editor and got this:

mel sampat part 2 - ORIGINAL.wav - Microsoft Visual Studio

Now, I'm not an expert on the WAV file format, but I understand it's just a header and some RAW PCM data. It's supposed to be pretty simple, but ALL ZEROS is simpler than even I expected. :)

So, I opened up Part 1, the valid WAV file, and looked at its header. Then I selected it on a word boundary (guessing) and copied it to the clipboard. Then I flipped over to the broken WAV and pasted in the first 48 bytes of the header of the working file, up to and including the "data" chunk.

mel sampat part 1.wav - Microsoft Visual Studio (2)

Then, I saved the file with a new name and opened it in GoldWave.

GoldWave

Amazing, it worked! Notice the correct WAV format listed in the status bar. This trick worked, because I stole the WAV Header from a file that was encoded in the identical way. It wouldn't have worked with different files. There was a small warning from GoldWave that the header's length differed from reality, but this was fixed by File|Save As with a new filename.

Miracle of miracles. I thought the show was ruined. This technique was lucky because apparently only the header was missing and I had a header available with the same format. I hope this helps someone with the same problem.

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

DevConnections - The ASP.NET MVC Framework

November 8, '07 Comments [19] Posted in ASP.NET | ASP.NET MVC | Programming | Speaking
Sponsored By

imageThe work on the ASP.NET MVC Framework continues.

Phil's been playing with RhinoMocks writing tests for his MVC Samples, and Chris Tavares has his samples using Castle Windsor running as his Inversion of Control Container.

Eilon Lipton, the primary developer on the MVC project, and I presented at DevConnections yesterday. In fact, he and I did three presentations together in one day, which may have been a mistake. ;)

Anyway, I think Eilon and I worked pretty well as a team on stage. We wanted to get the point across. What's the point? This is not Web Forms 4.0.

I used the example of a Car vs. a Motorcycle. Both are two ways to get from Point A to Point B with their own advantages and drawbacks. The inclusion of this framework within System.Web is about offering alternatives. It will be a fully supported, fundamental part of the System.Web and isn't going anywhere.

It's also very extensible. We showed demos with Castle Windsor, RhinoMocks, as well as crazier samples like the DLR under MVC and running XML-RPC over MVC to try out an idea that Phil and I could get Windows Live Writer talking to MVC ala REST.

One important point I kept stressing in the talk was that this is designed to be compatible with the ASP.NET subsystems you already use. That means Session, Cache, Personalization, Roles, Membership, etc, still work and are there to be used and abused. This framework, in the namespace System.Web.Mvc, is an alternate architecture, but not "an entirely new parallel ASP.NET," no more than any of the other home-grown or open source MVC/MVP frameworks that are out there.

Here's a link to Eilon and my slides from DevConnections. If you don't have Office 2007, grab the Compatibility Pack for Office XP, 2000 or 2003 and you'll be able to open them. I'll record a screencast of the talk perhaps next week. There should be some public bits to play with in December sometime.

I'm going to give a very similar presentation at the PNP Summit today at 8:30am. ScottGu has had to cancel his keynote at the PNP Summit, so my MVC Framework talk will replace that. I'll also be presenting on Friday at 8:30am (the "ending" keynote) on "Community: my first 8 weeks inside the Big Blue Monster" so more on that talk soon.

Also, as a reminder, don't forget to come by the Nerd Dinner tonight at 6:30pm! Here's some links to help you remember and add this to your calendar:

Enjoy!

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 87 - Planning, Placing and Building a House with Google Earth and SketchUp

November 3, '07 Comments [0] Posted in Musings | Podcast
Sponsored By

My eighty-seventh podcast is up. I'm all alone this week, talking about planning the house me and my wife built. We used Google Earth to visualize the lot, placing a lot and neighborhood plan in 3D space. Then, working with our agent, we modeled the architectural plans in Google SketchUp and placed the model in Google Earth.

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

If you have trouble downloading, or your download is slow, do try the torrent with µtorrent or another BitTorrent Downloader.

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Check out their UI Suite of controls for ASP.NET. It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support while some vendors have zero support, or don't bother testing. They also are committed to XHTML compliance and publish their roadmap. It's nice when your controls vendor is very transparent.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

How To: Use Google Earth and SketchItUp to Visualize a New House Lot - Part 2

November 2, '07 Comments [10] Posted in Musings | Tools
Sponsored By

A while back I posted on How To: Use Google Earth or Virtual Earth to Visualize a New House Lot - Part 1. We took a PDF that the builder gave us of a house lot, made it transparent, sized it and overlaid it on the empty lot we found on Google Earth and then even better Helicopter Flyover imagery we found on Virtual Earth.

(Disclosure: This is an example location. It's not where we moved.)

The next step, of course, was to work with the builder and design the house. Ordinarily one works with an architect, and we had one, but we also took the basic 2D PDF plans and used them as an overlay in Google SketchIt Up and "traced them" in 3D.

I taught our Real Estate Agent how to use SketchItUp in a few sessions and he went nuts - in the very best way. Turns out he has a knack for these things and we work well together.

First, he modeled the house, floor by floor as seen below, including the roof.

190-1

Then he assembled the house by snapping the floors together. Here's cut-out view with the house cut in half diorama style next to the house in X-ray style.

hanselman animations 190

Next, I textured the house with our paint colors, cedar shake and exterior choices, etc.

190-2   

Fast forward and now the house is finished. It finished this week actually and we're moving in slowly over the next month.

Just to prove that this was a useful exercise, here's the virtual house exported and placed in Google Earth on the actual lot, next to a picture of the real house in the same orientation, Notice the big hill behind us in both the Google Earth and in Reality. The circular shape on the ground in the Google Earth shot became our cul-de-sac.

reality model

This wasn't very hard to do, and just required in total about two days of amateur 3D modeling by the agent (who was having a blast) along with two hours of modeling by me and two hours of texture mapping and placement by me. This helped Mo and I visualize what our big empty lot would look like, what our paints, floors and carpets would look like. I'm sure if we knew what we were doing as far as 3D is concerned it'd be even better. We didn't even scratch the surface with the potential textures, furniture, etc that we could have done.

Tools used:

Enjoy!

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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

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