Scott Hanselman

IPrincipal (User) ModelBinder in ASP.NET MVC for easier testing

February 6, '09 Comments [17] Posted in ASP.NET | ASP.NET MVC
Sponsored By

ModelBinders are great. I've blogged a bit about them before like the File Upload Model Binder.

I am working on some code like this:

[Authorize]
public ActionResult Edit(int id) {

Dinner dinner = dinnerRepository.FindDinner(id);

if (dinner.HostedBy != User.Identity.Name)
return View("InvalidOwner");

var viewModel = new DinnerFormViewModel {
Dinner = dinner,
Countries = new SelectList(PhoneValidator.Countries, dinner.Country)
};

return View(viewModel);
}

It's pretty straight forward, but this Controller knows too much. It's reaching into implicit parameters. The id was passed in, but the User is actually a property of the Controller base class and ultimately requires an HttpContext. Having this method "know" about the User object, and worse yet, having the User object go reaching into HttpContext.Current makes this hard to test.

I'd like to have the convenience of passing in the User (actually an IPrincipal interface) when I want to test, but when I'm running the app, I'd like to have the IPrincipal get passed into my method automatically. Enter the Model Binder. I need to teach ASP.NET MVC what to do when it sees a type as a parameter.

This quickie model binder is now responsible for one thing - it knows how to reach down into the HttpContext and get the current User (IPrincipal). It has one single responsibility.

public class IPrincipalModelBinder : IModelBinder
{
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
if (controllerContext == null) {
throw new ArgumentNullException("controllerContext");
}
if (bindingContext == null) {
throw new ArgumentNullException("bindingContext");
}
IPrincipal p = controllerContext.HttpContext.User;
return p;
}
}

Now I can release the Controller from the emotional baggage of knowing too much about the User object. It can just have that passed in automatically by the framework. I just need to register the binder to tell folks about it. I can either do it on a one-off basis and put an attribute on this one method parameter:

public ActionResult Edit(int id,                        
[ModelBinder(typeof(IPrincipalModelBinder))]
IPrincipal user)
{...}

But even better, I can just tell the whole application once in the global.asax:

void Application_Start() {
RegisterRoutes(RouteTable.Routes); //unrelated, don't sweat this line.
ModelBinders.Binders[typeof(IPrincipal)] = new IPrincipalModelBinder();
}

Now that ASP.NET MVC knows what to do when it see an IPrincipal as a method parameter, my method gets nicer.

[Authorize]
public ActionResult Edit(int id, IPrincipal user) {

Dinner dinner = dinnerRepository.FindDinner(id);

if (dinner.HostedBy != user.Identity.Name)
return View("InvalidOwner");

var viewModel = new DinnerFormViewModel {
Dinner = dinner,
Countries = new SelectList(PhoneValidator.Countries, dinner.Country)
};

return View(viewModel);
}

Now I can test my controller more easily by passing in fake users. No need for mocking in this case!

[TestMethod]
public void EditAllowsUsersToEditDinnersTheyOwn()
{
// Arrange
DinnersController controller = new DinnersController(new TestDinnerRespository());

// Act
IPrincipal FakeUser = new GenericPrincipal(new GenericIdentity("Scott","Forms"),null);
ViewResult result = controller.Edit(4, FakeUser) as ViewResult;

// Yada yada yada assert etc etc etc
Assert.IsTrue(result.ViewName != "InvalidOwner");
}

Fun stuff.

UPDATE: Phil had an interesting idea. He said, why not make method overloads, one for testing and one for without. I can see how this might be controversial, but it's very pragmatic.

[Authorize]
public ActionResult Edit(int id)
{
return Edit(id, User); //This one uses HttpContext
}

You'd use this one as before at runtime, and call the overload that takes the IPrincipal explicitly for testing.

Yes, I realize I could use an IoC container for this also.

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 Twitter - First Steps and a Twitter Glossary

February 5, '09 Comments [22] Posted in Musings
Sponsored By

tour_1UPDATE: Want more advanced Twitter Tips?
We're having loads of fun over on Twitter. I've blogged about it before and how it's a conversation starter, a message bus, a subject tagger and conference organizer and a link sharing service. It's a river of uselessfulness and truthiness. It's a permanent cocktail party where you know some folks, and don't know others. Some are famous, some are your friends. There's a the constant background of overheard conversations, except on Twitter, it's socially acceptable, nay, encouraged, to jump in. No need to say, "oh, I couldn't help but overheard, excuse me but..."

