Scott Hanselman

Hanselminutes Podcast 235 - Making a hobby a job - Talking with Eric Herbrandson about his Silverlight-based MicroISV

October 18, '10 Comments [3] Posted in Podcast | Silverlight
Sponsored By

Scratch Audio Eric Herbrandson has been working on the site creating a Silverlight-based audio mixer at night and weekends. What's the best way to hold down a full time job while pursuing your passion? Was it hard for Eric to learn a new technology and apply it to his little ISV? And some tech chat about his product, AudioOrchard Scratch Audio, what was possible and what wasn't.

NOTE: If you want to download our complete archives as a feed - that's all 235 shows, subscribe to the Complete MP3 Feed here.

Also, please do take a moment and review the show on iTunes.

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Download: MP3 Full Show

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.

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface and developer tools, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET AJAX, MVC,Silverlight,Windows Forms and WPF. Enjoy developer tools like .NET Reporting, ORM, Automated Testing Tools, Agile Project Management Tools, and Content Management Solution. And now you can increase your productivity with JustCode, Telerik’s new productivity tool for code analysis and refactoring. Visit www.telerik.com.

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

Subtle but Very Important Twitter Tips and Techniques You Should Know (cause no one will tell you)

October 12, '10 Comments [21] Posted in Musings
Sponsored By

Shameless Plug: If you're at Blogworld Expo 2010 this week, please join me at my talk on Friday afternoon. Details at http://hnsl.mn/blogworldsuckless. If you liked this post, you'll find 32 even more tips for blogging at my talk "32 Ways to Make Your Blog Suck Less."

If you're new to Twitter, do check out my two other articles:

There's a few behaviors about Twitter that are subtle, but important. For some of my examples I'll be making up tweets and timelines to protect the innocent.

Let's start with the most difficult to understand concept. It's obvious once you grok it, but it's a huge point of confusion to a LOT of people, especially new folks.

1. If your tweet starts with someone's @username, only that user and folks who follow both of you can will see the tweet in their timeline.

I wrote that sentence three times and it's still not 100% clear. Here's an example.

I'm @shanselman and I follow @robconery and @haacked. If @robconery tweets this:

@shanselman is the best. I love him so much. Tacos for all!

Rob thinks he's being nice, announcing something to all his Twitter followers. But in fact, Twitter says that a tweet that starts with a @username is not a @mention, it's a @reply.

Only those people who follow @robconery and @shanselman will see that tweet. In other words, the potential audience for that tweet is the intersection of our followers, NOT all of @robconery's followers.

Example: If @haacked follows @robconery, but not @shanselman, that tweet will NOT show up in @haacked's timeline.

Venn Diagram showing the relationship between followers and their tweets

When you want to reply to someone and have everyone see it, add a . or an R, or basically anything in front of their name. That'll make the tweet a @mention of them, rather than a @reply, then everyone in your timeline will see it.

2. Keep the Reply Chain unbroken and reap the benefits

What's the difference between these two tweets?

@shanselman nah, let's go to see The Town instead?

@shanselman nah, let's go to see The Town instead?

Nothing obvious, just by looking at them alone, right? But if you look closer in your Twitter client, or click the tweet on the Twitter website, they might differ by their inclusion of a hidden data point called "in reply to," like:

@shanselman nah, let's go to see The Town instead?
10/12/2010 10:00am in reply to @shanselman

It doesn't just know that you're replying to @shanselman, but also the status id (the unique number) of the exact tweet. This data is SO useful because it allows you (your twitter client, in fact) to follow the conversation thread as far back as there's data for it. Without that hidden metadata, you're just looking at tweets out of context.

Tweets refer to each other using the in_reply_to data

While both tweets are replies, since they start with a @username, only one includes that extra data because I actually clicked "reply" in either my Twitter Client or from the website. It's the act of clicking reply that causes that extra data to be added. If you just start typing a reply or copy paste a user name, your client or the twitter site will likely consider your tweet a fresh tweet.

On the Twitter website, in the New Twitter interface, tweets that have the reply to meta data have a little "conversation bubble" next to the tweet. If you click a tweet with this icon, you'll get the full conversation thread. In this image, two of the tweets are "proper replies," and the other two are "mentions."

