Scott Hanselman

Hanselminutes Podcast 123 - Dare Obasanjo on Social Networking

July 25, 2008 Comment on this post [2] Posted in Podcast
Sponsored By

image My one-hundred-and-twenty-third podcast is up.  I sat down with Dare Obasanjo this week and we chatted about the interesting problems that Social Networking sites face. Dare blogs about social networking, amongst other things, at http://www.25hoursaday.com/weblog/

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.

Telerik's new stuff is pretty sweet, check out the ONLINE DEMO of their new ASP.NET AJAX suite. RadGrid handles sorting, filtering, and paging of hundreds of thousands of records in milliseconds, and the RadEditor loads up to 4 times faster and the navigation controls now support binding to web services on the client.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Hanselminutes Podcast 122 - BabySmash!

July 25, 2008 Comment on this post [2] Posted in BabySmash | Podcast
Sponsored By

My one-hundred-and-twenty-second podcast is up.  In this episode I share BabySmash! with Carl Franklin and we chat about WPF, its strengths and weaknesses, and my trials in launching my tiny (free) Micro-ISV.

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.

Telerik's new stuff is pretty sweet, check out the ONLINE DEMO of their new ASP.NET AJAX suite. RadGrid handles sorting, filtering, and paging of hundreds of thousands of records in milliseconds, and the RadEditor loads up to 4 times faster and the navigation controls now support binding to web services on the client.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Learn How to use NHibernate with the Summer of NHibernate Screencast Series

July 22, 2008 Comment on this post [19] Posted in Screencasts
Sponsored By

I'm a huge fan of screencasts for learning. There are an increasing number of increasingly sophisticated tools and libraries that we as developers have available and I'm leaning on screencasts to learn them. I really like the screencasts that Rob Conery is doing and I've got really positive response from the ASP.NET MVC Screencasts.

I'm starting to think that all technical books should come with a accompanying screencast series. You typically have to watch closely and pay attention, and it's hard to watch a screencast in double speed (unlike a podcast) but a well-done screencast is the next-best thing to letting an expert take over your computer and show you.

There are many tools that support the fundamental tenets, beliefs, and preferred processes in the ALT.NET space. Certainly ALT.NET isn't "all about the tools," but there are certainly preferred tools.

One of those is NHibernate, a sophisticated Object Relational Mapper. I used NHibernate as my Data Layer recently when I got ASP.NET MVC running under .NET 2.0 using NHibernate examples from Davy Brion (who has an NHibernate Category on his blog).

NHibernate is very flexible, but it's a little overwhelming (for me, at least) to get started. Davy has a good "code-heavy" walkthrough of the concepts. Some NHibernate write-ups assume too much, IMHO.

Perhaps to combat this, Stephen Bohlen has created the Summer of NHibernate Screencast Series as a learning tool to educate engineers at his company. Stephen says:

"Often, our strategy for bringing people up to speed on [NHibernate] has been to rely on word-of-mouth and osmosis (often via pair-programming) to get the points across, but now we have a planned staffing ramp-up of a magnitude that will likely make that approach unwieldy."

He's releasing these screencasts to the public and you can check them out at http://www.summerofnhibernate.com/ or subscribe to the feed and get them downloaded automatically like podcasts! Stephen's also including Code Downloads with each screencast.

If you like them, remember that Stephen's doing this for free, while bandwidth isn't, so you can donate via Paypal to help him out. You can visit Stephen's blog with comments and suggestions. My primary suggestions to him would be to drop his resolution to 1024x768 or even 800x600 (what I do) and raise his font size to Lucida Console 16. Right now, you'll need a high-res (1280) monitor to watch his screencasts.

These small nits aside, I think it's great that NHibernate is getting more screencasts that really help folks get started and augment NHibernate's excellent documentation.

Related Links

Technorati Tags: ,

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

The Weekly Source Code 30 - Spark and NHaml - Crazy ASP.NET MVC ViewEngines

July 21, 2008 Comment on this post [20] Posted in ASP.NET | ASP.NET MVC | Source Code
Sponsored By

I've been getting more and more interested in how folks extend their applications using plugins and things. In my new ongoing quest to read source code to be a better developer, Dear Reader, I present to you thirtieth in a infinite number of posts of "The Weekly Source Code."

Spark

I'm really enjoying the extensibility points in ASP.NET MVC, but not as much as some people. Spark is a really promising ViewEngine from Louis DeJardin. You can download Spark here and join the mailing list here. Not only is it promising, it's also freaky. Freaky in that good, makes-you-think way.

Louis says "The idea is to allow the html to dominate the flow and the code to fit seamlessly." When he says HTML should dominate the flow, he's not kidding. Check this out:

<ul>
<li each='var p in ViewData.Model.Products'>
$p.Name; $Html.ActionLink[[ProductController]](c=>c.Edit(p.Id), "Edit");
</li>
</ul>

See the "each" attribute on the UL? Freakly. ;)

Remember this is NOT WebForms. That <li> and the each attribute are not controls, or parts of controls or runat=server or whatever. This is a complete ViewEngine. It's a templating language in and of itself. (As are most ViewEngines, although it's not an obvious point to a lot of folks getting started with ASP.NET MVC or any MVC Framework)