A Twitter Glossary

UPDATE: Readers point out there's also a very good "Twictionary" that's much more complete at http://twictionary.pbwiki.com/ so check it out also!

Tweet

When you say something on twitter, it has to be under 140 characters. That's a hard limit. What you say is called a tweet. It's a noun and a verb. "Oh, I saw this tweet..." and "He was tweeting all day."

Alternatively, some folks say "twittered" as in "I am twittering" and "I sent a twitter." I would say this is not typical.

Twitter is permanent (so far) so every tweet has a permalink. That means that every single tweet you put out there is now something that can be linked to, for example, this one: http://twitter.com/shanselman/status/1178002576. This immediately makes twitter different from IRC or other chat systems. That tweet is public and it's out there and it's web searchable.

I have always said, don't give bile a permalink. If you're a jerk on Twitter (and you care) it's in the record. Tweet positively.

Twoosh

A twoosh is a tweet that is exactly 140 characters, no more no less. You've maximized the size of your tweet. Some folks believe this is a sign of skill. You'll tweet and learn that it's usually luck.

Tweeple

People on Twitter. 'Nuff said.

Tweetup

When Tweeple meet in person.

Twitter Client

While you can read tweets and tweet yourself at http://www.twitter.com and http://m.twitter.com on your phone, most folks use a Twitter Client that talks to the Twitter API. Just like you can read your email on the web, but many folks use an email client.

There's lots of them...here's the top 100 twitter clients.

Me, I like:

  • Windows Mobile - Tiny Twitter - fast and small and basic.
  • iPhone - TwitterFon - simple and clean, lets you do everything you can on the web and more.
  • Power User - TweetDeck - powerful as it lets you have multiple columns for search terms you want to monitor.
  • Most Pretty (Vista) - Chirp - Missing some functionality, but it's gorgeous.
  • .NET Educational - Witty - A free open source client for XP and Vista written in WPF

I use TweetDeck the most.

Followers and Following