Replies as shown in New Twitter

What does this mean for you? Try to keep the reply chain unbroken by using the Reply button in your Twitter client or within the Twitter website. Not only will your followers appreciate it, but you will at some future date when looking back on your tweets and wondering what the heck you were talking about.

3. Know about the advanced features of Url Shorteners

There's a lot of URL shorteners out there like http://bit.ly and now Twitter's http://t.co. One of the most interesting things about Bit.ly is its ability to collect lots of statistics.

But did you know that you can take any bit.ly link, even ones that aren't yours and see their stats? Just add a plus after the URL. Like this crucial piece of breaking news I tweeted last week. "LA Area freeway clogged by burning yam truck." at http://bit.ly/aEu3Gj. You can visit http://bit.ly/aEu3Gj+ (see the plus?) and get all these great stats.

This trick even works with custom Bitly.Pro domains like my very own URL shortener, http://hnsl.mn. For example, check the stats on my diabetes video http://hnsl.mn/iamdiabetic with stats at http://hnsl.mn/iamdiabetic+.

My bit.ly stats

Not only do I get clicks, but I also get aggregate clicks via other bit.ly links pointing to the same URL. There's also a realtime chart at the bottom as well as recent (last week or so) conversations on Twitter that mention the link. Again, the takeaway here is that you can do with this anyone's link, not just yours.

4. Silence your Retweet friendly friends without unfollowing them

Have a friend who retweets WAY to much and fills your timeline with crap, but you still love them and don't want to un-follow? You can remove retweets on a per-user basis from a user's full profile.

For example, if I didn't want retweets from my friend Travis (just an example, he's a lovely guy) then I could visit his profile and silence his noisy RTs (retweets).

The Silence RTs button 

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

This Developer's Life 1.0.5 - Homerun

October 8, '10 Comments [6] Posted in Podcast
Sponsored By

imageIt's that time again. Time for another lovingly produced episode of This Developer's Life.

I blogged a few weeks ago about a new developer podcast called "This Developer's Life". Twice a month, Between Rob Conery and I, we'll bring you stories from the mouths of real people, some you know and some you don't.

This week we talk to two programmers who hit "homeruns" early in life.

First, David Heinemeier Hansson, creator of Ruby on Rails, who was born in 1979. Next, Dan Bricklin, creator of VisiCalc, the first electronic spreadsheet creating in, yes, wait for it, 1979.

What do you do when you hit a homerun? When do you know it's happened? And what does it mean 30 years later?

For your consideration, here is show 5:

This Developer's Life 1.05: The Homerun

Don't forget, you can subscribe via RSS, via iTunes or via Zune.

Here's our previous episodes, if you want to catch up.

1.0.4 - Being Mean

What makes people mean in our industry? What about aggressive? Confident? What's the difference? Would you rather have a drill sergeant for a boss, or a zen master? We talk to Cyra Richardson and Giles Bowkett.

1.0.3 - Problems

How do you solve problems as a developer? How do you tackle issues that seem completely unsolvable - as an individual or on a team? Mike Moore, Javier Lozano, Tamar Cohen and trouble.

1.0.2 - Fame

Is fame useful for a developer? Should you make a plan and become Internet Famous? Is there value and how does notoriety happen? John Sheehan joins me in the storytelling.

1.0.1 - Getting Fired

It eventually happens to everyone. The real question is, how do you deal with it when it happens to you? Oren Eini and Sara Chipps explore and share.

Enjoy http://thisdeveloperslife.com.

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

Introducing NuGet Package Management for .NET - Another piece of the Web Stack

October 6, '10 Comments [69] Posted in ASP.NET | ASP.NET Ajax | ASP.NET MVC | Nupack
Sponsored By

NuGet

Microsoft's been filling out the Web Stack with more and more right-sized LEGO pieces lately, and today ScottGu announced the developer preview of NuGet. It's a piece of the stack that's been notably missing for years and after using it for a while now, I'm not sure how I lived without it.