That means that Louis has complete control of what the syntax is, and as you can see, it's somewhere in between HTML and Something Else. He's still changing the syntax based on feedback, so this is your chance to get involved.

Here's Louis' Northwind "Listing By Category" page:

<viewdata 
model="IList[[Product]]"
CategoryName="string"/>

${PageTitle(CategoryName)}

<CategoryMenuItems category="ViewData.Model.Select(p=>p.Category).FirstOrDefault()"/>

<ul class="productlist">
<var styles='new[] {"odd", "even"}'/>
<li each="var product in ViewData.Model" class="${styles[productIndex%2]}">
<ProductImage style='"float:left;"'/>
<p>
<a href="/Products/Detail/${product.ProductID}">${product.ProductName}</a>
<br />
Price: ${String.Format("{0:C2}", product.UnitPrice)}
<span class="editlink">
(${Html.ActionLink[[ProductsController]](c=>c.Edit(product.ProductID), "Edit")})
</span>
</p>
<div style="clear:both;"></div>
</li>
</ul>

imageNotice  not only that the iterators live on the markup tags like <li> but also that you can create variables. See how an array called styles is created to hold the strings odd and even, then used to set the class on the <li> on the next line. The "jump into code block" is usually ${ } rather than <% %> which I find nice visually.

However, Spark is all about choice, so you can use EITHER ${ } or <% %>. Whatever makes you happy.

Also, check out the <CategoryMenuItems> tag. What's that? That's a partial view-file that gives you clean partial rendering.

If you have a partial view file that are starts with an underscore, then you can call that from a regular view using its name as a tag. You can see two partial view files in the screenshot at right. It's really just a really pretty syntactic sugar over include files. Neat though!

Go check out Spark and hear more at Louis' Blog.

NHaml

The deeply awesome Andrew Peters created NHaml (part of MVCContrib), an ASP.NET View Engine using the Haml syntax from Ruby. I've been showing Andrew's stuff as an extreme example of what a ViewEngine could look like.

For example, here's a standard "Listing by Category" page using the built-in WebForms ViewEngine, written using NHaml. Notice the lack of angle brackets. Notice that the UL tag never ends...it just leaves scope. The whitespace is significant. Haml users feel strongly about not repeating themselves, even in markup. They want "Markup Haiku."

#foo
- foreach (var product in ViewData)
- if (product.Category.CategoryName != null)
%h2=product.Category.CategoryName
- break
%ul.productlist
- foreach (var product in ViewData)
%li
= Html.Image("/Content/Images/" + product.ProductID + ".jpg", product.ProductName)
.productdetail
=Html.ActionLink(product.ProductName, "Detail", new { ID=product.ProductID })
%br
Price:
=String.Format("{0:C2}", product.UnitPrice)
%span.editlink
(
=Html.ActionLink("Edit", "Edit", new { ID=product.ProductID })
)

Other cool View Engines include Castle's Fork of NVelocity and Brail (in MVCContrib).

Related Links

Technorati Tags: ,,,

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

Adding OpenSearch to your website and getting in the Browser's Search Box

July 21, 2008 Comment on this post [18] Posted in Musings | Tools | Web Services
Sponsored By

I was over at http://search.twitter.com earlier today and I noticed the Search Box in Firefox had a blue lit-up dealie:

image

Hm...OK. What's that? I hit another site and didn't see it. Weird. Ok, View-Source then, what drives you little blue thing?

<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Twitter Search">

Hey, that's not something I've seen before. What's in it...http://search.twitter.com/opensearch.xml...

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Twitter Search</ShortName>
<Description>Realtime Twitter Search</Description>
<Url type="text/html" method="get" template="http://search.twitter.com/search?q={searchTerms}"/>
<Image width="16" height="16">http://search.twitter.com/favicon.png</Image>
<InputEncoding>UTF-8</InputEncoding>
<SearchForm>http://search.twitter.com/</SearchForm>
</OpenSearchDescription>

Ah! I totally get it. Excellent. I shall make my own immediately! I added this file to my website and added a <link> line as seen in the first example above that pointed to it.

<?xml version="1.0" encoding="UTF-8" ?> 
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Hanselman Search</ShortName>
<Description>Search Scott Hanselman's Blog</Description>
<Url type="text/html" method="get" template="http://www.hanselman.com/blog/...snip...q={searchTerms}"/>
<Image width="16" height="16">http://www.hanselman.com/blog/favicon.ico</Image>
<InputEncoding>UTF-8</InputEncoding>
<SearchForm>http://www.hanselman.com/</SearchForm>
</OpenSearchDescription>

Bam.

image

I wonder if it works in IE7?

image

Pow! I wonder if Live.com supports it?

  image

Eek! FAIL. I'll mention that to someone at Live.com

OpenSearch is a really easy feature that you can add to your website in literally minutes. Seconds if you type fast. Check me out noticing this only three years late. :)

Give it a try!

IMPORTANT NOTES: Make sure you include the first line of the XML file (the XML declaration) or IE will ignore it and nothing will happen when you add it. Also, make sure you include the default XML namespace or Firefox will give you an error: "Firefox could not download the search plugin"

Technorati Tags: ,

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.