When you "follow" someone, you are saying you want them to appear in your "timeline" of friends. I follow something like 500 people. It's like subscribing to a blog you're interested in. However, I have more than 500 people following me...but (here's the important part) I don't need to follow everyone back.

If you follow everyone and keep some 1:1 ratio between who you follow and who follows you, that will render your main timeline useless. Follow who is interesting to you, but make sure you can see the @replies from folks you don't follow. This leads me to:

@replies

When you want to reply to someone, you hit the little reply arrow in your client or on the web. The client will insert that users name with an @ sign, like @shanselman. It will also populate some hidden metadata indicating which tweet you were replying to. It's helpful to reply to specific tweets as it makes the conversation easier to follow later. Often newbies reply to the most recent tweet, but then make reference to tweets from days before.

For maximum social-ness, the first setting you should change when you sign up for Twitter is your @replies setting. Set it to show replies from anyone rather than just the replies from people you follow. Otherwise you'll miss out on a lot of the conversation.

I can see your replies even if I don't follow you. You don't need permission from me or anyone to reply and jump into a conversation.

Search.Twitter.com

If you want to watch the replies for a Twitter user that is not you, you can use http://search.twitter.com or a new column in TweetDeck. For example, here's me: http://search.twitter.com/search?q=shanselman. By searching for the string "shanselman" you can see both replies as well as mentions, like http://search.twitter.com/search?q=hanselman. Often new folks try to reply but mention your name rather than correctly using the @shanselman syntax.

You can also subscribe to an RSS feed for search.twitter.com queries. But it's not just for ego-surfing. I also watch for diabetes and asp.net. You get the idea.

Retweet or RT

When you see a tweet you really like, you can "retweet" it. Usually newbies will over-retweet, so watch for that.

The idea is that if @foo has 100 followers and @bar has 100 different followers and @foo retweets @bar's tweet, the idea is magnified, and may go viral.

If you care, there are tools to measure and track retweets. I don't care. I'm in it for the conversation and the sharing. If something strikes you as awesome, retweet it. Many Twitter clients have a "retweet" button now that will do this for you.

Twitter #Hashcodes

Sometimes you'll see a tweet like

Having fun at #mix09

or

bill gates mosquitoes / unleashed on #ted audience / where is the 'green' deet #haiku

The hashcode is an informal way to "tag" something to a category or categories. For example, the second tweet there refers to both the Ted conference and marks the tweet as a Haiku. (Haiku on Twitter are called "Twaiku" but that's pretty geeky. ;)

Hashcodes can help you be social at a conference like #oscon or #mix09 but they can also create informal "chat rooms" like for the show #lost or to find folks that share a common interest like:

any #women out there who are #runners? Trying to get some more ideas for my blog.

When I got to a conference I always ask around for the conference hashcode, then create a search so I can find out where folks are hanging out. It really enhances the experience.

Tiny URLs

image Since you've only got 140 characters for a Tweet, it's really important that you not share large URLs. Nearly everyone on Twitter will use a URL shrinking service like http://bit.ly or http://is.gd or http://tinyurl.com. Funny, TinyUrl is positively HUGE!

Make sure your client will automatically shrink URLs. Most do.

Sharing Pictures with TwitPic

There are a lot of services that "orbit" Twitter. They aren't Twitter, and they usually aren't affiliated with Twitter, but they enhance the service, like the tiny URL makers above.

One of these services is TwitPic. It has an API that lets you attach a photo from your client, then it'll include a tiny link to that photo. Some clients can even extract the photo seamlessly. British entertainer Stephen Fry used Twitter and Twitpic and a mobile phone recently to tweet his way to safety whilst trapped in an elevator, er, lift.

Direct Messages

These are exactly what they sound like - private tweets between two people. The only trick here is that you can only "DM" people who follow you.

Integration with Facebook and other Social Sites

Facebook has "Status Updates" and my friends think I update my status all the time. In fact, there's a Twitter Facebook application that you can add to your Facebook Profile so that your Facebook Status is updated with your Tweets.

I find this to be fun as it allows topics to fire up inside Facebook and lets folks who aren't on Twitter get in on the conversation. Other social sites like FriendFeed and Live.com have similar features.

Overwhelmed?

Most people try out twitter, follow a few people, tweet some, get confused or bored and never come back. Totally understandable, as it's all a big secret handshake.

Here's what I suggest.

  1. Sign up
  2. Pick a Twitter Client (see list above)
    • Don't set the client to bother you (sound, notify, etc) every time something happens. You'll go nuts. I set mine to notify on replies only. I check the "river of tweets" whenever I feel like it. It's an interrupt, remember. You'll never keep up with all the tweets. You'll never have fun if you try to drink from the firehose, so don't. When it bothers you, shut it down. When there's a fun topic happening, jump in.
  3. Pick at LEAST 20 people or more to follow.
    • Mix it up. Follow people in all of the things you're interested in. For example, don't just follow programmers, or famous people, or news sites.
      I've seen folks follow just a few people, then get frustrated because they feel one person is dominating their "tweetstream." If you follow just me and @codinghorror, you'll immediately hate us both because it'll seem like we tweet all day. (I don't, honest) If you have enough people, it'll seem more like a cocktail party with lots of folks talking, as opposed to a lecture by two obnoxious dudes.
    • There are many famous people on twitter but there's also lots of useful bots and news services. For example, @cnn, and @npr, but also companies with Twitter specific discounts like @DellOutlet.
      Another example: I wrote a Twitter-bot that posts funny things that my 3 year old says (or yours!) and cute things that are OverheardAtHome using the totally automated Twitter name @overheardathome.
  4. Watch for other interesting people to follow.
    • If someone you follow seems be having a conversation with someone you aren't following, why not use the "Follow" feature of your client to listen to that new person. You can always unfollow them.
  5. Tweet smartly.

Have fun! See you on Twitter. I'm @shanselman.

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

Technical Presentations: Be Prepared for Absolute Chaos

February 4, '09 Comments [18] Posted in Musings
Sponsored By

This is kind of random, but yesterday was such a surreal day I had to share it with someone, and today, that someone is you, Dear Reader.

I do a lot of stand up comedy technical presentations, and have now for over ten years, so there's a number of things I've become pretty comfortable with. I'm usually pretty prepared and I've written a few posts with presentation tips. Here's the outline of my favorite tips:

  1. Have a Reset Strategy (One-Click)
  2. Know Your Affectations (Ssssssseriously)
  3. Know When To Move and When To Not Move (Red light!)
  4. For the Love of All That Is Holy, FONT SIZE, People (See that?)
  5. Speak their Language (Know the Audience)
  6. Be Utterly Prepared (No excuses)
  7. CONTENT, CONTENT, CONTENT (Have some)
  8. System Setup (Be unique, but don't be nuts)
  9. Speaking (Um…)
  10. Advancing Slides (No lasers!)
  11. Care (deeply)

But this post isn't about tips. This about panic, chaos, and miracles. ;)

The Setup

Yesterday I was in Seattle for TechReady8. It's an internal Microsoft conference, only for employees. It's like TechEd and Mix and PDC all rolled into one, meant to prepare the field for the coming year. It's full of stuff that I can't tell you or I'd have to kill you (not really). Folks fly in from all over the world and have a week of training and talks from Product Groups. It's not just developers, of course, there's piles of IT folks, mobile, etc.

DevDiv (Developer Division, where I work) is one "Track" of the larger conference. The owner is our Services CTO, Norm Judah, who you might remember from last year's podcast. (That was the same conference I met and interviewed physicist Michio Kaku.)

A month ago, my partner in crime, Chuck Sterling, and I were told I was to give the Dev Track Keynote. Chuck was my ghost writer and concierge, helping me with timing, demos, coordination, and a pile of other behind-the-music type stuff. We imagined a pretty complex talk, and it eventually ballooned into something we called an "Unkeynote." We decided it would go against basically all the rules (read: marketing) and we'd go crazy.

Fast forward a few weeks and we'd put together a 75 minute talk (which isn't a lot of time, it turns out) with myself hosting and five other speakers. Each would get 10 minutes to blow me away with a demo. I can't tell you all the details as much of it was internal stuff (that you'll eventually hear about later this year) but this was the general idea with some context as to the hardware, software and setup we needed. Remember, each one got 10 minutes.

