Scott Hanselman

Scott Hanselman: Developer Productivity Tools Video Part 3

July 27, '06 Comments [4] Posted in Reviews | PowerShell | TechEd | Speaking | XML | Web Services | Tools
Sponsored By

Scottvideo3When I was at TechEd I visited the Beantown.net INETA User Group and gave a (fairly ad-hoc) talk on Developer Productivity Tools. Jim Minatel loaned me his microphone and a copy of Camtasia and we recorded the talk. Thanks Jim!

It was a great crowd, a lot of fun. We had a number of "off the cuff" discussions about random stuff so I hope it doesn't take away from the gist of the talk.

The complete presentation was around 1 hour 45 minutes, so for online, Jim has split it into 4 segments. This week's segment is #3 and is available now and is about 30 minutes long. If you watch it in your browser, I recommend you double click on Windows Media Player to make the video go full screen. You can also download the full video.

It covers:

  • 00:00 Title
  • 00:23 Scott's introduction (repeated from the first video segment)
  • 00:55 Let's look at PowerShell
  • 02:45 Starting to show some code in PowerShell - "It's .NET at the command line."
  • 07:10 PowerShell Type extensions
  • 13:40 cd into the registry, files, and more
  • 17:00 Calling an existing .NET object (an RSS feed) and putting it in a variable

The remaining segment for next week will cover roughly:

  • Week 4: Active Words, Code Rush, SOAP Scope, XML doc viewer - 23 minutes

Here's a few notes about the video quality from Jim:

1. Why can't I fast forward or skip ahead through the video while it's streaming? Answer: We're running these off of a standard IIS server, not a Windows Media Server. IIS supports streaming, but not indexed playback during streaming to allow skipping ahead. If you want to do that, just download the whole video and all of the forwarding and timeline controls will be available in Windows Media Player.

2. Why isn't the video quality better? Is Camtasia to blame? No, Camtasia rocks. The raw videos I'm getting in Camtasia format are 100% clear, as if you were looking right at the presenter's monitor. The problem I've discovered is with the Windows Media Encoder. It just isn't well suited to on-screen presentation videos like this. The blurring and color blotching seems worst in Scott Hanselman's videos and I think I know why. When I watch the raw presentation, he's flying back and forth between open windows, background tools that pop up, and his desktop. It's just faster switching between very varied images than the encoder can seem to keep up with. I've twidled all the settings and got the best I can for now without doubling or tripling the file sizes. The other option would be to post an alternate version in Camtasia format and a link to download their playback codec [Scott: or a large FLV]. Because WMV is universal for my .NET developer audience, that has to be my common choice though.

There's also some other good screencasts up at Wrox. The growing list of videos is available at wrox.com. The first few videos in the series are:

I hope you enjoy them.

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

Dictionary Password Generator in Powershell

July 26, '06 Comments [6] Posted in Programming
Sponsored By

A fellow at work wanted a script to generate strong passwords from a dictionary file. The "l337" hashtable in the first line is the list of characters that we'll be replacing. The $skip variable adds a little variance so we won't (likely) generate the same password twice given the same word.

$leet = @{e=3;o=0;l=1;a=4;i='!';t=7}
$rand = new-object System.Random
$words = import-csv dict.csv
$word = ($words[$rand.Next(0,$words.Count)]).Word
if ($args[0]) { $word = $args[0] }
$leet.Keys | foreach-object { $skip = $rand.Next(0,3); if ($skip -ne 0){ $word = $word.Replace($_,$leet[$_]) } }
$word

Here's the dictionary I used: File Attachment: dict.csv (6 KB)

> ./generate-password.ps1
1ass!7ude
!nterd!ct
c4j013
par!ah
ruff!4n
r3cant
pl3th0r4
> ./generate-password.ps1 "quixotic"
qu!x07!c
quixo7ic
quix0tic

UPDATE: Jeff opines (correctly) passphrases are where it's at, so...

$rand = new-object System.Random
$conjunction = "the","my","we","our","and","but","+"
$words = import-csv dict.csv
$word1 = ($words[$rand.Next(0,$words.Count)]).Word
$con = ($conjunction[$rand.Next(0,$conjunction.Count)])
$word2 = ($words[$rand.Next(0,$words.Count)]).Word
return $word1 + " " + $con + " " + $word2

Yielding:

> ./generate-passphrase.ps1'
foible my finesse
bolster but permeate
augury my dogmatic
surfeit the mercurial
reconcile but dexterity
acarpous our inveigh
perilous and bequest
cognizant we foible
calipers and vilify
trickle our enzyme
vigorous we ominous
ascertain + dubious
suborn but middling

I totally agree that passphrases are better. I've advocated them to family and friends and have a few long-ass passphrases myselfs

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 26 - Globalization/Internationalization with .NET

July 26, '06 Comments [2] Posted in Podcast | ASP.NET | Internationalization | XML | Bugs | Tools
Sponsored By

HanselminutesMy twenty-sixth Podcast is up. This episode is a discussion of Globalization/Internationalization with .NET. It ran a little longer than I'd have liked, but I didn't realize how big a topic it is. It's just hard to make things fit in 20 minutes sometimes!

We're listed in the iTunes Podcast Directory, so I encourage you to subscribe with a single click (two in Firefox) with the button below. For those of you on slower connections there are lo-fi and torrent-based versions as well.

This show was FULL of links, so here they are again. They are also always on the show site. Do also remember the archives are always up and they have PDF Transcripts, a little known feature.

Links from the Show