NuGet is a package management system for .NET. The goal of NuGet is to make the process of incorporating third party libraries into your solutions as simple as possible.

Package Management itself is not a new concept. From Apt and "deity" before it at the system-level on *nix, to Ruby Gems, Maven, Synaptic, portage, dpkg, rpm and others, it's a well understood space. There are package managers for operating systems that install machine-wide libraries, and there are package managers for developers and their projects that manage dependencies and install libraries. NuGet takes inspiration from Ruby Gems and adds some .NET specifics.

NuGet - The Idea

Here's how it works. Notice the "Package Manager Console" window at the bottom of Visual Studio 2010. That's PowerShell. (It'll be in View | Other Windows for this release)

MvcApplication4 - Microsoft Visual Studio (4)

I type List-Package and NuGet goes to a central ATOM feed and retrieves a list of packages like this (not complete, I snipped it for the example)

Id Version Description
-- ------- -----------
Antlr 3.1.1 ANother Tool for Language Rec...
Artem.XmlProviders 2.5 Implementation of XML ASP.NET...
AutoMapper 1.1.0.118 A convention-based object-obj...
Castle.Components.Validator 1.1.0 The Validator component is us...
Castle.Core 1.2.0 Core of the castle project
Castle.DynamicProxy 2.2.0 Castle DynamicProxy is a libr...
Castle.Ioc 2.1.1 Castle Project offers two Inv...
EFCTP4 1.0 This CTP is a an early previe...
elmah 1.1 ELMAH (Error Logging Modules ...

tarantino-db-deployer 1.0.146.0 This is a database migration ...
WebFormsMVP 0.9.7.2 A simple Model-View-Presenter...
xunit 1.6.1 xUnit.net is a developer test...

At this point, as an example, perhaps I want to get the ELMAH (Error Logging Modules and Handlers) open source library setup in my MVC project. I have long said that ELMAH, as a project, deserves way more attention than it gets.

One of the reasons that it doesn't get used - as is the case with many .NET open source libraries - is that it takes too much effort to get it working. Unzip it, put it in a folder somewhere in your project, figure out what needs to be added to web.config, you know.

With NuGet, I type "Install-Package elmah" and it's done. If I wanted to be extra cool with PowerShell aliases I could have just typed "install-packageelmah."

PM> Install-Package elmah
Successfully added 'elmah 1.1' to MvcApplication4

And that's it. Elmah is automatically brought down to my machine, a reference is added to my project and everything it needs is merged non-destructively into my web.config.

MvcApplication4 - Microsoft Visual Studio (5)

I'll run my app and hit /elmah.axd just to prove it.

Error log for  on HANSELMAN-W500 (Page #1) - Windows Internet Explorer

Complex Packages and their Dependencies

Looks good. But what if I want to add a more complex project, maybe NHibernate.Linq. From the Package Manager Console I'll start typing install-package nh and get Intellisense for all the packages that are available.

image

And the console reports:

PM> Install-Package NHibernate.Linq
'NHibernate.Core (>= 2.0)' not referenced. Retrieving dependency...Done 'log4net (= 1.2.1)' not referenced. Retrieving dependency...Done 'Iesi.Collections (= 1.0)' not referenced. Retrieving dependency...Done 'Antlr (>= 3.0)' not referenced. Retrieving dependency...Done Successfully added 'log4net 1.2.1' to MvcApplication4 Successfully added 'Iesi.Collections 1.0' to MvcApplication4 Successfully added 'Antlr 3.1.1' to MvcApplication4 Successfully added 'NHibernate.Core 2.1.2' to MvcApplication4 Successfully added 'NHibernate.Linq 1.0' to MvcApplication4

Notice that NHibernate.Linq knows its dependant on a bunch of other things. All those packages got pulled in and put in the packages folder. Notice the nupkg file there? That's just a ZIP file. Let's look inside.

A nupkg file open in Windows Explorer

Unzipping the nupkg we see lots of stuff. The binary is in there, but also a nuspec file that looks like this. Dig around in there and you'll find some standard packaging namespaces from openformats.org.




NHibernate.Linq
1.0
NHibernate Linq support is based on the existing, proven in production, Linq provider in NHibernate Contrib. The plans to overhaul that and merge that into NHibernate’s proper for the next release are still active, but the project team feels most strongly that production quality Linq support is something that we ought to provide for our users now.

Ayende

en-US
false
2010-10-03T16:32:29
2010-10-03T16:32:29




NuGet walks its way up the dependency chain and gets all the packages it needs, installing each. Packages can add scripts, content, references, and even run postscripts (ahem) written in PowerShell if they need something fancy.

I can even remove all that and its dependancies.

PM> Remove-Package NHibernate.Linq -RemoveDependencies

Let's add a few more interesting packages to my project. First, I'll add David Ebbo's wonderful T4MVC templates.

PM> install-packageT4MVC
Successfully added 'T4MVC 2.6.30' to MvcApplication4

David's project isn't actually DLLs, it's a T4 template and a config file, but no problem, it's added to the project.

T4MVC in my project

Next I'll add the Entity Framework "Magic Unicorn" library that I love so much.

PM> install-packageEFCTP4

You are downloading EFCTP4 from Microsoft, the license agreement
to which is available at ....Check the package for additional dependencies,
which may come with their own license agreement(s).
Your use of the package and dependencies constitutes your acceptance
of their license agreements. If you do not accept the license agreement(s),
then delete the relevant components from your device.
Successfully added 'EFCTP4 1.0' to MvcApplication4

Note that this package includes some licensing stuff, as do many OSS projects, so I'm told as I get it. Finally I'll add SQL Compact Edition 4 as well with a little...

PM> install-packageSQLCE
Successfully added 'SQLCE 4.0.8402.1' to MvcApplication4

I've added NHibernate.Linq and four dependencies, then removed them all. I've added T4MVC, SQL Compact, Entity Framework CTP 4, and ELMAH.

We see we can add basically anything to a solution and it's only modifying the solution, and the packages folder next to it. Nothing is being added to the GAC (Global Assembly Cache) and no one is installing anything or messing with things system-wide. NuGet is about affecting local projects and solutions...and possibly adding functionality to enable me to make changes even faster...

Can you say Scaffolding?

I'll add one more interesting package. It's not a library like EFCTP4, or a database like SQLCE, or a T4 template like T4MVC. It's actually an example of PowerShell scripts that extend the Package Manager Console itself with new commands that interact with my project.

Note: This is just a sample/example, because we want to see and hear what you want, and how you want to use it. Talk is cheap, show me the code! ;)

install-package MvcScaffold

Typing

PM> install-packageMvcScaffold

adds new commands to my console via a PowerShell script. It adds Add-MvcView, so I could so something basic like

PM> Add-MvcView Empty
Added file 'Views\Empty.aspx'

But that's not interesting. Let's assume I have a Code First class like this in my project and I've compiled once (in fact, a sample model is included with the EFCTP4 package):

using System.Data.Entity;

namespace MvcApplication4.Models {
public class Product {
public int ID { get; set; }
public string Name { get; set; }
public double Price { get; set; }
}
public class MyProductContext : DbContext {
public DbSet Products { get; set; }
}
}

Since I've got a nice Product, why not:

PM> Scaffold-MvcViews -ModelType Product  Added file 'Views\Product\List.aspx'
Added file 'Views\Product\Details.aspx'
Added file 'Views\Product\Edit.aspx'
Added file 'Views\Product\Create.aspx'
Added file 'Views\Product\Delete.aspx'

Which gives me a nice scaffolded set of views generated from T4 Code Templates (or your custom ones, if you like)

image

Pretty sweet. A lot has been done and prepped for me and all from the Package Manager Console within VS. I can personally see folks creating templates or meta-packages that encapsulate some CRUD (Create, Read, Update, Delete) best practices and sharing them via NuGet packages.

Can Haz UI?

I've focused on the Command Line, because it's awesome and "computers need to be hard©" but you could have certainly added your packages like this:

Add Package Reference in the Solution Explorer

Clicking Add Package Reference brings up this dialog box. Look familiar?

Add Package Reference Dialog

From here I can search for packages, install, as well as see what packages I've already got installed. I can also check for updates and download new versions.

NuGet Developer Preview

Now this is just a Developer Preview, but look at it generically. We can interact with Visual Studio from PowerShell, package up Open Source libraries, scripts, content or perhaps even meta-packages (install-package hanselpack or install-package dearReaderLibs).

Phil talks about the Guiding Principles for NuGet on his blog. There will be a central feed with no central approval process for adding libraries. The community will police and moderate packages. But, anyone can host a feed. You can host an internal feed at your work, or even just point NuGet at a file system folder and share packages across your group.

Open Source

NuGet is interesting for a couple of reasons. NuGet isn't a classic Microsoft closed-source project; it's been accepted into the CodePlex Outercurve Foundation and is entirely hosted and managed in a Mercurial Repository at the CodePlex.com Forge. Developers from inside Microsoft and developers from outside Microsoft have been committing to the same repository. All the bugs and issues are managed transparently on that projects.

Yeah, we're slow, but we're working to turn this ship around. NuGet can, and has, accepted contributions, most recently from some folks on the "Nu" open source project. In fact, working with the Nu folks caused us to change the name of this project from its original name of "NPack" to NuGet. There's been a lot of "Source Opened" at Microsoft and a lot of "Open Source but No Takebacks" with some Open Source, but with NuGet I'm stoked to see us start giving (and taking back) in a more open way.

As Phil says, go over to the NuGet website on CodePlex and check out our guide to contributing to NuGet. It's early, and there's a LOT of work to be done, but we're planning to make this available for use in all editions of Visual Studio 2010.

Get the NuGet Preview today with ASP.NET MVC 3 Beta

Go get ASP.NET MVC 3 Beta and NuGet is included inside. Here's the direct download link.

To summarize:

  • NuGet is open source and in the Outercurve Foundation
  • NuGet integrates with VS and with PowerShell
  • NuGet will have a community managed gallery without central approving authority
  • NuGet won't mess up your computer or install anything outside your solution
  • You can host your own feeds, or read packages out of a network share/folder

The whole team - inside and outside Microsoft - really hopes you like it.

Personal Aside: Changing Jobs

An a related aside, one of the reasons I came to Microsoft was to work on and encourage open source like NuGet. For the last few years I've been working in MSDN and STO (Server and Tools Online) most recently leading a community team with a great bunch of folks, including Joe Stagner, Jon Galloway, Rey Bango, Jesse Liberty, and Pete Brown. This week I'm leaving MSDN to go to work as Community Architect for the Web Platform and Tools (WPT) team under ScottGu, Bill Staples and Omar Khan. Pete will take over as the lead of my team and they'll all join Developer Guidance (née Patterns and Practices). We'll hang out a lot together, though, I have no doubt, and I'll be at the Patterns and Practices Symposium as well as PDC 2010 this year.

The WPT team includes ASP.NET, IIS, as well as open source projects like NuGet, ASP.NET MVC and Orchard. I'll be promoting Open Source inside and outside Microsoft, making sure the customers voice is heard as products are architected, as well as speaking and teaching whenever they'll let me. I won't be moving to Seattle. ;)

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 on 9 - Inside Ward Cunningham's Hardware Basement

October 5, '10 Comments [8] Posted in Channel9 | Hardware
Sponsored By

imageThis weekend I stopped by Ward Cunningham's house (you know, the guy who invented the Wiki. Yes, that Ward Cunningham) to hang out, and discovered Ward's treasure trove of electronics, software, soldering guns and web accessible sensor arrays that run 24/7/365.

Ever wish you had a real cool uncle that didn't take you fishing, but instead showed you how to create your own multi-processor computer with $2 chips off the shelf? Let's step into Uncle Ward's basement.

Check Ward at out at Channel 9. You can also download MP3s, iPod, Zune and other formats there.

You might also enjoy the complete "Hanselminutes on 9" Video Series, a completely non-scripted video show that happens spontaneously throughout the year. Here's some of my favorites:

Ward has all sorts of cool stuff going on in his lab. Look for him on an upcoming episode of Rob Conery's and my new podcast, This Developer's Life.

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

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