Presenters and Hardware

  • Brad Abrams - "Something Crazy with Silverlight"
    • His laptop, running a daily Windows 7 build
  • Lauren Cooney/Darth Vader - "/web"
    • My laptop, running yesterday's Windows 7 build
  • Chris Dias - "Unbelievable Visual Studio Addin"
    • His laptop, running Vista and a daily of Visual Studio 10
  • James Whittaker - "Worlds Wackiest Error Messages"
    • A Hyper-V machine and daily build of a VM with VSTS
  • Stephen Toub - "891 Billion Monkeys, in parallel"
    • A quad-proc laptop and a 24-proc (yes, 24) Windows 2008 Server

All this was setup on the table on stage, along with my Dell Mini 9 that had one purpose - it ran the timer that comes with ZoomIt. It had a full screen display counting down from 10 minutes. I reset it after each speaker came up.

This was a lot of hardware running a lot of beta software. We had no "backup machines," it just wasn't feasible. We started setting up...

Rehearsal

It was a miracle these folks agreed to help me, so that was cool. We all showed up at 8am for rehearsal. The talk was at 10:30. However, there are always catches and crazy stuff when you're putting together a parade of technology like this.

Here's some of the stuff that happened in the few hours before the talk:

  • JamesW had never seen the demo. He'd literally just gotten off a plane from a week in Hawaii. We went over his demo 15 minutes before the talk.
  • My laptop blue screened in the display driver an hour before the talk, causing me to not trust it for anything. It didn't BSOD in the talk, though, which was a blessing. That's what I get for running dailies. ;)
  • Neither Brad nor Stephen could get their laptops to recognize the projector and flip their displays. Stephen had the balls to install a beta ATI driver 45 minutes before the talk and it worked. We just about had heart attacks collectively when we saw him start installing it.
  • I was told by the organizers that I HAD to run the PowerPoint on their computer, not my laptop. I'd included an audio file and a movie within my PowerPoint using "Insert Video", etc. When I advanced to a slide, the movie automatically played in the slide. However, when I copied the PowerPoint file over I forgot the movie file (it was a link, rather than an embedded movie), so that didn't work initially. Then I moved the movie file over, but it wouldn't play. The main presentation machine didn't have the video codec I needed! Rather than try to find the right codec, I literally trans-encoded my video file to Windows Media on my laptop and copied the new file over. But it still wouldn't play! (Keep in mind this is like 9:30am and we're on in an hour, and I'm messing with videos of dancing hamsters.) Well, it seems that if you have an embedded video in PowerPoint and you advance to that slide but you've never run Windows Media Player at least once to go their initial setup process, you get a black square where you video should be. Don't ask me how I knew this, I just knew it in my gut. Since they'd just built this machine from an image, somehow I knew they hadn't run Windows Media at least once.
  • The network went down. Not the network on the laptop, or the hub for the stage, but the WHOLE FLOOR. And it was down for an hour. This sucked because two of the demos required RAS (internal) access back to the Redmond Campus to work.