Localization in ASP.NET 2.0 (gve) Michael Kaplan (guw)
Global Development and Computing Portal (gv3)
How Do I? (gvb)
Microsoft TimeZone Utility (gux)
Microsoft Terminology Translations (gv4)
Microsoft .NET Internationalization (gup)
Directory of Localization Resources (guy)
W3C Language information and text direction (gv5)
Chris Sells' FormatDesigner (guq)
Basics of .NET Internationalization (guz)
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) (gv6)
Internationalization Overview (gus)
ASP.NET 2.0 Internationalization Diagram (gvo)
Authoring HTML for Middle Eastern Content (gv7)
Localizer for VS 2002/2003 (gut)
Locale Builder (VISTA) (gv1)
Michele Bustamante on Localization (gv8)
Using HTTP and meta for language information (guu)
NLS information page (gv2)
Enterprise Localization Toolkit - Todd Abel (gv9)
PsuedoInternationalization (guv)

Subscribe to my Podcast in iTunes

NEW COUPON CODE EXCLUSIVELY FOR HANSELMINUTES LISTENERS: The folks at XCeed are giving Hanselminutes listeners that is Coupon Code "hm-20-20." It'll work on their online shop or over the phone. This is an amazing deal, and I encourage you to check our their stuff. The coupon is good for 20% off any component or suite, with or without subscription, for 1 developer all the way up to a site license.

Our sponsors are XCeed, CodeSmith Tools, PeterBlum and the .NET Dev Journal. There's a $100 off CodeSmith coupon for Hanselminutes listeners - it's coupon code HM100. Spread the word, now's the time to buy.

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)

  • The basic MP3 feed is here, and the iPod friendly one is here. There's a number of other ways you can get it (streaming, straight download, etc) that are all up on the site just below the fold. I use iTunes, myself, to listen to most podcasts, but I also use FeedDemon and it's built in support.
  • Note that for now, because of bandwidth constraints, the feeds always have just the current show. If you want to get an old show (and because many Podcasting Clients aren't smart enough to not download the file more than once) you can always find them at http://www.hanselminutes.com.
  • I have, and will, also include the enclosures to this feed you're reading, so if you're already subscribed to ComputerZen and you're not interested in cluttering your life with another feed, you have the choice to get the 'cast as well.
  • If there's a topic you'd like to hear, perhaps one that is better spoken than presented on a blog, or a great tool you can't live without, contact me and I'll get it in the queue!

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

New Release of WatirMaker now WatirRecorder

July 25, '06 Comments [5] Posted in Ruby | Watir
Sponsored By

Watirrecorder1Rutger Smit has given the original WatirMaker an overhaul and we're re-releasing it as WatirRecorder++. Here's the original screencast if you want to see what it does. A roadmap will follow soon. Thanks Rutger!

This version compiles and runs under 1.1, but it upgrades smoothly to 2.0, so we'll probably do that one day. We're in the process of setting up an Open Source BSD Project at CodePlex.com so if you've made changes yourself, or you want to join up, now's the time. We'll get the source uploaded as soon as the permissions are setup. If you become a developer or want the source, you'll be able to interact with the Team System source control system using a number of clients. Be sure to read the manual.

UPDATE: We had some trouble getting everyone access on CodePlex so we're putting WatirMaker/WatirRecorder up on OpenQA.org, where Watir itself is hosted.

You can check out the source anonymously using the Subversion URL http://svn.openqa.org/svn/watir-recorder/trunk You can get the source by doing the following:

svn co https://svn.openqa.org/svn/watir-recorder/trunk

If you've never installed Watir, here's the easiest possible thing to do:

  • Install the Ruby One-Click Installer.
  • Open cmd.exe and type "gem install watir"
  • Install WatirRecorder++, hit Start, do some stuff (do NOT use the keyboard to submit forms). Hit stop, and playback.
  • Now, STOP everything and remind yourself that this is a jump-starter, that's it.

Enjoy.

File Attachment: WatirRecorder_Setup_Lite.msi (2858 KB)

As an aside, keep an eye out for FireWatir. It's tricky to install and requires a number of bleeding edge things, but it's very shiny.

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

Internationalization and Classic ASP

July 24, '06 Comments [3] Posted in ASP.NET | Internationalization | XML | Bugs
Sponsored By

If you've ever done work in non-English languages with Classic ASP (ASP3) and gotten black squares in side of the characters you expected, your checklist should be something like this.

Remember: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)

Classic ASP Internationalization "Don't Lie" Checklist

  • Are your ASP pages saved as UTF-8? I recommend Notepad2 (or debug.exe ;) ) as a good editor that knows what a Unicode Byte-Order-Mark looks like.
  • There's two aspects to encoding with Classic ASP - there's the encoding of the page (the static stuff) and the encoding of the dynamically created content.
    • Add this little-known bit-o-goodness to your pages:
      Response.CodePage = 65001
      Response.CharSet = "utf-8"
  • Make sure that the strings/content you are consuming is also the correct encoding. A very common problem is having Unicode content in an XML file but the prolog might say:
    <?xml version="1.0" encoding="iso-1159-1" ?>.
    This mistake will go unnoticed until José shows up.
    • Make sure your XML encoding matches you actual encoding:
      <?xml version="1.0" encoding="UTF-8" ?>.
  • You might also ensure your Http Headers don't lie:
    Content-Type: text/html; charset=utf-8
  • You might also ensure your META tags don't lie:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

When all these things line up, things tend to just work. Again, this is old-school stuff, so you likely don't care. Move along, nothing to see here.

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.