Then...

imageYour Presentation Has Been Deleted

See that picture on the right? That says "Chuck Sterling deleted file...at 7:49am." That's the PowerPoint that Chuck and I worked on until late the night before. That time is 10 minutes before rehearsal. Live Mesh is telling me Chuck deleted our presentation 10 minutes ago and now it's been deleted from my computer as well.

We'd been collaborating on this presentation for weeks in the Mesh. I hooked up my computer on stage, opened the presentation folder and the file was gone.

I checked this log and turned to Chuck:

"Um, you deleted the presentation?"

"Um, no?"

"Um, YA!"

"I seriously didn't."

"This program disagrees with you, Chuck. Where's the presentation?"

(I can only assume I thought Chuck was holding it hostage or hiding it somewhere in his pants at this point.)

"I just copied it to the desktop."

"You dragged it with your mouse?"

"Duh!"

"Dude, that's a move, not a copy."

"No, it's a copy when you drag between drives."

"But the folder is on your desktop, where did you drag it to?"

"Um, my desktop."

"And....MOVE. Can you put it back? Pretty Please?"

Yes, it was pretty freaking tense, this exchange, let's just say. Of course, when you're using File Synchronization technology like we were using and we were both Administrators (as opposed to read-only Reviewer) you can get into trouble. Chuck innocently moved the file into the folder required for the conference techs, and the deleted was sync'ed to my machine over the Mesh. We were panicked, to say the least.

Still, Crisis #13 averted.

Something Always Goes Wrong on Stage

Turned out that while trying to debug the network problem during rehearsal the network admins in the room had unplugged some cables and moved things around. Someone ended up plugging the network cable that ran from Chris Dias' laptop into another computer. Rather than from computer to hub, it was computer to computer, knocking both off the network. We didn't discover this until Chris came up on stage.

It didn't take long to notice the big red X over his network connection. The demo required network and he'd said it repeatedly. Without it, we had nothing.

Amazingly, we were able to quickly hook up to the public wireless network then RAS into work over while I did a little tap dance. The demo worked perfectly and we only lost about 1 minute (and audiences love a tight-rope act.)

"No Banter"

One of the presenters has a notoriously dry sense of humor and he/she had said something like "I've got a good script, so let's have no banter during my segment." (I tend to tease/play/smartmouth during team presentations. Just ask Phil.)

I knew I was going to have trouble remembering this, so I put it on my notes. We had five presenters so I made five large 8.5"x11" (A4ish) pieces of paper and wrote on them with a large felt pen...basically giant notes. Not small cards like you often see when public speaking. Giant. Like cue cards.

I taped these giant notes to the floor, so if I glanced down at my feet I'd be reminded of a particular point. (I do this tip a lot...keeps me on task.) On this guy's sheet, I wrote down the timing, some points he'd hit in the demo and then "NO BANTER" in large capital letters.

This note was, of course, discovered by the other presenters who had no end of fun with. Still, it helped me during the talk. :)

Conclusion

I have no conclusion.

All of this happened over the two and a half hours from 8am until 10:30am when we did our talk.

Here's the crazy part. It went great. Every demo worked, every presenter got laughs and felt good about their message. The audience stayed awake the whole time and applauded at the end. The presentation part really couldn't have gone better, even though the previous two and a half hours really couldn't have gone worse unless there'd been a fire or a someone had lost a finger.

Crazy crazy stuff happens in technical presentations. You can prepare all you want, but sometimes things just go wrong. Fuses blow, batteries die, microphones break, computers decide that now is the best time to defrag themselves, cats and dogs, living together, mass hysteria. My tip - don't get flustered. Have a plan. Make notes on big sheets of paper and tape them to the ground so you can see them when you talk. Bring a timer.

In terms of moving parts, this particular presentation was at least as complex as the talk I did at PDC this last year. Usually I do xcopy-deploy demos...really simple stuff that can't go wrong. Someone said after this demo that they'd seen the PDC talk and now this one and wondered if all my talks from now on would be like "Super Bowl Halftime Shows" with dancers and lights. I don't know if I have the stamina and emotional health to do one of these again! :)

But still, such fun.

Related Posts

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

HD vs. SD - Flip MinoHD vs Flip Ultra - Head to Head

January 30, '09 Comments [11] Posted in Reviews | Tools
Sponsored By

imageI picked up a Flip Ultra in May and we love it. We use it all the time and the wife keeps it in her purse. We've taken three different camcorders to Africa on three different trips and we've enjoyed the Flip Ultra the most. (Flip Ultra Video Review here)

Now, let me preface this review with a statement. I don't like being negative. I don't like blogging negativity, and I'm likely to keep my mouth shut rather than say negative things. I know the Flip marketing folks will eventually find this review and I'm sure they worked hard on this new product. However, it's a step backward in so many ways and that needs to be said.

But, first...

The Good about the Flip MinoHD

  • It's really small, about half the volume of the Flip Ultra.
  • It's 1280x720p HD H.264 video compression, AAC audio compression, MP4 file format. 9.0 Mbps bitrate.
  • You can customize the skin online with your own pics.
  • It has decent low-light support.

The Bad about the Flip MinoHD

  • Batteries
    • The Flip Ultra uses AA batteries. This is so convenient when away from your laptop. You can get AAs anywhere.
    • The Flip MinoHD is sealed and can only be replaced via Flip Support. They are Internal Lithium-Ion batteries and they last between 3 and 4 hours. There's no included power adapter, so you need either a USB charger or a laptop to charge it. Inconvenient when on safari.
  • Resolution
    • There's a lot of artifacting. I'd have preferred a higher bit rate or even uncompressed, but I realize that this is a consumer device made for folks who don't care about that kind of stuff.
    • It's just not 1080p. You may think, "oh, HD!" but 720p vs. 480p is dramatic, but not Dramatic.
  • Field of View
    • The MinoHD has a much narrower field of view. It's not just the letter boxing, it's left-to-right also. I'd have to step back at least 2 feet to see the same visual field. Not a huge deal, but immediately noticeable vs. the Flip Ultra
  • Ergonomics
    • Here's where the profound disappointment begins. The Ultra isn't a beautiful slim device, but it can be easily used without looking at it; you can use it completely by touch. The MinoHD is pretty, almost iPod pretty, but it's smooth buttons are useless without looking. Two are indented, which is a noble attempt at tactile feedback, but it doesn't work in practice. There's sound as you click, but without an actually "clicky" feeling, you'll find yourself accidentally pressing buttons you don't mean to.
  • Video Out Port
    • This one is almost unforgiveable. The Flip Ultra uses a standard camcorder RCA video cable with 1/8" 3-ring connector. The Flip site glosses over this. The MinoHD uses a non-standard 1/16" video out cable. This is one more cable that I can't afford to keep (I have enough unmarked, unlabeled random cables, don't you?) but without it, watching videos on your TV isn't possible without first down-rezzing the videos to 480p on a DVD, or burning to Blu-Ray.
    • The real tragedy here is that this HD camcorder can't output HD to an HDTV. There's no HDMI, no DVI, not even a Component Video Adapter for sale. It outputs SDTV via Composite (Y/W/R) Cables and letterboxed at that. At this point, it appears the Creative Vado HD would have been a better choice as it includes HDMI out.
  • Color Reproduction
    • The Ultra and the MinoHD really have different CMOS sensors. The MinoHD has a red tint and a level of color saturation that's really strange. I can't decide which I think looks like real life, but I'm leaning towards the Ultra. It is more muted, but looks like real life.
    • To it's created, the low-light pickup on the MinoHD is clearly better than the Ultra, which is unusual in a cheap digital camera, video or otherwise.

Conclusion: It's not a BAD camera, by any means. It's is a step backwards from with the Ultra, save it's improved resolution. It's harder to charge, harder to view, and harder to operate.

To test, I recorded 1 minute of my random crazy family after dinner tonight. I put the two cameras right next to each other and tried bright light, low light, action, slow, far, near, etc. Here's the results, both on You Tube and on Vimeo.

NOTE: You'll need to visit the video pages directly and hit "Watch in HD" or whatever the highest res available is, to be sure you're getting a good comparison. Put them next to either other and hit Play at the same time and mute the sound to get a good comparison. (Yes, I realize the videos have been double compressed, so it's not 100% fair. However, that's why I put them on two different sites as mitigation.)

Sample - Flip Ultra Video on YouTube (Standard Res)

Sample - Flip Ultra Video on YouTube (HD Res)

Sample - Flip Ultra Video on Vimeo (Standard Res)


Family Video Test using Flip Ultra at 640x480 from Scott Hanselman on Vimeo.

Sample - Flip Ultra Video on Vimeo (HD Res)

I'm not able to embed my Vimeo HD version. Click the video below and visit the site for HD.


Family Video Test using Flip Mino HD at 1280x720 from Scott Hanselman on Vimeo.

Related Links

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

RTFLF - Read the Expletive Log File

January 29, '09 Comments [21] Posted in ASP.NET | ASP.NET Dynamic Data | ASP.NET MVC | IIS | Learning .NET | Programming | Web Services
Sponsored By

A buddy of mine and I had a nice slap in the face yesterday. I was helping him deploy an ADO.NET Data Service to a large company's staging server  and we were seeing REALLY odd behavior.

We'd request something like /myservice.svc and get a 404. But we could request /myservice.svc/Stuff or /myservice.svc/?metadata.

We settled in to debug this. We thought we were "getting down to basics." You know, you've done this. The conversation goes something like:

"Ok, people, what's the definition of insanity? Trying the same thing and expecting a different result."

"Right...let's challenge all our assumptions. Let's start from scratch. Can get Hello World working?"

"What's the ACLs on that file? Is the .svc extension registered? Are we sure we have the right version of .NET?"

We were both tired and we wasted a couple of hours basically dicking around, hitting Refresh and hoping for another solution. I wanted to plugin procexp and filemon and get down to some serious CSI: IIS-type debugging, but here's the rub: We didn't have access to the machine. Only "large company's" guys were allow to touch anything. We could make suggestions, watch a SharedView session, but the human latency of the whole process was slowing us by a factor of at least five.

But I can't blame it all on the process. In retrospect, it was my fault. I'm a good debugger. I know this and I'm happy to say it. However, I can recognize a ninja when I see one. Well, if you can see the ninja, maybe they aren't a ninja, but still. I reached out to a real debugging ninja. What did he do that I was missing?

I ignored a basic tenet of debugging. It wasn't that I didn't RTFM. I didn't RTFLF.

Ninjas can't catch you if you're on fire.

My debugger-ninja-friend started out by simply asking us to Start|Run and type "LogFiles."

At this point I realized that this process was going to make me look and feel like an idiot. My internal lights went on and I realized my buddy and I hadn't bothered to check any log files. We'd been treating IIS like it was a black box. It's not. It logs the hell out of everything that goes in and out if you want it to.

We were trying to debug a 404 on this .svc. We opened the log in Notepad, went to the bottom, searched up for ".svc" and there it was:

This Page was blocked by Microsofts URL Scan 3.0 Reason=Dot-in-path-detected

You could have knocked me over with a feather. I've said myself, UrlScan is step 0. If you're debugging a weird 404, UrlScan is the first and most obvious place to look and it was all there, in the log files. You remember, the log files I never looked at. ;)

Did my ninja friend know or care? No, because he RTFLF. A painful reminder to me as I wasted a bit of a ninja's time. Everyone knows, don't piss off a ninja. He was cool about it though.

Today's Lesson: Whatever it was, it was probably logged. Try there first.

* Pic from Dr. McNinja.

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.